Display time relative to start of current index

This commit is contained in:
deagahelio
2021-04-15 19:24:04 -03:00
parent 0be0ff584a
commit cd3b8d8cfc
2 changed files with 30 additions and 4 deletions

View File

@@ -71,7 +71,22 @@ namespace RedBookPlayer
}
}
}
public ushort CurrentIndex { get; private set; } = 1;
ushort currentIndex = 1;
public ushort CurrentIndex
{
get
{
return currentIndex;
}
private set
{
currentIndex = value;
Console.WriteLine("thing set");
SectionStartSector = (ulong)Image.Tracks[CurrentTrack].Indexes[CurrentIndex];
}
}
private ulong currentSector = 0;
private int currentSectorReadPosition = 0;
public ulong CurrentSector
@@ -116,6 +131,7 @@ namespace RedBookPlayer
public bool ApplyDeEmphasis { get; private set; } = false;
public bool CopyAllowed { get; private set; } = false;
public TrackType? TrackType_ { get; private set; }
public ulong SectionStartSector { get; private set; }
public int TotalTracks { get; private set; } = 0;
public int TotalIndexes { get; private set; } = 0;
public ulong TimeOffset { get; private set; } = 0;

View File

@@ -136,12 +136,22 @@ namespace RedBookPlayer
{
if (Player.Initialized)
{
ulong sectorTime = Player.CurrentSector;
if (Player.SectionStartSector != 0)
{
sectorTime -= Player.SectionStartSector;
}
else
{
sectorTime += Player.TimeOffset;
}
int[] numbers = new int[]{
Player.CurrentTrack + 1,
Player.CurrentIndex,
(int)((Player.CurrentSector + Player.TimeOffset) / (75 * 60)),
(int)(((Player.CurrentSector + Player.TimeOffset) / 75) % 60),
(int)((Player.CurrentSector + Player.TimeOffset) % 75),
(int)(sectorTime / (75 * 60)),
(int)((sectorTime / 75) % 60),
(int)(sectorTime % 75),
Player.TotalTracks,
Player.TotalIndexes,
(int)(Player.TotalTime / (75 * 60)),