mirror of
https://github.com/aaru-dps/RedBookPlayer.git
synced 2025-12-16 19:24:41 +00:00
Add keyboard volume controls
This commit is contained in:
25
README.md
25
README.md
@@ -8,14 +8,17 @@
|
||||
|
||||
| Key | Action |
|
||||
| --- | ------ |
|
||||
| `F1` | Open Settings Window |
|
||||
| `F2` | Load New Image |
|
||||
| `Space` | Toggle Play / Pause |
|
||||
| `Esc` | Stop Playback |
|
||||
| `→` | Next Track |
|
||||
| `←` | Previous Track |
|
||||
| `]` | Next Index |
|
||||
| `[` | Previous Index |
|
||||
| `.` | Fast Forward |
|
||||
| `,` | Rewind |
|
||||
| `E` | Toggle Emphasis |
|
||||
| **F1** | Open Settings Window |
|
||||
| **F2** | Load New Image |
|
||||
| **Space** | Toggle Play / Pause |
|
||||
| **Esc** | Stop Playback |
|
||||
| **→** | Next Track |
|
||||
| **←** | Previous Track |
|
||||
| **]** | Next Index |
|
||||
| **[** | Previous Index |
|
||||
| **.** | Fast Forward |
|
||||
| **,** | Rewind |
|
||||
| **+** | Volume Up |
|
||||
| **-** | Volume Down |
|
||||
| **M** | Mute |
|
||||
| **E** | Toggle Emphasis |
|
||||
@@ -178,6 +178,24 @@ namespace RedBookPlayer.GUI
|
||||
playerView?.RewindButton_Click(this, null);
|
||||
}
|
||||
|
||||
// Volume Up
|
||||
else if(e.Key == App.Settings.VolumeUpKey || e.Key == Key.VolumeUp)
|
||||
{
|
||||
playerView?.VolumeUpButton_Click(this, null);
|
||||
}
|
||||
|
||||
// Volume Down
|
||||
else if(e.Key == App.Settings.VolumeDownKey || e.Key == Key.VolumeDown)
|
||||
{
|
||||
playerView?.VolumeDownButton_Click(this, null);
|
||||
}
|
||||
|
||||
// Mute Toggle
|
||||
else if(e.Key == App.Settings.ToggleMuteKey || e.Key == Key.VolumeMute)
|
||||
{
|
||||
playerView?.MuteToggleButton_Click(this, null);
|
||||
}
|
||||
|
||||
// Emphasis Toggle
|
||||
else if(e.Key == App.Settings.ToggleDeEmphasisKey)
|
||||
{
|
||||
|
||||
@@ -35,6 +35,11 @@ namespace RedBookPlayer.GUI
|
||||
/// </summary>
|
||||
private Timer _updateTimer;
|
||||
|
||||
/// <summary>
|
||||
/// Last volume for mute toggling
|
||||
/// </summary>
|
||||
private int? _lastVolume = null;
|
||||
|
||||
public PlayerView() => InitializeComponent(null);
|
||||
|
||||
public PlayerView(string xaml) => InitializeComponent(xaml);
|
||||
@@ -235,6 +240,32 @@ namespace RedBookPlayer.GUI
|
||||
|
||||
public void RewindButton_Click(object sender, RoutedEventArgs e) => Player.Rewind();
|
||||
|
||||
public void VolumeUpButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if(App.Settings.Volume < 100)
|
||||
App.Settings.Volume++;
|
||||
}
|
||||
|
||||
public void VolumeDownButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if(App.Settings.Volume > 0)
|
||||
App.Settings.Volume--;
|
||||
}
|
||||
|
||||
public void MuteToggleButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (_lastVolume == null)
|
||||
{
|
||||
_lastVolume = App.Settings.Volume;
|
||||
App.Settings.Volume = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
App.Settings.Volume = _lastVolume.Value;
|
||||
_lastVolume = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void EnableDeEmphasisButton_Click(object sender, RoutedEventArgs e) => Player.ToggleDeEmphasis(true);
|
||||
|
||||
public void DisableDeEmphasisButton_Click(object sender, RoutedEventArgs e) => Player.ToggleDeEmphasis(false);
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<TextBlock VerticalAlignment="Center">Generate a TOC if the disc is missing one</TextBlock>
|
||||
</WrapPanel>
|
||||
<DockPanel Margin="0,0,0,16">
|
||||
<TextBlock VerticalAlignment="Center" Margin="0,0,8,0" DockPanel.Dock="Left">Volume</TextBlock>
|
||||
<TextBlock VerticalAlignment="Center" Margin="0,0,8,0" DockPanel.Dock="Left">Default Volume</TextBlock>
|
||||
<TextBlock VerticalAlignment="Center" DockPanel.Dock="Right" Text="%" />
|
||||
<TextBlock VerticalAlignment="Center" Margin="8,0,0,0" DockPanel.Dock="Right" Text="{Binding Volume}"
|
||||
Name="VolumeLabel" />
|
||||
@@ -41,98 +41,80 @@
|
||||
</DockPanel>
|
||||
</TabItem>
|
||||
<TabItem Header="Keyboard Bindings">
|
||||
<StackPanel Margin="16">
|
||||
<Grid Margin="0,0,0,16">
|
||||
<Grid Margin="16">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Grid.Column="0" Width="120">Load Image</TextBlock>
|
||||
<ComboBox Grid.Column="1" HorizontalAlignment="Right" Name="LoadImageKeyBind" Margin="8,0,0,0" Width="120"/>
|
||||
</Grid>
|
||||
<Grid Margin="0,0,0,16">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Column="0" Width="120">Toggle Play/Pause</TextBlock>
|
||||
<ComboBox Grid.Column="1" HorizontalAlignment="Right" Name="TogglePlaybackKeyBind" Margin="8,0,0,0" Width="120"/>
|
||||
</Grid>
|
||||
<Grid Margin="0,0,0,16">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<!-- Load Image-->
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Width="120">Load Image</TextBlock>
|
||||
<ComboBox Grid.Row="0" Grid.Column="1" HorizontalAlignment="Right" Name="LoadImageKeyBind" Margin="8,0,0,0" Width="120"/>
|
||||
|
||||
<TextBlock Grid.Column="0" Width="120">Stop Playback</TextBlock>
|
||||
<ComboBox Grid.Column="1" HorizontalAlignment="Right" Name="StopPlaybackKeyBind" Margin="8,0,0,0" Width="120"/>
|
||||
</Grid>
|
||||
<Grid Margin="0,0,0,16">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<!-- Toggle Play/Pause -->
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Width="120">Toggle Play/Pause</TextBlock>
|
||||
<ComboBox Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Name="TogglePlaybackKeyBind" Margin="8,0,0,0" Width="120"/>
|
||||
|
||||
<TextBlock Grid.Column="0" Width="120">Next Track</TextBlock>
|
||||
<ComboBox Grid.Column="1" HorizontalAlignment="Right" Name="NextTrackKeyBind" Margin="8,0,0,0" Width="120"/>
|
||||
</Grid>
|
||||
<Grid Margin="0,0,0,16">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<!-- Stop Playback-->
|
||||
<TextBlock Grid.Row="2" Grid.Column="0" Width="120">Stop Playback</TextBlock>
|
||||
<ComboBox Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right" Name="StopPlaybackKeyBind" Margin="8,0,0,0" Width="120"/>
|
||||
|
||||
<TextBlock Grid.Column="0" Width="120">Previous Track</TextBlock>
|
||||
<ComboBox Grid.Column="1" HorizontalAlignment="Right" Name="PreviousTrackKeyBind" Margin="8,0,0,0" Width="120"/>
|
||||
</Grid>
|
||||
<Grid Margin="0,0,0,16">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<!-- Next Track -->
|
||||
<TextBlock Grid.Row="3" Grid.Column="0" Width="120">Next Track</TextBlock>
|
||||
<ComboBox Grid.Row="3" Grid.Column="1" HorizontalAlignment="Right" Name="NextTrackKeyBind" Margin="8,0,0,0" Width="120"/>
|
||||
|
||||
<TextBlock Grid.Column="0" Width="120">Next Index</TextBlock>
|
||||
<ComboBox Grid.Column="1" HorizontalAlignment="Right" Name="NextIndexKeyBind" Margin="8,0,0,0" Width="120"/>
|
||||
</Grid>
|
||||
<Grid Margin="0,0,0,16">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<!-- Previous Track -->
|
||||
<TextBlock Grid.Row="4" Grid.Column="0" Width="120">Previous Track</TextBlock>
|
||||
<ComboBox Grid.Row="4" Grid.Column="1" HorizontalAlignment="Right" Name="PreviousTrackKeyBind" Margin="8,0,0,0" Width="120"/>
|
||||
|
||||
<TextBlock Grid.Column="0" Width="120">Previous Index</TextBlock>
|
||||
<ComboBox Grid.Column="1" HorizontalAlignment="Right" Name="PreviousIndexKeyBind" Margin="8,0,0,0" Width="120"/>
|
||||
</Grid>
|
||||
<Grid Margin="0,0,0,16">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<!-- Next Index -->
|
||||
<TextBlock Grid.Row="5" Grid.Column="0" Width="120">Next Index</TextBlock>
|
||||
<ComboBox Grid.Row="5" Grid.Column="1" HorizontalAlignment="Right" Name="NextIndexKeyBind" Margin="8,0,0,0" Width="120"/>
|
||||
|
||||
<TextBlock Grid.Column="0" Width="120">Fast-Forward</TextBlock>
|
||||
<ComboBox Grid.Column="1" HorizontalAlignment="Right" Name="FastForwardPlaybackKeyBind" Margin="8,0,0,0" Width="120"/>
|
||||
</Grid>
|
||||
<Grid Margin="0,0,0,16">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<!-- Previous Index -->
|
||||
<TextBlock Grid.Row="6" Grid.Column="0" Width="120">Previous Index</TextBlock>
|
||||
<ComboBox Grid.Row="6" Grid.Column="1" HorizontalAlignment="Right" Name="PreviousIndexKeyBind" Margin="8,0,0,0" Width="120"/>
|
||||
|
||||
<TextBlock Grid.Column="0" Width="120">Rewind</TextBlock>
|
||||
<ComboBox Grid.Column="1" HorizontalAlignment="Right" Name="RewindPlaybackKeyBind" Margin="8,0,0,0" Width="120"/>
|
||||
</Grid>
|
||||
<Grid Margin="0,0,0,16">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<!-- Fast Forward -->
|
||||
<TextBlock Grid.Row="7" Grid.Column="0" Width="120">Fast-Forward</TextBlock>
|
||||
<ComboBox Grid.Row="7" Grid.Column="1" HorizontalAlignment="Right" Name="FastForwardPlaybackKeyBind" Margin="8,0,0,0" Width="120"/>
|
||||
|
||||
<TextBlock Grid.Column="0" Width="120">Toggle De-Emphasis</TextBlock>
|
||||
<ComboBox Grid.Column="1" HorizontalAlignment="Right" Name="ToggleDeEmphasisKeyBind" Margin="8,0,0,0" Width="120"/>
|
||||
<!-- Rewind -->
|
||||
<TextBlock Grid.Row="8" Grid.Column="0" Width="120">Rewind</TextBlock>
|
||||
<ComboBox Grid.Row="8" Grid.Column="1" HorizontalAlignment="Right" Name="RewindPlaybackKeyBind" Margin="8,0,0,0" Width="120"/>
|
||||
|
||||
<!-- Volume Up -->
|
||||
<TextBlock Grid.Row="9" Grid.Column="0" Width="120">Volume Up</TextBlock>
|
||||
<ComboBox Grid.Row="9" Grid.Column="1" HorizontalAlignment="Right" Name="VolumeUpKeyBind" Margin="8,0,0,0" Width="120"/>
|
||||
|
||||
<!-- Volume Down -->
|
||||
<TextBlock Grid.Row="10" Grid.Column="0" Width="120">Volume Down</TextBlock>
|
||||
<ComboBox Grid.Row="10" Grid.Column="1" HorizontalAlignment="Right" Name="VolumeDownKeyBind" Margin="8,0,0,0" Width="120"/>
|
||||
|
||||
<!-- Mute Toggle -->
|
||||
<TextBlock Grid.Row="11" Grid.Column="0" Width="120">Toggle Mute</TextBlock>
|
||||
<ComboBox Grid.Row="11" Grid.Column="1" HorizontalAlignment="Right" Name="ToggleMuteKeyBind" Margin="8,0,0,0" Width="120"/>
|
||||
|
||||
<!-- De-Emphasis Toggle -->
|
||||
<TextBlock Grid.Row="12" Grid.Column="0" Width="120">Toggle De-Emphasis</TextBlock>
|
||||
<ComboBox Grid.Row="12" Grid.Column="1" HorizontalAlignment="Right" Name="ToggleDeEmphasisKeyBind" Margin="8,0,0,0" Width="120"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
<Button Name="ApplyButton">Apply</Button>
|
||||
|
||||
@@ -92,41 +92,50 @@ namespace RedBookPlayer.GUI
|
||||
private void PopulateKeyboardList()
|
||||
{
|
||||
// Access all of the combo boxes
|
||||
ComboBox LoadImageKeyBind = this.FindControl<ComboBox>("LoadImageKeyBind");
|
||||
ComboBox TogglePlaybackKeyBind = this.FindControl<ComboBox>("TogglePlaybackKeyBind");
|
||||
ComboBox StopPlaybackKeyBind = this.FindControl<ComboBox>("StopPlaybackKeyBind");
|
||||
ComboBox NextTrackKeyBind = this.FindControl<ComboBox>("NextTrackKeyBind");
|
||||
ComboBox PreviousTrackKeyBind = this.FindControl<ComboBox>("PreviousTrackKeyBind");
|
||||
ComboBox NextIndexKeyBind = this.FindControl<ComboBox>("NextIndexKeyBind");
|
||||
ComboBox PreviousIndexKeyBind = this.FindControl<ComboBox>("PreviousIndexKeyBind");
|
||||
ComboBox FastForwardPlaybackKeyBind = this.FindControl<ComboBox>("FastForwardPlaybackKeyBind");
|
||||
ComboBox RewindPlaybackKeyBind = this.FindControl<ComboBox>("RewindPlaybackKeyBind");
|
||||
ComboBox ToggleDeEmphasisKeyBind = this.FindControl<ComboBox>("ToggleDeEmphasisKeyBind");
|
||||
ComboBox loadImageKeyBind = this.FindControl<ComboBox>("LoadImageKeyBind");
|
||||
ComboBox togglePlaybackKeyBind = this.FindControl<ComboBox>("TogglePlaybackKeyBind");
|
||||
ComboBox stopPlaybackKeyBind = this.FindControl<ComboBox>("StopPlaybackKeyBind");
|
||||
ComboBox nextTrackKeyBind = this.FindControl<ComboBox>("NextTrackKeyBind");
|
||||
ComboBox previousTrackKeyBind = this.FindControl<ComboBox>("PreviousTrackKeyBind");
|
||||
ComboBox nextIndexKeyBind = this.FindControl<ComboBox>("NextIndexKeyBind");
|
||||
ComboBox previousIndexKeyBind = this.FindControl<ComboBox>("PreviousIndexKeyBind");
|
||||
ComboBox fastForwardPlaybackKeyBind = this.FindControl<ComboBox>("FastForwardPlaybackKeyBind");
|
||||
ComboBox rewindPlaybackKeyBind = this.FindControl<ComboBox>("RewindPlaybackKeyBind");
|
||||
ComboBox volumeUpKeyBind = this.FindControl<ComboBox>("VolumeUpKeyBind");
|
||||
ComboBox volumeDownKeyBind = this.FindControl<ComboBox>("VolumeDownKeyBind");
|
||||
ComboBox toggleMuteKeyBind = this.FindControl<ComboBox>("ToggleMuteKeyBind");
|
||||
ComboBox toggleDeEmphasisKeyBind = this.FindControl<ComboBox>("ToggleDeEmphasisKeyBind");
|
||||
|
||||
// Assign the list of values to all of them
|
||||
Array keyboardList = GenerateKeyboardList();
|
||||
LoadImageKeyBind.Items = keyboardList;
|
||||
TogglePlaybackKeyBind.Items = keyboardList;
|
||||
StopPlaybackKeyBind.Items = keyboardList;
|
||||
NextTrackKeyBind.Items = keyboardList;
|
||||
PreviousTrackKeyBind.Items = keyboardList;
|
||||
NextIndexKeyBind.Items = keyboardList;
|
||||
PreviousIndexKeyBind.Items = keyboardList;
|
||||
FastForwardPlaybackKeyBind.Items = keyboardList;
|
||||
RewindPlaybackKeyBind.Items = keyboardList;
|
||||
ToggleDeEmphasisKeyBind.Items = keyboardList;
|
||||
loadImageKeyBind.Items = keyboardList;
|
||||
togglePlaybackKeyBind.Items = keyboardList;
|
||||
stopPlaybackKeyBind.Items = keyboardList;
|
||||
nextTrackKeyBind.Items = keyboardList;
|
||||
previousTrackKeyBind.Items = keyboardList;
|
||||
nextIndexKeyBind.Items = keyboardList;
|
||||
previousIndexKeyBind.Items = keyboardList;
|
||||
fastForwardPlaybackKeyBind.Items = keyboardList;
|
||||
rewindPlaybackKeyBind.Items = keyboardList;
|
||||
volumeUpKeyBind.Items = keyboardList;
|
||||
volumeDownKeyBind.Items = keyboardList;
|
||||
toggleMuteKeyBind.Items = keyboardList;
|
||||
toggleDeEmphasisKeyBind.Items = keyboardList;
|
||||
|
||||
// Set all of the currently selected items
|
||||
LoadImageKeyBind.SelectedItem = _settings.LoadImageKey;
|
||||
TogglePlaybackKeyBind.SelectedItem = _settings.TogglePlaybackKey;
|
||||
StopPlaybackKeyBind.SelectedItem = _settings.StopPlaybackKey;
|
||||
NextTrackKeyBind.SelectedItem = _settings.NextTrackKey;
|
||||
PreviousTrackKeyBind.SelectedItem = _settings.PreviousTrackKey;
|
||||
NextIndexKeyBind.SelectedItem = _settings.NextIndexKey;
|
||||
PreviousIndexKeyBind.SelectedItem = _settings.PreviousIndexKey;
|
||||
FastForwardPlaybackKeyBind.SelectedItem = _settings.FastForwardPlaybackKey;
|
||||
RewindPlaybackKeyBind.SelectedItem = _settings.RewindPlaybackKey;
|
||||
ToggleDeEmphasisKeyBind.SelectedItem = _settings.ToggleDeEmphasisKey;
|
||||
loadImageKeyBind.SelectedItem = _settings.LoadImageKey;
|
||||
togglePlaybackKeyBind.SelectedItem = _settings.TogglePlaybackKey;
|
||||
stopPlaybackKeyBind.SelectedItem = _settings.StopPlaybackKey;
|
||||
nextTrackKeyBind.SelectedItem = _settings.NextTrackKey;
|
||||
previousTrackKeyBind.SelectedItem = _settings.PreviousTrackKey;
|
||||
nextIndexKeyBind.SelectedItem = _settings.NextIndexKey;
|
||||
previousIndexKeyBind.SelectedItem = _settings.PreviousIndexKey;
|
||||
fastForwardPlaybackKeyBind.SelectedItem = _settings.FastForwardPlaybackKey;
|
||||
rewindPlaybackKeyBind.SelectedItem = _settings.RewindPlaybackKey;
|
||||
volumeUpKeyBind.SelectedItem = _settings.VolumeUpKey;
|
||||
volumeDownKeyBind.SelectedItem = _settings.VolumeDownKey;
|
||||
toggleMuteKeyBind.SelectedItem = _settings.ToggleMuteKey;
|
||||
toggleDeEmphasisKeyBind.SelectedItem = _settings.ToggleDeEmphasisKey;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -135,28 +144,34 @@ namespace RedBookPlayer.GUI
|
||||
private void SaveKeyboardList()
|
||||
{
|
||||
// Access all of the combo boxes
|
||||
ComboBox LoadImageKeyBind = this.FindControl<ComboBox>("LoadImageKeyBind");
|
||||
ComboBox TogglePlaybackKeyBind = this.FindControl<ComboBox>("TogglePlaybackKeyBind");
|
||||
ComboBox StopPlaybackKeyBind = this.FindControl<ComboBox>("StopPlaybackKeyBind");
|
||||
ComboBox NextTrackKeyBind = this.FindControl<ComboBox>("NextTrackKeyBind");
|
||||
ComboBox PreviousTrackKeyBind = this.FindControl<ComboBox>("PreviousTrackKeyBind");
|
||||
ComboBox NextIndexKeyBind = this.FindControl<ComboBox>("NextIndexKeyBind");
|
||||
ComboBox PreviousIndexKeyBind = this.FindControl<ComboBox>("PreviousIndexKeyBind");
|
||||
ComboBox FastForwardPlaybackKeyBind = this.FindControl<ComboBox>("FastForwardPlaybackKeyBind");
|
||||
ComboBox RewindPlaybackKeyBind = this.FindControl<ComboBox>("RewindPlaybackKeyBind");
|
||||
ComboBox ToggleDeEmphasisKeyBind = this.FindControl<ComboBox>("ToggleDeEmphasisKeyBind");
|
||||
ComboBox loadImageKeyBind = this.FindControl<ComboBox>("LoadImageKeyBind");
|
||||
ComboBox togglePlaybackKeyBind = this.FindControl<ComboBox>("TogglePlaybackKeyBind");
|
||||
ComboBox stopPlaybackKeyBind = this.FindControl<ComboBox>("StopPlaybackKeyBind");
|
||||
ComboBox nextTrackKeyBind = this.FindControl<ComboBox>("NextTrackKeyBind");
|
||||
ComboBox previousTrackKeyBind = this.FindControl<ComboBox>("PreviousTrackKeyBind");
|
||||
ComboBox nextIndexKeyBind = this.FindControl<ComboBox>("NextIndexKeyBind");
|
||||
ComboBox previousIndexKeyBind = this.FindControl<ComboBox>("PreviousIndexKeyBind");
|
||||
ComboBox fastForwardPlaybackKeyBind = this.FindControl<ComboBox>("FastForwardPlaybackKeyBind");
|
||||
ComboBox rewindPlaybackKeyBind = this.FindControl<ComboBox>("RewindPlaybackKeyBind");
|
||||
ComboBox volumeUpKeyBind = this.FindControl<ComboBox>("VolumeUpKeyBind");
|
||||
ComboBox volumeDownKeyBind = this.FindControl<ComboBox>("VolumeDownKeyBind");
|
||||
ComboBox toggleMuteKeyBind = this.FindControl<ComboBox>("ToggleMuteKeyBind");
|
||||
ComboBox toggleDeEmphasisKeyBind = this.FindControl<ComboBox>("ToggleDeEmphasisKeyBind");
|
||||
|
||||
// Set all of the currently selected items
|
||||
_settings.LoadImageKey = (Key)LoadImageKeyBind.SelectedItem;
|
||||
_settings.TogglePlaybackKey = (Key)TogglePlaybackKeyBind.SelectedItem;
|
||||
_settings.StopPlaybackKey = (Key)StopPlaybackKeyBind.SelectedItem;
|
||||
_settings.NextTrackKey = (Key)NextTrackKeyBind.SelectedItem;
|
||||
_settings.PreviousTrackKey = (Key)PreviousTrackKeyBind.SelectedItem;
|
||||
_settings.NextIndexKey = (Key)NextIndexKeyBind.SelectedItem;
|
||||
_settings.PreviousIndexKey = (Key)PreviousIndexKeyBind.SelectedItem;
|
||||
_settings.FastForwardPlaybackKey = (Key)FastForwardPlaybackKeyBind.SelectedItem;
|
||||
_settings.RewindPlaybackKey = (Key)RewindPlaybackKeyBind.SelectedItem;
|
||||
_settings.ToggleDeEmphasisKey = (Key)ToggleDeEmphasisKeyBind.SelectedItem;
|
||||
_settings.LoadImageKey = (Key)loadImageKeyBind.SelectedItem;
|
||||
_settings.TogglePlaybackKey = (Key)togglePlaybackKeyBind.SelectedItem;
|
||||
_settings.StopPlaybackKey = (Key)stopPlaybackKeyBind.SelectedItem;
|
||||
_settings.NextTrackKey = (Key)nextTrackKeyBind.SelectedItem;
|
||||
_settings.PreviousTrackKey = (Key)previousTrackKeyBind.SelectedItem;
|
||||
_settings.NextIndexKey = (Key)nextIndexKeyBind.SelectedItem;
|
||||
_settings.PreviousIndexKey = (Key)previousIndexKeyBind.SelectedItem;
|
||||
_settings.FastForwardPlaybackKey = (Key)fastForwardPlaybackKeyBind.SelectedItem;
|
||||
_settings.RewindPlaybackKey = (Key)rewindPlaybackKeyBind.SelectedItem;
|
||||
_settings.VolumeUpKey = (Key)volumeUpKeyBind.SelectedItem;
|
||||
_settings.VolumeDownKey = (Key)volumeDownKeyBind.SelectedItem;
|
||||
_settings.ToggleMuteKey = (Key)toggleMuteKeyBind.SelectedItem;
|
||||
_settings.ToggleDeEmphasisKey = (Key)toggleDeEmphasisKeyBind.SelectedItem;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -99,6 +99,21 @@ namespace RedBookPlayer
|
||||
/// </summary>
|
||||
public Key RewindPlaybackKey { get; set; } = Key.OemComma;
|
||||
|
||||
/// <summary>
|
||||
/// Key assigned to raise volume
|
||||
/// </summary>
|
||||
public Key VolumeUpKey { get; set; } = Key.OemPlus;
|
||||
|
||||
/// <summary>
|
||||
/// Key assigned to lower volume
|
||||
/// </summary>
|
||||
public Key VolumeDownKey { get; set; } = Key.OemMinus;
|
||||
|
||||
/// <summary>
|
||||
/// Key assigned to toggle mute
|
||||
/// </summary>
|
||||
public Key ToggleMuteKey { get; set; } = Key.M;
|
||||
|
||||
/// <summary>
|
||||
/// Key assigned to toggle de-emphasis
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user