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