Add chapters display, gray out fixed tracks, spacebar preview
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Windows;
|
||||
@@ -357,6 +358,13 @@ public partial class MainWindow : FluentWindow
|
||||
/// </summary>
|
||||
private void FileQueueList_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
|
||||
{
|
||||
if (e.Key == System.Windows.Input.Key.Space)
|
||||
{
|
||||
OpenSelectedFileInDefaultPlayer();
|
||||
e.Handled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.Key != System.Windows.Input.Key.Delete) return;
|
||||
|
||||
var selected = FileQueueList.SelectedItems.Cast<QueuedFileItem>().ToList();
|
||||
@@ -371,6 +379,25 @@ public partial class MainWindow : FluentWindow
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Opens the currently-selected queue item with whatever application
|
||||
/// Windows has associated with .mkv files (typically the default video
|
||||
/// player), so the user can quickly preview a file without leaving the app.
|
||||
/// </summary>
|
||||
private void OpenSelectedFileInDefaultPlayer()
|
||||
{
|
||||
if (FileQueueList.SelectedItem is not QueuedFileItem item) return;
|
||||
|
||||
try
|
||||
{
|
||||
Process.Start(new ProcessStartInfo(item.FilePath) { UseShellExecute = true });
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
StatusText.Text = $"Couldn't open {item.FileName}: {ex.Message}";
|
||||
}
|
||||
}
|
||||
|
||||
private void ClearQueueButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
foreach (var item in _fileQueue)
|
||||
|
||||
Reference in New Issue
Block a user