Skip to content

Commit

Permalink
feat: space sink, slider scroll, move in VM
Browse files Browse the repository at this point in the history
* VM stuff needs another move later on
* space sink is kind of bad right now
  • Loading branch information
Raymonf committed Sep 19, 2023
1 parent 726b076 commit a9fb2da
Show file tree
Hide file tree
Showing 3 changed files with 340 additions and 235 deletions.
40 changes: 40 additions & 0 deletions BAKKA_Editor/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,50 @@ public partial class MainViewModel : ViewModelBase

// Music UI State

// TODO: move this stuff out of here
[ObservableProperty] private double sizeTrackBar = 0.0;
[ObservableProperty] private int sizeTrackBarMinimum = 4;
[ObservableProperty] private int sizeTrackBarMaximum = 59;

[ObservableProperty] private double positionTrackBar = 0.0;
[ObservableProperty] private int positionTrackBarMinimum = 0;
[ObservableProperty] private int positionTrackBarMaximum = 59;

[ObservableProperty] private decimal sizeNumeric = 0;
[ObservableProperty] private int sizeNumericMinimum = 4;
[ObservableProperty] private int sizeNumericMaximum = 59;

[ObservableProperty] private decimal positionNumeric = 0;
[ObservableProperty] private int positionNumericMinimum = 0;
[ObservableProperty] private int positionNumericMaximum = 59;

[ObservableProperty] private decimal measureNumeric = 0;
[ObservableProperty] private int measureNumericMinimum = 0;
[ObservableProperty] private int measureNumericMaximum = 9999;

[ObservableProperty] private decimal beat1Numeric = 0;
[ObservableProperty] private int beat1NumericMinimum = 0;
[ObservableProperty] private int beat1NumericMaximum = 1920;

[ObservableProperty] private decimal beat2Numeric = 16;
[ObservableProperty] private int beat2NumericMinimum = 0;
[ObservableProperty] private int beat2NumericMaximum = 1920;

[ObservableProperty] private double songTrackBar = 0.0;
[ObservableProperty] private int songTrackBarMaximum = 0;

[ObservableProperty] private double speedTrackBar = 100;
[ObservableProperty] private int speedTrackBarMaximum = 100;

[ObservableProperty] private double volumeTrackBar = 100;
[ObservableProperty] private int volumeTrackBarMaximum = 100;

[ObservableProperty] private double hitsoundVolumeTrackBar = 50;
[ObservableProperty] private int hitsoundVolumeMaximum = 100;

[ObservableProperty] private decimal visualHiSpeedNumeric = 0.5m;
[ObservableProperty] private double visualHiSpeedNumericMinimum = 0.001;
[ObservableProperty] private double visualHiSpeedNumericMaximum = 500;

// Commands
public async Task<bool> NewCommand()
Expand Down
73 changes: 47 additions & 26 deletions BAKKA_Editor/Views/MainView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
mc:Ignorable="d" d:DesignWidth="1154" d:DesignHeight="800"
xmlns:controls="clr-namespace:BAKKA_Editor.Controls"
x:Class="BAKKA_Editor.Views.MainView"
PropertyChanged="AvaloniaObject_OnPropertyChanged">
PropertyChanged="AvaloniaObject_OnPropertyChanged"
Focusable="True">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
Expand Down Expand Up @@ -297,45 +298,60 @@
<StackPanel Margin="8">
<TextBlock Margin="0,0,0,4">Position:</TextBlock>
<Grid ColumnDefinitions="100*,158*">
<NumericUpDown Name="positionNumeric"
Value="{Binding PositionNumeric}" Increment="1" Minimum="0" Maximum="59"
ValueChanged="PositionNumeric_OnValueChanged" />
<Slider Grid.Column="1" Name="positionTrackBar"
<NumericUpDown
Value="{Binding PositionNumeric}" Increment="1"
Minimum="{Binding PositionNumericMinimum}"
Maximum="{Binding PositionNumericMaximum}"
ValueChanged="PositionNumeric_OnValueChanged" />
<Slider Grid.Column="1"
VerticalAlignment="Center"
Value="{Binding PositionTrackBar}" Minimum="0" Maximum="59"
Value="{Binding PositionTrackBar}"
Minimum="{Binding PositionTrackBarMinimum}"
Maximum="{Binding PositionTrackBarMaximum}"
SmallChange="1" LargeChange="5"
Padding="8,0,0,0"
PropertyChanged="PositionTrackBar_OnPropertyChanged" />
PropertyChanged="PositionTrackBar_OnPropertyChanged"
PointerWheelChanged="PositionTrackBar_OnPointerWheelChanged" />
</Grid>
<TextBlock Margin="0,4">Size:</TextBlock>
<Grid ColumnDefinitions="100*,158*">
<NumericUpDown Name="sizeNumeric"
ShowButtonSpinner="False"
Value="{Binding SizeNumeric}" Increment="1" Minimum="0" Maximum="59"
ValueChanged="SizeNumeric_OnValueChanged" />
<Slider Grid.Column="1" Name="sizeTrackBar"
<NumericUpDown
Value="{Binding SizeNumeric}" Increment="1"
Minimum="{Binding SizeNumericMinimum}"
Maximum="{Binding SizeNumericMaximum}"
ValueChanged="SizeNumeric_OnValueChanged" />
<Slider Grid.Column="1"
VerticalAlignment="Center"
Value="{Binding SizeTrackBar}" Minimum="4" Maximum="59"
Value="{Binding SizeTrackBar}"
Minimum="{Binding SizeTrackBarMinimum}"
Maximum="{Binding SizeTrackBarMaximum}"
SmallChange="1" LargeChange="5"
Padding="8,0,0,0"
PropertyChanged="SizeTrackBar_OnPropertyChanged" />
PropertyChanged="SizeTrackBar_OnPropertyChanged"
PointerWheelChanged="SizeTrackBar_OnPointerWheelChanged" />
</Grid>
<TextBlock Margin="0,4">Measure:</TextBlock>
<Grid ColumnDefinitions="8*,4*,*,4*">
<NumericUpDown Grid.Column="0" Name="measureNumeric"
<NumericUpDown Grid.Column="0"
HorizontalAlignment="Stretch"
Value="0" Increment="1" Minimum="0" Maximum="9999"
Value="{Binding MeasureNumeric}" Increment="1"
Minimum="{Binding MeasureNumericMinimum}"
Maximum="{Binding MeasureNumericMaximum}"
Margin="0,0,8,0"
ValueChanged="MeasureNumeric_OnValueChanged" />
<NumericUpDown Grid.Column="1" Name="beat1Numeric"
<NumericUpDown Grid.Column="1"
HorizontalAlignment="Stretch"
Value="0" Increment="1" Minimum="0" Maximum="1920"
Value="{Binding Beat1Numeric}" Increment="1"
Minimum="{Binding Beat1NumericMinimum}"
Maximum="{Binding Beat1NumericMaximum}"
ValueChanged="Beat1Numeric_OnValueChanged" />
<TextBlock Grid.Column="2" Text="/" Width="8" Margin="8,0,8,0"
VerticalAlignment="Center" />
<NumericUpDown Grid.Column="3" Name="beat2Numeric"
<NumericUpDown Grid.Column="3"
HorizontalAlignment="Stretch"
Value="16" Increment="1" Minimum="0" Maximum="1920"
Value="{Binding Beat2Numeric}" Increment="1"
Minimum="{Binding Beat2NumericMinimum}"
Maximum="{Binding Beat2NumericMaximum}"
ValueChanged="Beat2Numeric_OnValueChanged" />
</Grid>
</StackPanel>
Expand Down Expand Up @@ -384,7 +400,8 @@
</StackPanel>

<StackPanel Grid.Column="1">
<Slider Name="songTrackBar" Value="0" Minimum="0" Maximum="10" SmallChange="1"
<Slider Value="{Binding SongTrackBar}" Minimum="0"
Maximum="{Binding SongTrackBarMaximum}" SmallChange="1"
LargeChange="5" PropertyChanged="SongTrackBar_OnPropertyChanged"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch" />

Expand All @@ -397,7 +414,8 @@
Width="100">
Speed
</TextBlock>
<Slider Name="trackBarSpeed" Value="100" Minimum="0" Maximum="100"
<Slider Value="{Binding SpeedTrackBar}" Minimum="0"
Maximum="{Binding SpeedTrackBarMaximum}"
SmallChange="1" LargeChange="5" Width="100"
HorizontalAlignment="Center"
PropertyChanged="TrackBarSpeed_OnPropertyChanged" />
Expand All @@ -407,7 +425,8 @@
TextAlignment="Right" Margin="0,0,8,0" Width="60">
Volume
</TextBlock>
<Slider Name="trackBarVolume" Value="100" Minimum="0" Maximum="100"
<Slider Name="trackBarVolume" Value="{Binding VolumeTrackBar}" Minimum="0"
Maximum="{Binding VolumeTrackBarMaximum}"
SmallChange="1" LargeChange="5" Width="100"
HorizontalAlignment="Center"
PropertyChanged="TrackBarVolume_OnPropertyChanged" />
Expand All @@ -417,7 +436,8 @@
TextAlignment="Right" Margin="0,0,8,0" Width="60">
Hitsounds
</TextBlock>
<Slider Name="trackBarHitsoundVolume" Value="100" Minimum="0" Maximum="100"
<Slider Value="{Binding HitsoundVolumeTrackBar}" Minimum="0"
Maximum="{Binding HitsoundVolumeMaximum}"
SmallChange="1" LargeChange="5" Width="50"
HorizontalAlignment="Center"
PropertyChanged="TrackBarHitsounds_OnPropertyChanged" />
Expand All @@ -435,8 +455,9 @@
HorizontalAlignment="Stretch">
<StackPanel Margin="8">
<TextBlock Margin="0,0,0,8">Hi-Speed:</TextBlock>
<NumericUpDown Name="visualHispeedNumeric"
Minimum="0.001" Maximum="500" Value="0.5" Increment="0.05"
<NumericUpDown Minimum="{Binding VisualHiSpeedNumericMinimum}"
Maximum="{Binding VisualHiSpeedNumericMaximum}"
Value="{Binding VisualHiSpeedNumeric}" Increment="0.05"
ValueChanged="VisualHispeedNumeric_OnValueChanged" />
</StackPanel>
</HeaderedContentControl>
Expand Down
Loading

0 comments on commit a9fb2da

Please sign in to comment.