mirror of
https://github.com/aaru-dps/RedBookPlayer.git
synced 2025-12-16 19:24:41 +00:00
Wire up disc changing to UI
This commit is contained in:
@@ -16,6 +16,8 @@
|
|||||||
| **Space** | Toggle Play / Pause |
|
| **Space** | Toggle Play / Pause |
|
||||||
| **Esc** | Stop Playback |
|
| **Esc** | Stop Playback |
|
||||||
| **~** | Eject |
|
| **~** | Eject |
|
||||||
|
| **Page Up** | Next Disc |
|
||||||
|
| **Page Down** | Previous Disc |
|
||||||
| **→** | Next Track |
|
| **→** | Next Track |
|
||||||
| **←** | Previous Track |
|
| **←** | Previous Track |
|
||||||
| **]** | Next Index |
|
| **]** | Next Index |
|
||||||
|
|||||||
@@ -75,6 +75,18 @@ namespace RedBookPlayer.GUI.ViewModels
|
|||||||
PlayerView?.ViewModel?.ExecuteEject();
|
PlayerView?.ViewModel?.ExecuteEject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Next Disc
|
||||||
|
else if(e.Key == App.Settings.NextDiscKey)
|
||||||
|
{
|
||||||
|
PlayerView?.ViewModel?.ExecuteNextDisc();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Previous Disc
|
||||||
|
else if(e.Key == App.Settings.PreviousDiscKey)
|
||||||
|
{
|
||||||
|
PlayerView?.ViewModel?.ExecutePreviousDisc();
|
||||||
|
}
|
||||||
|
|
||||||
// Next Track
|
// Next Track
|
||||||
else if(e.Key == App.Settings.NextTrackKey || e.Key == Key.MediaNextTrack)
|
else if(e.Key == App.Settings.NextTrackKey || e.Key == Key.MediaNextTrack)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -44,6 +44,15 @@ namespace RedBookPlayer.GUI.ViewModels
|
|||||||
|
|
||||||
#region OpticalDisc Passthrough
|
#region OpticalDisc Passthrough
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Path to the disc image
|
||||||
|
/// </summary>
|
||||||
|
public string ImagePath
|
||||||
|
{
|
||||||
|
get => _imagePath;
|
||||||
|
private set => this.RaiseAndSetIfChanged(ref _imagePath, value);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Current track number
|
/// Current track number
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -159,6 +168,7 @@ namespace RedBookPlayer.GUI.ViewModels
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public ulong TotalTime => _player.TotalTime;
|
public ulong TotalTime => _player.TotalTime;
|
||||||
|
|
||||||
|
private string _imagePath;
|
||||||
private int _currentTrackNumber;
|
private int _currentTrackNumber;
|
||||||
private ushort _currentTrackIndex;
|
private ushort _currentTrackIndex;
|
||||||
private ushort _currentTrackSession;
|
private ushort _currentTrackSession;
|
||||||
@@ -274,6 +284,16 @@ namespace RedBookPlayer.GUI.ViewModels
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public ReactiveCommand<Unit, Unit> EjectCommand { get; }
|
public ReactiveCommand<Unit, Unit> EjectCommand { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Command for moving to the next disc
|
||||||
|
/// </summary>
|
||||||
|
public ReactiveCommand<Unit, Unit> NextDiscCommand { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Command for moving to the previous disc
|
||||||
|
/// </summary>
|
||||||
|
public ReactiveCommand<Unit, Unit> PreviousDiscCommand { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Command for moving to the next track
|
/// Command for moving to the next track
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -359,6 +379,8 @@ namespace RedBookPlayer.GUI.ViewModels
|
|||||||
TogglePlayPauseCommand = ReactiveCommand.Create(ExecuteTogglePlayPause);
|
TogglePlayPauseCommand = ReactiveCommand.Create(ExecuteTogglePlayPause);
|
||||||
StopCommand = ReactiveCommand.Create(ExecuteStop);
|
StopCommand = ReactiveCommand.Create(ExecuteStop);
|
||||||
EjectCommand = ReactiveCommand.Create(ExecuteEject);
|
EjectCommand = ReactiveCommand.Create(ExecuteEject);
|
||||||
|
NextDiscCommand = ReactiveCommand.Create(ExecuteNextDisc);
|
||||||
|
PreviousDiscCommand = ReactiveCommand.Create(ExecutePreviousDisc);
|
||||||
NextTrackCommand = ReactiveCommand.Create(ExecuteNextTrack);
|
NextTrackCommand = ReactiveCommand.Create(ExecuteNextTrack);
|
||||||
PreviousTrackCommand = ReactiveCommand.Create(ExecutePreviousTrack);
|
PreviousTrackCommand = ReactiveCommand.Create(ExecutePreviousTrack);
|
||||||
NextIndexCommand = ReactiveCommand.Create(ExecuteNextIndex);
|
NextIndexCommand = ReactiveCommand.Create(ExecuteNextIndex);
|
||||||
@@ -819,8 +841,17 @@ namespace RedBookPlayer.GUI.ViewModels
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImagePath = _player.ImagePath;
|
||||||
Initialized = _player.Initialized;
|
Initialized = _player.Initialized;
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(ImagePath) && Initialized)
|
||||||
|
{
|
||||||
|
Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
|
{
|
||||||
|
App.MainWindow.Title = "RedBookPlayer - " + ImagePath.Split('/').Last().Split('\\').Last();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
CurrentDisc = _player.CurrentDisc;
|
CurrentDisc = _player.CurrentDisc;
|
||||||
CurrentTrackNumber = _player.CurrentTrackNumber;
|
CurrentTrackNumber = _player.CurrentTrackNumber;
|
||||||
CurrentTrackIndex = _player.CurrentTrackIndex;
|
CurrentTrackIndex = _player.CurrentTrackIndex;
|
||||||
|
|||||||
@@ -103,7 +103,8 @@
|
|||||||
<TextBlock Margin="0,0,16,0" IsVisible="{Binding QuadChannel}">4CH</TextBlock>
|
<TextBlock Margin="0,0,16,0" IsVisible="{Binding QuadChannel}">4CH</TextBlock>
|
||||||
<TextBlock Margin="0,0,16,0" Foreground="LightGray" IsVisible="{Binding !HiddenTrack}">HIDDEN</TextBlock>
|
<TextBlock Margin="0,0,16,0" Foreground="LightGray" IsVisible="{Binding !HiddenTrack}">HIDDEN</TextBlock>
|
||||||
<TextBlock Margin="0,0,16,0" IsVisible="{Binding HiddenTrack}">HIDDEN</TextBlock>
|
<TextBlock Margin="0,0,16,0" IsVisible="{Binding HiddenTrack}">HIDDEN</TextBlock>
|
||||||
<TextBlock Margin="0,0,16,0" Text="{Binding Volume}"/>
|
<TextBlock Margin="0,0,16,0" Text="{Binding Volume, StringFormat='Volume {0}%'}"/>
|
||||||
|
<TextBlock Margin="0,0,16,0" Text="{Binding CurrentDisc, StringFormat='Disc Number: {0}'}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ReactiveUserControl>
|
</ReactiveUserControl>
|
||||||
@@ -58,120 +58,144 @@
|
|||||||
</DockPanel>
|
</DockPanel>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem Header="Keyboard Bindings">
|
<TabItem Header="Keyboard Bindings">
|
||||||
<Grid Margin="16">
|
<StackPanel Margin="16">
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition/>
|
|
||||||
<ColumnDefinition/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition/>
|
|
||||||
<RowDefinition/>
|
|
||||||
<RowDefinition/>
|
|
||||||
<RowDefinition/>
|
|
||||||
<RowDefinition/>
|
|
||||||
<RowDefinition/>
|
|
||||||
<RowDefinition/>
|
|
||||||
<RowDefinition/>
|
|
||||||
<RowDefinition/>
|
|
||||||
<RowDefinition/>
|
|
||||||
<RowDefinition/>
|
|
||||||
<RowDefinition/>
|
|
||||||
<RowDefinition/>
|
|
||||||
<RowDefinition/>
|
|
||||||
<RowDefinition/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
|
|
||||||
<!-- Load Image-->
|
<!-- Load Image-->
|
||||||
<TextBlock Grid.Row="0" Grid.Column="0" Width="120">Load Image</TextBlock>
|
<WrapPanel Margin="0,0,0,16">
|
||||||
<ComboBox Grid.Row="0" Grid.Column="1" Name="LoadImageKeyBind"
|
<TextBlock Width="120">Load Image</TextBlock>
|
||||||
Items="{Binding KeyboardList}" SelectedItem="{Binding LoadImageKey, Mode=TwoWay}"
|
<ComboBox Name="LoadImageKeyBind"
|
||||||
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
Items="{Binding KeyboardList}" SelectedItem="{Binding LoadImageKey, Mode=TwoWay}"
|
||||||
|
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
||||||
|
</WrapPanel>
|
||||||
|
|
||||||
<!-- Save Track -->
|
<!-- Save Track -->
|
||||||
<TextBlock Grid.Row="1" Grid.Column="0" Width="120">Save Track(s)</TextBlock>
|
<WrapPanel Margin="0,0,0,16">
|
||||||
<ComboBox Grid.Row="1" Grid.Column="1" Name="SaveTrackKeyBind"
|
<TextBlock Width="120">Save Track(s)</TextBlock>
|
||||||
Items="{Binding KeyboardList}" SelectedItem="{Binding SaveTrackKey, Mode=TwoWay}"
|
<ComboBox Name="SaveTrackKeyBind"
|
||||||
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
Items="{Binding KeyboardList}" SelectedItem="{Binding SaveTrackKey, Mode=TwoWay}"
|
||||||
|
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
||||||
|
</WrapPanel>
|
||||||
|
|
||||||
<!-- Toggle Play/Pause -->
|
<!-- Toggle Play/Pause -->
|
||||||
<TextBlock Grid.Row="2" Grid.Column="0" Width="120">Toggle Play/Pause</TextBlock>
|
<WrapPanel Margin="0,0,0,16">
|
||||||
<ComboBox Grid.Row="2" Grid.Column="1" Name="TogglePlaybackKeyBind"
|
<TextBlock Width="120">Toggle Play/Pause</TextBlock>
|
||||||
Items="{Binding KeyboardList}" SelectedItem="{Binding TogglePlaybackKey, Mode=TwoWay}"
|
<ComboBox Name="TogglePlaybackKeyBind"
|
||||||
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
Items="{Binding KeyboardList}" SelectedItem="{Binding TogglePlaybackKey, Mode=TwoWay}"
|
||||||
|
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
||||||
|
</WrapPanel>
|
||||||
|
|
||||||
<!-- Stop Playback-->
|
<!-- Stop Playback-->
|
||||||
<TextBlock Grid.Row="3" Grid.Column="0" Width="120">Stop Playback</TextBlock>
|
<WrapPanel Margin="0,0,0,16">
|
||||||
<ComboBox Grid.Row="3" Grid.Column="1" Name="StopPlaybackKeyBind"
|
<TextBlock Width="120">Stop Playback</TextBlock>
|
||||||
Items="{Binding KeyboardList}" SelectedItem="{Binding StopPlaybackKey, Mode=TwoWay}"
|
<ComboBox Name="StopPlaybackKeyBind"
|
||||||
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
Items="{Binding KeyboardList}" SelectedItem="{Binding StopPlaybackKey, Mode=TwoWay}"
|
||||||
|
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
||||||
|
</WrapPanel>
|
||||||
|
|
||||||
<!-- Eject Disc-->
|
<!-- Eject Disc-->
|
||||||
<TextBlock Grid.Row="4" Grid.Column="0" Width="120">Eject Disc</TextBlock>
|
<WrapPanel Margin="0,0,0,16">
|
||||||
<ComboBox Grid.Row="4" Grid.Column="1" Name="EjectKeyBind"
|
<TextBlock Width="120">Eject Disc</TextBlock>
|
||||||
Items="{Binding KeyboardList}" SelectedItem="{Binding EjectKey, Mode=TwoWay}"
|
<ComboBox Name="EjectKeyBind"
|
||||||
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
Items="{Binding KeyboardList}" SelectedItem="{Binding EjectKey, Mode=TwoWay}"
|
||||||
|
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
||||||
|
</WrapPanel>
|
||||||
|
|
||||||
|
<!-- Next Disc -->
|
||||||
|
<WrapPanel Margin="0,0,0,16">
|
||||||
|
<TextBlock Width="120">Next Disc</TextBlock>
|
||||||
|
<ComboBox Name="NextDiscKeyBind"
|
||||||
|
Items="{Binding KeyboardList}" SelectedItem="{Binding NextDiscKey, Mode=TwoWay}"
|
||||||
|
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
||||||
|
</WrapPanel>
|
||||||
|
|
||||||
|
<!-- Previous Disc -->
|
||||||
|
<WrapPanel Margin="0,0,0,16">
|
||||||
|
<TextBlock Width="120">Previous Disc</TextBlock>
|
||||||
|
<ComboBox Name="PreviousDiscKeyBind"
|
||||||
|
Items="{Binding KeyboardList}" SelectedItem="{Binding PreviousDiscKey, Mode=TwoWay}"
|
||||||
|
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
||||||
|
</WrapPanel>
|
||||||
|
|
||||||
<!-- Next Track -->
|
<!-- Next Track -->
|
||||||
<TextBlock Grid.Row="5" Grid.Column="0" Width="120">Next Track</TextBlock>
|
<WrapPanel Margin="0,0,0,16">
|
||||||
<ComboBox Grid.Row="5" Grid.Column="1" Name="NextTrackKeyBind"
|
<TextBlock Width="120">Next Track</TextBlock>
|
||||||
Items="{Binding KeyboardList}" SelectedItem="{Binding NextTrackKey, Mode=TwoWay}"
|
<ComboBox Name="NextTrackKeyBind"
|
||||||
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
Items="{Binding KeyboardList}" SelectedItem="{Binding NextTrackKey, Mode=TwoWay}"
|
||||||
|
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
||||||
|
</WrapPanel>
|
||||||
|
|
||||||
<!-- Previous Track -->
|
<!-- Previous Track -->
|
||||||
<TextBlock Grid.Row="6" Grid.Column="0" Width="120">Previous Track</TextBlock>
|
<WrapPanel Margin="0,0,0,16">
|
||||||
<ComboBox Grid.Row="6" Grid.Column="1" Name="PreviousTrackKeyBind"
|
<TextBlock Width="120">Previous Track</TextBlock>
|
||||||
Items="{Binding KeyboardList}" SelectedItem="{Binding PreviousTrackKey, Mode=TwoWay}"
|
<ComboBox Name="PreviousTrackKeyBind"
|
||||||
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
Items="{Binding KeyboardList}" SelectedItem="{Binding PreviousTrackKey, Mode=TwoWay}"
|
||||||
|
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
||||||
|
</WrapPanel>
|
||||||
|
|
||||||
<!-- Next Index -->
|
<!-- Next Index -->
|
||||||
<TextBlock Grid.Row="7" Grid.Column="0" Width="120">Next Index</TextBlock>
|
<WrapPanel Margin="0,0,0,16">
|
||||||
<ComboBox Grid.Row="7" Grid.Column="1" Name="NextIndexKeyBind"
|
<TextBlock Width="120">Next Index</TextBlock>
|
||||||
Items="{Binding KeyboardList}" SelectedItem="{Binding NextIndexKey, Mode=TwoWay}"
|
<ComboBox Name="NextIndexKeyBind"
|
||||||
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
Items="{Binding KeyboardList}" SelectedItem="{Binding NextIndexKey, Mode=TwoWay}"
|
||||||
|
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
||||||
|
</WrapPanel>
|
||||||
|
|
||||||
<!-- Previous Index -->
|
<!-- Previous Index -->
|
||||||
<TextBlock Grid.Row="8" Grid.Column="0" Width="120">Previous Index</TextBlock>
|
<WrapPanel Margin="0,0,0,16">
|
||||||
<ComboBox Grid.Row="8" Grid.Column="1" Name="PreviousIndexKeyBind"
|
<TextBlock Width="120">Previous Index</TextBlock>
|
||||||
Items="{Binding KeyboardList}" SelectedItem="{Binding PreviousIndexKey, Mode=TwoWay}"
|
<ComboBox Name="PreviousIndexKeyBind"
|
||||||
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
Items="{Binding KeyboardList}" SelectedItem="{Binding PreviousIndexKey, Mode=TwoWay}"
|
||||||
|
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
||||||
|
</WrapPanel>
|
||||||
|
|
||||||
<!-- Fast Forward -->
|
<!-- Fast Forward -->
|
||||||
<TextBlock Grid.Row="9" Grid.Column="0" Width="120">Fast-Forward</TextBlock>
|
<WrapPanel Margin="0,0,0,16">
|
||||||
<ComboBox Grid.Row="9" Grid.Column="1" Name="FastForwardPlaybackKeyBind"
|
<TextBlock Width="120">Fast-Forward</TextBlock>
|
||||||
Items="{Binding KeyboardList}" SelectedItem="{Binding FastForwardPlaybackKey, Mode=TwoWay}"
|
<ComboBox Name="FastForwardPlaybackKeyBind"
|
||||||
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
Items="{Binding KeyboardList}" SelectedItem="{Binding FastForwardPlaybackKey, Mode=TwoWay}"
|
||||||
|
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
||||||
|
</WrapPanel>
|
||||||
|
|
||||||
<!-- Rewind -->
|
<!-- Rewind -->
|
||||||
<TextBlock Grid.Row="10" Grid.Column="0" Width="120">Rewind</TextBlock>
|
<WrapPanel Margin="0,0,0,16">
|
||||||
<ComboBox Grid.Row="10" Grid.Column="1" Name="RewindPlaybackKeyBind"
|
<TextBlock Width="120">Rewind</TextBlock>
|
||||||
Items="{Binding KeyboardList}" SelectedItem="{Binding RewindPlaybackKey, Mode=TwoWay}"
|
<ComboBox Name="RewindPlaybackKeyBind"
|
||||||
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
Items="{Binding KeyboardList}" SelectedItem="{Binding RewindPlaybackKey, Mode=TwoWay}"
|
||||||
|
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
||||||
|
</WrapPanel>
|
||||||
|
|
||||||
<!-- Volume Up -->
|
<!-- Volume Up -->
|
||||||
<TextBlock Grid.Row="11" Grid.Column="0" Width="120">Volume Up</TextBlock>
|
<WrapPanel Margin="0,0,0,16">
|
||||||
<ComboBox Grid.Row="11" Grid.Column="1" Name="VolumeUpKeyBind"
|
<TextBlock Width="120">Volume Up</TextBlock>
|
||||||
Items="{Binding KeyboardList}" SelectedItem="{Binding VolumeUpKey, Mode=TwoWay}"
|
<ComboBox Name="VolumeUpKeyBind"
|
||||||
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
Items="{Binding KeyboardList}" SelectedItem="{Binding VolumeUpKey, Mode=TwoWay}"
|
||||||
|
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
||||||
|
</WrapPanel>
|
||||||
|
|
||||||
<!-- Volume Down -->
|
<!-- Volume Down -->
|
||||||
<TextBlock Grid.Row="12" Grid.Column="0" Width="120">Volume Down</TextBlock>
|
<WrapPanel Margin="0,0,0,16">
|
||||||
<ComboBox Grid.Row="12" Grid.Column="1" Name="VolumeDownKeyBind"
|
<TextBlock Width="120">Volume Down</TextBlock>
|
||||||
Items="{Binding KeyboardList}" SelectedItem="{Binding VolumeDownKey, Mode=TwoWay}"
|
<ComboBox Name="VolumeDownKeyBind"
|
||||||
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
Items="{Binding KeyboardList}" SelectedItem="{Binding VolumeDownKey, Mode=TwoWay}"
|
||||||
|
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
||||||
|
</WrapPanel>
|
||||||
|
|
||||||
<!-- Mute Toggle -->
|
<!-- Mute Toggle -->
|
||||||
<TextBlock Grid.Row="13" Grid.Column="0" Width="120">Toggle Mute</TextBlock>
|
<WrapPanel Margin="0,0,0,16">
|
||||||
<ComboBox Grid.Row="13" Grid.Column="1" Name="ToggleMuteKeyBind"
|
<TextBlock Width="120">Toggle Mute</TextBlock>
|
||||||
Items="{Binding KeyboardList}" SelectedItem="{Binding ToggleMuteKey, Mode=TwoWay}"
|
<ComboBox Name="ToggleMuteKeyBind"
|
||||||
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
Items="{Binding KeyboardList}" SelectedItem="{Binding ToggleMuteKey, Mode=TwoWay}"
|
||||||
|
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
||||||
|
</WrapPanel>
|
||||||
|
|
||||||
<!-- De-Emphasis Toggle -->
|
<!-- De-Emphasis Toggle -->
|
||||||
<TextBlock Grid.Row="14" Grid.Column="0" Width="120">Toggle De-Emphasis</TextBlock>
|
<WrapPanel Margin="0,0,0,16">
|
||||||
<ComboBox Grid.Row="14" Grid.Column="1" Name="ToggleDeEmphasisKeyBind"
|
<TextBlock Width="120">Toggle De-Emphasis</TextBlock>
|
||||||
Items="{Binding KeyboardList}" SelectedItem="{Binding ToggleDeEmphasisKey, Mode=TwoWay}"
|
<ComboBox Name="ToggleDeEmphasisKeyBind"
|
||||||
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
Items="{Binding KeyboardList}" SelectedItem="{Binding ToggleDeEmphasisKey, Mode=TwoWay}"
|
||||||
</Grid>
|
HorizontalAlignment="Right" Margin="8,0,0,0" Width="120"/>
|
||||||
|
</WrapPanel>
|
||||||
|
</StackPanel>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
</TabControl>
|
</TabControl>
|
||||||
<Button Name="ApplyButton" Command="{Binding ApplySettingsCommand}">Apply</Button>
|
<Button Name="ApplyButton" Command="{Binding ApplySettingsCommand}">Apply</Button>
|
||||||
|
|||||||
@@ -103,7 +103,8 @@
|
|||||||
<TextBlock Margin="0,0,16,0" IsVisible="{Binding QuadChannel}">4CH</TextBlock>
|
<TextBlock Margin="0,0,16,0" IsVisible="{Binding QuadChannel}">4CH</TextBlock>
|
||||||
<TextBlock Margin="0,0,16,0" Foreground="LightGray" IsVisible="{Binding !HiddenTrack}">HIDDEN</TextBlock>
|
<TextBlock Margin="0,0,16,0" Foreground="LightGray" IsVisible="{Binding !HiddenTrack}">HIDDEN</TextBlock>
|
||||||
<TextBlock Margin="0,0,16,0" IsVisible="{Binding HiddenTrack}">HIDDEN</TextBlock>
|
<TextBlock Margin="0,0,16,0" IsVisible="{Binding HiddenTrack}">HIDDEN</TextBlock>
|
||||||
<TextBlock Margin="0,0,16,0" Text="{Binding Volume}"/>
|
<TextBlock Margin="0,0,16,0" Text="{Binding Volume, StringFormat='Volume {0}%'}"/>
|
||||||
|
<TextBlock Margin="0,0,16,0" Text="{Binding CurrentDisc, StringFormat='Disc Number: {0}'}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ReactiveUserControl>
|
</ReactiveUserControl>
|
||||||
@@ -299,13 +299,14 @@ namespace RedBookPlayer.Models.Discs
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public override void Init(IOpticalMediaImage image, bool autoPlay)
|
public override void Init(string path, IOpticalMediaImage image, bool autoPlay)
|
||||||
{
|
{
|
||||||
// If the image is null, we can't do anything
|
// If the image is null, we can't do anything
|
||||||
if(image == null)
|
if(image == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Set the current disc image
|
// Set the current disc image
|
||||||
|
ImagePath = path;
|
||||||
_image = image;
|
_image = image;
|
||||||
|
|
||||||
// Attempt to load the TOC
|
// Attempt to load the TOC
|
||||||
|
|||||||
@@ -8,6 +8,11 @@ namespace RedBookPlayer.Models.Discs
|
|||||||
{
|
{
|
||||||
#region Public Fields
|
#region Public Fields
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Path to the disc image
|
||||||
|
/// </summary>
|
||||||
|
public string ImagePath { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicate if the disc is ready to be used
|
/// Indicate if the disc is ready to be used
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -93,9 +98,10 @@ namespace RedBookPlayer.Models.Discs
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initialize the disc with a given image
|
/// Initialize the disc with a given image
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="path">Path of the image</param>
|
||||||
/// <param name="image">Aaruformat image to load</param>
|
/// <param name="image">Aaruformat image to load</param>
|
||||||
/// <param name="autoPlay">True if playback should begin immediately, false otherwise</param>
|
/// <param name="autoPlay">True if playback should begin immediately, false otherwise</param>
|
||||||
public abstract void Init(IOpticalMediaImage image, bool autoPlay);
|
public abstract void Init(string path, IOpticalMediaImage image, bool autoPlay);
|
||||||
|
|
||||||
#region Seeking
|
#region Seeking
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ namespace RedBookPlayer.Models.Factories
|
|||||||
image.Open(filter);
|
image.Open(filter);
|
||||||
|
|
||||||
// Generate and instantiate the disc
|
// Generate and instantiate the disc
|
||||||
return GenerateFromImage(image, options, autoPlay);
|
return GenerateFromImage(path, image, options, autoPlay);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
@@ -44,11 +44,12 @@ namespace RedBookPlayer.Models.Factories
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Generate an OpticalDisc from an input IOpticalMediaImage
|
/// Generate an OpticalDisc from an input IOpticalMediaImage
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="path">Path of the image</param>
|
||||||
/// <param name="image">IOpticalMediaImage to create from</param>
|
/// <param name="image">IOpticalMediaImage to create from</param>
|
||||||
/// <param name="options">Options to pass to the optical disc factory</param>
|
/// <param name="options">Options to pass to the optical disc factory</param>
|
||||||
/// <param name="autoPlay">True if the image should be playable immediately, false otherwise</param>
|
/// <param name="autoPlay">True if the image should be playable immediately, false otherwise</param>
|
||||||
/// <returns>Instantiated OpticalDisc, if possible</returns>
|
/// <returns>Instantiated OpticalDisc, if possible</returns>
|
||||||
public static OpticalDiscBase GenerateFromImage(IOpticalMediaImage image, OpticalDiscOptions options, bool autoPlay)
|
public static OpticalDiscBase GenerateFromImage(string path, IOpticalMediaImage image, OpticalDiscOptions options, bool autoPlay)
|
||||||
{
|
{
|
||||||
// If the image is not usable, we don't do anything
|
// If the image is not usable, we don't do anything
|
||||||
if(!IsUsableImage(image))
|
if(!IsUsableImage(image))
|
||||||
@@ -74,7 +75,7 @@ namespace RedBookPlayer.Models.Factories
|
|||||||
return opticalDisc;
|
return opticalDisc;
|
||||||
|
|
||||||
// Instantiate the disc and return
|
// Instantiate the disc and return
|
||||||
opticalDisc.Init(image, autoPlay);
|
opticalDisc.Init(path, image, autoPlay);
|
||||||
return opticalDisc;
|
return opticalDisc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,15 @@ namespace RedBookPlayer.Models.Hardware
|
|||||||
|
|
||||||
#region OpticalDisc Passthrough
|
#region OpticalDisc Passthrough
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Path to the disc image
|
||||||
|
/// </summary>
|
||||||
|
public string ImagePath
|
||||||
|
{
|
||||||
|
get => _imagePath;
|
||||||
|
private set => this.RaiseAndSetIfChanged(ref _imagePath, value);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Current track number
|
/// Current track number
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -156,6 +165,7 @@ namespace RedBookPlayer.Models.Hardware
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public ulong TotalTime => _opticalDiscs[CurrentDisc]?.TotalTime ?? 0;
|
public ulong TotalTime => _opticalDiscs[CurrentDisc]?.TotalTime ?? 0;
|
||||||
|
|
||||||
|
private string _imagePath;
|
||||||
private int _currentTrackNumber;
|
private int _currentTrackNumber;
|
||||||
private ushort _currentTrackIndex;
|
private ushort _currentTrackIndex;
|
||||||
private ushort _currentTrackSession;
|
private ushort _currentTrackSession;
|
||||||
@@ -669,6 +679,7 @@ namespace RedBookPlayer.Models.Hardware
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void OpticalDiscStateChanged(object sender, PropertyChangedEventArgs e)
|
private void OpticalDiscStateChanged(object sender, PropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
|
ImagePath = _opticalDiscs[CurrentDisc].ImagePath;
|
||||||
CurrentTrackNumber = _opticalDiscs[CurrentDisc].CurrentTrackNumber;
|
CurrentTrackNumber = _opticalDiscs[CurrentDisc].CurrentTrackNumber;
|
||||||
CurrentTrackIndex = _opticalDiscs[CurrentDisc].CurrentTrackIndex;
|
CurrentTrackIndex = _opticalDiscs[CurrentDisc].CurrentTrackIndex;
|
||||||
CurrentSector = _opticalDiscs[CurrentDisc].CurrentSector;
|
CurrentSector = _opticalDiscs[CurrentDisc].CurrentSector;
|
||||||
|
|||||||
Reference in New Issue
Block a user