Add 'X' hotkey for removing selected audio from the playlist

This commit is contained in:
ScrubN 2023-12-31 02:06:05 -05:00 committed by Krowe Moh
parent 749790b1de
commit cbc580ce37
3 changed files with 12 additions and 0 deletions

View File

@ -363,6 +363,13 @@ namespace FModel.Settings
set => SetProperty(ref _addAudio, value);
}
private Hotkey _removeAudio = new(Key.X);
public Hotkey RemoveAudio
{
get => _removeAudio;
set => SetProperty(ref _removeAudio, value);
}
private Hotkey _playPauseAudio = new(Key.K);
public Hotkey PlayPauseAudio
{

View File

@ -75,6 +75,8 @@ public partial class AudioPlayer
_applicationView.AudioPlayer.Previous();
else if (UserSettings.Default.NextAudio.IsTriggered(e.Key))
_applicationView.AudioPlayer.Next();
else if (UserSettings.Default.RemoveAudio.IsTriggered(e.Key))
_applicationView.AudioPlayer.Remove();
}
private void OnAudioFileMouseDoubleClick(object sender, MouseButtonEventArgs e)

View File

@ -602,6 +602,9 @@
<TextBlock Grid.Row="12" Grid.Column="0" Text="Next Audio" VerticalAlignment="Center" Margin="0 0 0 5" />
<controls:HotkeyTextBox Grid.Row="12" Grid.Column="2" Style="{StaticResource TextBoxDefaultStyle}" Margin="0 0 0 5"
HotKey="{Binding NextAudio, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
<TextBlock Grid.Row="12" Grid.Column="0" Text="Remove Selected Audio" VerticalAlignment="Center" Margin="0 0 0 5" />
<controls:HotkeyTextBox Grid.Row="12" Grid.Column="2" Style="{StaticResource TextBoxDefaultStyle}" Margin="0 0 0 5"
HotKey="{Binding RemoveAudio, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
</Grid>
</DataTemplate>
</ResourceDictionary>