Use Aaru.CommonTypes.Enums.TrackType

This commit is contained in:
Matt Nadareski
2021-06-10 22:43:27 -07:00
parent f6a137785b
commit 7a0e1429bd
3 changed files with 7 additions and 18 deletions

View File

@@ -69,11 +69,11 @@ namespace RedBookPlayer
ApplyDeEmphasis = (subchannel[3] & 0b01000000) != 0;
CopyAllowed = (subchannel[2] & 0b01000000) != 0;
TrackType = (subchannel[1] & 0b01000000) != 0 ? TrackTypeValue.Data : TrackTypeValue.Audio;
TrackType = (subchannel[1] & 0b01000000) != 0 ? Aaru.CommonTypes.Enums.TrackType.Data : Aaru.CommonTypes.Enums.TrackType.Audio;
}
catch(ArgumentException)
{
// Ignore subchannel read issues
TrackType = track.TrackType;
}
TrackHasEmphasis = ApplyDeEmphasis;
@@ -82,7 +82,7 @@ namespace RedBookPlayer
CurrentIndex = track.Indexes.Keys.Min();
// If we're not playing data tracks, skip
if(!App.Settings.PlayDataTracks && TrackType == TrackTypeValue.Data)
if(!App.Settings.PlayDataTracks && TrackType != Aaru.CommonTypes.Enums.TrackType.Audio)
{
if(increment)
NextTrack();
@@ -190,7 +190,7 @@ namespace RedBookPlayer
/// <summary>
/// Represents the track type
/// </summary>
public TrackTypeValue? TrackType { get; private set; }
public TrackType? TrackType { get; private set; }
/// <summary>
/// Represents the sector starting the section

View File

@@ -4,6 +4,7 @@ using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Timers;
using Aaru.CommonTypes.Enums;
using Aaru.DiscImages;
using Aaru.Filters;
using Avalonia;
@@ -235,8 +236,8 @@ namespace RedBookPlayer
dataContext.ApplyDeEmphasis = Player.ApplyDeEmphasis;
dataContext.TrackHasEmphasis = Player.TrackHasEmphasis;
dataContext.CopyAllowed = Player.CopyAllowed;
dataContext.IsAudioTrack = Player.TrackType == TrackTypeValue.Audio;
dataContext.IsDataTrack = Player.TrackType == TrackTypeValue.Data;
dataContext.IsAudioTrack = Player.TrackType == TrackType.Audio;
dataContext.IsDataTrack = Player.TrackType != TrackType.Audio;
}
});
}

View File

@@ -1,12 +0,0 @@
namespace RedBookPlayer
{
/// <summary>
/// Track type for determining how to handle
/// </summary>
/// <remarks>Does not distinguish between different data track types</remarks>
public enum TrackTypeValue
{
Audio,
Data
}
}