fixed timeline in medley mode

This commit is contained in:
Alexander Eckart committed 2012-03-24 17:47:48 +01:00
1 parent 4172f85bc8
commit a86ca33d9b
2 files changed
+25 -11

No files matched your search

+11
View File
@@ -274,6 +274,7 @@ namespace Vocaluxe.Lib.Song
private int _StartBeat; private int _StartBeat;
private int _EndBeat; private int _EndBeat;
private bool _PerfectLine; // for drawing perfect line effect private bool _PerfectLine; // for drawing perfect line effect
private bool _VisibleInTimeLine;
private int _MinBeat = int.MaxValue; private int _MinBeat = int.MaxValue;
private int _MaxBeat = int.MinValue; private int _MaxBeat = int.MinValue;
@@ -285,6 +286,7 @@ namespace Vocaluxe.Lib.Song
StartBeat = int.MinValue; StartBeat = int.MinValue;
EndBeat = int.MaxValue; EndBeat = int.MaxValue;
_PerfectLine = false; _PerfectLine = false;
_VisibleInTimeLine = true;
} }
public CLine(CLine line) public CLine(CLine line)
@@ -298,10 +300,17 @@ namespace Vocaluxe.Lib.Song
_PerfectLine = line._PerfectLine; _PerfectLine = line._PerfectLine;
_MinBeat = line._MinBeat; _MinBeat = line._MinBeat;
_MaxBeat = line._MaxBeat; _MaxBeat = line._MaxBeat;
_VisibleInTimeLine = line._VisibleInTimeLine;
} }
#endregion Constructors #endregion Constructors
#region Properties #region Properties
public bool VisibleInTimeLine
{
get { return _VisibleInTimeLine; }
set { _VisibleInTimeLine = value; }
}
public int StartBeat public int StartBeat
{ {
get { return _StartBeat; } get { return _StartBeat; }
@@ -508,6 +517,8 @@ namespace Vocaluxe.Lib.Song
if (note.StartBeat < StartBeat || note.EndBeat > EndBeat) if (note.StartBeat < StartBeat || note.EndBeat > EndBeat)
note.NoteType = ENoteType.Freestyle; note.NoteType = ENoteType.Freestyle;
} }
_VisibleInTimeLine = _MinBeat >= StartBeat && _MaxBeat <= EndBeat;
} }
private void updateMinMaxBeat(CNote Note) private void updateMinMaxBeat(CNote Note)
+14 -11
View File
@@ -1087,19 +1087,22 @@ namespace Vocaluxe.Screens
{ {
CLine[] Line = Lines[i].Line; CLine[] Line = Lines[i].Line;
for(int j = 0; j<Line.Length; j++){ for(int j = 0; j<Line.Length; j++){
TimeRect trect = new TimeRect(); if (Line[j].VisibleInTimeLine)
trect.startBeat = Line[j].FirstNoteBeat; {
trect.endBeat = Line[j].EndBeat; TimeRect trect = new TimeRect();
trect.startBeat = Line[j].FirstNoteBeat;
trect.endBeat = Line[j].EndBeat;
trect.rect = new CStatic(new STexture(-1), trect.rect = new CStatic(new STexture(-1),
new SColorF(1f, 1f, 1f, 1f), new SColorF(1f, 1f, 1f, 1f),
new SRectF(stat.Rect.X + stat.Rect.W * ((CGame.GetTimeFromBeats(trect.startBeat, song.BPM) + song.Gap - song.Start) / TotalTime), new SRectF(stat.Rect.X + stat.Rect.W * ((CGame.GetTimeFromBeats(trect.startBeat, song.BPM) + song.Gap - song.Start) / TotalTime),
stat.Rect.Y, stat.Rect.Y,
stat.Rect.W * (CGame.GetTimeFromBeats((trect.endBeat - trect.startBeat), song.BPM) / TotalTime), stat.Rect.W * (CGame.GetTimeFromBeats((trect.endBeat - trect.startBeat), song.BPM) / TotalTime),
stat.Rect.H, stat.Rect.H,
stat.Rect.Z)); stat.Rect.Z));
_TimeRects.Add(trect); _TimeRects.Add(trect);
}
} }
} }