From 1269af7897c195688efadb8d40f6c61a7cfc7ad5 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 11 Mar 2012 14:28:32 +0100 Subject: [PATCH 01/70] created medley branch, loading medley and preview tags --- Vocaluxe/Base/CSettings.cs | 3 + Vocaluxe/Lib/Song/CSong.cs | 140 +++++++++++++++++-- Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs | 10 +- 3 files changed, 142 insertions(+), 11 deletions(-) diff --git a/Vocaluxe/Base/CSettings.cs b/Vocaluxe/Base/CSettings.cs index 40d2a062..5de5c61a 100644 --- a/Vocaluxe/Base/CSettings.cs +++ b/Vocaluxe/Base/CSettings.cs @@ -111,6 +111,9 @@ namespace Vocaluxe.Base public const float LyricHelperMoveTime = 1.5f; public const float LyricHelperMinTime = 0.2f; + public const float DefaultMedleyFadeInTime = 8f; + public const float DefaultMedleyFadeOutTIme = 2f; + public static bool TabNavigation = false; public const float BackgroundMusicFadeTime = 0.5f; diff --git a/Vocaluxe/Lib/Song/CSong.cs b/Vocaluxe/Lib/Song/CSong.cs index 1327363b..6ad4c2e5 100644 --- a/Vocaluxe/Lib/Song/CSong.cs +++ b/Vocaluxe/Lib/Song/CSong.cs @@ -13,13 +13,38 @@ namespace Vocaluxe.Lib.Song [Flags] enum EHeaderFlags { - Title, - Artist, - MP3, - BPM, - PreviewStart, - MedleyStartBeat, - MedleyEndBeat + Title = 1, + Artist = 2, + MP3 = 4, + BPM = 8, + PreviewStart = 16, + MedleyStartBeat = 32, + MedleyEndBeat = 64 + } + + enum EMedleySource + { + None, + Calculated, + Tag + } + + struct SMedley + { + public EMedleySource Source; + public int StartBeat; + public int EndBeat; + public float FadeInTime; + public float FadeOutTime; + + public SMedley(int dummy) + { + Source = EMedleySource.None; + StartBeat = 0; + EndBeat = 0; + FadeInTime = 0f; + FadeOutTime = 0f; + } } class CSong @@ -28,6 +53,11 @@ namespace Vocaluxe.Lib.Song private STexture _CoverTextureSmall = new STexture(-1); private STexture _CoverTextureBig = new STexture(-1); + private SMedley Medley = new SMedley(0); + + public bool CalculateMedley = true; + public float PreviewStart = 0f; + public Encoding Encoding = Encoding.Default; public string Folder = String.Empty; public string FolderName = String.Empty; @@ -305,6 +335,25 @@ namespace Vocaluxe.Lib.Song if (CHelper.TryParse(Value, out this.Finish)) this.Finish /= 1000f; break; + case "PREVIEWSTART": + if (CHelper.TryParse(Value, out this.PreviewStart)) + if (this.PreviewStart < 0f) + this.PreviewStart = 0f; + else + HeaderFlags |= EHeaderFlags.PreviewStart; + break; + case "MEDLEYSTARTBEAT": + if (int.TryParse(Value, out this.Medley.StartBeat)) + HeaderFlags |= EHeaderFlags.MedleyStartBeat; + break; + case "MEDLEYENDBEAT": + if (int.TryParse(Value, out this.Medley.EndBeat)) + HeaderFlags |= EHeaderFlags.MedleyEndBeat; + break; + case "CALCMEDLEY": + if (Value.ToUpper() == "OFF") + this.CalculateMedley = false; + break; default: ; break; @@ -320,13 +369,64 @@ namespace Vocaluxe.Lib.Song } } //end of while - if (HeaderFlags != (EHeaderFlags.Title | EHeaderFlags.Artist | EHeaderFlags.MP3 | EHeaderFlags.BPM)) + if ((HeaderFlags & EHeaderFlags.Title) == 0) + { + CLog.LogError("Title tag missing: " + FilePath); return false; + } + + if ((HeaderFlags & EHeaderFlags.Artist) == 0) + { + CLog.LogError("Artist tag missing: " + FilePath); + return false; + } + + if ((HeaderFlags & EHeaderFlags.MP3) == 0) + { + CLog.LogError("MP3 tag missing: " + FilePath); + return false; + } + + if ((HeaderFlags & EHeaderFlags.BPM) == 0) + { + CLog.LogError("BPM tag missing: " + FilePath); + return false; + } + + #region check medley tags + if ((HeaderFlags & EHeaderFlags.MedleyStartBeat) != 0 && (HeaderFlags & EHeaderFlags.MedleyEndBeat) != 0) + { + if (this.Medley.StartBeat > this.Medley.EndBeat) + { + CLog.LogError("MedleyStartBeat is bigger than MedleyEndBeat in file: " + FilePath); + HeaderFlags = HeaderFlags - EHeaderFlags.MedleyStartBeat - EHeaderFlags.MedleyEndBeat; + } + } + + if ((HeaderFlags & EHeaderFlags.PreviewStart) == 0 || this.PreviewStart == 0f) + { + //PreviewStart is not set or <=0 + if ((HeaderFlags & EHeaderFlags.MedleyStartBeat) != 0) + //fallback to MedleyStart + this.PreviewStart = CGame.GetTimeFromBeats(this.Medley.StartBeat, this.BPM); + else + //else set to 0, it will be set in FindRefrainStart + this.PreviewStart = 0f; + } + + if ((HeaderFlags & EHeaderFlags.MedleyStartBeat) != 0 && (HeaderFlags & EHeaderFlags.MedleyEndBeat) != 0) + { + this.Medley.Source = EMedleySource.Tag; + this.Medley.FadeInTime = CSettings.DefaultMedleyFadeInTime; + this.Medley.FadeOutTime = CSettings.DefaultMedleyFadeOutTIme; + } + #endregion check medley tags this.Encoding = sr.CurrentEncoding; } - catch (Exception) + catch (Exception e) { + CLog.LogError("Error reading txt header in file \"" + FilePath + "\": " + e.Message); return false; } @@ -466,6 +566,9 @@ namespace Vocaluxe.Lib.Song CLog.LogError("Error loading song. Line No.: " + FileLineNo.ToString() + ". An unhandled exception occured (" + e.Message + "): " + FilePath); return false; } + + FindRefrain(); + return true; } @@ -531,5 +634,24 @@ namespace Vocaluxe.Lib.Song } } } + + private void FindRefrain() + { + if (this.Medley.Source == EMedleySource.Tag) + return; + + if (!this.CalculateMedley) + return; + + + + + + if (this.PreviewStart == 0f) + { + if (this.Medley.Source == EMedleySource.Calculated) + this.PreviewStart = CGame.GetTimeFromBeats(this.Medley.StartBeat, this.BPM); + } + } } } diff --git a/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs b/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs index 43cd6f28..5682c1c9 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs @@ -551,7 +551,13 @@ namespace Vocaluxe.Menu.SongMenu int _stream = CSound.Load(Path.Combine(CSongs.VisibleSongs[_actsong].Folder, CSongs.VisibleSongs[_actsong].MP3FileName), true); CSound.SetStreamVolume(_stream, 0f); - CSound.SetPosition(_stream, CSound.GetLength(_stream) / 4f); + + float startposition = CSongs.VisibleSongs[_actsong].PreviewStart; + + if (startposition == 0f) + startposition = CSound.GetLength(_stream) / 4f; + + CSound.SetPosition(_stream, startposition); CSound.Play(_stream); CSound.Fade(_stream, 100f, 3f); _streams.Add(_stream); @@ -562,7 +568,7 @@ namespace Vocaluxe.Menu.SongMenu _video = CVideo.VdLoad(Path.Combine(CSongs.VisibleSongs[_actsong].Folder, CSongs.VisibleSongs[_actsong].VideoFileName)); if (_video == -1) return; - CVideo.VdSkip(_video, CSound.GetLength(_stream) / 4f, CSongs.VisibleSongs[_actsong].VideoGap); + CVideo.VdSkip(_video, startposition, CSongs.VisibleSongs[_actsong].VideoGap); _VideoFadeTimer.Stop(); _VideoFadeTimer.Reset(); _VideoFadeTimer.Start(); From 830875d24eb5ef46841e88510c04fd055e787d44 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 11 Mar 2012 15:22:18 +0100 Subject: [PATCH 02/70] added medley calculation --- Vocaluxe/Base/CSettings.cs | 2 + Vocaluxe/Lib/Song/CNotes.cs | 12 ++-- Vocaluxe/Lib/Song/CSong.cs | 92 +++++++++++++++++++++++++++ Vocaluxe/Menu/SingNotes/CSingNotes.cs | 10 +-- Vocaluxe/Screens/CScreenSing.cs | 38 +++++------ 5 files changed, 124 insertions(+), 30 deletions(-) diff --git a/Vocaluxe/Base/CSettings.cs b/Vocaluxe/Base/CSettings.cs index 5de5c61a..e75835b1 100644 --- a/Vocaluxe/Base/CSettings.cs +++ b/Vocaluxe/Base/CSettings.cs @@ -113,6 +113,8 @@ namespace Vocaluxe.Base public const float DefaultMedleyFadeInTime = 8f; public const float DefaultMedleyFadeOutTIme = 2f; + public const int MedleyMinSeriesLength = 3; + public const float MedleyMinDuration = 40f; public static bool TabNavigation = false; diff --git a/Vocaluxe/Lib/Song/CNotes.cs b/Vocaluxe/Lib/Song/CNotes.cs index d5ac4dab..0396c8da 100644 --- a/Vocaluxe/Lib/Song/CNotes.cs +++ b/Vocaluxe/Lib/Song/CNotes.cs @@ -298,7 +298,7 @@ namespace Vocaluxe.Lib.Song set { _PerfectLine = value; } } - public int FirstBeat + public int FirstNoteBeat { get { @@ -312,7 +312,7 @@ namespace Vocaluxe.Lib.Song } } - public int LastBeat + public int LastNoteBeat { get { @@ -509,15 +509,15 @@ namespace Vocaluxe.Lib.Song int startbeat = int.MaxValue; for (int i = 0; i < _Lines.Count; i++) { - if (_Lines[i].FirstBeat < startbeat) - startbeat = _Lines[i].FirstBeat; + if (_Lines[i].FirstNoteBeat < startbeat) + startbeat = _Lines[i].FirstNoteBeat; } int endbeat = int.MinValue; for (int i = 0; i < _Lines.Count; i++) { - if (_Lines[i].LastBeat < endbeat) - endbeat = _Lines[i].LastBeat; + if (_Lines[i].LastNoteBeat < endbeat) + endbeat = _Lines[i].LastNoteBeat; } int result = endbeat - startbeat; diff --git a/Vocaluxe/Lib/Song/CSong.cs b/Vocaluxe/Lib/Song/CSong.cs index 6ad4c2e5..3a728747 100644 --- a/Vocaluxe/Lib/Song/CSong.cs +++ b/Vocaluxe/Lib/Song/CSong.cs @@ -635,6 +635,13 @@ namespace Vocaluxe.Lib.Song } } + private struct Series + { + public int start; + public int end; + public int length; + } + private void FindRefrain() { if (this.Medley.Source == EMedleySource.Tag) @@ -643,10 +650,95 @@ namespace Vocaluxe.Lib.Song if (!this.CalculateMedley) return; + CLines lines = this.Notes.GetLines(0); + if (lines.LineCount == 0) + return; + // build sentences list + List sentences = new List(); + foreach (CLine line in lines.Line) + { + if (line.Points != 0) + sentences.Add(line.Lyrics); + else + sentences.Add(String.Empty); + } + // find equal sentences series + List series = new List(); + for (int i = 0; i < lines.LineCount - 1; i++) + { + for (int j = i + 1; j < lines.LineCount; j++) + { + if (sentences[i] == sentences[j] && sentences[i] != String.Empty) + { + Series tempSeries = new Series(); + tempSeries.start = i; + tempSeries.end = i; + int max = 0; + if (j + j - i - 1 > lines.LineCount - 1) + max = lines.LineCount - 1 - j; + else + max = j - i - 1; + + for (int k = 1; k <= max; k++) + { + if (sentences[i + k] == sentences[j + k] && sentences[i + k] != String.Empty) + tempSeries.end = i + k; + else + break; + } + + tempSeries.length = tempSeries.end - tempSeries.start + 1; + series.Add(tempSeries); + } + } + } + + // search for longest series + int longest = 0; + for (int i = 0; i < series.Count; i++) + { + if (series[i].length > series[longest].length) + longest = i; + } + + // set medley vars + if (series.Count > 0 && series[longest].length > CSettings.MedleyMinSeriesLength) + { + this.Medley.StartBeat = lines.Line[series[longest].start].FirstNoteBeat; + this.Medley.EndBeat = lines.Line[series[longest].end].LastNoteBeat; + + bool foundEnd = false; + + // set end if duration > MedleyMinDuration + if (CGame.GetTimeFromBeats(this.Medley.StartBeat, this.BPM) + CSettings.MedleyMinDuration > + CGame.GetTimeFromBeats(this.Medley.EndBeat, this.BPM)) + foundEnd = true; + + if (!foundEnd) + { + for (int i = series[longest].start + 1; i < lines.LineCount - 1; i++) + { + if (CGame.GetTimeFromBeats(this.Medley.StartBeat, this.BPM) + CSettings.MedleyMinDuration > + CGame.GetTimeFromBeats(lines.Line[i].LastNoteBeat, this.BPM)) + { + foundEnd = true; + this.Medley.EndBeat = lines.Line[i].LastNoteBeat; + } + } + } + + if (foundEnd) + { + this.Medley.Source = EMedleySource.Calculated; + this.Medley.FadeInTime = CSettings.DefaultMedleyFadeInTime; + this.Medley.FadeOutTime = CSettings.DefaultMedleyFadeOutTIme; + } + } + if (this.PreviewStart == 0f) { if (this.Medley.Source == EMedleySource.Calculated) diff --git a/Vocaluxe/Menu/SingNotes/CSingNotes.cs b/Vocaluxe/Menu/SingNotes/CSingNotes.cs index a157e9fa..aff8ca8b 100644 --- a/Vocaluxe/Menu/SingNotes/CSingNotes.cs +++ b/Vocaluxe/Menu/SingNotes/CSingNotes.cs @@ -304,7 +304,7 @@ namespace Vocaluxe.Menu.SingNotes float h = _PlayerNotes[n].Rect.H; float dh = h / CSettings.NumNoteLines * (2f - (int)CGame.Player[_PlayerNotes[n].PlayerNr].Difficulty) / 4f; - float beats = Line.LastBeat - Line.FirstBeat + 1; + float beats = Line.LastNoteBeat - Line.FirstNoteBeat + 1; if (beats == 0) return; @@ -324,7 +324,7 @@ namespace Vocaluxe.Menu.SingNotes float width = note.Duration / beats * w; SRectF rect = new SRectF( - _PlayerNotes[n].Rect.X + (note.StartBeat - Line.FirstBeat) / beats * w, + _PlayerNotes[n].Rect.X + (note.StartBeat - Line.FirstNoteBeat) / beats * w, _PlayerNotes[n].Rect.Y + (CSettings.NumNoteLines - 1 - (note.Tone - BaseLine)/2) / CSettings.NumNoteLines * h - dh, width, h / CSettings.NumNoteLines + 2 * dh, @@ -344,7 +344,7 @@ namespace Vocaluxe.Menu.SingNotes if (CConfig.DrawToneHelper == EOffOn.TR_CONFIG_ON) { - DrawToneHelper(n, (int)BaseLine, (CGame.MidBeatD - Line.FirstBeat) / beats * w); + DrawToneHelper(n, (int)BaseLine, (CGame.MidBeatD - Line.FirstNoteBeat) / beats * w); } int i = 0; @@ -377,7 +377,7 @@ namespace Vocaluxe.Menu.SingNotes foreach (CNote note in SingLine[CGame.Player[Player].CurrentLine].Notes) { - if (note.StartBeat >= Line.FirstBeat && note.EndBeat <= Line.LastBeat) + if (note.StartBeat >= Line.FirstNoteBeat && note.EndBeat <= Line.LastNoteBeat) { float width = note.Duration / beats * w; @@ -385,7 +385,7 @@ namespace Vocaluxe.Menu.SingNotes width -= (1 - (CGame.MidBeatD - CGame.ActBeatD)) / beats * w; SRectF rect = new SRectF( - _PlayerNotes[n].Rect.X + (note.StartBeat - Line.FirstBeat) / beats * w, + _PlayerNotes[n].Rect.X + (note.StartBeat - Line.FirstNoteBeat) / beats * w, _PlayerNotes[n].Rect.Y + (CSettings.NumNoteLines - 1 - (note.Tone - BaseLine)/2) / CSettings.NumNoteLines * h - dh, width, h / CSettings.NumNoteLines + 2 * dh, diff --git a/Vocaluxe/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs index 415a7bd9..2577fa6d 100644 --- a/Vocaluxe/Screens/CScreenSing.cs +++ b/Vocaluxe/Screens/CScreenSing.cs @@ -588,7 +588,7 @@ namespace Vocaluxe.Screens { if (line[j].StartBeat <= _CurrentBeat) { - if (CGame.GetTimeFromBeats(line[j].FirstBeat, song.BPM) <= _CurrentTime - song.Gap + 10f) + if (CGame.GetTimeFromBeats(line[j].FirstNoteBeat, song.BPM) <= _CurrentTime - song.Gap + 10f) { nr = j; } @@ -607,8 +607,8 @@ namespace Vocaluxe.Screens { Lyrics[htLyrics(LyricMain)].SetLine(line[nr]); Lyrics[htLyrics(LyricMainTop)].SetLine(line[nr]); - _TimeToFirstNote = CGame.GetTimeFromBeats(line[nr].FirstBeat - line[nr].StartBeat, song.BPM); - _RemainingTimeToFirstNote = CGame.GetTimeFromBeats(line[nr].FirstBeat - CGame.GetBeatFromTime(_CurrentTime, song.BPM, song.Gap), song.BPM); + _TimeToFirstNote = CGame.GetTimeFromBeats(line[nr].FirstNoteBeat - line[nr].StartBeat, song.BPM); + _RemainingTimeToFirstNote = CGame.GetTimeFromBeats(line[nr].FirstNoteBeat - CGame.GetBeatFromTime(_CurrentTime, song.BPM, song.Gap), song.BPM); if (line.Length >= nr + 2) { @@ -624,8 +624,8 @@ namespace Vocaluxe.Screens if (i == 0 && song.IsDuet) { Lyrics[htLyrics(LyricMainDuet)].SetLine(line[nr]); - _TimeToFirstNoteDuet = CGame.GetTimeFromBeats(line[nr].FirstBeat - line[nr].StartBeat, song.BPM); - _RemainingTimeToFirstNoteDuet = CGame.GetTimeFromBeats(line[nr].FirstBeat - CGame.GetBeatFromTime(_CurrentTime, song.BPM, song.Gap), song.BPM); + _TimeToFirstNoteDuet = CGame.GetTimeFromBeats(line[nr].FirstNoteBeat - line[nr].StartBeat, song.BPM); + _RemainingTimeToFirstNoteDuet = CGame.GetTimeFromBeats(line[nr].FirstNoteBeat - CGame.GetBeatFromTime(_CurrentTime, song.BPM, song.Gap), song.BPM); if (line.Length >= nr + 2) Lyrics[htLyrics(LyricSubDuet)].SetLine(line[nr + 1]); @@ -857,7 +857,7 @@ namespace Vocaluxe.Screens { if (line[j].StartBeat <= _CurrentBeat) { - if (CGame.GetTimeFromBeats(line[j].FirstBeat, Song.BPM) <= _CurrentTime - Song.Gap + 10f) + if (CGame.GetTimeFromBeats(line[j].FirstNoteBeat, Song.BPM) <= _CurrentTime - Song.Gap + 10f) { CurrentLineSub = j; } @@ -868,7 +868,7 @@ namespace Vocaluxe.Screens int CurrentLine = 0; for (int j = 0; j < line.Length; j++) { - if (line[j].FirstBeat <= _CurrentBeat) + if (line[j].FirstNoteBeat <= _CurrentBeat) { CurrentLine = j; } @@ -879,33 +879,33 @@ namespace Vocaluxe.Screens Alpha[i * 2 + 1] = 1f; // main line alpha - if (CurrentLine == 0 && CurrentTime < CGame.GetTimeFromBeats(line[CurrentLine].FirstBeat, Song.BPM)) + if (CurrentLine == 0 && CurrentTime < CGame.GetTimeFromBeats(line[CurrentLine].FirstNoteBeat, Song.BPM)) { // first main line and fist note is not reached // => fade in - float diff = CGame.GetTimeFromBeats(line[CurrentLine].FirstBeat, Song.BPM) - CurrentTime; + float diff = CGame.GetTimeFromBeats(line[CurrentLine].FirstNoteBeat, Song.BPM) - CurrentTime; if (diff > dt) { Alpha[i * 2] = 1f - (diff - dt) / rt; } } - else if (CurrentLine < line.Length - 1 && CGame.GetTimeFromBeats(line[CurrentLine].LastBeat, Song.BPM) < CurrentTime && - CGame.GetTimeFromBeats(line[CurrentLine + 1].FirstBeat, Song.BPM) > CurrentTime) + else if (CurrentLine < line.Length - 1 && CGame.GetTimeFromBeats(line[CurrentLine].LastNoteBeat, Song.BPM) < CurrentTime && + CGame.GetTimeFromBeats(line[CurrentLine + 1].FirstNoteBeat, Song.BPM) > CurrentTime) { // current position is between two lines // time between the to lines - float diff = CGame.GetTimeFromBeats(line[CurrentLine + 1].FirstBeat, Song.BPM) - - CGame.GetTimeFromBeats(line[CurrentLine].LastBeat, Song.BPM); + float diff = CGame.GetTimeFromBeats(line[CurrentLine + 1].FirstNoteBeat, Song.BPM) - + CGame.GetTimeFromBeats(line[CurrentLine].LastNoteBeat, Song.BPM); // fade only if there is enough time for fading if (diff > 3.3f * dt) { // time elapsed since last line - float last = CurrentTime - CGame.GetTimeFromBeats(line[CurrentLine].LastBeat, Song.BPM); + float last = CurrentTime - CGame.GetTimeFromBeats(line[CurrentLine].LastNoteBeat, Song.BPM); // time to next line - float next = CGame.GetTimeFromBeats(line[CurrentLine + 1].FirstBeat, Song.BPM) - CurrentTime; + float next = CGame.GetTimeFromBeats(line[CurrentLine + 1].FirstNoteBeat, Song.BPM) - CurrentTime; if (last < next) { @@ -920,11 +920,11 @@ namespace Vocaluxe.Screens } } } - else if (CurrentLine == line.Length - 1 && CGame.GetTimeFromBeats(line[CurrentLine].LastBeat, Song.BPM) < CurrentTime) + else if (CurrentLine == line.Length - 1 && CGame.GetTimeFromBeats(line[CurrentLine].LastNoteBeat, Song.BPM) < CurrentTime) { // last main line and last note was reached // => fade out - float diff = CurrentTime - CGame.GetTimeFromBeats(line[CurrentLine].LastBeat, Song.BPM); + float diff = CurrentTime - CGame.GetTimeFromBeats(line[CurrentLine].LastNoteBeat, Song.BPM); Alpha[i * 2] = 1f - diff / rt; } @@ -932,7 +932,7 @@ namespace Vocaluxe.Screens if (CurrentLineSub < line.Length - 2) { float diff = 0f; - diff = CGame.GetTimeFromBeats(line[CurrentLineSub + 1].FirstBeat, Song.BPM) - CurrentTime; + diff = CGame.GetTimeFromBeats(line[CurrentLineSub + 1].FirstNoteBeat, Song.BPM) - CurrentTime; if (diff > dt) { @@ -1088,7 +1088,7 @@ namespace Vocaluxe.Screens CLine[] Line = Lines[i].Line; for(int j = 0; j Date: Sun, 11 Mar 2012 17:49:53 +0100 Subject: [PATCH 03/70] first playable medley stage --- Vocaluxe/Base/CSettings.cs | 2 +- Vocaluxe/GameModes/CGameMode.cs | 82 ++++++++++++++++------- Vocaluxe/GameModes/CGameModeMedley.cs | 18 ++++++ Vocaluxe/Lib/Song/CNotes.cs | 71 ++++++++++++++++++-- Vocaluxe/Lib/Song/CSong.cs | 93 +++++++++++++++++++++++++-- Vocaluxe/Screens/CScreenSong.cs | 23 +++++++ 6 files changed, 252 insertions(+), 37 deletions(-) diff --git a/Vocaluxe/Base/CSettings.cs b/Vocaluxe/Base/CSettings.cs index e75835b1..d5331c4a 100644 --- a/Vocaluxe/Base/CSettings.cs +++ b/Vocaluxe/Base/CSettings.cs @@ -112,7 +112,7 @@ namespace Vocaluxe.Base public const float LyricHelperMinTime = 0.2f; public const float DefaultMedleyFadeInTime = 8f; - public const float DefaultMedleyFadeOutTIme = 2f; + public const float DefaultMedleyFadeOutTime = 2f; public const int MedleyMinSeriesLength = 3; public const float MedleyMinDuration = 40f; diff --git a/Vocaluxe/GameModes/CGameMode.cs b/Vocaluxe/GameModes/CGameMode.cs index 821178e4..80e19118 100644 --- a/Vocaluxe/GameModes/CGameMode.cs +++ b/Vocaluxe/GameModes/CGameMode.cs @@ -85,14 +85,14 @@ namespace Vocaluxe.GameModes { protected bool _Initialized = false; protected EGameMode _GameMode; - protected List _SongIDs; + protected List _Songs; protected int _ActualSong; protected CPoints _Points; #region Implementation public virtual void Init() { - _SongIDs = new List(); + _Songs = new List(); Reset(); } @@ -105,12 +105,9 @@ namespace Vocaluxe.GameModes { if (CSongs.VisibleSongs.Length > VisibleIndex) { - //int ID = CSongs.VisibleSongs[VisibleIndex].ID; - //if (!_SongIDs.Exists(delegate(int i) { return (i == ID); })) - //{ - _SongIDs.Add(CSongs.VisibleSongs[VisibleIndex].ID); - return true; - //} + _Songs.Add(new CSong(CSongs.VisibleSongs[VisibleIndex])); + SongManipulation(_Songs.Count - 1); + return true; } return false; } @@ -119,12 +116,9 @@ namespace Vocaluxe.GameModes { if (CSongs.AllSongs.Length > AbsoluteIndex) { - //int ID = CSongs.AllSongs[AbsoluteIndex].ID; - //if (!_SongIDs.Exists(delegate(int i) { return (i == ID); })) - //{ - _SongIDs.Add(CSongs.AllSongs[AbsoluteIndex].ID); + _Songs.Add(CSongs.AllSongs[AbsoluteIndex]); + SongManipulation(_Songs.Count - 1); return true; - //} } return false; } @@ -133,7 +127,24 @@ namespace Vocaluxe.GameModes { if (CSongs.VisibleSongs.Length > VisibleIndex) { - return _SongIDs.Remove(CSongs.VisibleSongs[VisibleIndex].ID); + int ID = CSongs.VisibleSongs[VisibleIndex].ID; + int index = -1; + + for (int i = 0; i < _Songs.Count; i++) + { + if (_Songs[i].ID == ID) + { + index = i; + break; + } + } + + if (index > -1) + { + _Songs.RemoveAt(index); + return true; + } + return false; } return false; } @@ -142,14 +153,31 @@ namespace Vocaluxe.GameModes { if (CSongs.AllSongs.Length > AbsoluteIndex) { - return _SongIDs.Remove(CSongs.AllSongs[AbsoluteIndex].ID); + int ID = CSongs.AllSongs[AbsoluteIndex].ID; + int index = -1; + + for (int i = 0; i < _Songs.Count; i++) + { + if (_Songs[i].ID == ID) + { + index = i; + break; + } + } + + if (index > -1) + { + _Songs.RemoveAt(index); + return true; + } + return false; } return false; } public virtual void ClearSongs() { - _SongIDs.Clear(); + _Songs.Clear(); } public virtual void Reset() @@ -159,16 +187,16 @@ namespace Vocaluxe.GameModes public virtual void Start(SPlayer[] Player) { - _Points = new CPoints(_SongIDs.Count, Player); + _Points = new CPoints(_Songs.Count, Player); } public virtual void NextRound(SPlayer[] Player) { - if (_ActualSong < _SongIDs.Count && _SongIDs.Count > 0) + if (_ActualSong < _Songs.Count && _Songs.Count > 0) { if (_ActualSong > -1) { - _Points.SetPoints(_ActualSong, _SongIDs[_ActualSong], Player, _GameMode == EGameMode.Medley, _GameMode == EGameMode.Duet); + _Points.SetPoints(_ActualSong, _Songs[_ActualSong].ID, Player, _GameMode == EGameMode.Medley, _GameMode == EGameMode.Duet); } _ActualSong++; } @@ -176,7 +204,7 @@ namespace Vocaluxe.GameModes public virtual bool IsFinished() { - return (_ActualSong == _SongIDs.Count || _SongIDs.Count == 0); + return (_ActualSong == _Songs.Count || _Songs.Count == 0); } public virtual int GetActualRoundNr() @@ -186,22 +214,22 @@ namespace Vocaluxe.GameModes public virtual CSong GetSong() { - if (_ActualSong >= 0 && _ActualSong < _SongIDs.Count) + if (_ActualSong >= 0 && _ActualSong < _Songs.Count) { - return CSongs.GetSong(_SongIDs[_ActualSong]); + return _Songs[_ActualSong]; } return null; } public virtual int GetNumSongs() { - return _SongIDs.Count; + return _Songs.Count; } public virtual CSong GetSong(int Num) { - if (Num - 1 < _SongIDs.Count) - return CSongs.GetSong(_SongIDs[Num - 1]); + if (Num - 1 < _Songs.Count) + return _Songs[Num - 1]; return null; } @@ -211,5 +239,9 @@ namespace Vocaluxe.GameModes return _Points; } #endregion Implementation + + protected virtual void SongManipulation(int SongIndex) + { + } } } diff --git a/Vocaluxe/GameModes/CGameModeMedley.cs b/Vocaluxe/GameModes/CGameModeMedley.cs index 03daef3f..7b22f145 100644 --- a/Vocaluxe/GameModes/CGameModeMedley.cs +++ b/Vocaluxe/GameModes/CGameModeMedley.cs @@ -2,6 +2,9 @@ using System.Collections.Generic; using System.Text; +using Vocaluxe.Base; +using Vocaluxe.Lib.Song; + namespace Vocaluxe.GameModes { class CGameModeMedley : CGameMode @@ -13,5 +16,20 @@ namespace Vocaluxe.GameModes _GameMode = EGameMode.Medley; _Initialized = true; } + + protected override void SongManipulation(int SongIndex) + { + CSong song = _Songs[SongIndex]; + + // set medley mode timings + song.Start = CGame.GetTimeFromBeats(song.Medley.StartBeat, song.BPM) - song.Medley.FadeInTime + song.Gap; + if (song.Start < 0f) + song.Start = 0f; + + song.Finish = CGame.GetTimeFromBeats(song.Medley.EndBeat, song.BPM) + song.Medley.FadeOutTime + song.Gap; + + // set lines to medley mode + song.Notes.SetMedley(song.Medley.StartBeat, song.Medley.EndBeat); + } } } diff --git a/Vocaluxe/Lib/Song/CNotes.cs b/Vocaluxe/Lib/Song/CNotes.cs index 0396c8da..2b3045c0 100644 --- a/Vocaluxe/Lib/Song/CNotes.cs +++ b/Vocaluxe/Lib/Song/CNotes.cs @@ -15,6 +15,18 @@ namespace Vocaluxe.Lib.Song get { return _Lines.ToArray(); } } + public CNotes() + { + } + + public CNotes(CNotes notes) + { + foreach (CLines lines in notes._Lines) + { + _Lines.Add(new CLines(lines)); + } + } + public CLines GetLines(int Index) { while (Index >= _Lines.Count) @@ -54,6 +66,13 @@ namespace Vocaluxe.Lib.Song _Lines.Clear(); } + public void SetMedley(int StartBeat, int EndBeat) + { + foreach (CLines lines in _Lines) + { + lines.SetMedley(StartBeat, EndBeat); + } + } } public enum ENoteType @@ -85,6 +104,17 @@ namespace Vocaluxe.Lib.Song _Perfect = false; } + public CNote(CNote note) + { + _StartBeat = note._StartBeat; + _Duration = note._Duration; + _Tone = note._Tone; + _NoteType = note._NoteType; + _Text = note._Text; + _Hit = note._Hit; + _Perfect = note._Perfect; + } + public CNote(int StartBeat, int Duration, int Tone, string Text) : this() { @@ -245,16 +275,26 @@ namespace Vocaluxe.Lib.Song private int _EndBeat; private bool _PerfectLine; // for drawing perfect line effect - private List _Notes; + private List _Notes = new List(); #region Constructors public CLine() { - _Notes = new List(); StartBeat = int.MinValue; EndBeat = int.MaxValue; _PerfectLine = false; } + + public CLine(CLine line) + { + foreach (CNote note in line._Notes) + { + _Notes.Add(new CNote(note)); + } + _StartBeat = line._StartBeat; + _EndBeat = line._EndBeat; + _PerfectLine = line._PerfectLine; + } #endregion Constructors #region Properties @@ -475,16 +515,32 @@ namespace Vocaluxe.Lib.Song { _Notes.Clear(); } + + public void SetMedley(int StartBeat, int EndBeat) + { + foreach (CNote note in _Notes) + { + if (note.StartBeat < StartBeat || note.EndBeat > EndBeat) + note.NoteType = ENoteType.Freestyle; + } + } #endregion Methods } public class CLines { - private List _Lines; + private List _Lines = new List(); public CLines() { - _Lines = new List(); + } + + public CLines(CLines lines) + { + foreach (CLine line in lines._Lines) + { + _Lines.Add(new CLine(line)); + } } public CLine[] Line @@ -648,6 +704,13 @@ namespace Vocaluxe.Lib.Song } } + public void SetMedley(int StartBeat, int EndBeat) + { + foreach (CLine line in _Lines) + { + line.SetMedley(StartBeat, EndBeat); + } + } #endregion Methods } } diff --git a/Vocaluxe/Lib/Song/CSong.cs b/Vocaluxe/Lib/Song/CSong.cs index 3a728747..d9998e61 100644 --- a/Vocaluxe/Lib/Song/CSong.cs +++ b/Vocaluxe/Lib/Song/CSong.cs @@ -53,7 +53,7 @@ namespace Vocaluxe.Lib.Song private STexture _CoverTextureSmall = new STexture(-1); private STexture _CoverTextureBig = new STexture(-1); - private SMedley Medley = new SMedley(0); + public SMedley Medley = new SMedley(0); public bool CalculateMedley = true; public float PreviewStart = 0f; @@ -74,9 +74,7 @@ namespace Vocaluxe.Lib.Song { get { return _CoverLoaded; } } - public bool CoverBigLoaded = false; - public bool BackgroundLoaded = false; public STexture CoverTextureSmall { @@ -111,8 +109,6 @@ namespace Vocaluxe.Lib.Song set { _CoverTextureBig = value; } } - public CBackground Background = new CBackground(); - public string Title = String.Empty; public string Artist = String.Empty; @@ -143,6 +139,83 @@ namespace Vocaluxe.Lib.Song // Notes public CNotes Notes = new CNotes(); + public CSong() + { + } + + public CSong(CSong song) + { + this._CoverTextureSmall = song._CoverTextureSmall; + this._CoverTextureBig = song._CoverTextureBig; + + this.Medley = new SMedley(); + this.Medley.Source = song.Medley.Source; + this.Medley.StartBeat = song.Medley.StartBeat; + this.Medley.EndBeat = song.Medley.EndBeat; + this.Medley.FadeInTime = song.Medley.FadeInTime; + this.Medley.FadeOutTime = song.Medley.FadeOutTime; + + this.CalculateMedley = song.CalculateMedley; + this.PreviewStart = song.PreviewStart; + + this.Encoding = song.Encoding; + this.Folder = song.Folder; + this.FolderName = song.FolderName; + this.FileName = song.FileName; + + this.MP3FileName = song.MP3FileName; + this.CoverFileName = song.CoverFileName; + this.BackgroundFileName = song.BackgroundFileName; + this.VideoFileName = song.VideoFileName; + + this.VideoAspect = song.VideoAspect; + this._CoverLoaded = song._CoverLoaded; + this.CoverBigLoaded = song.CoverBigLoaded; + + this.Artist = song.Artist; + this.Title = song.Title; + + this.Start = song.Start; + this.Finish = song.Finish; + + this.BPM = song.BPM; + this.Gap = song.Gap; + this.VideoGap = song.VideoGap; + + this.Comment = new List(); + foreach (string value in song.Comment) + { + this.Comment.Add(value); + } + + this.ID = song.ID; + this.Visible = song.Visible; + this.CatIndex = song.CatIndex; + this.Selected = song.Selected; + + this.Edition = new List(); + foreach (string value in song.Edition) + { + this.Edition.Add(value); + } + + this.Genre = new List(); + foreach (string value in song.Genre) + { + this.Genre.Add(value); + } + + this.Year = song.Year; + + this.Language = new List(); + foreach (string value in song.Language) + { + this.Language.Add(value); + } + + this.Notes = new CNotes(song.Notes); + } + public string GetMP3() { return Path.Combine(Folder, MP3FileName); @@ -418,7 +491,7 @@ namespace Vocaluxe.Lib.Song { this.Medley.Source = EMedleySource.Tag; this.Medley.FadeInTime = CSettings.DefaultMedleyFadeInTime; - this.Medley.FadeOutTime = CSettings.DefaultMedleyFadeOutTIme; + this.Medley.FadeOutTime = CSettings.DefaultMedleyFadeOutTime; } #endregion check medley tags @@ -644,6 +717,12 @@ namespace Vocaluxe.Lib.Song private void FindRefrain() { + if (this.IsDuet) + { + this.Medley.Source = EMedleySource.None; + return; + } + if (this.Medley.Source == EMedleySource.Tag) return; @@ -735,7 +814,7 @@ namespace Vocaluxe.Lib.Song { this.Medley.Source = EMedleySource.Calculated; this.Medley.FadeInTime = CSettings.DefaultMedleyFadeInTime; - this.Medley.FadeOutTime = CSettings.DefaultMedleyFadeOutTIme; + this.Medley.FadeOutTime = CSettings.DefaultMedleyFadeOutTime; } } diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index abc609de..356edf80 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -8,6 +8,7 @@ using System.Windows.Forms; using Vocaluxe.Base; using Vocaluxe.Lib.Draw; +using Vocaluxe.Lib.Song; using Vocaluxe.Menu; using Vocaluxe.Menu.SongMenu; @@ -133,6 +134,11 @@ namespace Vocaluxe.Screens SongMenus[htSongMenus(SongMenu)].SetSelectedSong(CSongs.GetRandomSong()); } break; + + case Keys.S: + if (CSongs.NumVisibleSongs > 0) + StartMedleySong(SongMenus[htSongMenus(SongMenu)].GetSelectedSong()); + break; } } @@ -234,6 +240,23 @@ namespace Vocaluxe.Screens } } + private void StartMedleySong(int SongNr) + { + if ((CSongs.Category >= 0) && (SongNr >= 0)) + { + if (CSongs.VisibleSongs[SongNr].Medley.Source != EMedleySource.None) + CGame.SetGameMode(GameModes.EGameMode.Medley); + else + return; + + CGame.Reset(); + CGame.ClearSongs(); + CGame.AddVisibleSong(SongNr); + + CGraphics.FadeTo(EScreens.ScreenNames); + } + } + private void StartRandomAllSongs() { CGame.Reset(); From a86ca33d9b82372ea8d341932d180b08a7b0987f Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sat, 24 Mar 2012 17:47:48 +0100 Subject: [PATCH 04/70] fixed timeline in medley mode --- Vocaluxe/Lib/Song/CNotes.cs | 11 +++++++++++ Vocaluxe/Screens/CScreenSing.cs | 27 +++++++++++++++------------ 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/Vocaluxe/Lib/Song/CNotes.cs b/Vocaluxe/Lib/Song/CNotes.cs index adcb59fb..590b5932 100644 --- a/Vocaluxe/Lib/Song/CNotes.cs +++ b/Vocaluxe/Lib/Song/CNotes.cs @@ -274,6 +274,7 @@ namespace Vocaluxe.Lib.Song private int _StartBeat; private int _EndBeat; private bool _PerfectLine; // for drawing perfect line effect + private bool _VisibleInTimeLine; private int _MinBeat = int.MaxValue; private int _MaxBeat = int.MinValue; @@ -285,6 +286,7 @@ namespace Vocaluxe.Lib.Song StartBeat = int.MinValue; EndBeat = int.MaxValue; _PerfectLine = false; + _VisibleInTimeLine = true; } public CLine(CLine line) @@ -298,10 +300,17 @@ namespace Vocaluxe.Lib.Song _PerfectLine = line._PerfectLine; _MinBeat = line._MinBeat; _MaxBeat = line._MaxBeat; + _VisibleInTimeLine = line._VisibleInTimeLine; } #endregion Constructors #region Properties + public bool VisibleInTimeLine + { + get { return _VisibleInTimeLine; } + set { _VisibleInTimeLine = value; } + } + public int StartBeat { get { return _StartBeat; } @@ -508,6 +517,8 @@ namespace Vocaluxe.Lib.Song if (note.StartBeat < StartBeat || note.EndBeat > EndBeat) note.NoteType = ENoteType.Freestyle; } + + _VisibleInTimeLine = _MinBeat >= StartBeat && _MaxBeat <= EndBeat; } private void updateMinMaxBeat(CNote Note) diff --git a/Vocaluxe/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs index 2577fa6d..997f3858 100644 --- a/Vocaluxe/Screens/CScreenSing.cs +++ b/Vocaluxe/Screens/CScreenSing.cs @@ -1087,19 +1087,22 @@ namespace Vocaluxe.Screens { CLine[] Line = Lines[i].Line; for(int j = 0; j Date: Sat, 24 Mar 2012 18:24:21 +0100 Subject: [PATCH 05/70] added medley icons (we need some nicer icons) --- .../{MedleyIcon.png => MedleyCalcIcon.png} | Bin Output/Themes/Ambient/MedleyTagIcon.png | Bin 0 -> 10385 bytes Output/Themes/Ambient/Screens/ScreenSong.xml | 38 +++++++++++++++++- Output/Themes/Ambient/Skin Blue.xml | 10 +++-- Output/Themes/Ambient/Skin Green.xml | 10 +++-- Output/Themes/Ambient/Skin Red.xml | 10 +++-- Output/Themes/Ambient/Skin Yellow.xml | 10 +++-- .../Themes/Changelog/Changelog_ScreenSong.txt | 13 ++++++ Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs | 30 +++++++++----- Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs | 25 ++++++++---- Vocaluxe/Screens/CScreenSong.cs | 2 +- 11 files changed, 112 insertions(+), 36 deletions(-) rename Output/Themes/Ambient/{MedleyIcon.png => MedleyCalcIcon.png} (100%) create mode 100644 Output/Themes/Ambient/MedleyTagIcon.png create mode 100644 Output/Themes/Changelog/Changelog_ScreenSong.txt diff --git a/Output/Themes/Ambient/MedleyIcon.png b/Output/Themes/Ambient/MedleyCalcIcon.png similarity index 100% rename from Output/Themes/Ambient/MedleyIcon.png rename to Output/Themes/Ambient/MedleyCalcIcon.png diff --git a/Output/Themes/Ambient/MedleyTagIcon.png b/Output/Themes/Ambient/MedleyTagIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..2cfe3f20dc4486de7cd6e11cc7737a4c149fb500 GIT binary patch literal 10385 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 T_mO{$7zD`6s7RMfng;wIAqgrI literal 0 HcmV?d00001 diff --git a/Output/Themes/Ambient/Screens/ScreenSong.xml b/Output/Themes/Ambient/Screens/ScreenSong.xml index f693065d..84bfa297 100644 --- a/Output/Themes/Ambient/Screens/ScreenSong.xml +++ b/Output/Themes/Ambient/Screens/ScreenSong.xml @@ -1,7 +1,7 @@  - 1 + 2 Video @@ -180,6 +180,10 @@ DuetIcon VideoIcon + + MedleyCalcIcon + + MedleyTagIcon 40 100 @@ -356,6 +360,38 @@ + + + MedleyCalcIcon + + 280 + 530 + -1,00 + 40 + 40 + + + StaticColor + + + + + + + MedleyTagIcon + + 280 + 530 + -1,00 + 40 + 40 + + + StaticColor + + + + diff --git a/Output/Themes/Ambient/Skin Blue.xml b/Output/Themes/Ambient/Skin Blue.xml index 62fefa5d..7f5b16ab 100644 --- a/Output/Themes/Ambient/Skin Blue.xml +++ b/Output/Themes/Ambient/Skin Blue.xml @@ -214,13 +214,13 @@ 0,300 1,000 - - 0,800 + + 0,800 0,950 1,000 0,500 - - + + 0,800 0,950 1,000 @@ -263,6 +263,8 @@ EnergyBeam.png DuetIcon.png VideoIcon.png + MedleyCalcIcon.png + MedleyTagIcon.png Invisible.png diff --git a/Output/Themes/Ambient/Skin Green.xml b/Output/Themes/Ambient/Skin Green.xml index 9d6047ae..bee2b2ba 100644 --- a/Output/Themes/Ambient/Skin Green.xml +++ b/Output/Themes/Ambient/Skin Green.xml @@ -214,13 +214,13 @@ 0,300 1,000 - - 0,800 + + 0,800 0,950 1,000 0,500 - - + + 0,800 0,950 1,000 @@ -263,6 +263,8 @@ EnergyBeam.png DuetIcon.png VideoIcon.png + MedleyCalcIcon.png + MedleyTagIcon.png Invisible.png diff --git a/Output/Themes/Ambient/Skin Red.xml b/Output/Themes/Ambient/Skin Red.xml index b74a054b..42b71d2c 100644 --- a/Output/Themes/Ambient/Skin Red.xml +++ b/Output/Themes/Ambient/Skin Red.xml @@ -214,13 +214,13 @@ 0,300 1,000 - - 0,800 + + 0,800 0,950 1,000 0,500 - - + + 0,800 0,950 1,000 @@ -263,6 +263,8 @@ EnergyBeam.png DuetIcon.png VideoIcon.png + MedleyCalcIcon.png + MedleyTagIcon.png Invisible.png diff --git a/Output/Themes/Ambient/Skin Yellow.xml b/Output/Themes/Ambient/Skin Yellow.xml index 5d63b033..1207b7fe 100644 --- a/Output/Themes/Ambient/Skin Yellow.xml +++ b/Output/Themes/Ambient/Skin Yellow.xml @@ -214,13 +214,13 @@ 0,300 1,000 - - 0,800 + + 0,800 0,950 1,000 0,500 - - + + 0,800 0,950 1,000 @@ -263,6 +263,8 @@ EnergyBeam.png DuetIcon.png VideoIcon.png + MedleyCalcIcon.png + MedleyTagIcon.png Invisible.png diff --git a/Output/Themes/Changelog/Changelog_ScreenSong.txt b/Output/Themes/Changelog/Changelog_ScreenSong.txt new file mode 100644 index 00000000..1303abb5 --- /dev/null +++ b/Output/Themes/Changelog/Changelog_ScreenSong.txt @@ -0,0 +1,13 @@ +ScreenSong + +++++++++++ +Version 2: + +Add: + and +to SongMenu + +Add: + and +to SongMenu.SongMenuTileBoard +++++++++++ \ No newline at end of file diff --git a/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs b/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs index 4e6a14d0..92c0a431 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs @@ -20,6 +20,9 @@ namespace Vocaluxe.Menu.SongMenu public string DuetIconName; public string VideoIconName; + public string MedleyCalcIcon; + public string MedleyTagIcon; + public string ColorName; //public SThemeSongMenuBook songMenuBook; @@ -72,6 +75,8 @@ namespace Vocaluxe.Menu.SongMenu public CStatic StaticTextBG; public CStatic StaticDuetIcon; public CStatic StaticVideoIcon; + public CStatic StaticMedleyCalcIcon; + public CStatic StaticMedleyTagIcon; } abstract class CSongMenuFramework : ISongMenu @@ -225,6 +230,8 @@ namespace Vocaluxe.Menu.SongMenu _Theme.songMenuTileBoard.StaticTextBG = new CStatic(); _Theme.songMenuTileBoard.StaticDuetIcon = new CStatic(); _Theme.songMenuTileBoard.StaticVideoIcon = new CStatic(); + _Theme.songMenuTileBoard.StaticMedleyCalcIcon = new CStatic(); + _Theme.songMenuTileBoard.StaticMedleyTagIcon = new CStatic(); _ThemeLoaded = false; } @@ -238,8 +245,9 @@ namespace Vocaluxe.Menu.SongMenu _ThemeLoaded &= CHelper.GetValueFromXML(item + "/CoverBigBackground", navigator, ref _Theme.CoverBigBackgroundName, String.Empty); _ThemeLoaded &= CHelper.GetValueFromXML(item + "/DuetIcon", navigator, ref _Theme.DuetIconName, String.Empty); _ThemeLoaded &= CHelper.GetValueFromXML(item + "/VideoIcon", navigator, ref _Theme.VideoIconName, String.Empty); - - + _ThemeLoaded &= CHelper.GetValueFromXML(item + "/MedleyCalcIcon", navigator, ref _Theme.MedleyCalcIcon, String.Empty); + _ThemeLoaded &= CHelper.GetValueFromXML(item + "/MedleyTagIcon", navigator, ref _Theme.MedleyTagIcon, String.Empty); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/X", navigator, ref _Rect.X); _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/Y", navigator, ref _Rect.Y); _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/Z", navigator, ref _Rect.Z); @@ -272,6 +280,8 @@ namespace Vocaluxe.Menu.SongMenu _ThemeLoaded &= _Theme.songMenuTileBoard.StaticTextBG.LoadTheme(item + "/SongMenuTileBoard", "StaticTextBG", navigator, SkinIndex); _ThemeLoaded &= _Theme.songMenuTileBoard.StaticDuetIcon.LoadTheme(item + "/SongMenuTileBoard", "StaticDuetIcon", navigator, SkinIndex); _ThemeLoaded &= _Theme.songMenuTileBoard.StaticVideoIcon.LoadTheme(item + "/SongMenuTileBoard", "StaticVideoIcon", navigator, SkinIndex); + _ThemeLoaded &= _Theme.songMenuTileBoard.StaticMedleyCalcIcon.LoadTheme(item + "/SongMenuTileBoard", "StaticMedleyCalcIcon", navigator, SkinIndex); + _ThemeLoaded &= _Theme.songMenuTileBoard.StaticMedleyTagIcon.LoadTheme(item + "/SongMenuTileBoard", "StaticMedleyTagIcon", navigator, SkinIndex); _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/SongMenuTileBoard/TileRectX", navigator, ref _Theme.songMenuTileBoard.TileRect.X); _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/SongMenuTileBoard/TileRectY", navigator, ref _Theme.songMenuTileBoard.TileRect.Y); @@ -309,6 +319,12 @@ namespace Vocaluxe.Menu.SongMenu writer.WriteComment(": Texture name of video icon"); writer.WriteElementString("VideoIcon", _Theme.VideoIconName); + writer.WriteComment(": Texture name of medley calc (calculated) icon"); + writer.WriteElementString("MedleyCalcIcon", _Theme.MedleyCalcIcon); + + writer.WriteComment(": Texture name of medley tag (manuelly set) icon"); + writer.WriteElementString("MedleyTagIcon", _Theme.MedleyTagIcon); + writer.WriteComment(", , , , : SongMenu position, width and height"); writer.WriteElementString("X", _Rect.X.ToString("#0")); writer.WriteElementString("Y", _Rect.Y.ToString("#0")); @@ -361,6 +377,8 @@ namespace Vocaluxe.Menu.SongMenu _Theme.songMenuTileBoard.StaticTextBG.SaveTheme(writer); _Theme.songMenuTileBoard.StaticDuetIcon.SaveTheme(writer); _Theme.songMenuTileBoard.StaticVideoIcon.SaveTheme(writer); + _Theme.songMenuTileBoard.StaticMedleyCalcIcon.SaveTheme(writer); + _Theme.songMenuTileBoard.StaticMedleyTagIcon.SaveTheme(writer); writer.WriteEndElement(); #endregion SongMenuTileBoard @@ -491,14 +509,6 @@ namespace Vocaluxe.Menu.SongMenu if (_Theme.ColorName != String.Empty) _Color = CTheme.GetColor(_Theme.ColorName); - - _Theme.songMenuTileBoard.StaticCoverBig.ReloadTextures(); - _Theme.songMenuTileBoard.StaticTextBG.ReloadTextures(); - _Theme.songMenuTileBoard.StaticDuetIcon.ReloadTextures(); - _Theme.songMenuTileBoard.StaticVideoIcon.ReloadTextures(); - - _Theme.songMenuTileBoard.TextArtist.ReloadTextures(); - _Theme.songMenuTileBoard.TextTitle.ReloadTextures(); } public void ReloadTextures() diff --git a/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs b/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs index 558cb093..becc1bdc 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs @@ -18,6 +18,8 @@ namespace Vocaluxe.Menu.SongMenu private CStatic _TextBG; private CStatic _DuetIcon; private CStatic _VideoIcon; + private CStatic _MedleyCalcIcon; + private CStatic _MedleyTagIcon; private STexture _CoverBigTexture; private STexture _CoverTexture; @@ -81,6 +83,8 @@ namespace Vocaluxe.Menu.SongMenu _TextBG = _Theme.songMenuTileBoard.StaticTextBG; _DuetIcon = _Theme.songMenuTileBoard.StaticDuetIcon; _VideoIcon = _Theme.songMenuTileBoard.StaticVideoIcon; + _MedleyCalcIcon = _Theme.songMenuTileBoard.StaticMedleyCalcIcon; + _MedleyTagIcon = _Theme.songMenuTileBoard.StaticMedleyTagIcon; _Artist = _Theme.songMenuTileBoard.TextArtist; _Title = _Theme.songMenuTileBoard.TextTitle; @@ -113,6 +117,8 @@ namespace Vocaluxe.Menu.SongMenu _Locked = 0; _DuetIcon.Visible = false; _VideoIcon.Visible = false; + _MedleyCalcIcon.Visible = false; + _MedleyTagIcon.Visible = false; } if (CSongs.NumVisibleSongs == 0 && CSongs.SearchFilter != String.Empty) @@ -125,6 +131,8 @@ namespace Vocaluxe.Menu.SongMenu _Locked = -1; _DuetIcon.Visible = false; _VideoIcon.Visible = false; + _MedleyCalcIcon.Visible = false; + _MedleyTagIcon.Visible = false; } } @@ -406,14 +414,9 @@ namespace Vocaluxe.Menu.SongMenu _Artist.Text = song.Artist; _Title.Text = song.Title; _DuetIcon.Visible = song.IsDuet; - if (song.VideoFileName.Length > 0) - { - _VideoIcon.Visible = true; - } - else - { - _VideoIcon.Visible = false; - } + _VideoIcon.Visible = song.VideoFileName.Length > 0; + _MedleyCalcIcon.Visible = song.Medley.Source == EMedleySource.Calculated; + _MedleyTagIcon.Visible = song.Medley.Source == EMedleySource.Tag; float Time = CSound.GetLength(_SongStream); if (song.Finish != 0) @@ -442,6 +445,8 @@ namespace Vocaluxe.Menu.SongMenu _SongLength.Text = String.Empty; _DuetIcon.Visible = false; _VideoIcon.Visible = false; + _MedleyCalcIcon.Visible = false; + _MedleyTagIcon.Visible = false; } } @@ -465,6 +470,8 @@ namespace Vocaluxe.Menu.SongMenu _SongLength.Draw(); _DuetIcon.Draw(); _VideoIcon.Draw(); + _MedleyCalcIcon.Draw(); + _MedleyTagIcon.Draw(); } @@ -651,6 +658,8 @@ namespace Vocaluxe.Menu.SongMenu _Theme.songMenuTileBoard.StaticTextBG.ReloadTextures(); _Theme.songMenuTileBoard.StaticDuetIcon.ReloadTextures(); _Theme.songMenuTileBoard.StaticVideoIcon.ReloadTextures(); + _Theme.songMenuTileBoard.StaticMedleyCalcIcon.ReloadTextures(); + _Theme.songMenuTileBoard.StaticMedleyTagIcon.ReloadTextures(); _Theme.songMenuTileBoard.TextArtist.ReloadTextures(); _Theme.songMenuTileBoard.TextTitle.ReloadTextures(); diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 58b0322e..20022427 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -17,7 +17,7 @@ namespace Vocaluxe.Screens class CScreenSong : CMenu { // Version number for theme files. Increment it, if you've changed something on the theme files! - const int ScreenVersion = 1; + const int ScreenVersion = 2; private const string TextCategory = "TextCategory"; private const string TextSelection = "TextSelection"; From 992397d498a913fc1cef2007f2f08c37ce6e1520 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sun, 17 Jun 2012 11:29:31 +0200 Subject: [PATCH 06/70] Added song-options on ScreenSong. Need fix for drawing... --- Output/Languages/Deutsch.xml | 4 + Output/Languages/English.xml | 4 + Output/Themes/Ambient/Screens/ScreenSong.xml | 257 +++++++++++++++- Output/Themes/Ambient/Skin Blue.xml | 1 + Output/Themes/Ambient/Skin Green.xml | 1 + Output/Themes/Ambient/Skin Red.xml | 1 + Output/Themes/Ambient/Skin Yellow.xml | 1 + Output/Themes/Ambient/SongMenuBG.png | Bin 0 -> 1320 bytes Vocaluxe/Screens/CScreenSong.cs | 308 ++++++++++++++----- 9 files changed, 493 insertions(+), 84 deletions(-) create mode 100644 Output/Themes/Ambient/SongMenuBG.png diff --git a/Output/Languages/Deutsch.xml b/Output/Languages/Deutsch.xml index ecb1c632..e3aac4ae 100644 --- a/Output/Languages/Deutsch.xml +++ b/Output/Languages/Deutsch.xml @@ -118,6 +118,10 @@ Warnung: Den Spielern %v sind keine Profile zugeordnet! Songauswahl + Lied singen + Zur Playlist hinzufügen + Schließen + Lied-Optionen Suche: Ohne Sprache Ohne Jahr diff --git a/Output/Languages/English.xml b/Output/Languages/English.xml index e40c62d2..fb5d72e4 100644 --- a/Output/Languages/English.xml +++ b/Output/Languages/English.xml @@ -118,6 +118,10 @@ Warning: There are no profiles assigned to players %v! Song Selection + Sing + Add to playlist + Close + Song Options Search: No Language No Year diff --git a/Output/Themes/Ambient/Screens/ScreenSong.xml b/Output/Themes/Ambient/Screens/ScreenSong.xml index 84bfa297..fc3e511a 100644 --- a/Output/Themes/Ambient/Screens/ScreenSong.xml +++ b/Output/Themes/Ambient/Screens/ScreenSong.xml @@ -1,7 +1,7 @@  - 2 + 3 Video @@ -33,6 +33,25 @@ 26 + + + SongMenuBG + + 40 + 40 + -2,10 + 360 + 360 + + + 1 + 1 + 1 + 0.3 + + + + Menu @@ -53,6 +72,175 @@ 26 + + + Button + + Button + + 40 + 90 + -2,11 + 360 + 40 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + + + Outline + + TR_SCREENSONG_BUTTON_SING + + + + + + + + + + + Button + + Button + + 40 + 180 + -2,11 + 360 + 40 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + + + Outline + + TR_SCREENSONG_BUTTON_PLAYLIST + + + + + + + + + + + Button + + Button + + 40 + 225 + -2,11 + 360 + 40 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + + + Outline + + TR_SCREENSONG_BUTTON_CANCEL + + + + + + + + + + + 200 + 45 + + -2,11 + + 40 + + 350 + + + StaticColor + + + TextSColor + + Center + + + + Outline + + TR_SCREENSONG_SONGOPTIONS + + + + 220 @@ -171,6 +359,71 @@ + + + Button + + SelectSlideArrowLeft + + SelectSlideArrowRight + + SelectSlide + + SelectSlideArrowLeft + + SelectSlideArrowRight + + SelectSlide + + 40 + 135 + -2,11 + 360 + 40 + + 45 + 140 + -2,12 + 30 + 30 + + 365 + 140 + -2,12 + 30 + 30 + + + ButtonColor + + + ButtonSColor + + + SelectSlideHColor + + + ArrowColor + + + ArrowSColor + + + TextColor + + + TextSColor + + 30 + + 280 + + Outline + + Bold + + 1 + CoverTile @@ -395,4 +648,4 @@ - \ No newline at end of file + diff --git a/Output/Themes/Ambient/Skin Blue.xml b/Output/Themes/Ambient/Skin Blue.xml index 3369f76b..3169a5a6 100644 --- a/Output/Themes/Ambient/Skin Blue.xml +++ b/Output/Themes/Ambient/Skin Blue.xml @@ -308,6 +308,7 @@ PlayIcon.png PauseIcon.png RepeatIcon.png + SongMenuBG.png [Blue]BG_Video.mp4 diff --git a/Output/Themes/Ambient/Skin Green.xml b/Output/Themes/Ambient/Skin Green.xml index 46bfead0..fd6af963 100644 --- a/Output/Themes/Ambient/Skin Green.xml +++ b/Output/Themes/Ambient/Skin Green.xml @@ -308,6 +308,7 @@ PlayIcon.png PauseIcon.png RepeatIcon.png + SongMenuBG.png [Green]BG_Video.mp4 diff --git a/Output/Themes/Ambient/Skin Red.xml b/Output/Themes/Ambient/Skin Red.xml index cf07c56a..c48cc135 100644 --- a/Output/Themes/Ambient/Skin Red.xml +++ b/Output/Themes/Ambient/Skin Red.xml @@ -308,6 +308,7 @@ PlayIcon.png PauseIcon.png RepeatIcon.png + SongMenuBG.png [Red]BG_Video.mp4 diff --git a/Output/Themes/Ambient/Skin Yellow.xml b/Output/Themes/Ambient/Skin Yellow.xml index e89cb753..9e58f222 100644 --- a/Output/Themes/Ambient/Skin Yellow.xml +++ b/Output/Themes/Ambient/Skin Yellow.xml @@ -308,6 +308,7 @@ PlayIcon.png PauseIcon.png RepeatIcon.png + SongMenuBG.png [Yellow]BG_Video.mp4 diff --git a/Output/Themes/Ambient/SongMenuBG.png b/Output/Themes/Ambient/SongMenuBG.png new file mode 100644 index 0000000000000000000000000000000000000000..a7333adbf034ff6b7b5d0f41bf8382724356198f GIT binary patch literal 1320 zcmeAS@N?(olHy`uVBq!ia0y~yV4MKL9Be?5hW%z|fD~hKkh>GZx^prwfgH9ZZ+91l z{~)+v@AAn&5zYdS$YKTtZeb8+WSBKa0w~B{;_2(keuqtv-9%7IqD&7cB%2u$QR1AR zo12itaNC{3~Htva#?0y)Z+=vmsPxd6F_B@r>mdKI;Vst08Bi(DF6Tf literal 0 HcmV?d00001 diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 5ee5c9e5..d8035d7a 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -17,22 +17,35 @@ namespace Vocaluxe.Screens class CScreenSong : CMenu { // Version number for theme files. Increment it, if you've changed something on the theme files! - const int ScreenVersion = 2; + const int ScreenVersion = 3; private const string TextCategory = "TextCategory"; private const string TextSelection = "TextSelection"; private const string TextSearchBarTitle = "TextSearchBarTitle"; private const string TextSearchBar = "TextSearchBar"; + private const string TextOptionsTitle = "TextOptionsTitle"; + + private const string ButtonOptionsSing = "ButtonOptionsSing"; + private const string ButtonOptionsPlaylist = "ButtonOptionsPlaylist"; + private const string ButtonOptionsClose = "ButtonOptionsClose"; + + private const string SelectSlideOptionsMode = "SelectSlideOptionsMode"; private const string StaticSearchBar = "StaticSearchBar"; + private const string StaticOptionsBG = "StaticOptionsBG"; private const string SongMenu = "SongMenu"; private string _SearchText = String.Empty; private bool _SearchActive = false; + private bool _SongOptionsActive = false; + private List _AvailableGameModes; + public CScreenSong() { Init(); + + _AvailableGameModes = new List(); } protected override void Init() @@ -41,87 +54,76 @@ namespace Vocaluxe.Screens _ThemeName = "ScreenSong"; _ScreenVersion = ScreenVersion; - _ThemeStatics = new string[] { StaticSearchBar }; - _ThemeTexts = new string[] { TextCategory, TextSelection, TextSearchBarTitle, TextSearchBar }; + _ThemeStatics = new string[] { StaticSearchBar, StaticOptionsBG }; + _ThemeTexts = new string[] { TextCategory, TextSelection, TextSearchBarTitle, TextSearchBar, TextOptionsTitle }; + _ThemeButtons = new string[] { ButtonOptionsClose, ButtonOptionsPlaylist, ButtonOptionsSing }; + _ThemeSelectSlides = new string[] { SelectSlideOptionsMode }; _ThemeSongMenus = new string[] { SongMenu }; } public override void LoadTheme() { base.LoadTheme(); + SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible = false; + Buttons[htButtons(ButtonOptionsClose)].Visible = false; + Buttons[htButtons(ButtonOptionsSing)].Visible = false; + Buttons[htButtons(ButtonOptionsPlaylist)].Visible = false; + Texts[htTexts(TextOptionsTitle)].Visible = false; + Statics[htStatics(StaticOptionsBG)].Visible = false; } public override bool HandleInput(KeyEvent KeyEvent) { base.HandleInput(KeyEvent); - if (KeyEvent.KeyPressed && !Char.IsControl(KeyEvent.Unicode)) + if (!_SongOptionsActive) { - if (_SearchActive) - ApplyNewSearchFilter(_SearchText + KeyEvent.Unicode); - /* - else if (!Char.IsControl(KeyEvent.Unicode)) + + if (KeyEvent.KeyPressed && !Char.IsControl(KeyEvent.Unicode)) { - JumpTo(KeyEvent.Unicode); - return true; - } */ - } - else - { - SongMenus[htSongMenus(SongMenu)].HandleInput(ref KeyEvent); - - if (KeyEvent.Handled) - return true; - - switch (KeyEvent.Key) + if (_SearchActive) + ApplyNewSearchFilter(_SearchText + KeyEvent.Unicode); + /* + else if (!Char.IsControl(KeyEvent.Unicode)) + { + JumpTo(KeyEvent.Unicode); + return true; + } */ + } + else { - case Keys.Escape: - if (CSongs.Category < 0 || CConfig.Tabs == EOffOn.TR_CONFIG_OFF) - CGraphics.FadeTo(EScreens.ScreenMain); - break; + SongMenus[htSongMenus(SongMenu)].HandleInput(ref KeyEvent); - case Keys.Enter: - if (CSongs.NumVisibleSongs > 0) - StartSong(SongMenus[htSongMenus(SongMenu)].GetSelectedSong()); - break; + if (KeyEvent.Handled) + return true; - case Keys.Back: - if (_SearchText.Length > 0) - { - ApplyNewSearchFilter(_SearchText.Remove(_SearchText.Length - 1)); - } + switch (KeyEvent.Key) + { + case Keys.Escape: + if (CSongs.Category < 0 || CConfig.Tabs == EOffOn.TR_CONFIG_OFF) + CGraphics.FadeTo(EScreens.ScreenMain); + break; - if (!_SearchActive && CSongs.Category < 0) - CGraphics.FadeTo(EScreens.ScreenMain); + case Keys.Enter: + if (CSongs.NumVisibleSongs > 0) + { + if (SongMenus[htSongMenus(SongMenu)].GetSelectedSong() != -1 && !_SongOptionsActive) + ToggleSongOptions(); + } + break; - break; + case Keys.Back: + if (_SearchText.Length > 0) + { + ApplyNewSearchFilter(_SearchText.Remove(_SearchText.Length - 1)); + } - case Keys.F3: - if (_SearchActive) - { - _SearchActive = false; - _SearchText = String.Empty; - ApplyNewSearchFilter(_SearchText); - } - else - { - _SearchActive = true; - } - break; + if (!_SearchActive && CSongs.Category < 0) + CGraphics.FadeTo(EScreens.ScreenMain); - case Keys.A: - if (!_SearchActive && KeyEvent.Mod == Modifier.None) - { - StartRandomAllSongs(); - } - if (KeyEvent.Mod == Modifier.Ctrl) - { - StartRandomVisibleSongs(); - } - break; + break; - case Keys.F: - if (KeyEvent.Mod == Modifier.Ctrl){ + case Keys.F3: if (_SearchActive) { _SearchActive = false; @@ -132,19 +134,69 @@ namespace Vocaluxe.Screens { _SearchActive = true; } - } - break; + break; - case Keys.R: - if (CSongs.Category != -1 && KeyEvent.Mod == Modifier.Ctrl) + case Keys.A: + if (!_SearchActive && KeyEvent.Mod == Modifier.None) + { + StartRandomAllSongs(); + } + if (KeyEvent.Mod == Modifier.Ctrl) + { + StartRandomVisibleSongs(); + } + break; + + case Keys.F: + if (KeyEvent.Mod == Modifier.Ctrl) + { + if (_SearchActive) + { + _SearchActive = false; + _SearchText = String.Empty; + ApplyNewSearchFilter(_SearchText); + } + else + { + _SearchActive = true; + } + } + break; + + case Keys.R: + if (CSongs.Category != -1 && KeyEvent.Mod == Modifier.Ctrl) + { + SongMenus[htSongMenus(SongMenu)].SetSelectedSong(CSongs.GetRandomSong()); + } + break; + + case Keys.S: + if (CSongs.NumVisibleSongs > 0) + StartMedleySong(SongMenus[htSongMenus(SongMenu)].GetSelectedSong()); + break; + } + } + } + + else + { + switch (KeyEvent.Key) + { + case Keys.Enter: + if (Buttons[htButtons(ButtonOptionsClose)].Selected) + ToggleSongOptions(); + else if (Buttons[htButtons(ButtonOptionsSing)].Selected) { - SongMenus[htSongMenus(SongMenu)].SetSelectedSong(CSongs.GetRandomSong()); + ToggleSongOptions(); + StartSong(SongMenus[htSongMenus(SongMenu)].GetSelectedSong()); } + else if (Buttons[htButtons(ButtonOptionsPlaylist)].Selected) + ToggleSongOptions(); break; - case Keys.S: - if (CSongs.NumVisibleSongs > 0) - StartMedleySong(SongMenus[htSongMenus(SongMenu)].GetSelectedSong()); + case Keys.Escape: + case Keys.Back: + ToggleSongOptions(); break; } } @@ -156,22 +208,55 @@ namespace Vocaluxe.Screens { base.HandleMouse(MouseEvent); - if ((MouseEvent.RB) && (CSongs.Category < 0)) + if (!_SongOptionsActive) { - CGraphics.FadeTo(EScreens.ScreenMain); + + if ((MouseEvent.RB) && (CSongs.Category < 0)) + { + CGraphics.FadeTo(EScreens.ScreenMain); + } + else if (MouseEvent.RB && _SongOptionsActive) + ToggleSongOptions(); + + if (MouseEvent.MB && CSongs.Category != -1) + { + Console.WriteLine("MB pressed"); + SongMenus[htSongMenus(SongMenu)].SetSelectedSong(CSongs.GetRandomSong()); + } + else + SongMenus[htSongMenus(SongMenu)].HandleMouse(ref MouseEvent); + + if (MouseEvent.LB && CSongs.NumVisibleSongs > 0 && SongMenus[htSongMenus(SongMenu)].GetActualSelection() != -1) + { + if (SongMenus[htSongMenus(SongMenu)].GetSelectedSong() != -1 && !_SongOptionsActive) + { + ToggleSongOptions(); + } + } } - if (MouseEvent.MB && CSongs.Category != -1) - { - Console.WriteLine("MB pressed"); - SongMenus[htSongMenus(SongMenu)].SetSelectedSong(CSongs.GetRandomSong()); - } else - SongMenus[htSongMenus(SongMenu)].HandleMouse(ref MouseEvent); - - if (MouseEvent.LB && CSongs.NumVisibleSongs > 0 && SongMenus[htSongMenus(SongMenu)].GetActualSelection() != -1) { - StartSong(SongMenus[htSongMenus(SongMenu)].GetSelectedSong()); + if (MouseEvent.LB && IsMouseOver(MouseEvent)) + { + if (Buttons[htButtons(ButtonOptionsClose)].Selected) + { + ToggleSongOptions(); + } + else if (Buttons[htButtons(ButtonOptionsSing)].Selected) + { + ToggleSongOptions(); + StartSong(SongMenus[htSongMenus(SongMenu)].GetSelectedSong()); + } + else if (Buttons[htButtons(ButtonOptionsPlaylist)].Selected) + { + ToggleSongOptions(); + } + } + if (MouseEvent.RB) + { + ToggleSongOptions(); + } } return true; @@ -230,6 +315,17 @@ namespace Vocaluxe.Screens base.Draw(); SongMenus[htSongMenus(SongMenu)].Draw(); + if (_SongOptionsActive) + { + Statics[htStatics(StaticOptionsBG)].Draw(); + Texts[htTexts(TextOptionsTitle)].Draw(); + SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Draw(); + Buttons[htButtons(ButtonOptionsClose)].Draw(); + Buttons[htButtons(ButtonOptionsSing)].Draw(); + Buttons[htButtons(ButtonOptionsPlaylist)].Draw(); + + } + return true; } @@ -244,10 +340,17 @@ namespace Vocaluxe.Screens { if ((CSongs.Category >= 0) && (SongNr >= 0)) { - if (CSongs.VisibleSongs[SongNr].IsDuet) - CGame.SetGameMode(GameModes.EGameMode.Duet); + if (_AvailableGameModes.Count >= SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection) + { + CGame.SetGameMode(_AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]); + } else - CGame.SetGameMode(GameModes.EGameMode.Normal); + { + if (CSongs.VisibleSongs[SongNr].IsDuet) + CGame.SetGameMode(GameModes.EGameMode.Duet); + else + CGame.SetGameMode(GameModes.EGameMode.Normal); + } CGame.Reset(); CGame.ClearSongs(); @@ -377,5 +480,46 @@ namespace Vocaluxe.Screens SongMenus[htSongMenus(SongMenu)].OnShow(); } + + private void ToggleSongOptions() + { + _SongOptionsActive = !_SongOptionsActive; + if (_SongOptionsActive) + { + SetInteractionToButton(Buttons[htButtons(ButtonOptionsSing)]); + _AvailableGameModes.Clear(); + SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Clear(); + if (!CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) + { + SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(GameModes.EGameMode), GameModes.EGameMode.Normal)); + _AvailableGameModes.Add(GameModes.EGameMode.Normal); + } + if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) + { + SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(GameModes.EGameMode), GameModes.EGameMode.Duet)); + _AvailableGameModes.Add(GameModes.EGameMode.Duet); + } + if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].Medley.Source != EMedleySource.None) + { + SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(GameModes.EGameMode), GameModes.EGameMode.Medley)); + _AvailableGameModes.Add(GameModes.EGameMode.Medley); + } + SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible = true; + Buttons[htButtons(ButtonOptionsClose)].Visible = true; + Buttons[htButtons(ButtonOptionsSing)].Visible = true; + Buttons[htButtons(ButtonOptionsPlaylist)].Visible = true; + Texts[htTexts(TextOptionsTitle)].Visible = true; + Statics[htStatics(StaticOptionsBG)].Visible = true; + } + else + { + SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible = false; + Buttons[htButtons(ButtonOptionsClose)].Visible = false; + Buttons[htButtons(ButtonOptionsSing)].Visible = false; + Buttons[htButtons(ButtonOptionsPlaylist)].Visible = false; + Texts[htTexts(TextOptionsTitle)].Visible = false; + Statics[htStatics(StaticOptionsBG)].Visible = false; + } + } } } From a4f253bf67590bb8430ac3adec616c4b527dd1d5 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sun, 17 Jun 2012 13:37:18 +0200 Subject: [PATCH 07/70] Added short-song-game-mode. Game-Mode-Names are now translated. --- Output/Languages/Deutsch.xml | 1 + Output/Languages/English.xml | 1 + Vocaluxe/Base/CGame.cs | 9 +- Vocaluxe/GameModes/CGameMode.cs | 2 +- Vocaluxe/GameModes/CGameModeDuet.cs | 2 +- Vocaluxe/GameModes/CGameModeMedley.cs | 2 +- Vocaluxe/GameModes/CGameModeNormal.cs | 2 +- Vocaluxe/GameModes/CGameModeShortSong.cs | 30 +++++++ Vocaluxe/GameModes/IGameMode.cs | 7 +- Vocaluxe/Lib/Song/CSong.cs | 88 +++++++++++++++++++ Vocaluxe/Screens/CPopupScreenPlayerControl.cs | 4 +- Vocaluxe/Screens/CScreenHighscore.cs | 6 +- Vocaluxe/Screens/CScreenSong.cs | 24 ++--- Vocaluxe/Vocaluxe.csproj | 1 + 14 files changed, 153 insertions(+), 26 deletions(-) create mode 100644 Vocaluxe/GameModes/CGameModeShortSong.cs diff --git a/Output/Languages/Deutsch.xml b/Output/Languages/Deutsch.xml index e3aac4ae..abae22f4 100644 --- a/Output/Languages/Deutsch.xml +++ b/Output/Languages/Deutsch.xml @@ -23,6 +23,7 @@ Normal Duett Medley + Kurz-Version Vocal Hero Superstar diff --git a/Output/Languages/English.xml b/Output/Languages/English.xml index fb5d72e4..e6a4240f 100644 --- a/Output/Languages/English.xml +++ b/Output/Languages/English.xml @@ -23,6 +23,7 @@ Normal Duet Medley + Short version Vocal Hero Superstar diff --git a/Vocaluxe/Base/CGame.cs b/Vocaluxe/Base/CGame.cs index f0cf4245..54df8b2c 100644 --- a/Vocaluxe/Base/CGame.cs +++ b/Vocaluxe/Base/CGame.cs @@ -112,15 +112,18 @@ namespace Vocaluxe.Base { switch (Mode) { - case EGameMode.Normal: + case EGameMode.TR_GAMEMODE_NORMAL: _GameMode = new CGameModeNormal(); break; - case EGameMode.Medley: + case EGameMode.TR_GAMEMODE_MEDLEY: _GameMode = new CGameModeMedley(); break; - case EGameMode.Duet: + case EGameMode.TR_GAMEMODE_DUET: _GameMode = new CGameModeDuet(); break; + case EGameMode.TR_GAMEMODE_SHORTSONG: + _GameMode = new CGameModeShortSong(); + break; default: break; } diff --git a/Vocaluxe/GameModes/CGameMode.cs b/Vocaluxe/GameModes/CGameMode.cs index b1dede96..2e1fbd2d 100644 --- a/Vocaluxe/GameModes/CGameMode.cs +++ b/Vocaluxe/GameModes/CGameMode.cs @@ -202,7 +202,7 @@ namespace Vocaluxe.GameModes { if (_ActualSong > -1) { - _Points.SetPoints(_ActualSong, _Songs[_ActualSong].ID, Player, _GameMode == EGameMode.Medley, _GameMode == EGameMode.Duet); + _Points.SetPoints(_ActualSong, _Songs[_ActualSong].ID, Player, _GameMode == EGameMode.TR_GAMEMODE_MEDLEY, _GameMode == EGameMode.TR_GAMEMODE_DUET); } _ActualSong++; } diff --git a/Vocaluxe/GameModes/CGameModeDuet.cs b/Vocaluxe/GameModes/CGameModeDuet.cs index cf105151..09f64b95 100644 --- a/Vocaluxe/GameModes/CGameModeDuet.cs +++ b/Vocaluxe/GameModes/CGameModeDuet.cs @@ -10,7 +10,7 @@ namespace Vocaluxe.GameModes { base.Init(); - _GameMode = EGameMode.Duet; + _GameMode = EGameMode.TR_GAMEMODE_DUET; _Initialized = true; } } diff --git a/Vocaluxe/GameModes/CGameModeMedley.cs b/Vocaluxe/GameModes/CGameModeMedley.cs index 7b22f145..7257e86a 100644 --- a/Vocaluxe/GameModes/CGameModeMedley.cs +++ b/Vocaluxe/GameModes/CGameModeMedley.cs @@ -13,7 +13,7 @@ namespace Vocaluxe.GameModes { base.Init(); - _GameMode = EGameMode.Medley; + _GameMode = EGameMode.TR_GAMEMODE_MEDLEY; _Initialized = true; } diff --git a/Vocaluxe/GameModes/CGameModeNormal.cs b/Vocaluxe/GameModes/CGameModeNormal.cs index 6a27341b..008d55cc 100644 --- a/Vocaluxe/GameModes/CGameModeNormal.cs +++ b/Vocaluxe/GameModes/CGameModeNormal.cs @@ -10,7 +10,7 @@ namespace Vocaluxe.GameModes { base.Init(); - _GameMode = EGameMode.Normal; + _GameMode = EGameMode.TR_GAMEMODE_NORMAL; _Initialized = true; } } diff --git a/Vocaluxe/GameModes/CGameModeShortSong.cs b/Vocaluxe/GameModes/CGameModeShortSong.cs new file mode 100644 index 00000000..18027a52 --- /dev/null +++ b/Vocaluxe/GameModes/CGameModeShortSong.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Text; + +using Vocaluxe.Base; +using Vocaluxe.Lib.Song; + +namespace Vocaluxe.GameModes +{ + class CGameModeShortSong : CGameMode + { + public override void Init() + { + base.Init(); + + _GameMode = EGameMode.TR_GAMEMODE_SHORTSONG; + _Initialized = true; + } + + protected override void SongManipulation(int SongIndex) + { + CSong song = _Songs[SongIndex]; + + song.Finish = CGame.GetTimeFromBeats(song.ShortEnd, song.BPM) + CSettings.DefaultMedleyFadeOutTime + song.Gap; + + // set lines to medley mode + song.Notes.SetMedley(song.Notes.GetLines(0).Line[0].FirstNoteBeat, song.ShortEnd); + } + } +} diff --git a/Vocaluxe/GameModes/IGameMode.cs b/Vocaluxe/GameModes/IGameMode.cs index e7d69afb..3daba3a2 100644 --- a/Vocaluxe/GameModes/IGameMode.cs +++ b/Vocaluxe/GameModes/IGameMode.cs @@ -9,9 +9,10 @@ namespace Vocaluxe.GameModes { public enum EGameMode { - Normal, - Medley, - Duet + TR_GAMEMODE_NORMAL, + TR_GAMEMODE_MEDLEY, + TR_GAMEMODE_DUET, + TR_GAMEMODE_SHORTSONG } interface IGameMode diff --git a/Vocaluxe/Lib/Song/CSong.cs b/Vocaluxe/Lib/Song/CSong.cs index e906c285..bd8a8df5 100644 --- a/Vocaluxe/Lib/Song/CSong.cs +++ b/Vocaluxe/Lib/Song/CSong.cs @@ -59,6 +59,8 @@ namespace Vocaluxe.Lib.Song public bool CalculateMedley = true; public float PreviewStart = 0f; + public int ShortEnd = 0; + public Encoding Encoding = Encoding.Default; public string Folder = String.Empty; public string FolderName = String.Empty; @@ -161,6 +163,8 @@ namespace Vocaluxe.Lib.Song this.CalculateMedley = song.CalculateMedley; this.PreviewStart = song.PreviewStart; + this.ShortEnd = song.ShortEnd; + this.Encoding = song.Encoding; this.Folder = song.Folder; this.FolderName = song.FolderName; @@ -652,6 +656,7 @@ namespace Vocaluxe.Lib.Song return false; } FindRefrain(); + FindShortEnd(); _NotesLoaded = true; return true; @@ -836,5 +841,88 @@ namespace Vocaluxe.Lib.Song this.PreviewStart = CGame.GetTimeFromBeats(this.Medley.StartBeat, this.BPM); } } + + private void FindShortEnd(){ + CLines lines = this.Notes.GetLines(0); + + if (lines.LineCount == 0) + return; + + // build sentences list + List sentences = new List(); + foreach (CLine line in lines.Line) + { + if (line.Points != 0) + sentences.Add(line.Lyrics); + else + sentences.Add(String.Empty); + } + + // find equal sentences series + List series = new List(); + for (int i = 0; i < lines.LineCount - 1; i++) + { + for (int j = i + 1; j < lines.LineCount; j++) + { + if (sentences[i] == sentences[j] && sentences[i] != String.Empty) + { + Series tempSeries = new Series(); + tempSeries.start = i; + tempSeries.end = i; + + int max = 0; + if (j + j - i - 1 > lines.LineCount - 1) + max = lines.LineCount - 1 - j; + else + max = j - i - 1; + + for (int k = 1; k <= max; k++) + { + if (sentences[i + k] == sentences[j + k] && sentences[i + k] != String.Empty) + tempSeries.end = i + k; + else + break; + } + + tempSeries.length = tempSeries.end - tempSeries.start + 1; + series.Add(tempSeries); + } + } + } + + //Calculate length of singing + int stop = (lines.Line[lines.Line.Length - 1].LastNoteBeat - lines.Line[0].FirstNoteBeat) / 2; + + //Check if stop is in series + for (int i = 0; i < series.Count; i++) + { + if (lines.Line[series[i].start].FirstNoteBeat < stop && lines.Line[series[i].end].LastNoteBeat > stop) + { + if (stop < (lines.Line[series[i].start].FirstNoteBeat + ((lines.Line[series[i].end].LastNoteBeat - lines.Line[series[i].start].FirstNoteBeat) / 2))) + { + this.ShortEnd = lines.Line[series[i].start-1].LastNote.EndBeat; + return; + } + else + { + this.ShortEnd = lines.Line[series[i].end].LastNote.EndBeat; + return; + } + } + } + + //Check if stop is in line + for (int i = 0; i < lines.Line.Length; i++) + { + if (lines.Line[i].FirstNoteBeat < stop && lines.Line[i].LastNoteBeat > stop) + { + this.ShortEnd = lines.Line[i].LastNoteBeat; + return; + } + } + + ShortEnd = stop; + + } } } diff --git a/Vocaluxe/Screens/CPopupScreenPlayerControl.cs b/Vocaluxe/Screens/CPopupScreenPlayerControl.cs index 85e1467d..cb21d9d4 100644 --- a/Vocaluxe/Screens/CPopupScreenPlayerControl.cs +++ b/Vocaluxe/Screens/CPopupScreenPlayerControl.cs @@ -214,9 +214,9 @@ namespace Vocaluxe.Screens if (SongNr >= 0 && CSongs.SongsLoaded) { if (Duet) - CGame.SetGameMode(GameModes.EGameMode.Duet); + CGame.SetGameMode(GameModes.EGameMode.TR_GAMEMODE_DUET); else - CGame.SetGameMode(GameModes.EGameMode.Normal); + CGame.SetGameMode(GameModes.EGameMode.TR_GAMEMODE_NORMAL); CGame.Reset(); CGame.ClearSongs(); diff --git a/Vocaluxe/Screens/CScreenHighscore.cs b/Vocaluxe/Screens/CScreenHighscore.cs index 6f499513..78c199fd 100644 --- a/Vocaluxe/Screens/CScreenHighscore.cs +++ b/Vocaluxe/Screens/CScreenHighscore.cs @@ -250,15 +250,15 @@ namespace Vocaluxe.Screens switch (CGame.GameMode) { - case EGameMode.Normal: + case EGameMode.TR_GAMEMODE_NORMAL: Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_NORMAL"; break; - case EGameMode.Medley: + case EGameMode.TR_GAMEMODE_MEDLEY: Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_MEDLEY"; break; - case EGameMode.Duet: + case EGameMode.TR_GAMEMODE_DUET: Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_DUET"; _IsDuet = true; break; diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index d8035d7a..4c5427d2 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -347,9 +347,9 @@ namespace Vocaluxe.Screens else { if (CSongs.VisibleSongs[SongNr].IsDuet) - CGame.SetGameMode(GameModes.EGameMode.Duet); + CGame.SetGameMode(GameModes.EGameMode.TR_GAMEMODE_DUET); else - CGame.SetGameMode(GameModes.EGameMode.Normal); + CGame.SetGameMode(GameModes.EGameMode.TR_GAMEMODE_NORMAL); } CGame.Reset(); @@ -366,7 +366,7 @@ namespace Vocaluxe.Screens if ((CSongs.Category >= 0) && (SongNr >= 0)) { if (CSongs.VisibleSongs[SongNr].Medley.Source != EMedleySource.None) - CGame.SetGameMode(GameModes.EGameMode.Medley); + CGame.SetGameMode(GameModes.EGameMode.TR_GAMEMODE_MEDLEY); else return; @@ -382,7 +382,7 @@ namespace Vocaluxe.Screens { CGame.Reset(); CGame.ClearSongs(); - CGame.SetGameMode(GameModes.EGameMode.Normal); + CGame.SetGameMode(GameModes.EGameMode.TR_GAMEMODE_NORMAL); List IDs = new List(); for (int i = 0; i < CSongs.AllSongs.Length; i++) @@ -409,7 +409,7 @@ namespace Vocaluxe.Screens { CGame.Reset(); CGame.ClearSongs(); - CGame.SetGameMode(GameModes.EGameMode.Normal); + CGame.SetGameMode(GameModes.EGameMode.TR_GAMEMODE_NORMAL); List IDs = new List(); for (int i = 0; i < CSongs.VisibleSongs.Length; i++) @@ -491,18 +491,20 @@ namespace Vocaluxe.Screens SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Clear(); if (!CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) { - SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(GameModes.EGameMode), GameModes.EGameMode.Normal)); - _AvailableGameModes.Add(GameModes.EGameMode.Normal); + SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(GameModes.EGameMode), GameModes.EGameMode.TR_GAMEMODE_NORMAL)); + _AvailableGameModes.Add(GameModes.EGameMode.TR_GAMEMODE_NORMAL); + SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(GameModes.EGameMode), GameModes.EGameMode.TR_GAMEMODE_SHORTSONG)); + _AvailableGameModes.Add(GameModes.EGameMode.TR_GAMEMODE_SHORTSONG); } if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) { - SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(GameModes.EGameMode), GameModes.EGameMode.Duet)); - _AvailableGameModes.Add(GameModes.EGameMode.Duet); + SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(GameModes.EGameMode), GameModes.EGameMode.TR_GAMEMODE_DUET)); + _AvailableGameModes.Add(GameModes.EGameMode.TR_GAMEMODE_DUET); } if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].Medley.Source != EMedleySource.None) { - SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(GameModes.EGameMode), GameModes.EGameMode.Medley)); - _AvailableGameModes.Add(GameModes.EGameMode.Medley); + SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(GameModes.EGameMode), GameModes.EGameMode.TR_GAMEMODE_MEDLEY)); + _AvailableGameModes.Add(GameModes.EGameMode.TR_GAMEMODE_MEDLEY); } SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible = true; Buttons[htButtons(ButtonOptionsClose)].Visible = true; diff --git a/Vocaluxe/Vocaluxe.csproj b/Vocaluxe/Vocaluxe.csproj index e8282b61..7dfc6eea 100644 --- a/Vocaluxe/Vocaluxe.csproj +++ b/Vocaluxe/Vocaluxe.csproj @@ -135,6 +135,7 @@ + Form From 6d07fefffc4c68c95490721db0be26b9278a164c Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sun, 17 Jun 2012 13:47:05 +0200 Subject: [PATCH 08/70] Forget to update CScreenHighscore.cs --- Vocaluxe/Screens/CScreenHighscore.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Vocaluxe/Screens/CScreenHighscore.cs b/Vocaluxe/Screens/CScreenHighscore.cs index 78c199fd..39882a0a 100644 --- a/Vocaluxe/Screens/CScreenHighscore.cs +++ b/Vocaluxe/Screens/CScreenHighscore.cs @@ -263,6 +263,10 @@ namespace Vocaluxe.Screens _IsDuet = true; break; + case EGameMode.TR_GAMEMODE_SHORTSONG: + Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_SHORTSONG"; + break; + default: Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_NORMAL"; break; From d3cb14d51ae097510d321cbf86aa381bdc006962 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sun, 17 Jun 2012 16:34:30 +0200 Subject: [PATCH 09/70] Added switch to small view (not ready yet) --- Output/Themes/Ambient/Screens/ScreenSong.xml | 12 +++- Vocaluxe/Menu/SongMenu/CSongMenu.cs | 10 +++ Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs | 44 +++++++++++++ Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs | 68 ++++++++++++++++++++ Vocaluxe/Menu/SongMenu/ISongMenu.cs | 3 + Vocaluxe/Screens/CScreenSong.cs | 14 +--- 6 files changed, 137 insertions(+), 14 deletions(-) diff --git a/Output/Themes/Ambient/Screens/ScreenSong.xml b/Output/Themes/Ambient/Screens/ScreenSong.xml index fc3e511a..dbfcc8c4 100644 --- a/Output/Themes/Ambient/Screens/ScreenSong.xml +++ b/Output/Themes/Ambient/Screens/ScreenSong.xml @@ -47,7 +47,7 @@ 1 1 1 - 0.3 + 1 @@ -455,6 +455,10 @@ 6 4 + + 4 + + 4 10,00 @@ -465,6 +469,12 @@ -1,00 830 550 + + 410 + 40 + -1,00 + 550 + 550 222 diff --git a/Vocaluxe/Menu/SongMenu/CSongMenu.cs b/Vocaluxe/Menu/SongMenu/CSongMenu.cs index b37e1e04..57ef11b6 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenu.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenu.cs @@ -118,6 +118,16 @@ namespace Vocaluxe.Menu.SongMenu return _SongMenu.GetRect(); } + public bool IsSmallView() + { + return _SongMenu.IsSmallView(); + } + + public void SetSmallView(bool SmallView) + { + _SongMenu.SetSmallView(SmallView); + } + #endregion ISongMenu #region IMenuElement diff --git a/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs b/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs index 3be1a0f1..e4730e8e 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs @@ -55,6 +55,16 @@ namespace Vocaluxe.Menu.SongMenu /// public int numH; + /// + /// Number of tiles horizontal in small-modus + /// + public int numWsmall; + + /// + /// Number of tiles vertical in small-modus + /// + public int numHsmall; + /// /// Space between tiles horizontal /// @@ -66,6 +76,7 @@ namespace Vocaluxe.Menu.SongMenu public float spaceH; public SRectF TileRect; + public SRectF TileRectSmall; public CText TextArtist; public CText TextTitle; @@ -272,6 +283,9 @@ namespace Vocaluxe.Menu.SongMenu _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/SongMenuTileBoard/SpaceW", navigator, ref _Theme.songMenuTileBoard.spaceW); _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/SongMenuTileBoard/SpaceH", navigator, ref _Theme.songMenuTileBoard.spaceH); + _ThemeLoaded &= CHelper.TryGetIntValueFromXML(item + "/SongMenuTileBoard/NumWsmall", navigator, ref _Theme.songMenuTileBoard.numWsmall); + _ThemeLoaded &= CHelper.TryGetIntValueFromXML(item + "/SongMenuTileBoard/NumHsmall", navigator, ref _Theme.songMenuTileBoard.numHsmall); + _ThemeLoaded &= _Theme.songMenuTileBoard.TextArtist.LoadTheme(item + "/SongMenuTileBoard", "TextArtist", navigator, SkinIndex); _ThemeLoaded &= _Theme.songMenuTileBoard.TextTitle.LoadTheme(item + "/SongMenuTileBoard", "TextTitle", navigator, SkinIndex); _ThemeLoaded &= _Theme.songMenuTileBoard.TextSongLength.LoadTheme(item + "/SongMenuTileBoard", "TextSongLength", navigator, SkinIndex); @@ -289,6 +303,12 @@ namespace Vocaluxe.Menu.SongMenu _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/SongMenuTileBoard/TileRectW", navigator, ref _Theme.songMenuTileBoard.TileRect.W); _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/SongMenuTileBoard/TileRectH", navigator, ref _Theme.songMenuTileBoard.TileRect.H); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/SongMenuTileBoard/TileRectSmallX", navigator, ref _Theme.songMenuTileBoard.TileRectSmall.X); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/SongMenuTileBoard/TileRectSmallY", navigator, ref _Theme.songMenuTileBoard.TileRectSmall.Y); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/SongMenuTileBoard/TileRectSmallZ", navigator, ref _Theme.songMenuTileBoard.TileRectSmall.Z); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/SongMenuTileBoard/TileRectSmallW", navigator, ref _Theme.songMenuTileBoard.TileRectSmall.W); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/SongMenuTileBoard/TileRectSmallH", navigator, ref _Theme.songMenuTileBoard.TileRectSmall.H); + #endregion SongMenuTileBoard if (_ThemeLoaded) @@ -362,6 +382,12 @@ namespace Vocaluxe.Menu.SongMenu writer.WriteComment(": Space between tiles vertical"); writer.WriteElementString("SpaceH", _Theme.songMenuTileBoard.spaceH.ToString("#0.00")); + writer.WriteComment(": Number of tiles horizontal in small-mode"); + writer.WriteElementString("NumW", _Theme.songMenuTileBoard.numW.ToString()); + + writer.WriteComment(": Number of tiles vertical in small-mode"); + writer.WriteElementString("NumH", _Theme.songMenuTileBoard.numH.ToString()); + writer.WriteComment(", , , , : SongMenu position, width and height"); writer.WriteElementString("TileRectX", _Theme.songMenuTileBoard.TileRect.X.ToString("#0")); writer.WriteElementString("TileRectY", _Theme.songMenuTileBoard.TileRect.Y.ToString("#0")); @@ -369,6 +395,13 @@ namespace Vocaluxe.Menu.SongMenu writer.WriteElementString("TileRectW", _Theme.songMenuTileBoard.TileRect.W.ToString("#0")); writer.WriteElementString("TileRectH", _Theme.songMenuTileBoard.TileRect.H.ToString("#0")); + writer.WriteComment(", , , , : SongMenu position, width and height in small-mode"); + writer.WriteElementString("TileRectSmallX", _Theme.songMenuTileBoard.TileRectSmall.X.ToString("#0")); + writer.WriteElementString("TileRectSmallY", _Theme.songMenuTileBoard.TileRectSmall.Y.ToString("#0")); + writer.WriteElementString("TileRectSmallZ", _Theme.songMenuTileBoard.TileRectSmall.Z.ToString("#0.00")); + writer.WriteElementString("TileRectSmallW", _Theme.songMenuTileBoard.TileRectSmall.W.ToString("#0")); + writer.WriteElementString("TileRectSmallH", _Theme.songMenuTileBoard.TileRectSmall.H.ToString("#0")); + _Theme.songMenuTileBoard.TextArtist.SaveTheme(writer); _Theme.songMenuTileBoard.TextTitle.SaveTheme(writer); _Theme.songMenuTileBoard.TextSongLength.SaveTheme(writer); @@ -499,6 +532,17 @@ namespace Vocaluxe.Menu.SongMenu return; } + public virtual void SetSmallView(bool SmallView) + { + if (!_Initialized) + return; + } + + public virtual bool IsSmallView() + { + return false; + } + public virtual void UnloadTextures() { } diff --git a/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs b/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs index 6e20dc51..71ccf54b 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs @@ -40,6 +40,8 @@ namespace Vocaluxe.Menu.SongMenu private int _Offset = 0; private int _actualSelection = -1; + private bool _SmallView = false; + public override int GetActualSelection() { return _actualSelection; @@ -650,6 +652,72 @@ namespace Vocaluxe.Menu.SongMenu _Offset = offset; } + public override void SetSmallView(bool SmallView) + { + base.SetSmallView(SmallView); + + _SmallView = SmallView; + + if (_SmallView) + { + _NumH = _Theme.songMenuTileBoard.numHsmall; + _NumW = _Theme.songMenuTileBoard.numWsmall; + + _TileW = (int)((_Theme.songMenuTileBoard.TileRectSmall.W - _SpaceW * (_NumW - 1)) / _NumW); + _TileH = (int)((_Theme.songMenuTileBoard.TileRectSmall.H - _SpaceH * (_NumH - 1)) / _NumH); + + _CoverTexture = CTheme.GetSkinTexture(_Theme.CoverBackgroundName); + _CoverBigTexture = CTheme.GetSkinTexture(_Theme.CoverBigBackgroundName); + + _Tiles = new List(); + for (int i = 0; i < _NumH; i++) + { + for (int j = 0; j < _NumW; j++) + { + SRectF rect = new SRectF(_Theme.songMenuTileBoard.TileRectSmall.X + j * (_TileW + _SpaceW), + _Theme.songMenuTileBoard.TileRectSmall.Y + i * (_TileH + _SpaceH), _TileW, _TileH, _Rect.Z); + CStatic tile = new CStatic(_CoverTexture, Color, rect); + _Tiles.Add(tile); + } + } + + _ScrollRect = new SRectF(0, 0, CSettings.iRenderW, CSettings.iRenderH, _Theme.songMenuTileBoard.TileRectSmall.Z); + } + else + { + _NumH = _Theme.songMenuTileBoard.numH; + _NumW = _Theme.songMenuTileBoard.numW; + + _TileW = (int)((_Theme.songMenuTileBoard.TileRect.W - _SpaceW * (_NumW - 1)) / _NumW); + _TileH = (int)((_Theme.songMenuTileBoard.TileRect.H - _SpaceH * (_NumH - 1)) / _NumH); + + _CoverTexture = CTheme.GetSkinTexture(_Theme.CoverBackgroundName); + _CoverBigTexture = CTheme.GetSkinTexture(_Theme.CoverBigBackgroundName); + + _Tiles = new List(); + for (int i = 0; i < _NumH; i++) + { + for (int j = 0; j < _NumW; j++) + { + SRectF rect = new SRectF(_Theme.songMenuTileBoard.TileRect.X + j * (_TileW + _SpaceW), + _Theme.songMenuTileBoard.TileRect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, _Rect.Z); + CStatic tile = new CStatic(_CoverTexture, Color, rect); + _Tiles.Add(tile); + } + } + + _ScrollRect = new SRectF(0, 0, CSettings.iRenderW, CSettings.iRenderH, _Theme.songMenuTileBoard.TileRect.Z); + } + + UpdateList(_Offset); + + } + + public override bool IsSmallView() + { + return _SmallView; + } + public override void LoadTextures() { base.LoadTextures(); diff --git a/Vocaluxe/Menu/SongMenu/ISongMenu.cs b/Vocaluxe/Menu/SongMenu/ISongMenu.cs index 7118f8ca..a7e20542 100644 --- a/Vocaluxe/Menu/SongMenu/ISongMenu.cs +++ b/Vocaluxe/Menu/SongMenu/ISongMenu.cs @@ -29,6 +29,9 @@ namespace Vocaluxe.Menu.SongMenu bool IsVisible(); void SetVisible(bool Visible); + bool IsSmallView(); + void SetSmallView(bool SmallView); + SRectF GetRect(); } } diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 9982eb70..a3edd9c9 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -250,7 +250,7 @@ namespace Vocaluxe.Screens } else if (Buttons[htButtons(ButtonOptionsPlaylist)].Selected) { - ToggleSongOptions(); + SongMenus[htSongMenus(SongMenu)].SetSmallView(true); } } if (MouseEvent.RB) @@ -313,18 +313,6 @@ namespace Vocaluxe.Screens public override bool Draw() { base.Draw(); - - if (_SongOptionsActive) - { - Statics[htStatics(StaticOptionsBG)].Draw(); - Texts[htTexts(TextOptionsTitle)].Draw(); - SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Draw(); - Buttons[htButtons(ButtonOptionsClose)].Draw(); - Buttons[htButtons(ButtonOptionsSing)].Draw(); - Buttons[htButtons(ButtonOptionsPlaylist)].Draw(); - - } - return true; } From 8ef112f6b65c5786d3a78b2d46c8e4302df2302d Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sun, 17 Jun 2012 18:00:29 +0200 Subject: [PATCH 10/70] Could sing a medley or short-song now. --- Vocaluxe/GameModes/CGameMode.cs | 26 +++++++++++++++++- Vocaluxe/GameModes/CGameModeDuet.cs | 16 ----------- Vocaluxe/GameModes/CGameModeMedley.cs | 34 ------------------------ Vocaluxe/GameModes/CGameModeShortSong.cs | 29 -------------------- 4 files changed, 25 insertions(+), 80 deletions(-) delete mode 100644 Vocaluxe/GameModes/CGameModeDuet.cs delete mode 100644 Vocaluxe/GameModes/CGameModeMedley.cs delete mode 100644 Vocaluxe/GameModes/CGameModeShortSong.cs diff --git a/Vocaluxe/GameModes/CGameMode.cs b/Vocaluxe/GameModes/CGameMode.cs index 8af3ffbb..3c45aabf 100644 --- a/Vocaluxe/GameModes/CGameMode.cs +++ b/Vocaluxe/GameModes/CGameMode.cs @@ -243,7 +243,31 @@ namespace Vocaluxe.GameModes { if (_CurrentSong >= 0 && _CurrentSong < _SongQueque.Count) { - return CSongs.GetSong(_SongQueque[_CurrentSong].SongID); + CSong song = CSongs.GetSong(_SongQueque[_CurrentSong].SongID); + + switch (GetCurrentGameMode()) + { + case EGameMode.TR_GAMEMODE_MEDLEY: + // set medley mode timings + song.Start = CGame.GetTimeFromBeats(song.Medley.StartBeat, song.BPM) - song.Medley.FadeInTime + song.Gap; + if (song.Start < 0f) + song.Start = 0f; + + song.Finish = CGame.GetTimeFromBeats(song.Medley.EndBeat, song.BPM) + song.Medley.FadeOutTime + song.Gap; + + // set lines to medley mode + song.Notes.SetMedley(song.Medley.StartBeat, song.Medley.EndBeat); + break; + + case EGameMode.TR_GAMEMODE_SHORTSONG: + song.Finish = CGame.GetTimeFromBeats(song.ShortEnd, song.BPM) + CSettings.DefaultMedleyFadeOutTime + song.Gap; + + // set lines to medley mode + song.Notes.SetMedley(song.Notes.GetLines(0).Line[0].FirstNoteBeat, song.ShortEnd); + break; + } + + return song; } return null; } diff --git a/Vocaluxe/GameModes/CGameModeDuet.cs b/Vocaluxe/GameModes/CGameModeDuet.cs deleted file mode 100644 index 70aa39c1..00000000 --- a/Vocaluxe/GameModes/CGameModeDuet.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Vocaluxe.GameModes -{ - class CGameModeDuet : CGameMode - { - public override void Init() - { - base.Init(); - - _Initialized = true; - } - } -} diff --git a/Vocaluxe/GameModes/CGameModeMedley.cs b/Vocaluxe/GameModes/CGameModeMedley.cs deleted file mode 100644 index f0fca4f5..00000000 --- a/Vocaluxe/GameModes/CGameModeMedley.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -using Vocaluxe.Base; -using Vocaluxe.Lib.Song; - -namespace Vocaluxe.GameModes -{ - class CGameModeMedley : CGameMode - { - public override void Init() - { - base.Init(); - - _Initialized = true; - } - - protected override void SongManipulation(int SongIndex) - { - CSong song = CSongs.AllSongs[_SongQueque[SongIndex].SongID]; - - // set medley mode timings - song.Start = CGame.GetTimeFromBeats(song.Medley.StartBeat, song.BPM) - song.Medley.FadeInTime + song.Gap; - if (song.Start < 0f) - song.Start = 0f; - - song.Finish = CGame.GetTimeFromBeats(song.Medley.EndBeat, song.BPM) + song.Medley.FadeOutTime + song.Gap; - - // set lines to medley mode - song.Notes.SetMedley(song.Medley.StartBeat, song.Medley.EndBeat); - } - } -} diff --git a/Vocaluxe/GameModes/CGameModeShortSong.cs b/Vocaluxe/GameModes/CGameModeShortSong.cs deleted file mode 100644 index 4bff1e4c..00000000 --- a/Vocaluxe/GameModes/CGameModeShortSong.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -using Vocaluxe.Base; -using Vocaluxe.Lib.Song; - -namespace Vocaluxe.GameModes -{ - class CGameModeShortSong : CGameMode - { - public override void Init() - { - base.Init(); - - _Initialized = true; - } - - protected override void SongManipulation(int SongIndex) - { - CSong song = CSongs.AllSongs[_SongQueque[SongIndex].SongID]; - - song.Finish = CGame.GetTimeFromBeats(song.ShortEnd, song.BPM) + CSettings.DefaultMedleyFadeOutTime + song.Gap; - - // set lines to medley mode - song.Notes.SetMedley(song.Notes.GetLines(0).Line[0].FirstNoteBeat, song.ShortEnd); - } - } -} From 6202c67156596482f5b4758d529b1f79b95a4fbf Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Mon, 18 Jun 2012 17:28:21 +0200 Subject: [PATCH 11/70] Added first basic playlist-format. --- Output/Playlists/Test.xml | 23 +++ Vocaluxe/Base/CGame.cs | 2 + Vocaluxe/Base/CPlaylists.cs | 261 ++++++++++++++++++++++++++++++++ Vocaluxe/Base/CSettings.cs | 1 + Vocaluxe/GameModes/CGameMode.cs | 8 +- Vocaluxe/Screens/CScreenLoad.cs | 5 + Vocaluxe/Vocaluxe.csproj | 10 +- 7 files changed, 302 insertions(+), 8 deletions(-) create mode 100644 Output/Playlists/Test.xml create mode 100644 Vocaluxe/Base/CPlaylists.cs diff --git a/Output/Playlists/Test.xml b/Output/Playlists/Test.xml new file mode 100644 index 00000000..8e5b1b98 --- /dev/null +++ b/Output/Playlists/Test.xml @@ -0,0 +1,23 @@ + + + + Test + + + + 2raumwohnung + 36 grad + TR_GAMEMODE_NORMAL + + + Aura Dione + Geronimo + TR_GAMEMODE_SHORTSONG + + + Die Toten Hosen + Tage wie diese + TR_GAMEMODE_MEDLEY + + + \ No newline at end of file diff --git a/Vocaluxe/Base/CGame.cs b/Vocaluxe/Base/CGame.cs index f73ad6a8..d07275a7 100644 --- a/Vocaluxe/Base/CGame.cs +++ b/Vocaluxe/Base/CGame.cs @@ -27,6 +27,7 @@ namespace Vocaluxe.Base public int SongID; public bool Medley; public bool Duet; + public bool ShortSong; public long DateTicks; public bool SongFinished; } @@ -214,6 +215,7 @@ namespace Vocaluxe.Base _Player[i].SongID = -1; _Player[i].Medley = false; _Player[i].Duet = false; + _Player[i].ShortSong = false; _Player[i].DateTicks = DateTime.Now.Ticks; _Player[i].SongFinished = false; } diff --git a/Vocaluxe/Base/CPlaylists.cs b/Vocaluxe/Base/CPlaylists.cs new file mode 100644 index 00000000..563bcc2b --- /dev/null +++ b/Vocaluxe/Base/CPlaylists.cs @@ -0,0 +1,261 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Xml; +using System.Xml.XPath; + +using Vocaluxe.Lib.Song; + +namespace Vocaluxe.Base +{ + class CPlaylistSong + { + public int SongID; + public GameModes.EGameMode gm; + + public CPlaylistSong(int SongID, GameModes.EGameMode gm) + { + this.SongID = SongID; + this.gm = gm; + } + + public CPlaylistSong() + { + gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; + } + } + + struct SPlaylist + { + public string PlaylistName; + public string PlaylistFile; + public List Songs; + } + + static class CPlaylists + { + private static XmlWriterSettings _settings = new XmlWriterSettings(); + private static CHelper Helper = new CHelper(); + private static List _Playlists; + + public static SPlaylist[] Playlists + { + get { return _Playlists.ToArray(); } + } + + public static int NumPlaylists + { + get { return _Playlists.Count; } + } + + public static void Init() + { + _settings.Indent = true; + _settings.Encoding = System.Text.Encoding.UTF8; + _settings.ConformanceLevel = ConformanceLevel.Document; + + LoadPlaylists(); + } + + public static void LoadPlaylists() + { + _Playlists = new List(); + List files = new List(); + files.AddRange(Helper.ListFiles(CSettings.sFolderPlaylists, "*.xml", true, true)); + + foreach (string file in files) + { + LoadPlaylist(file); + } + + SortPlaylistsByName(); + } + + public static void DeletePlaylist(int PlaylistID) + { + if (PlaylistID < 0 || PlaylistID >= _Playlists.Count) + return; + if (_Playlists[PlaylistID].PlaylistFile != String.Empty) + { + try + { + File.Delete(_Playlists[PlaylistID].PlaylistFile); + _Playlists.RemoveAt(PlaylistID); + } + catch (Exception) + { + CLog.LogError("Can't delete Profile File " + _Playlists[PlaylistID].PlaylistFile + ".xml"); + } + } + } + + #region private methods + + private static void SortPlaylistsByName() + { + _Playlists.Sort(CompareByPlaylistName); + } + + private static int CompareByPlaylistName(SPlaylist a, SPlaylist b) + { + return String.Compare(a.PlaylistName, b.PlaylistName); + } + + private static void SavePlaylist(int PlaylistID) + { + if (PlaylistID < 0 || PlaylistID >= _Playlists.Count) + return; + + string filename = string.Empty; + foreach (char chr in _Playlists[PlaylistID].PlaylistName) + { + if (char.IsLetter(chr)) + filename += chr.ToString(); + } + + if (filename == String.Empty) + filename = "1"; + + int i = 0; + while (File.Exists(Path.Combine(CSettings.sFolderPlaylists, filename + ".xml"))) + { + i++; + if (!File.Exists(Path.Combine(CSettings.sFolderPlaylists, filename + i + ".xml"))) + { + filename += i; + } + } + + SPlaylist playlist = _Playlists[PlaylistID]; + playlist.PlaylistFile = Path.Combine(CSettings.sFolderPlaylists, filename + ".xml"); + _Playlists[PlaylistID] = playlist; + + XmlWriter writer; + try + { + writer = XmlWriter.Create(_Playlists[PlaylistID].PlaylistFile, _settings); + } + catch (Exception e) + { + CLog.LogError("Error creating/opening Playlist File " + _Playlists[PlaylistID].PlaylistFile + ": " + e.Message); + return; + } + + if (writer == null) + { + CLog.LogError("Error creating/opening Playlist File " + _Playlists[PlaylistID].PlaylistFile); + return; + } + + writer.WriteStartDocument(); + writer.WriteStartElement("root"); + + writer.WriteStartElement("Info"); + writer.WriteElementString("PlaylistName", _Playlists[PlaylistID].PlaylistName); + writer.WriteEndElement(); + + writer.WriteStartElement("Songs"); + for (i = 0; i < playlist.Songs.Count; i++) + { + CSong[] songs = CSongs.AllSongs; + CSong song = new CSong(); + for (int s = 0; i <= songs.Length; s++) + { + if (songs[s].ID == playlist.Songs[i].SongID) + { + song = songs[s]; + break; + } + } + writer.WriteStartElement("Song" + (i+1).ToString()); + writer.WriteElementString("Artist", song.Artist); + writer.WriteElementString("Title", song.Title); + writer.WriteElementString("GameMode", Enum.GetName(typeof(GameModes.EGameMode), playlist.Songs[i].gm)); + writer.WriteEndElement(); + } + writer.WriteEndElement(); + + writer.WriteEndElement(); //end of root + writer.WriteEndDocument(); + + writer.Flush(); + writer.Close(); + } + + private static void LoadPlaylist(string FileName) + { + bool loaded = false; + XPathDocument xPathDoc = null; + XPathNavigator navigator = null; + + SPlaylist playlist = new SPlaylist(); + playlist.PlaylistFile = Path.Combine(CSettings.sFolderPlaylists, FileName); + + try + { + xPathDoc = new XPathDocument(playlist.PlaylistFile); + navigator = xPathDoc.CreateNavigator(); + loaded = true; + } + catch (Exception e) + { + loaded = false; + if (navigator != null) + navigator = null; + + if (xPathDoc != null) + xPathDoc = null; + + CLog.LogError("Error opening Playlist File " + FileName + ": " + e.Message); + } + + if (loaded) + { + string value = String.Empty; + if (CHelper.GetValueFromXML("//root/Info/PlaylistName", navigator, ref value, value)) + { + playlist.PlaylistName = value; + + playlist.Songs = new List(); + + List songs = CHelper.GetValuesFromXML("Songs", navigator); + string artist = String.Empty; + string title = String.Empty; + GameModes.EGameMode gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; + + for (int i = 0; i < songs.Count; i++) + { + CHelper.GetValueFromXML("//root/Songs/" + songs[i] + "/Artist", navigator, ref artist, String.Empty); + CHelper.GetValueFromXML("//root/Songs/" + songs[i] + "/Title", navigator, ref title, String.Empty); + CHelper.TryGetEnumValueFromXML("//root/Songs/" + songs[i] + "/GameMode", navigator, ref gm); + + CPlaylistSong song = new CPlaylistSong(); + CSong[] AllSongs = CSongs.AllSongs; + + for (int s = 0; s < AllSongs.Length; s++) + { + if (AllSongs[s].Artist == artist && AllSongs[s].Title == title) + { + song.SongID = AllSongs[s].ID; + break; + } + } + + song.gm = gm; + + playlist.Songs.Add(song); + } + + _Playlists.Add(playlist); + } + else + { + CLog.LogError("Can't find PlaylistName in Playlist File: " + FileName); + } + } + } + + #endregion + } +} diff --git a/Vocaluxe/Base/CSettings.cs b/Vocaluxe/Base/CSettings.cs index 4183d586..7a382cf7 100644 --- a/Vocaluxe/Base/CSettings.cs +++ b/Vocaluxe/Base/CSettings.cs @@ -94,6 +94,7 @@ namespace Vocaluxe.Base public const string sFolderLanguages = "Languages"; public const string sFolderScreenshots = "Screenshots"; public const string sFolderBackgroundMusic = "BackgroundMusic"; + public const string sFolderPlaylists = "Playlists"; //public const String[] ToneStrings = new String[]{ "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B" }; public const int ToneMin = -36; diff --git a/Vocaluxe/GameModes/CGameMode.cs b/Vocaluxe/GameModes/CGameMode.cs index 3c45aabf..6dfe5ca5 100644 --- a/Vocaluxe/GameModes/CGameMode.cs +++ b/Vocaluxe/GameModes/CGameMode.cs @@ -39,12 +39,13 @@ namespace Vocaluxe.GameModes _Rounds[round, player].PointsLineBonus = 0f; _Rounds[round, player].Medley = false; _Rounds[round, player].Duet = false; + _Rounds[round, player].ShortSong = false; _Rounds[round, player].SongFinished = false; } } } - public void SetPoints(int Round, int SongID, SPlayer[] Player, bool Medley, bool Duet) + public void SetPoints(int Round, int SongID, SPlayer[] Player, bool Medley, bool Duet, bool ShortSong) { long DateTicks = DateTime.Now.Ticks; for (int player = 0; player < Player.Length; player++) @@ -56,6 +57,7 @@ namespace Vocaluxe.GameModes _Rounds[Round, player].PointsLineBonus = Player[player].PointsLineBonus; _Rounds[Round, player].Medley = Medley; _Rounds[Round, player].Duet = Duet; + _Rounds[Round, player].ShortSong = ShortSong; _Rounds[Round, player].DateTicks = DateTicks; _Rounds[Round, player].SongFinished = Player[player].SongFinished; } @@ -91,6 +93,7 @@ namespace Vocaluxe.GameModes player[p].Difficulty = _Rounds[Round, p].Difficulty; player[p].Medley = _Rounds[Round, p].Medley; player[p].Duet = _Rounds[Round, p].Duet; + player[p].ShortSong = _Rounds[Round, p].ShortSong; player[p].DateTicks = _Rounds[Round, p].DateTicks; player[p].SongFinished = _Rounds[Round, p].SongFinished; player[p].ProfileID = _Rounds[Round, p].ProfileID; @@ -223,7 +226,8 @@ namespace Vocaluxe.GameModes _SongQueque[_CurrentSong].SongID, Player, _SongQueque[_CurrentSong].GameMode == EGameMode.TR_GAMEMODE_MEDLEY, - _SongQueque[_CurrentSong].GameMode == EGameMode.TR_GAMEMODE_DUET); + _SongQueque[_CurrentSong].GameMode == EGameMode.TR_GAMEMODE_DUET, + _SongQueque[_CurrentSong].GameMode == EGameMode.TR_GAMEMODE_SHORTSONG); } _CurrentSong++; } diff --git a/Vocaluxe/Screens/CScreenLoad.cs b/Vocaluxe/Screens/CScreenLoad.cs index d20c7490..41f373b2 100644 --- a/Vocaluxe/Screens/CScreenLoad.cs +++ b/Vocaluxe/Screens/CScreenLoad.cs @@ -223,6 +223,11 @@ namespace Vocaluxe.Screens CBackgroundMusic.CanSing = true; CLog.StopBenchmark(3, "Load Cover"); + + //Init Playlists + CLog.StartBenchmark(0, "Init Playlists"); + CPlaylists.Init(); + CLog.StopBenchmark(0, "Init Playlists"); } private void CheckStartIntroVideos() diff --git a/Vocaluxe/Vocaluxe.csproj b/Vocaluxe/Vocaluxe.csproj index b75ed99f..ca240ee2 100644 --- a/Vocaluxe/Vocaluxe.csproj +++ b/Vocaluxe/Vocaluxe.csproj @@ -125,6 +125,7 @@ + @@ -132,12 +133,9 @@ - - - Code - - + Code + Form @@ -247,4 +245,4 @@ --> - + \ No newline at end of file From e6556e54eeb5183503c546f7f83fcdaa3cdb65a8 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Tue, 19 Jun 2012 18:12:25 +0200 Subject: [PATCH 12/70] Changed playlist. --- Vocaluxe/Base/CPlaylists.cs | 215 +++-------------------------- Vocaluxe/Lib/Playlist/CPlaylist.cs | 204 +++++++++++++++++++++++++++ 2 files changed, 221 insertions(+), 198 deletions(-) create mode 100644 Vocaluxe/Lib/Playlist/CPlaylist.cs diff --git a/Vocaluxe/Base/CPlaylists.cs b/Vocaluxe/Base/CPlaylists.cs index 563bcc2b..a720107a 100644 --- a/Vocaluxe/Base/CPlaylists.cs +++ b/Vocaluxe/Base/CPlaylists.cs @@ -6,40 +6,17 @@ using System.Xml; using System.Xml.XPath; using Vocaluxe.Lib.Song; +using Vocaluxe.Lib.Playlist; namespace Vocaluxe.Base { - class CPlaylistSong - { - public int SongID; - public GameModes.EGameMode gm; - - public CPlaylistSong(int SongID, GameModes.EGameMode gm) - { - this.SongID = SongID; - this.gm = gm; - } - - public CPlaylistSong() - { - gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; - } - } - - struct SPlaylist - { - public string PlaylistName; - public string PlaylistFile; - public List Songs; - } static class CPlaylists { - private static XmlWriterSettings _settings = new XmlWriterSettings(); + private static List _Playlists; private static CHelper Helper = new CHelper(); - private static List _Playlists; - public static SPlaylist[] Playlists + public static CPlaylist[] Playlists { get { return _Playlists.ToArray(); } } @@ -51,27 +28,35 @@ namespace Vocaluxe.Base public static void Init() { - _settings.Indent = true; - _settings.Encoding = System.Text.Encoding.UTF8; - _settings.ConformanceLevel = ConformanceLevel.Document; - LoadPlaylists(); } public static void LoadPlaylists() { - _Playlists = new List(); + _Playlists = new List(); List files = new List(); files.AddRange(Helper.ListFiles(CSettings.sFolderPlaylists, "*.xml", true, true)); foreach (string file in files) { - LoadPlaylist(file); + CPlaylist playlist = new CPlaylist(file); } SortPlaylistsByName(); } + #region private methods + + private static void SortPlaylistsByName() + { + _Playlists.Sort(CompareByPlaylistName); + } + + private static int CompareByPlaylistName(CPlaylist a, CPlaylist b) + { + return String.Compare(a.PlaylistName, b.PlaylistName); + } + public static void DeletePlaylist(int PlaylistID) { if (PlaylistID < 0 || PlaylistID >= _Playlists.Count) @@ -90,172 +75,6 @@ namespace Vocaluxe.Base } } - #region private methods - - private static void SortPlaylistsByName() - { - _Playlists.Sort(CompareByPlaylistName); - } - - private static int CompareByPlaylistName(SPlaylist a, SPlaylist b) - { - return String.Compare(a.PlaylistName, b.PlaylistName); - } - - private static void SavePlaylist(int PlaylistID) - { - if (PlaylistID < 0 || PlaylistID >= _Playlists.Count) - return; - - string filename = string.Empty; - foreach (char chr in _Playlists[PlaylistID].PlaylistName) - { - if (char.IsLetter(chr)) - filename += chr.ToString(); - } - - if (filename == String.Empty) - filename = "1"; - - int i = 0; - while (File.Exists(Path.Combine(CSettings.sFolderPlaylists, filename + ".xml"))) - { - i++; - if (!File.Exists(Path.Combine(CSettings.sFolderPlaylists, filename + i + ".xml"))) - { - filename += i; - } - } - - SPlaylist playlist = _Playlists[PlaylistID]; - playlist.PlaylistFile = Path.Combine(CSettings.sFolderPlaylists, filename + ".xml"); - _Playlists[PlaylistID] = playlist; - - XmlWriter writer; - try - { - writer = XmlWriter.Create(_Playlists[PlaylistID].PlaylistFile, _settings); - } - catch (Exception e) - { - CLog.LogError("Error creating/opening Playlist File " + _Playlists[PlaylistID].PlaylistFile + ": " + e.Message); - return; - } - - if (writer == null) - { - CLog.LogError("Error creating/opening Playlist File " + _Playlists[PlaylistID].PlaylistFile); - return; - } - - writer.WriteStartDocument(); - writer.WriteStartElement("root"); - - writer.WriteStartElement("Info"); - writer.WriteElementString("PlaylistName", _Playlists[PlaylistID].PlaylistName); - writer.WriteEndElement(); - - writer.WriteStartElement("Songs"); - for (i = 0; i < playlist.Songs.Count; i++) - { - CSong[] songs = CSongs.AllSongs; - CSong song = new CSong(); - for (int s = 0; i <= songs.Length; s++) - { - if (songs[s].ID == playlist.Songs[i].SongID) - { - song = songs[s]; - break; - } - } - writer.WriteStartElement("Song" + (i+1).ToString()); - writer.WriteElementString("Artist", song.Artist); - writer.WriteElementString("Title", song.Title); - writer.WriteElementString("GameMode", Enum.GetName(typeof(GameModes.EGameMode), playlist.Songs[i].gm)); - writer.WriteEndElement(); - } - writer.WriteEndElement(); - - writer.WriteEndElement(); //end of root - writer.WriteEndDocument(); - - writer.Flush(); - writer.Close(); - } - - private static void LoadPlaylist(string FileName) - { - bool loaded = false; - XPathDocument xPathDoc = null; - XPathNavigator navigator = null; - - SPlaylist playlist = new SPlaylist(); - playlist.PlaylistFile = Path.Combine(CSettings.sFolderPlaylists, FileName); - - try - { - xPathDoc = new XPathDocument(playlist.PlaylistFile); - navigator = xPathDoc.CreateNavigator(); - loaded = true; - } - catch (Exception e) - { - loaded = false; - if (navigator != null) - navigator = null; - - if (xPathDoc != null) - xPathDoc = null; - - CLog.LogError("Error opening Playlist File " + FileName + ": " + e.Message); - } - - if (loaded) - { - string value = String.Empty; - if (CHelper.GetValueFromXML("//root/Info/PlaylistName", navigator, ref value, value)) - { - playlist.PlaylistName = value; - - playlist.Songs = new List(); - - List songs = CHelper.GetValuesFromXML("Songs", navigator); - string artist = String.Empty; - string title = String.Empty; - GameModes.EGameMode gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; - - for (int i = 0; i < songs.Count; i++) - { - CHelper.GetValueFromXML("//root/Songs/" + songs[i] + "/Artist", navigator, ref artist, String.Empty); - CHelper.GetValueFromXML("//root/Songs/" + songs[i] + "/Title", navigator, ref title, String.Empty); - CHelper.TryGetEnumValueFromXML("//root/Songs/" + songs[i] + "/GameMode", navigator, ref gm); - - CPlaylistSong song = new CPlaylistSong(); - CSong[] AllSongs = CSongs.AllSongs; - - for (int s = 0; s < AllSongs.Length; s++) - { - if (AllSongs[s].Artist == artist && AllSongs[s].Title == title) - { - song.SongID = AllSongs[s].ID; - break; - } - } - - song.gm = gm; - - playlist.Songs.Add(song); - } - - _Playlists.Add(playlist); - } - else - { - CLog.LogError("Can't find PlaylistName in Playlist File: " + FileName); - } - } - } - #endregion } } diff --git a/Vocaluxe/Lib/Playlist/CPlaylist.cs b/Vocaluxe/Lib/Playlist/CPlaylist.cs new file mode 100644 index 00000000..54b654ad --- /dev/null +++ b/Vocaluxe/Lib/Playlist/CPlaylist.cs @@ -0,0 +1,204 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Xml; +using System.Xml.XPath; + +using Vocaluxe.Lib.Song; +using Vocaluxe.Base; + + +namespace Vocaluxe.Lib.Playlist +{ + public class CPlaylistSong + { + public int SongID; + public GameModes.EGameMode gm; + + public CPlaylistSong(int SongID, GameModes.EGameMode gm) + { + this.SongID = SongID; + this.gm = gm; + } + + public CPlaylistSong() + { + gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; + } + } + + public class CPlaylist + { + private static XmlWriterSettings _settings = new XmlWriterSettings(); + private static CHelper Helper = new CHelper(); + + public string PlaylistName; + public string PlaylistFile; + public List Songs; + + public CPlaylist() + { + Init(); + } + + public CPlaylist(string file) + { + Init(); + PlaylistName = file; + LoadPlaylist(); + } + + private void Init() + { + _settings.Indent = true; + _settings.Encoding = System.Text.Encoding.UTF8; + _settings.ConformanceLevel = ConformanceLevel.Document; + } + + + private void SavePlaylist() + { + string filename = string.Empty; + foreach (char chr in PlaylistName) + { + if (char.IsLetter(chr)) + filename += chr.ToString(); + } + + if (filename == String.Empty) + filename = "1"; + + int i = 0; + while (File.Exists(Path.Combine(CSettings.sFolderPlaylists, filename + ".xml"))) + { + i++; + if (!File.Exists(Path.Combine(CSettings.sFolderPlaylists, filename + i + ".xml"))) + { + filename += i; + } + } + + PlaylistFile = Path.Combine(CSettings.sFolderPlaylists, filename + ".xml"); + + XmlWriter writer; + try + { + writer = XmlWriter.Create(PlaylistFile, _settings); + } + catch (Exception e) + { + CLog.LogError("Error creating/opening Playlist File " + PlaylistFile + ": " + e.Message); + return; + } + + if (writer == null) + { + CLog.LogError("Error creating/opening Playlist File " + PlaylistFile); + return; + } + + writer.WriteStartDocument(); + writer.WriteStartElement("root"); + + writer.WriteStartElement("Info"); + writer.WriteElementString("PlaylistName", PlaylistName); + writer.WriteEndElement(); + + writer.WriteStartElement("Songs"); + for (i = 0; i < Songs.Count; i++) + { + CSong[] songs = CSongs.AllSongs; + CSong song = new CSong(); + for (int s = 0; i <= songs.Length; s++) + { + if (songs[s].ID == Songs[i].SongID) + { + song = songs[s]; + break; + } + } + writer.WriteStartElement("Song" + (i + 1).ToString()); + writer.WriteElementString("Artist", song.Artist); + writer.WriteElementString("Title", song.Title); + writer.WriteElementString("GameMode", Enum.GetName(typeof(GameModes.EGameMode), Songs[i].gm)); + writer.WriteEndElement(); + } + writer.WriteEndElement(); + + writer.WriteEndElement(); //end of root + writer.WriteEndDocument(); + + writer.Flush(); + writer.Close(); + } + + private void LoadPlaylist() + { + bool loaded = false; + XPathDocument xPathDoc = null; + XPathNavigator navigator = null; + + try + { + xPathDoc = new XPathDocument(PlaylistFile); + navigator = xPathDoc.CreateNavigator(); + loaded = true; + } + catch (Exception e) + { + loaded = false; + if (navigator != null) + navigator = null; + + if (xPathDoc != null) + xPathDoc = null; + + CLog.LogError("Error opening Playlist File " + PlaylistFile + ": " + e.Message); + } + + if (loaded) + { + string value = String.Empty; + if (CHelper.GetValueFromXML("//root/Info/PlaylistName", navigator, ref value, value)) + { + PlaylistName = value; + + Songs = new List(); + + List songs = CHelper.GetValuesFromXML("Songs", navigator); + string artist = String.Empty; + string title = String.Empty; + GameModes.EGameMode gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; + + for (int i = 0; i < songs.Count; i++) + { + CHelper.GetValueFromXML("//root/Songs/" + songs[i] + "/Artist", navigator, ref artist, String.Empty); + CHelper.GetValueFromXML("//root/Songs/" + songs[i] + "/Title", navigator, ref title, String.Empty); + CHelper.TryGetEnumValueFromXML("//root/Songs/" + songs[i] + "/GameMode", navigator, ref gm); + + CPlaylistSong song = new CPlaylistSong(); + CSong[] AllSongs = CSongs.AllSongs; + + for (int s = 0; s < AllSongs.Length; s++) + { + if (AllSongs[s].Artist == artist && AllSongs[s].Title == title) + { + song.SongID = AllSongs[s].ID; + break; + } + } + + song.gm = gm; + + Songs.Add(song); + } + } + else + { + CLog.LogError("Can't find PlaylistName in Playlist File: " + PlaylistFile); + } + } + } + } +} From c5fae33c4f63755a9e860890dae04203b582c872 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 24 Jun 2012 21:25:54 +0200 Subject: [PATCH 13/70] added missing folder an file --- Vocaluxe/Vocaluxe.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/Vocaluxe/Vocaluxe.csproj b/Vocaluxe/Vocaluxe.csproj index 7024d700..3b9ff835 100644 --- a/Vocaluxe/Vocaluxe.csproj +++ b/Vocaluxe/Vocaluxe.csproj @@ -189,6 +189,7 @@ Form + From d1d25939461fa08dd895531b06d49355bdd7cbfb Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 24 Jun 2012 21:37:32 +0200 Subject: [PATCH 14/70] some small code changes in Playlist/CPlaylist.cs, no new functions --- Vocaluxe/Lib/Playlist/CPlaylist.cs | 48 ++++++++++++++++-------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/Vocaluxe/Lib/Playlist/CPlaylist.cs b/Vocaluxe/Lib/Playlist/CPlaylist.cs index 54b654ad..a87ee61a 100644 --- a/Vocaluxe/Lib/Playlist/CPlaylist.cs +++ b/Vocaluxe/Lib/Playlist/CPlaylist.cs @@ -5,8 +5,9 @@ using System.Text; using System.Xml; using System.Xml.XPath; -using Vocaluxe.Lib.Song; using Vocaluxe.Base; +using Vocaluxe.GameModes; +using Vocaluxe.Lib.Song; namespace Vocaluxe.Lib.Playlist @@ -14,17 +15,17 @@ namespace Vocaluxe.Lib.Playlist public class CPlaylistSong { public int SongID; - public GameModes.EGameMode gm; + public EGameMode GameMode; - public CPlaylistSong(int SongID, GameModes.EGameMode gm) + public CPlaylistSong(int SongID, EGameMode gm) { this.SongID = SongID; - this.gm = gm; + this.GameMode = gm; } public CPlaylistSong() { - gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; + GameMode = EGameMode.TR_GAMEMODE_NORMAL; } } @@ -108,21 +109,19 @@ namespace Vocaluxe.Lib.Playlist writer.WriteStartElement("Songs"); for (i = 0; i < Songs.Count; i++) { - CSong[] songs = CSongs.AllSongs; - CSong song = new CSong(); - for (int s = 0; i <= songs.Length; s++) + CSong song = CSongs.GetSong(Songs[i].SongID); + if (song != null) { - if (songs[s].ID == Songs[i].SongID) - { - song = songs[s]; - break; - } + writer.WriteStartElement("Song" + (i + 1).ToString()); + writer.WriteElementString("Artist", song.Artist); + writer.WriteElementString("Title", song.Title); + writer.WriteElementString("GameMode", Enum.GetName(typeof(EGameMode), Songs[i].GameMode)); + writer.WriteEndElement(); + } + else + { + CLog.LogError("Playlist.SavePlaylist(): Can't find Song. This should never happen!"); } - writer.WriteStartElement("Song" + (i + 1).ToString()); - writer.WriteElementString("Artist", song.Artist); - writer.WriteElementString("Title", song.Title); - writer.WriteElementString("GameMode", Enum.GetName(typeof(GameModes.EGameMode), Songs[i].gm)); - writer.WriteEndElement(); } writer.WriteEndElement(); @@ -169,15 +168,16 @@ namespace Vocaluxe.Lib.Playlist List songs = CHelper.GetValuesFromXML("Songs", navigator); string artist = String.Empty; string title = String.Empty; - GameModes.EGameMode gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; + EGameMode gm = EGameMode.TR_GAMEMODE_NORMAL; for (int i = 0; i < songs.Count; i++) { CHelper.GetValueFromXML("//root/Songs/" + songs[i] + "/Artist", navigator, ref artist, String.Empty); CHelper.GetValueFromXML("//root/Songs/" + songs[i] + "/Title", navigator, ref title, String.Empty); - CHelper.TryGetEnumValueFromXML("//root/Songs/" + songs[i] + "/GameMode", navigator, ref gm); + CHelper.TryGetEnumValueFromXML("//root/Songs/" + songs[i] + "/GameMode", navigator, ref gm); CPlaylistSong song = new CPlaylistSong(); + song.SongID = -1; CSong[] AllSongs = CSongs.AllSongs; for (int s = 0; s < AllSongs.Length; s++) @@ -189,9 +189,11 @@ namespace Vocaluxe.Lib.Playlist } } - song.gm = gm; - - Songs.Add(song); + if (song.SongID != -1) + { + song.GameMode = gm; + Songs.Add(song); + } } } else From b197b5fcb466bc3e1cc95d0d740f214ca1f6d934 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 24 Jun 2012 21:58:57 +0200 Subject: [PATCH 15/70] read relative tag, log error and skip file --- Vocaluxe/Lib/Song/CSong.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Vocaluxe/Lib/Song/CSong.cs b/Vocaluxe/Lib/Song/CSong.cs index eefcbbc7..120efbf6 100644 --- a/Vocaluxe/Lib/Song/CSong.cs +++ b/Vocaluxe/Lib/Song/CSong.cs @@ -65,6 +65,7 @@ namespace Vocaluxe.Lib.Song public string Folder = String.Empty; public string FolderName = String.Empty; public string FileName = String.Empty; + public EOffOn Relative = EOffOn.TR_CONFIG_OFF; public string MP3FileName = String.Empty; public string CoverFileName = String.Empty; @@ -172,6 +173,7 @@ namespace Vocaluxe.Lib.Song this.Folder = song.Folder; this.FolderName = song.FolderName; this.FileName = song.FileName; + this.Relative = song.Relative; this.MP3FileName = song.MP3FileName; this.CoverFileName = song.CoverFileName; @@ -454,6 +456,10 @@ namespace Vocaluxe.Lib.Song if (Value.ToUpper() == "OFF") this.CalculateMedley = false; break; + case "RELATIVE": + if (Value.ToUpper() == "YES" && Value.ToUpper() != "NO") + this.Relative = EOffOn.TR_CONFIG_ON; + break; default: ; break; @@ -493,6 +499,12 @@ namespace Vocaluxe.Lib.Song return false; } + if (this.Relative == EOffOn.TR_CONFIG_ON) + { + CLog.LogError("Relative songs are not supported by Vocaluxe (perhaps later)! (" + FilePath + ")"); + return false; + } + #region check medley tags if ((HeaderFlags & EHeaderFlags.MedleyStartBeat) != 0 && (HeaderFlags & EHeaderFlags.MedleyEndBeat) != 0) { @@ -658,7 +670,7 @@ namespace Vocaluxe.Lib.Song char chr = (char)sr.Read(); Param1 = CHelper.TryReadInt(sr); - + NewSentence(Player, Param1); isNewSentence = true; From 74f24125dafc2d3e562f41069de502e31893e584 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sun, 8 Jul 2012 14:09:05 +0200 Subject: [PATCH 16/70] Added first (playable) Playlist-Element to ScreenSong. Still a lot to do! --- Output/Themes/Ambient/Close.png | Bin 0 -> 5236 bytes Output/Themes/Ambient/Delete.png | Bin 0 -> 5705 bytes Output/Themes/Ambient/Save.png | Bin 0 -> 5036 bytes Output/Themes/Ambient/Screens/ScreenSong.xml | 502 +++++++++++++++++- Output/Themes/Ambient/Sing.png | Bin 0 -> 4616 bytes Output/Themes/Ambient/Skin Blue.xml | 10 + Output/Themes/Ambient/Skin Green.xml | 10 + Output/Themes/Ambient/Skin Red.xml | 10 + Output/Themes/Ambient/Skin Yellow.xml | 10 + .../Themes/Changelog/Changelog_ScreenSong.txt | 11 + Vocaluxe/Base/CPlaylists.cs | 29 + Vocaluxe/Lib/Playlist/CPlaylist.cs | 68 ++- Vocaluxe/Lib/Song/CSong.cs | 18 + Vocaluxe/Menu/CInteraction.cs | 3 +- Vocaluxe/Menu/CMenu.cs | 113 +++- Vocaluxe/Menu/CSelectSlide.cs | 8 + Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs | 4 +- Vocaluxe/Screens/CScreenSong.cs | 169 +++++- Vocaluxe/Vocaluxe.csproj | 1 + 19 files changed, 933 insertions(+), 33 deletions(-) create mode 100644 Output/Themes/Ambient/Close.png create mode 100644 Output/Themes/Ambient/Delete.png create mode 100644 Output/Themes/Ambient/Save.png create mode 100644 Output/Themes/Ambient/Sing.png diff --git a/Output/Themes/Ambient/Close.png b/Output/Themes/Ambient/Close.png new file mode 100644 index 0000000000000000000000000000000000000000..b8b8a99477da3831071a68cc0d20b1d06ad8d624 GIT binary patch literal 5236 zcmeHL*E<^y+t#9LZ$%?kiqg_SM9ox+AXceTqgHK=y=#}Wb{eW?tr`{MM{Q}1+VZ1j z%p|rb8Y5cOukXQk@cjqh!TVg-{fwjMzV7RKo`V}@Vx-H?BFsWZN5>A=gPHxU1OLHg z`oHgp;VAKx3y8*_8>$;nAY zMa9O(#(;o;!^1;1Hn!yCWJ84E$jHcz8#g|F{OINBMWIjt06<=To{f#o!oq@@np#I^ zM?^%#+3&Nz>;4=6Rp9@v0=S@O)W75|1eh5;q|;iTefD=?M(SDl)6sD{{0A2*G(Wi0 z(Q&iGVNmlB!frk@dK)__rQE#9BZ6l|RCd=Qbrvw;(%d!shmX?h4;49lSVxKJgE-4wI&sPcG zemoe2iNdtS6S$lnOz^UDy0_WYhEHMjZSR#B%61HjEA19G++4G-G;%j6p~MU7)BIXt z#1r#w?W$ulJmdV2oMeWGFx5o)0P5}m=%YijaX1`P8RBSu)5kx4gPnL14|cGab#kOu69`g5 zUv{`3osJX&hK3PMIfxY!OoC-2M6T3* zQKjO^t&U-&UMp6XO!w=z>yR~MR;nEaM!j3AA6)xK9QUwAEY4mR{rLEDrSO*REqk zf|vRqfl(7ustCp~NeyI_b;>2`n6C&1xw=QBu9e5n52!IxpbYJPWK zdI^mJO|`kOUcLgPVC$tAt$4-$MG^U2=w0$ZnjNr?;bvXRv=Wx(525Y{tMb*YSU@An zH7#-2VY<$!(b}jw#*O#R(xrl@TuIw$^gH+bUrOA*?5GDzOM1R>Yem}Wo}CtdYe6~( zjV;c^C;)`HkGaRvzz{8^mh0JNf4?2^SfX~Uhb>#1W)IAFG? z?C$q>$a}4qOpmqFvp+ldKfcefJak3*J9{JQkJMChh}NH*NAoP-nI>LGV>I<&JBf0^ z3&&=(Y=_be!jqul_o1=nw&{E>XcH`z9N(TsVpwuJ-uDQ4-&fC+`N_9POR)CE+qRL_ zC^O&=&fF=5{Jb~4O|;ndcE+3ix7RXP>!2UN5CzC69j==ba@xb=T7Lgk2`I+OXzw7d zy!`^tsbwF^E&Ys2if=K9c=BbAb>x;|M08_tQqR?}sFo`^PAXm+#n0M;JG*IJ4xEm? zuft~Cc|A1M$mG+~A95beMyUXmI+xVDhwJ-UOgAzmAyv&x+nqHX5j=}GQde54Rpf#F z)ibOAB*cT|1(dTM1AKohh)C->-rS3}4@7$1N9^4o?zxW-wU)Vq+gPc-sk)YWQ;kLz^|J0!^&lxyd^_ z34UD}(t$CzNP_oX+ZWy~g~g??4YdNzE|CT0E3N} zLLLC~q{e!{rl9Sd$-)<>ut=Vi`!AYy21J#AR6p@Z)#;T)omq}!jMEvCecKno`JpC5 zzuM{#4?^qu+V^ck{ONPW;GP<$MG9vW#Hocp%Swurz4D#rL%EDw8r@(kuK`;hVm&MT zu&0wR=@n;2u8EE{T^apnMl4V`f} zp-?nC&=1yqJWo&?fef(Sp&K@G@2@UG6eTXF1~Xcs0|EJB9h`wzzIdp zCtm5BlJ^?bOBq`MxzXz7#QV(j^TRvMwi^~&Q$C0dsQN*irep(1z%6( z!SF=rk8<_HJL84EAy0l{5n}q^PrzK1i_5^U#C=W`%7*)FX(!}@XN5B-F2I;TP$9pXQN$t(qf5mbOI3ON|Q>>zC zL>n{&Ggp}BlB{FE;hQ~3p+GsBMd7`O_J8-Z1VW1tErw+L2g%~W@yI)|;HDsfL2Y!Y zn*1V~p3~~tLRmul($e)9$q{kxEe;`0(mrMUWCX#A(omhjEj(xIN9%j5;XLHQB+J-g z=(FJOsw=h+rFA;#9Q$=b}CGSY3+Kx6)mACCtSJ(X)80dDO9O0VzFjlB; z@Y-$}KY}Y9s_&eDAFmiLQbkW<;MKntueB<7R?~9phgH+i8BeZraAWCbNnb=et5>|` zKB{FFL+`8|CmmPc-?pe?{UF~n*KboW(qHmC;j~{eLnvVePN{cJpDp>OBMR+7MYzK0t@A%*j6f(H&BZv zX|gSy+A*jniNAg`)+*i8R&cdF>P{DGTDhCA2{$AWwEfM$sD=2QY>e?4)XEGF3AMik z4YC`Ehi_6%6*#D}nVO&EnVPdNW2W-nai{GL1KTsRJ(*{K#s7>=Akz`s;!7CC!pCH6 zk#9BxrjZm!D)p(^^Xrh?lA+)|7iqKX#9QF4ee89;j%|t8*sTG|-9cs<5L{YRn+U`2l_7@JGCXJ!^%N~J6) zhh*_6dhi8NRs3aeuLw?f4A@od5#GU9W^X9{uQ(j*XpF(d%rU6z_rdx=QeMH0*B#kj z_2;k19mNIqPZGJV8zt2*N?p;873l^GMJ!TK!P6d}m>MY}ZKD&boPq*lXYNV3||UlUJ7Xmm1ct;|UVi|kBxiwCGH*-P_?Gxwt^ zFZshYS{Sx6H`qD6xgH4;Z}EQ!fa0gC;+yqYDx43=uw2jyTtHhP>dT?hR6R0yWV|EJ2*{~dA=&r8D?~@I?eI0!|8ayh- zKyBNy>MUQA44)RzKi>WnF!sRTnf5eQy(7#cZMAPT6=8C`h~i!!XsE@@Lo=~?8P7=! zQ#On1DcT#!fxhRLrxFsqGF@`+23a+PPTub~5w&^!r9{B4{DYo}Wf0d_P?3+zi()Nb zXPU`Z;QM7Bw{(+IH=ee;?kXUA$M*NGi1syeu{O7ItaK z-?-Uonoye_w%-6qX$S;dAM1F?E&D(?y*j zo7Aoi&)*}0e5uEEB&WYO*)HJX5FRk!bp@_P(^b-5N*6UdzTR&_Jm#l~+Q&{#co+K9 zTsKm!CzLJDST)Cjv+$)g-&jr!c87?6_qD!Bol&Fr5{wxoB#0nUBf2nJ^b#Y8E{`C3 z9la&@dDp!^;(mC~+WYLaKb^hy$CF~HuSG@9N{)wzM+MW?F#cDE|3gxOe|JHmT@4-{ z0iL0*=@UYH!uYs&4GoR{zJ3Sv!0**L4 zJENqee3kl2_o?pqw{Z~>k(!zsFHf)i{e2J!^tSM=jkV44^7134M;HtyJR&){Mo{x)K^6Una9@?2_;<^pVoyUKBs;Gjf*)9v7 z{mx~;1Ymg2vYFpX^*>X=wV5u^Wk1{zrL-(;_eW;jtqB9>KaKR8*7?-L`WrC_XD~m%x+wSn$-kI z&}YNUt$Fh>5NNy3KQ$!7`n=w@8JRqz@XDK)g{8bal0K$yv0`xDZ>9fUYxRn^aGw)? zg{1=y*Xf-(@P>FQv)FQ;`eY2Z=i(M5ziUy9(9iz(L?ZyJ_;DT+y#W#?xGA%aOqxUEPb zqQjqbD0|yJY{-H81-XJ3oz^496a;D(&hf=Y5HS;EW^c=D0Hds;?-CE|o*g_e#Y)&R zvyWB?A)V`0+}7gN^U`IyOzE7}>yO_G=;lf9#EtpJz)R*>VWSUX94^eYQAM@2(z`Pw+bWxOGCQ$w#+Q-D`!%alJ=T~U#9 zCNA5C`+biI^I`U+JVw1RDo4Gt?{(&Ru#T~2-y<%Cia(H2pTnx5xC&aPPm#i>C-se4 z#&%XOdtk1c7XRRmOlN02p3s$<)}48sKl{y3wq>d%vtg4K8EEq}y`Xj9Qt#{Xr#(ge zf#5j$U}Kogl!JU9f%<1;Xw&Q8)o70&d9IenC3;a4W5mF}xpGCoH?998lgQFR~@KNU%UV>~i z6Uq$16@H<@;VOQyu&$xKR>_nHPJ=HxP^MD*(KnTl znf}`^02ijKXY^2oClq9_nQGOeB606_p7-~nSF>!P9%mU3yW+|wsyInoPFQvyFxb&o zHEqi@euKQcpu`)(TTu{>@Kes4FYAF=UVdzzm%jKc>T7Aobzw(e5yx#^rw{{|8|&X`?lx*YFjC6S)!s1o>G^SM2rf^CjnkxAQusMG8@ps5DbxMxz|9}`TefnPVv zn?daRA*AQ?Sml(F|HG8q6M`J?m~))Zd`pwB6pve9L$vVLT-^0LXgYc4_7Q#1dcFB)@Kd!ws&nZ7<1$DowoZ@NipJ6TVy z1jy+pNd|Y#Vt0Bh(#Pt}d1HPNSj>_vX2=;&Hlo=&MC0*!3$x!O#c}VFI!yHnWw1!9 zl_{mp{Oxi+IIDpeKT&~jd+H}x=B$m@tLrsk9 zJsxmVX&`x|or5*6odmW&8Xr3ISo%FV?g=uJ5BYF_n!UT_6N!4tyKh)5rW_nxB z+0=%I2_?nJRB5(liKXrfB7up;V5UuGs*TeTMWBCMxc9>^vcZ-f5$6muG(iQk{y-$M znyp3jIeShacNasweo^gyUBNS^;Q=-!c=k+la4yn!j(y~M9J1_{?+=|Q{C0G+FI-C# z2!GPC!{K!bLU$Y!&t0{qWwB-kWI!j>quX-N_jRbD6X1`NRtlE4HE*#!y>ghsu9L~E zt55fvb+N{6ewqDXfUCpW*>j=??s!}sU&r5Ot!F*v&Iu`;{K3@4;DChVWt}~juJu7u z7`Mr7h8z|7d=T{EbFkFf)Zr|Uzn6f{dVz*du7V)TNG~rPM=hcq>DoXjEY@~`-v{sm z68;{YCMiZF`Pw}&#s{sg+5_Uw`G+o%cR| zucJfT7Q9~Q^K z#qt>mJwP$IhaHp#=jF@aL!oz^e|*K|JkH15y5!uE89m`;dJc2h7U4$WO9=z(QSUIs z#J#$7q~wF0IWN6kEN`7n2D9+Da=nkGsH-~TT5JqmHzfRToT5XrtVth~csqEQ{Nq0m z(8RbR8P~xm{T+Wzd#>6-lZ4CCbJ|KH!_~{&wO56crw~Kd`1;wZyaDA`NP}5sYr;3P zd(r^sq!WS9SNTE_Ui|o#K$Nk9Ybx9?-6=taqqBuEtsgD5_K+?{q*Ws2_r3QT-k$A< z2gt%8_UVyh344^xkTY18i|lsEE!eu>sJ5CIC65@FU`h5B@Pw=qB7S>2q^|oMrp9|o z#EY3k%nL#tfuI=Baa+7%QvIbiKVy=epAG&_DLLqcV)|R%!v5SgA;W_HPd$RPFritp zc48lAoN|M(5{q`Tv<#3}kffH7ceb3djh(~^XYcTM+Jl!2#NhvKxmpOhO}01uY1?G# zrv}(tv0iJ!GVtS+YoVzQe`+cDIYIY(gF)X&ClonsetL7b_}NMOsq)mY$i_n;gYHhlbu;2CJ{)m+I)vRj< zUy1iKBe8%JYwpJs5I_Pl+SV*4?yEU-Wy*9E1EC`?06?^+%}j)77)!1mJzAq+us{;7 z#fhi%jmVNS$7tV($C-+PbF~HJ?D!W_|BN1Sxq77aD7*HJsc|~T|B!t#h+r;bWzz5n zA82SPqrp0qbqcxra$~s2`rYOj-0P;!odN*fwh*m}{O!1lXdyqaW##10Pe9=&p4jC@ zD1FMdx}=NKQiB>wyNqUuGJuVKBQCOa1roaA3wx?FwOU#_1tN-%tXumq+^LU+&maOM zVM~19p-*MyNfCo)Q(l%6OFNd-wdhBFZa`16GsyzY@mj$;WP0t|=S(%P$&pHq`GCr0 zE&P(i?xHTUP4I!wNB@*SnfV{DtfjW4w5F1Op~kBZaBF`=Pwv<3j?KExyKk`8MBV?y zI{ZGH{hiN3L1>0T`;+k1hujF|VOb#`!8n~hoVlD-uBM-E#c81yOLcrn9FJJ+ zaa#CbxAQDz4Xtj1>(7<#+*FmL@qO&TK;9OhT0E)N1&RDq4F+8639XYEvl`$Dq8Zi7 zRUal>W{&IaiK5G1wmR|)>7hZS`5v8m+&gi)!_7ZsbQI7}B2W_ponb|nV*QZ}1B}rQ z4as9WWWw#8!1QTZkC74g@Jl>Mz^KI$k+oYy@m7^C+VB!3w$ ze;fi%c`148fW$uU37NF>P9}mOd2kggnbgKhj>AdHy-Xg7Fh@=%V6VX|GZdY|_q}Sy8FD9flz>dvcuMw)U~iRz2ts6Oo)~g5 z)PRQ9zJ>knFXBcOf5cW7XjGf}+1g}sFe2zuRTTf9W6>nhX>=Ck{t5i%UbrJ|Sg@4^ zqHyFM)PAi25BJRC*%ZOH?AadI!}JS14E{cu_DIo&&&xOi9^%${dI3uvS+>+C`Ak+k zLr`gyCcSSJsaEc{hPQ~5_;*%!w_)L(HfrnKC-Qpp{ zU~FMspS`1h<%W;xN0R?^?63mNX1Z~x+Q%w4JioH=vxJPcm!;|kDdey{fWrmHq!!LR znyF&f89`b{C4#0v!^!xFe>JXr0)yDc(%?G1&b`sO2rWy{@%qv2c5iL=eeVKk)u>Lq2r_*iQc>MB3>v?(74mTkDU zb{??()+<)=J@RuP&cb?T$$d~IPd?HFCu8+m7!r;zilmJf6G5^ueK|vwYBn5=T41{# z+np0wVOZL{GFq5zX61F{QTnyJ)pL(i_PA~EDZl>oIux$HaUSbMfs-6w>XND*`iQDj z$8uy(C4-ODqcP3V@xw|MFN;Gya7!-w6j1eV!@D~4s_nGahB?hj&DCUa+MRBDw!n?f zQ&7gX{X*jKbjdH=cxVq;#|)f%qViYz2Gj9Agl%GE7xMAwe!n#o7@A$Qk8v^vfE^e}fM zDi$L*X2!v~P9s!qW5tyrlobn8>D%M0O@ujKqQ^v2+I*DL+1O9r;js|8Z?wWymt4xXnim0SeiE7c z`o@r2sb~BxqPNR6jB9Cnve>S9Y0^L*Rgz!mGzmV{h2__J!i*@}qOEA*)?Pkqdxhaz zUxt!OB46tcwt+x*z4SEEj(JWu4S9X<2jlyEPiAfj@9eFgPHbLGwY+V~0q@2j*-__;c*PijpoO}zk))wH*(X-IYn3GcQoe$8Wnvr-*1C@ zYS|O{>*P)N^3($omCG?4B0zO|1V_MkHI~N-5-}*di76ggHEwCEzI(kfBql}RMA>^{ zz(KEAtVJPB2VMPK#BqGJc6zzZ@@7%>Q!Dn|V5KoGa|M8f=8$lAUHTgz3NKR0C^DVM zpyWV$p1msH2vn`|^4|EN4!kvJ ri}z<(LhN6|TnLj@uhIVt&1)KGbw1TUu&Sm1JnLXj^ff*`wvYWEC-{n! literal 0 HcmV?d00001 diff --git a/Output/Themes/Ambient/Save.png b/Output/Themes/Ambient/Save.png new file mode 100644 index 0000000000000000000000000000000000000000..1afc31136a75898cc89c655d7add37abe5c468e5 GIT binary patch literal 5036 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 EA1h22W&i*H literal 0 HcmV?d00001 diff --git a/Output/Themes/Ambient/Screens/ScreenSong.xml b/Output/Themes/Ambient/Screens/ScreenSong.xml index 4abd92ab..24f56698 100644 --- a/Output/Themes/Ambient/Screens/ScreenSong.xml +++ b/Output/Themes/Ambient/Screens/ScreenSong.xml @@ -72,6 +72,38 @@ 26 + + + Menu + + 970 + 40 + -1,00 + 295 + 40 + + + StaticColor + + + + + + + Menu + + 970 + 550 + -1,00 + 295 + 40 + + + StaticColor + + + + Button @@ -126,7 +158,7 @@ Button 40 - 180 + 235 -2,11 360 40 @@ -173,7 +205,7 @@ Button 40 - 225 + 290 -2,11 360 40 @@ -213,6 +245,194 @@ + + + CloseIcon + + CloseIcon + + 1215 + 42 + -1,01 + 35 + 35 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + + + Outline + + + + + + + + + + + + + SingIcon + + SingIcon + + 975 + 553 + -1,01 + 35 + 35 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + + + Outline + + + + + + + + + + + + + SaveIcon + + SaveIcon + + 1175 + 553 + -1,01 + 35 + 35 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + + + Outline + + + + + + + + + + + + + DeleteIcon + + DeleteIcon + + 1215 + 553 + -1,01 + 35 + 35 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + + + Outline + + + + + + + + + + 200 @@ -367,6 +587,36 @@ + + + 975 + 45 + + -1,01 + + 30 + + 220 + + + StaticColor + + + TextSColor + + Left + + Center + + + + Outline + + + + + + Button @@ -432,6 +682,71 @@ 1 + + + Button + + SelectSlideArrowLeft + + SelectSlideArrowRight + + SelectSlide + + SelectSlideArrowLeft + + SelectSlideArrowRight + + SelectSlide + + 40 + 190 + -2,11 + 360 + 40 + + 45 + 195 + -2,12 + 30 + 30 + + 365 + 195 + -2,12 + 30 + 30 + + + ButtonColor + + + ButtonSColor + + + SelectSlideHColor + + + ArrowColor + + + ArrowSColor + + + TextColor + + + TextSColor + + 30 + + 280 + + Outline + + Bold + + 1 + CoverTile @@ -671,5 +986,188 @@ + + 970 + 80 + 295 + 460 + -1,00 + 50,00 + CoverTile + CoverTile + StaticColorAlpha + StaticColor + + + 54 + 4 + + -1,01 + + 24 + + 235 + + + StaticColor + + + TextSColor + + Left + + Top + + + + Outline + + %a - %t + + + + + + + 222 + 456 + + -1,01 + + 38 + + 340 + + + StaticColor + + + TextSColor + + Center + + Center + + + + Outline + + + + + + + + + 222 + 456 + + -1,01 + + 38 + + 340 + + + StaticColor + + + TextSColor + + Center + + Center + + + + Outline + + + + + + + + + + + 4 + 2 + -1,00 + 46 + 46 + + + Visible + + + + + + + Button + + SelectSlideArrowLeft + + SelectSlideArrowRight + + SelectSlide + + SelectSlideArrowLeft + + SelectSlideArrowRight + + SelectSlide + + 54 + 28 + -1,01 + 235 + 24 + + 54 + 30 + 0,00 + 20 + 20 + + 110 + 30 + 0,00 + 20 + 20 + + + ButtonColor + + + ButtonSColor + + + SelectSlideHColor + + + ArrowColor + + + ArrowSColor + + + TextColor + + + TextSColor + + 24,00 + + 230,00 + + Outline + + Bold + + 1 + + diff --git a/Output/Themes/Ambient/Sing.png b/Output/Themes/Ambient/Sing.png new file mode 100644 index 0000000000000000000000000000000000000000..c7daf961999ad89e32b0f0ddc2f49d627dfc2ad9 GIT binary patch literal 4616 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 Z>fc39b;R*=^?!eD6yl+FmFAPM{{X#!ZRh|1 literal 0 HcmV?d00001 diff --git a/Output/Themes/Ambient/Skin Blue.xml b/Output/Themes/Ambient/Skin Blue.xml index 50a16aa8..3cb2b0db 100644 --- a/Output/Themes/Ambient/Skin Blue.xml +++ b/Output/Themes/Ambient/Skin Blue.xml @@ -166,6 +166,12 @@ 0,969 1,000 + + 0,675 + 0,890 + 0,969 + 0,500 + 0,675 0,890 @@ -315,6 +321,10 @@ PauseIcon.png RepeatIcon.png SongMenuBG.png + Close.png + Delete.png + Save.png + Sing.png [Blue]BG_Video.mp4 diff --git a/Output/Themes/Ambient/Skin Green.xml b/Output/Themes/Ambient/Skin Green.xml index 7aefeb34..663faf5c 100644 --- a/Output/Themes/Ambient/Skin Green.xml +++ b/Output/Themes/Ambient/Skin Green.xml @@ -130,6 +130,12 @@ 0,674 1,000 + + 0,709 + 0,968 + 0,674 + 0,500 + 0,709 0,968 @@ -315,6 +321,10 @@ PauseIcon.png RepeatIcon.png SongMenuBG.png + Close.png + Delete.png + Save.png + Sing.png [Green]BG_Video.mp4 diff --git a/Output/Themes/Ambient/Skin Red.xml b/Output/Themes/Ambient/Skin Red.xml index d7f5ecf2..9d3f1f8d 100644 --- a/Output/Themes/Ambient/Skin Red.xml +++ b/Output/Themes/Ambient/Skin Red.xml @@ -130,6 +130,12 @@ 0,674 1,000 + + 0,968 + 0,674 + 0,674 + 0,500 + 0,968 0,674 @@ -315,6 +321,10 @@ PauseIcon.png RepeatIcon.png SongMenuBG.png + Close.png + Delete.png + Save.png + Sing.png [Red]BG_Video.mp4 diff --git a/Output/Themes/Ambient/Skin Yellow.xml b/Output/Themes/Ambient/Skin Yellow.xml index d7366abc..fcb4664a 100644 --- a/Output/Themes/Ambient/Skin Yellow.xml +++ b/Output/Themes/Ambient/Skin Yellow.xml @@ -130,6 +130,12 @@ 0,674 1,000 + + 0,968 + 0,956 + 0,674 + 0,500 + 0,968 0,956 @@ -315,6 +321,10 @@ PauseIcon.png RepeatIcon.png SongMenuBG.png + Close.png + Delete.png + Save.png + Sing.png [Yellow]BG_Video.mp4 diff --git a/Output/Themes/Changelog/Changelog_ScreenSong.txt b/Output/Themes/Changelog/Changelog_ScreenSong.txt index 1303abb5..e78df639 100644 --- a/Output/Themes/Changelog/Changelog_ScreenSong.txt +++ b/Output/Themes/Changelog/Changelog_ScreenSong.txt @@ -1,5 +1,16 @@ ScreenSong +++++++++++ +Version 3: + +Add: +, , +, +, , , , , , +, +and + as a new Screen-Element. For details, look at ScreenSong.xml + ++++++++++ Version 2: diff --git a/Vocaluxe/Base/CPlaylists.cs b/Vocaluxe/Base/CPlaylists.cs index a720107a..8ab1dfe5 100644 --- a/Vocaluxe/Base/CPlaylists.cs +++ b/Vocaluxe/Base/CPlaylists.cs @@ -21,6 +21,19 @@ namespace Vocaluxe.Base get { return _Playlists.ToArray(); } } + public static string[] PlaylistNames + { + get + { + List names = new List(); + for (int i = 0; i < _Playlists.Count; i++) + { + names.Add(_Playlists[i].PlaylistName); + } + return names.ToArray(); + } + } + public static int NumPlaylists { get { return _Playlists.Count; } @@ -40,6 +53,7 @@ namespace Vocaluxe.Base foreach (string file in files) { CPlaylist playlist = new CPlaylist(file); + _Playlists.Add(playlist); } SortPlaylistsByName(); @@ -75,6 +89,21 @@ namespace Vocaluxe.Base } } + public static void SavePlaylist(int PlaylistID) + { + if (PlaylistID < 0 || PlaylistID >= _Playlists.Count) + return; + _Playlists[PlaylistID].SavePlaylist(); + } + + public static int NewPlaylist() + { + CPlaylist pl = new CPlaylist(); + pl.PlaylistName = "New Playlist"; + _Playlists.Add(pl); + return (_Playlists.Count - 1); + } + #endregion } } diff --git a/Vocaluxe/Lib/Playlist/CPlaylist.cs b/Vocaluxe/Lib/Playlist/CPlaylist.cs index a87ee61a..86e5e320 100644 --- a/Vocaluxe/Lib/Playlist/CPlaylist.cs +++ b/Vocaluxe/Lib/Playlist/CPlaylist.cs @@ -36,17 +36,19 @@ namespace Vocaluxe.Lib.Playlist public string PlaylistName; public string PlaylistFile; - public List Songs; + public List Songs = new List(); public CPlaylist() { Init(); + PlaylistName = string.Empty; + PlaylistFile = string.Empty; } public CPlaylist(string file) { Init(); - PlaylistName = file; + PlaylistFile = file; LoadPlaylist(); } @@ -58,29 +60,32 @@ namespace Vocaluxe.Lib.Playlist } - private void SavePlaylist() + public void SavePlaylist() { - string filename = string.Empty; - foreach (char chr in PlaylistName) + if (PlaylistFile == string.Empty) { - if (char.IsLetter(chr)) - filename += chr.ToString(); - } - - if (filename == String.Empty) - filename = "1"; - - int i = 0; - while (File.Exists(Path.Combine(CSettings.sFolderPlaylists, filename + ".xml"))) - { - i++; - if (!File.Exists(Path.Combine(CSettings.sFolderPlaylists, filename + i + ".xml"))) + string filename = string.Empty; + foreach (char chr in PlaylistName) { - filename += i; + if (char.IsLetter(chr)) + filename += chr.ToString(); } - } - PlaylistFile = Path.Combine(CSettings.sFolderPlaylists, filename + ".xml"); + if (filename == String.Empty) + filename = "1"; + + int i = 0; + while (File.Exists(Path.Combine(CSettings.sFolderPlaylists, filename + ".xml"))) + { + i++; + if (!File.Exists(Path.Combine(CSettings.sFolderPlaylists, filename + i + ".xml"))) + { + filename += i; + } + } + + PlaylistFile = Path.Combine(CSettings.sFolderPlaylists, filename + ".xml"); + } XmlWriter writer; try @@ -107,7 +112,7 @@ namespace Vocaluxe.Lib.Playlist writer.WriteEndElement(); writer.WriteStartElement("Songs"); - for (i = 0; i < Songs.Count; i++) + for (int i = 0; i < Songs.Count; i++) { CSong song = CSongs.GetSong(Songs[i].SongID); if (song != null) @@ -202,5 +207,26 @@ namespace Vocaluxe.Lib.Playlist } } } + + public void AddSong(int SongID) + { + CPlaylistSong song = new CPlaylistSong(); + song.SongID = SongID; + if (CSongs.GetSong(SongID).IsDuet) + song.GameMode = EGameMode.TR_GAMEMODE_DUET; + else + song.GameMode = EGameMode.TR_GAMEMODE_NORMAL; + + Songs.Add(song); + } + + public void AddSong(int SongID, EGameMode gm) + { + CPlaylistSong song = new CPlaylistSong(); + song.SongID = SongID; + song.GameMode = gm; + + Songs.Add(song); + } } } diff --git a/Vocaluxe/Lib/Song/CSong.cs b/Vocaluxe/Lib/Song/CSong.cs index 120efbf6..2cb63c36 100644 --- a/Vocaluxe/Lib/Song/CSong.cs +++ b/Vocaluxe/Lib/Song/CSong.cs @@ -7,6 +7,7 @@ using System.Text.RegularExpressions; using Vocaluxe.Base; using Vocaluxe.Lib.Draw; using Vocaluxe.Menu; +using Vocaluxe.GameModes; namespace Vocaluxe.Lib.Song { @@ -148,6 +149,23 @@ namespace Vocaluxe.Lib.Song // Notes public CNotes Notes = new CNotes(); + public EGameMode[] AvailableGameModes + { + get + { + List gms = new List(); + if (IsDuet) + gms.Add(EGameMode.TR_GAMEMODE_DUET); + else + gms.Add(EGameMode.TR_GAMEMODE_NORMAL); + if (Medley.Source != EMedleySource.None) + gms.Add(EGameMode.TR_GAMEMODE_MEDLEY); + gms.Add(EGameMode.TR_GAMEMODE_SHORTSONG); + + return gms.ToArray(); + } + } + public CSong() { } diff --git a/Vocaluxe/Menu/CInteraction.cs b/Vocaluxe/Menu/CInteraction.cs index 618bc051..8f7afe8d 100644 --- a/Vocaluxe/Menu/CInteraction.cs +++ b/Vocaluxe/Menu/CInteraction.cs @@ -14,7 +14,8 @@ namespace Vocaluxe.Menu TSongMenu, TLyric, TSingNote, - TNameSelection + TNameSelection, + TPlaylist } class CInteraction diff --git a/Vocaluxe/Menu/CMenu.cs b/Vocaluxe/Menu/CMenu.cs index 01432976..e27a7c51 100644 --- a/Vocaluxe/Menu/CMenu.cs +++ b/Vocaluxe/Menu/CMenu.cs @@ -36,6 +36,7 @@ namespace Vocaluxe.Menu private List _Lyrics; private List _SingNotes; private List _NameSelections; + private List _Playlists; private Hashtable _htBackgrounds; private Hashtable _htStatics; @@ -46,6 +47,7 @@ namespace Vocaluxe.Menu private Hashtable _htSelectSlides; private Hashtable _htSingNotes; private Hashtable _htNameSelections; + private Hashtable _htPlaylists; private int _PrevMouseX; @@ -67,6 +69,7 @@ namespace Vocaluxe.Menu protected string[] _ThemeSelectSlides; protected string[] _ThemeSingNotes; protected string[] _ThemeNameSelections; + protected string[] _ThemePlaylists; protected SRectF _ScreenArea; @@ -99,6 +102,7 @@ namespace Vocaluxe.Menu _Lyrics = new List(); _SingNotes = new List(); _NameSelections = new List(); + _Playlists = new List(); _htBackgrounds = new Hashtable(); _htStatics = new Hashtable(); @@ -109,6 +113,7 @@ namespace Vocaluxe.Menu _htSelectSlides = new Hashtable(); _htSingNotes = new Hashtable(); _htNameSelections = new Hashtable(); + _htPlaylists = new Hashtable(); _PrevMouseX = 0; _PrevMouseY = 0; @@ -129,6 +134,7 @@ namespace Vocaluxe.Menu _ThemeSelectSlides = null; _ThemeSingNotes = null; _ThemeNameSelections = null; + _ThemePlaylists = null; } #region ThemeHandler @@ -311,6 +317,22 @@ namespace Vocaluxe.Menu } } } + + if (_ThemePlaylists != null) + { + for (int i = 0; i < _ThemePlaylists.Length; i++) + { + CPlaylist pls = new CPlaylist(); + if (pls.LoadTheme("//root/" + _ThemeName, _ThemePlaylists[i], navigator, SkinIndex)) + { + _htPlaylists.Add(_ThemePlaylists[i], AddPlaylist(pls)); + } + else + { + CLog.LogError("Can't load Playlist \"" + _ThemePlaylists[i] + "\" in screen " + _ThemeName); + } + } + } } else { @@ -386,6 +408,12 @@ namespace Vocaluxe.Menu _NameSelections[i].SaveTheme(writer); } + //Playlists + for (int i = 0; i < _Playlists.Count; i++) + { + _Playlists[i].SaveTheme(writer); + } + writer.WriteEndElement(); // End of File @@ -442,6 +470,11 @@ namespace Vocaluxe.Menu { ns.ReloadTextures(); } + + foreach (CPlaylist pls in _Playlists) + { + pls.ReloadTextures(); + } } public virtual void UnloadTextures() @@ -490,7 +523,10 @@ namespace Vocaluxe.Menu { ns.UnloadTextures(); } - + foreach (CPlaylist pls in _Playlists) + { + pls.UnloadTextures(); + } } @@ -547,6 +583,11 @@ namespace Vocaluxe.Menu { return _NameSelections; } + + public List GetPlaylists() + { + return _Playlists; + } #endregion GetLists #region ElementHandler @@ -622,6 +663,14 @@ namespace Vocaluxe.Menu return _NameSelections.ToArray(); } } + + public CPlaylist[] Playlists + { + get + { + return _Playlists.ToArray(); + } + } #endregion Get Arrays #region Hashtables @@ -741,6 +790,19 @@ namespace Vocaluxe.Menu throw; } } + + public int htPlaylists(string key) + { + try + { + return (int)_htPlaylists[key]; + } + catch (Exception) + { + CLog.LogError("Can't find Playlist Element \"" + key + "\" in Screen " + _ThemeName); + throw; + } + } #endregion Hashtables #endregion ElementHandler @@ -999,7 +1061,8 @@ namespace Vocaluxe.Menu _Interactions[i].Type == EType.TStatic || _Interactions[i].Type == EType.TNameSelection || _Interactions[i].Type == EType.TText || - _Interactions[i].Type == EType.TSongMenu)) + _Interactions[i].Type == EType.TSongMenu || + _Interactions[i].Type == EType.TPlaylist)) { ZSort zs = new ZSort(); zs.ID = i; @@ -1085,6 +1148,13 @@ namespace Vocaluxe.Menu _AddInteraction(_NameSelections.Count - 1, EType.TNameSelection); return _NameSelections.Count - 1; } + + public int AddPlaylist(CPlaylist pls) + { + _Playlists.Add(pls); + _AddInteraction(_Playlists.Count - 1, EType.TPlaylist); + return _Playlists.Count - 1; + } #endregion Elements #region InteractionHandling @@ -1233,6 +1303,10 @@ namespace Vocaluxe.Menu if (CHelper.IsInBounds(_NameSelections[interact.Num].Rect, x, y)) return true; break; + case EType.TPlaylist: + if (CHelper.IsInBounds(_Playlists[interact.Num].Rect, x, y)) + return true; + break; } return false; } @@ -1255,6 +1329,8 @@ namespace Vocaluxe.Menu return _Lyrics[interact.Num].Rect.Z; case EType.TNameSelection: return _NameSelections[interact.Num].Rect.Z; + case EType.TPlaylist: + return _Playlists[interact.Num].Rect.Z; } return CSettings.zFar; } @@ -1283,6 +1359,9 @@ namespace Vocaluxe.Menu case EType.TNameSelection: return _NameSelections[_Interactions[interaction].Num].Rect.Z; + + case EType.TPlaylist: + return _Playlists[_Interactions[interaction].Num].Rect.Z; } return CSettings.zFar; @@ -1605,6 +1684,9 @@ namespace Vocaluxe.Menu case EType.TNameSelection: _NameSelections[_Interactions[_Selection].Num].Selected = true; break; + case EType.TPlaylist: + //_Playlists[_Interactions[_Selection].Num].Selected = true; + break; } } @@ -1633,6 +1715,9 @@ namespace Vocaluxe.Menu case EType.TNameSelection: _NameSelections[_Interactions[_Selection].Num].Selected = false; break; + case EType.TPlaylist: + //_Playlists[_Interactions[_Selection].Num].Selected = true; + break; } } @@ -1664,6 +1749,9 @@ namespace Vocaluxe.Menu case EType.TNameSelection: //_NameSelections[_Interactions[selection].Num].Selected = true; break; + case EType.TPlaylist: + //_Playlists[_Interactions[_Selection].Num].Selected = true; + break; } } @@ -1695,6 +1783,9 @@ namespace Vocaluxe.Menu case EType.TNameSelection: //_NameSelections[_Interactions[selection].Num].Selected = false; break; + case EType.TPlaylist: + //_Playlists[_Interactions[_Selection].Num].Selected = true; + break; } } @@ -1744,6 +1835,9 @@ namespace Vocaluxe.Menu case EType.TNameSelection: return _NameSelections[_Interactions[interaction].Num].Visible; + + case EType.TPlaylist: + return _Playlists[_Interactions[interaction].Num].Visible; } return false; @@ -1774,6 +1868,9 @@ namespace Vocaluxe.Menu case EType.TNameSelection: return _NameSelections[_Interactions[interaction].Num].Rect; + + case EType.TPlaylist: + return _Playlists[_Interactions[interaction].Num].Rect; } return Result; @@ -1815,6 +1912,10 @@ namespace Vocaluxe.Menu case EType.TNameSelection: _NameSelections[_Interactions[interaction].Num].Draw(); break; + + case EType.TPlaylist: + _Playlists[_Interactions[interaction].Num].Draw(); + break; //TODO: //case EType.TLyric: @@ -1859,6 +1960,10 @@ namespace Vocaluxe.Menu case EType.TNameSelection: _NameSelections[_Interactions[_Selection].Num].MoveElement(stepX, stepY); break; + + case EType.TPlaylist: + _Playlists[_Interactions[_Selection].Num].MoveElement(stepX, stepY); + break; } } } @@ -1896,6 +2001,10 @@ namespace Vocaluxe.Menu case EType.TNameSelection: _NameSelections[_Interactions[_Selection].Num].ResizeElement(stepW, stepH); break; + + case EType.TPlaylist: + _Playlists[_Interactions[_Selection].Num].ResizeElement(stepW, stepH); + break; } } } diff --git a/Vocaluxe/Menu/CSelectSlide.cs b/Vocaluxe/Menu/CSelectSlide.cs index 099ef2ea..126ec839 100644 --- a/Vocaluxe/Menu/CSelectSlide.cs +++ b/Vocaluxe/Menu/CSelectSlide.cs @@ -112,6 +112,14 @@ namespace Vocaluxe.Menu } } + public int NumValues + { + get + { + return _ValueNames.Count; + } + } + private int _NumVisible = -1; public int NumVisible { diff --git a/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs b/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs index e4730e8e..dc917994 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs @@ -383,10 +383,10 @@ namespace Vocaluxe.Menu.SongMenu writer.WriteElementString("SpaceH", _Theme.songMenuTileBoard.spaceH.ToString("#0.00")); writer.WriteComment(": Number of tiles horizontal in small-mode"); - writer.WriteElementString("NumW", _Theme.songMenuTileBoard.numW.ToString()); + writer.WriteElementString("NumWsmall", _Theme.songMenuTileBoard.numW.ToString()); writer.WriteComment(": Number of tiles vertical in small-mode"); - writer.WriteElementString("NumH", _Theme.songMenuTileBoard.numH.ToString()); + writer.WriteElementString("NumHsmall", _Theme.songMenuTileBoard.numH.ToString()); writer.WriteComment(", , , , : SongMenu position, width and height"); writer.WriteElementString("TileRectX", _Theme.songMenuTileBoard.TileRect.X.ToString("#0")); diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index e520d0ee..9b18ab2f 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -25,21 +25,31 @@ namespace Vocaluxe.Screens private const string TextSearchBarTitle = "TextSearchBarTitle"; private const string TextSearchBar = "TextSearchBar"; private const string TextOptionsTitle = "TextOptionsTitle"; + private const string TextPlaylistHeader = "TextPlaylistHeader"; private const string ButtonOptionsSing = "ButtonOptionsSing"; private const string ButtonOptionsPlaylist = "ButtonOptionsPlaylist"; private const string ButtonOptionsClose = "ButtonOptionsClose"; + private const string ButtonPlaylistClose = "ButtonPlaylistClose"; + private const string ButtonPlaylistSing = "ButtonPlaylistSing"; + private const string ButtonPlaylistSave = "ButtonPlaylistSave"; + private const string ButtonPlaylistDelete = "ButtonPlaylistDelete"; private const string SelectSlideOptionsMode = "SelectSlideOptionsMode"; + private const string SelectSlideOptionsPlaylist = "SelectSlideOptionsPlaylist"; private const string StaticSearchBar = "StaticSearchBar"; private const string StaticOptionsBG = "StaticOptionsBG"; + private const string StaticPlaylistHeader = "StaticPlaylistHeader"; + private const string StaticPlaylistFooter = "StaticPlaylistFooter"; private const string SongMenu = "SongMenu"; + private const string Playlist = "Playlist"; private string _SearchText = String.Empty; private bool _SearchActive = false; private bool _SongOptionsActive = false; + private int _OpenedPlaylist = -1; private List _AvailableGameModes; public CScreenSong() @@ -55,22 +65,32 @@ namespace Vocaluxe.Screens _ThemeName = "ScreenSong"; _ScreenVersion = ScreenVersion; - _ThemeStatics = new string[] { StaticSearchBar, StaticOptionsBG }; - _ThemeTexts = new string[] { TextCategory, TextSelection, TextSearchBarTitle, TextSearchBar, TextOptionsTitle }; - _ThemeButtons = new string[] { ButtonOptionsClose, ButtonOptionsPlaylist, ButtonOptionsSing }; - _ThemeSelectSlides = new string[] { SelectSlideOptionsMode }; + _ThemeStatics = new string[] { StaticSearchBar, StaticOptionsBG, StaticPlaylistHeader, StaticPlaylistFooter }; + _ThemeTexts = new string[] { TextCategory, TextSelection, TextSearchBarTitle, TextSearchBar, TextOptionsTitle, TextPlaylistHeader }; + _ThemeButtons = new string[] { ButtonOptionsClose, ButtonOptionsPlaylist, ButtonOptionsSing, ButtonPlaylistClose, ButtonPlaylistSing, ButtonPlaylistSave, ButtonPlaylistDelete }; + _ThemeSelectSlides = new string[] { SelectSlideOptionsMode, SelectSlideOptionsPlaylist }; _ThemeSongMenus = new string[] { SongMenu }; + _ThemePlaylists = new string[] { Playlist }; } public override void LoadTheme() { base.LoadTheme(); SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible = false; + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Visible = false; Buttons[htButtons(ButtonOptionsClose)].Visible = false; Buttons[htButtons(ButtonOptionsSing)].Visible = false; Buttons[htButtons(ButtonOptionsPlaylist)].Visible = false; + Buttons[htButtons(ButtonPlaylistClose)].Visible = false; + Buttons[htButtons(ButtonPlaylistSing)].Visible = false; + Buttons[htButtons(ButtonPlaylistSave)].Visible = false; + Buttons[htButtons(ButtonPlaylistDelete)].Visible = false; Texts[htTexts(TextOptionsTitle)].Visible = false; + Texts[htTexts(TextPlaylistHeader)].Visible = false; Statics[htStatics(StaticOptionsBG)].Visible = false; + Statics[htStatics(StaticPlaylistHeader)].Visible = false; + Statics[htStatics(StaticPlaylistFooter)].Visible = false; + Playlists[htPlaylists(Playlist)].Visible = false; } public override bool HandleInput(KeyEvent KeyEvent) @@ -185,14 +205,40 @@ namespace Vocaluxe.Screens { case Keys.Enter: if (Buttons[htButtons(ButtonOptionsClose)].Selected) + { ToggleSongOptions(); + } else if (Buttons[htButtons(ButtonOptionsSing)].Selected) { ToggleSongOptions(); StartSong(SongMenus[htSongMenus(SongMenu)].GetSelectedSong()); } else if (Buttons[htButtons(ButtonOptionsPlaylist)].Selected) + { + //Open a playlist and add song + if (_OpenedPlaylist != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1)) + { + _OpenedPlaylist = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1; + if (_OpenedPlaylist < 0) + _OpenedPlaylist = CPlaylists.NewPlaylist(); + CPlaylists.Playlists[_OpenedPlaylist].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + OpenPlaylist(_OpenedPlaylist); + } + //Create a new playlist and add song + else if ((SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1) == -1) + { + _OpenedPlaylist = CPlaylists.NewPlaylist(); + CPlaylists.Playlists[_OpenedPlaylist].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + OpenPlaylist(_OpenedPlaylist); + } + //Add song to loaded playlist + else + { + CPlaylists.Playlists[_OpenedPlaylist].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + Playlists[htPlaylists(Playlist)].UpdatePlaylist(); + } ToggleSongOptions(); + } break; case Keys.Escape: @@ -251,7 +297,31 @@ namespace Vocaluxe.Screens } else if (Buttons[htButtons(ButtonOptionsPlaylist)].Selected) { - SongMenus[htSongMenus(SongMenu)].SetSmallView(true); + //Open a playlist and add song + if (_OpenedPlaylist != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1)) + { + _OpenedPlaylist = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1; + if (_OpenedPlaylist < 0) + _OpenedPlaylist = CPlaylists.NewPlaylist(); + CPlaylists.Playlists[_OpenedPlaylist].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + OpenPlaylist(_OpenedPlaylist); + } + //Create a new playlist and add song + else if ((SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1) == -1) + { + _OpenedPlaylist = CPlaylists.NewPlaylist(); + CPlaylists.Playlists[_OpenedPlaylist].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + OpenPlaylist(_OpenedPlaylist); + UpdatePlaylistNames(); + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].NumValues - 1; + } + //Add song to loaded playlist + else + { + CPlaylists.Playlists[_OpenedPlaylist].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + Playlists[htPlaylists(Playlist)].UpdatePlaylist(); + } + ToggleSongOptions(); } } if (MouseEvent.RB) @@ -260,6 +330,31 @@ namespace Vocaluxe.Screens } } + if (_OpenedPlaylist > -1) + { + if (MouseEvent.LB && IsMouseOver(MouseEvent)) + { + if (Buttons[htButtons(ButtonPlaylistClose)].Selected) + { + ClosePlaylist(); + } + else if (Buttons[htButtons(ButtonPlaylistSing)].Selected) + { + StartPlaylistSongs(); + } + else if (Buttons[htButtons(ButtonPlaylistSave)].Selected) + { + CPlaylists.SavePlaylist(_OpenedPlaylist); + } + else if (Buttons[htButtons(ButtonPlaylistDelete)].Selected) + { + CPlaylists.DeletePlaylist(_OpenedPlaylist); + ClosePlaylist(); + UpdatePlaylistNames(); + } + } + } + return true; } @@ -268,11 +363,16 @@ namespace Vocaluxe.Screens base.OnShow(); CGame.EnterNormalGame(); SongMenus[htSongMenus(SongMenu)].OnShow(); + Playlists[htPlaylists(Playlist)].Init(); + if(_OpenedPlaylist != -1) + Playlists[htPlaylists(Playlist)].LoadPlaylist(_OpenedPlaylist); + UpdatePlaylistNames(); } public override bool UpdateGame() { SongMenus[htSongMenus(SongMenu)].Update(); + Playlists[htPlaylists(Playlist)].Visible = SongMenus[htSongMenus(SongMenu)].IsSmallView(); Texts[htTexts(TextCategory)].Text = CSongs.GetActualCategoryName(); if (CSongs.Category > -1 || CConfig.Tabs == EOffOn.TR_CONFIG_OFF) @@ -368,6 +468,22 @@ namespace Vocaluxe.Screens } } + private void StartPlaylistSongs() + { + CGame.Reset(); + CGame.ClearSongs(); + + if (_OpenedPlaylist > -1 && _OpenedPlaylist < CPlaylists.NumPlaylists) + { + for (int i = 0; i < CPlaylists.Playlists[_OpenedPlaylist].Songs.Count; i++) + { + CGame.AddSong(CPlaylists.Playlists[_OpenedPlaylist].Songs[i].SongID, CPlaylists.Playlists[_OpenedPlaylist].Songs[i].GameMode); + } + if (CGame.GetNumSongs() > 0) + CGraphics.FadeTo(EScreens.ScreenNames); + } + } + private void StartRandomAllSongs() { CGame.Reset(); @@ -498,6 +614,7 @@ namespace Vocaluxe.Screens _AvailableGameModes.Add(GameModes.EGameMode.TR_GAMEMODE_MEDLEY); } SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible = true; + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Visible = true; Buttons[htButtons(ButtonOptionsClose)].Visible = true; Buttons[htButtons(ButtonOptionsSing)].Visible = true; Buttons[htButtons(ButtonOptionsPlaylist)].Visible = true; @@ -507,6 +624,7 @@ namespace Vocaluxe.Screens else { SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible = false; + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Visible = false; Buttons[htButtons(ButtonOptionsClose)].Visible = false; Buttons[htButtons(ButtonOptionsSing)].Visible = false; Buttons[htButtons(ButtonOptionsPlaylist)].Visible = false; @@ -514,5 +632,46 @@ namespace Vocaluxe.Screens Statics[htStatics(StaticOptionsBG)].Visible = false; } } + + private void OpenPlaylist(int PlaylistID) + { + if (CPlaylists.Playlists.Length > PlaylistID && PlaylistID > -1) + { + _OpenedPlaylist = PlaylistID; + Playlists[htPlaylists(Playlist)].LoadPlaylist(_OpenedPlaylist); + SongMenus[htSongMenus(SongMenu)].SetSmallView(true); + Playlists[htPlaylists(Playlist)].Visible = true; + Statics[htStatics(StaticPlaylistHeader)].Visible = true; + Statics[htStatics(StaticPlaylistFooter)].Visible = true; + Texts[htTexts(TextPlaylistHeader)].Visible = true; + Texts[htTexts(TextPlaylistHeader)].Text = CPlaylists.Playlists[PlaylistID].PlaylistName; + Buttons[htButtons(ButtonPlaylistClose)].Visible = true; + Buttons[htButtons(ButtonPlaylistSing)].Visible = true; + Buttons[htButtons(ButtonPlaylistSave)].Visible = true; + Buttons[htButtons(ButtonPlaylistDelete)].Visible = true; + } + } + + private void ClosePlaylist() + { + _OpenedPlaylist = -1; + SongMenus[htSongMenus(SongMenu)].SetSmallView(false); + Playlists[htPlaylists(Playlist)].Visible = false; + Statics[htStatics(StaticPlaylistHeader)].Visible = false; + Statics[htStatics(StaticPlaylistFooter)].Visible = false; + Texts[htTexts(TextPlaylistHeader)].Visible = false; + Texts[htTexts(TextPlaylistHeader)].Text = String.Empty; + Buttons[htButtons(ButtonPlaylistClose)].Visible = false; + Buttons[htButtons(ButtonPlaylistSing)].Visible = false; + Buttons[htButtons(ButtonPlaylistSave)].Visible = false; + Buttons[htButtons(ButtonPlaylistDelete)].Visible = false; + } + + private void UpdatePlaylistNames() + { + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Clear(); + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].AddValue("TR_SCREENSONG_NEWPLAYLIST"); + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].AddValues(CPlaylists.PlaylistNames); + } } } diff --git a/Vocaluxe/Vocaluxe.csproj b/Vocaluxe/Vocaluxe.csproj index 3b9ff835..8c439bef 100644 --- a/Vocaluxe/Vocaluxe.csproj +++ b/Vocaluxe/Vocaluxe.csproj @@ -214,6 +214,7 @@ + From ba04c6babb044f1fbd8c44240a4b2d30a35ea174 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sun, 8 Jul 2012 14:11:09 +0200 Subject: [PATCH 17/70] Forget to upload file. --- Vocaluxe/Menu/CPlaylist.cs | 396 +++++++++++++++++++++++++++++++++++++ 1 file changed, 396 insertions(+) create mode 100644 Vocaluxe/Menu/CPlaylist.cs diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs new file mode 100644 index 00000000..3725196b --- /dev/null +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -0,0 +1,396 @@ +using System; +using System.Drawing; +using System.Collections.Generic; +using System.Text; +using System.Xml; +using System.Xml.XPath; + +using Vocaluxe.Base; +using Vocaluxe.Lib.Draw; +using Vocaluxe.GameModes; + +namespace Vocaluxe.Menu +{ + + struct SThemePlaylist + { + public string Name; + + public string ColorBackgroundName; + public string SColorBackgroundName; + + public string TextureBackgroundName; + public string STextureBackgroundName; + + public float EntryHeight; + + public string StringText1; + public string StringText2; + public string StringText3; + + public CText Text1; + public CText Text2; + public CText Text3; + + public CStatic StaticCover; + + public CSelectSlide SelectSlideGameMode; + } + + class CPlaylist : IMenuElement + { + struct PlaylistElementContent + { + public EGameMode[] Modes; + public int SongID; + public EGameMode Mode; + } + + struct PlaylistElement + { + public CStatic Cover; + public CStatic Background; + public CText Text1; + public CText Text2; + public CText Text3; + public CSelectSlide SelectSlide; + } + + private SThemePlaylist _Theme; + private bool _ThemeLoaded; + + private List PlaylistElements; + private List PlaylistElementContents; + + public SRectF Rect; + public SColorF BackgroundColor; + public SColorF BackgroundSColor; + + public bool Visible; + + public int ActivePlaylistID = 0; + public int Offset = 0; + + public CPlaylist() + { + _Theme = new SThemePlaylist(); + _Theme.Text1 = new CText(); + _Theme.Text2 = new CText(); + _Theme.Text3 = new CText(); + _Theme.StaticCover = new CStatic(); + _Theme.SelectSlideGameMode = new CSelectSlide(); + + Rect = new SRectF(); + BackgroundColor = new SColorF(); + BackgroundSColor = new SColorF(); + + PlaylistElements = new List(); + PlaylistElementContents = new List(); + + Visible = false; + } + + public void Init() + { + PrepareList(); + } + + public bool LoadTheme(string XmlPath, string ElementName, XPathNavigator navigator, int SkinIndex) + { + string item = XmlPath + "/" + ElementName; + _ThemeLoaded = true; + + _ThemeLoaded &= CHelper.GetValueFromXML(item + "/SkinBackground", navigator, ref _Theme.TextureBackgroundName, String.Empty); + _ThemeLoaded &= CHelper.GetValueFromXML(item + "/SkinBackgroundSelected", navigator, ref _Theme.STextureBackgroundName, String.Empty); + + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/X", navigator, ref Rect.X); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/Y", navigator, ref Rect.Y); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/Z", navigator, ref Rect.Z); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/W", navigator, ref Rect.W); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/H", navigator, ref Rect.H); + if (CHelper.GetValueFromXML(item + "/ColorBackground", navigator, ref _Theme.ColorBackgroundName, String.Empty)) + { + _ThemeLoaded &= CTheme.GetColor(_Theme.ColorBackgroundName, SkinIndex, ref BackgroundColor); + } + else + { + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/BackgroundR", navigator, ref BackgroundColor.R); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/BackgroundG", navigator, ref BackgroundColor.G); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/BackgroundB", navigator, ref BackgroundColor.B); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/BackgroundA", navigator, ref BackgroundColor.A); + } + if (CHelper.GetValueFromXML(item + "/SColorBackground", navigator, ref _Theme.SColorBackgroundName, String.Empty)) + { + _ThemeLoaded &= CTheme.GetColor(_Theme.SColorBackgroundName, SkinIndex, ref BackgroundSColor); + } + else + { + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/SBackgroundR", navigator, ref BackgroundSColor.R); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/SBackgroundG", navigator, ref BackgroundSColor.G); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/SBackgroundB", navigator, ref BackgroundSColor.B); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/SBackgroundA", navigator, ref BackgroundSColor.A); + } + + _ThemeLoaded &= _Theme.Text1.LoadTheme(item, "TextPart1", navigator, SkinIndex); + _ThemeLoaded &= _Theme.Text2.LoadTheme(item, "TextPart2", navigator, SkinIndex); + _ThemeLoaded &= _Theme.Text2.LoadTheme(item, "TextPart3", navigator, SkinIndex); + _Theme.StringText1 = _Theme.Text1.Text; + _Theme.StringText2 = _Theme.Text2.Text; + _Theme.StringText3 = _Theme.Text3.Text; + + _ThemeLoaded &= _Theme.StaticCover.LoadTheme(item, "StaticCover", navigator, SkinIndex); + _ThemeLoaded &= _Theme.SelectSlideGameMode.LoadTheme(item, "SelectSlideGameMode", navigator, SkinIndex); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/EntryHeight", navigator, ref _Theme.EntryHeight); + if (_ThemeLoaded) + { + _Theme.Name = ElementName; + LoadTextures(); + } + return _ThemeLoaded; + } + + public bool SaveTheme(XmlWriter writer) + { + if (_ThemeLoaded) + { + writer.WriteStartElement(_Theme.Name); + + writer.WriteComment(", , , , : Playlist position, width and height"); + writer.WriteElementString("X", Rect.X.ToString("#0")); + writer.WriteElementString("Y", Rect.Y.ToString("#0")); + writer.WriteElementString("Z", Rect.Z.ToString("#0.00")); + writer.WriteElementString("W", Rect.W.ToString("#0")); + writer.WriteElementString("H", Rect.H.ToString("#0")); + + writer.WriteElementString("EntryHeight", _Theme.EntryHeight.ToString("#0.00")); + + writer.WriteComment(": Texture name"); + writer.WriteElementString("SkinBackground", _Theme.TextureBackgroundName); + + writer.WriteComment(": Texture name for selected playlist-entry"); + writer.WriteElementString("SkinBackgroundSelected", _Theme.STextureBackgroundName); + + writer.WriteComment(": Button color from ColorScheme (high priority)"); + writer.WriteComment("or , , , (lower priority)"); + if (_Theme.ColorBackgroundName != String.Empty) + { + writer.WriteElementString("BackgroundColor", _Theme.ColorBackgroundName); + } + else + { + writer.WriteElementString("BackgroundR", BackgroundColor.R.ToString("#0.00")); + writer.WriteElementString("BackgroundG", BackgroundColor.G.ToString("#0.00")); + writer.WriteElementString("BackgroundB", BackgroundColor.B.ToString("#0.00")); + writer.WriteElementString("BackgroundA", BackgroundColor.A.ToString("#0.00")); + } + + writer.WriteComment(": Selected paylist-entry color from ColorScheme (high priority)"); + writer.WriteComment("or , , , (lower priority)"); + if (_Theme.SColorBackgroundName != String.Empty) + { + writer.WriteElementString("SColor", _Theme.SColorBackgroundName); + } + else + { + writer.WriteElementString("SR", BackgroundSColor.R.ToString("#0.00")); + writer.WriteElementString("SG", BackgroundSColor.G.ToString("#0.00")); + writer.WriteElementString("SB", BackgroundSColor.B.ToString("#0.00")); + writer.WriteElementString("SA", BackgroundSColor.A.ToString("#0.00")); + } + + writer.WriteComment("Positions of , , , and are relative to playlist-entry!"); + writer.WriteComment("Use placeholders for Text of , and : %t, %a, %l"); + _Theme.Text1.SaveTheme(writer); + _Theme.Text2.SaveTheme(writer); + _Theme.Text3.SaveTheme(writer); + _Theme.StaticCover.SaveTheme(writer); + _Theme.SelectSlideGameMode.SaveTheme(writer); + + writer.WriteEndElement(); + + return true; + } + return false; + } + + public void Draw() + { + Draw(false); + } + + public void ForceDraw() + { + Draw(true); + } + + public void Draw(bool ForceDraw) + { + if (PlaylistElements.Count <= 0) + { + LoadPlaylist(0); + } + if (!Visible && CSettings.GameState != EGameState.EditTheme && !ForceDraw) + return; + + for (int i = 0; i < PlaylistElements.Count; i++ ) + { + PlaylistElements[i].Background.Draw(); + PlaylistElements[i].Cover.Draw(); + PlaylistElements[i].Text1.Draw(); + PlaylistElements[i].Text2.Draw(); + PlaylistElements[i].Text3.Draw(); + PlaylistElements[i].SelectSlide.Draw(); + } + } + + public void UnloadTextures() + { + } + + public void LoadTextures() + { + _Theme.Text1.LoadTextures(); + _Theme.Text2.LoadTextures(); + _Theme.Text3.LoadTextures(); + + if (_Theme.ColorBackgroundName != String.Empty) + BackgroundColor = CTheme.GetColor(_Theme.ColorBackgroundName); + + if (_Theme.SColorBackgroundName != String.Empty) + BackgroundSColor = CTheme.GetColor(_Theme.SColorBackgroundName); + } + + public void ReloadTextures() + { + UnloadTextures(); + LoadTextures(); + } + + private void PrepareList() + { + PlaylistElements.Clear(); + for (int i = 0; i < (Rect.H / _Theme.EntryHeight); i++) + { + PlaylistElement en = new PlaylistElement(); + en.Background = new CStatic(_Theme.TextureBackgroundName, BackgroundColor, new SRectF(Rect.X, Rect.Y + (i * _Theme.EntryHeight), Rect.W, _Theme.EntryHeight, Rect.Z)); + en.Cover = new CStatic(new STexture(), _Theme.StaticCover.Color, new SRectF(Rect.X + _Theme.StaticCover.Rect.X, Rect.Y + _Theme.StaticCover.Rect.Y + (i * _Theme.EntryHeight), _Theme.StaticCover.Rect.W, _Theme.StaticCover.Rect.H, _Theme.StaticCover.Rect.Z)); + en.Text1 = new CText(Rect.X + _Theme.Text1.X, Rect.Y + _Theme.Text1.Y + (i * _Theme.EntryHeight), _Theme.Text1.Z, _Theme.Text1.Height, _Theme.Text1.MaxWidth, _Theme.Text1.Align, _Theme.Text1.Style, _Theme.Text1.Fon, _Theme.Text1.Color, "", _Theme.Text1.ReflectionSpace, _Theme.Text1.ReflectionHeight); + en.Text2 = new CText(Rect.X + _Theme.Text2.X, Rect.Y + _Theme.Text2.Y + (i * _Theme.EntryHeight), _Theme.Text2.Z, _Theme.Text2.Height, _Theme.Text2.MaxWidth, _Theme.Text2.Align, _Theme.Text2.Style, _Theme.Text2.Fon, _Theme.Text2.Color, "", _Theme.Text2.ReflectionSpace, _Theme.Text2.ReflectionHeight); + en.Text3 = new CText(Rect.X + _Theme.Text3.X, Rect.Y + _Theme.Text3.Y + (i * _Theme.EntryHeight), _Theme.Text3.Z, _Theme.Text3.Height, _Theme.Text3.MaxWidth, _Theme.Text3.Align, _Theme.Text3.Style, _Theme.Text3.Fon, _Theme.Text3.Color, "", _Theme.Text3.ReflectionSpace, _Theme.Text3.ReflectionHeight); + en.SelectSlide = new CSelectSlide(); + en.SelectSlide.Rect = new SRectF(Rect.X + _Theme.SelectSlideGameMode.Rect.X, Rect.Y + _Theme.SelectSlideGameMode.Rect.Y + (i * _Theme.EntryHeight), _Theme.SelectSlideGameMode.Rect.W, _Theme.SelectSlideGameMode.Rect.H, _Theme.SelectSlideGameMode.Rect.Z); + en.SelectSlide.RectArrowLeft = new SRectF(Rect.X + _Theme.SelectSlideGameMode.RectArrowLeft.X, Rect.Y + _Theme.SelectSlideGameMode.RectArrowLeft.Y + (i * _Theme.EntryHeight), _Theme.SelectSlideGameMode.RectArrowLeft.W, _Theme.SelectSlideGameMode.RectArrowLeft.H, _Theme.SelectSlideGameMode.RectArrowLeft.Z); + en.SelectSlide.RectArrowRight = new SRectF(Rect.X + _Theme.SelectSlideGameMode.RectArrowRight.X, Rect.Y + _Theme.SelectSlideGameMode.RectArrowRight.Y + (i * _Theme.EntryHeight), _Theme.SelectSlideGameMode.RectArrowRight.W, _Theme.SelectSlideGameMode.RectArrowRight.H, _Theme.SelectSlideGameMode.RectArrowRight.Z); + en.SelectSlide.Color = _Theme.SelectSlideGameMode.Color; + en.SelectSlide.ColorArrow = _Theme.SelectSlideGameMode.ColorArrow; + en.SelectSlide.HColor = _Theme.SelectSlideGameMode.HColor; + en.SelectSlide.Highlighted = _Theme.SelectSlideGameMode.Highlighted; + en.SelectSlide.MaxW = _Theme.SelectSlideGameMode.MaxW; + en.SelectSlide.SColor = _Theme.SelectSlideGameMode.SColor; + en.SelectSlide.SColorArrow = _Theme.SelectSlideGameMode.SColorArrow; + en.SelectSlide.STextColor = _Theme.SelectSlideGameMode.STextColor; + en.SelectSlide.TextColor = _Theme.SelectSlideGameMode.TextColor; + en.SelectSlide.TextH = _Theme.SelectSlideGameMode.TextH; + en.SelectSlide.Visible = true; + PlaylistElements.Add(en); + } + } + + public bool LoadPlaylist(int PlaylistID) + { + if (PlaylistID > -1 && PlaylistID < CPlaylists.NumPlaylists) + { + ActivePlaylistID = PlaylistID; + PlaylistElementContents.Clear(); + for (int i = 0; i < CPlaylists.Playlists[ActivePlaylistID].Songs.Count; i++) + { + PlaylistElementContent pec = new PlaylistElementContent(); + pec.SongID = CPlaylists.Playlists[ActivePlaylistID].Songs[i].SongID; + pec.Modes = CSongs.AllSongs[CPlaylists.Playlists[ActivePlaylistID].Songs[i].SongID].AvailableGameModes; + pec.Mode = CPlaylists.Playlists[ActivePlaylistID].Songs[i].GameMode; + PlaylistElementContents.Add(pec); + } + Update(); + return true; + } + else + return false; + } + + public void UpdatePlaylist() + { + PlaylistElementContents.Clear(); + for (int i = 0; i < CPlaylists.Playlists[ActivePlaylistID].Songs.Count; i++) + { + PlaylistElementContent pec = new PlaylistElementContent(); + pec.SongID = CPlaylists.Playlists[ActivePlaylistID].Songs[i].SongID; + pec.Modes = CSongs.AllSongs[CPlaylists.Playlists[ActivePlaylistID].Songs[i].SongID].AvailableGameModes; + pec.Mode = CPlaylists.Playlists[ActivePlaylistID].Songs[i].GameMode; + PlaylistElementContents.Add(pec); + } + Update(); + } + + public void Update() + { + if (ActivePlaylistID > -1 && ActivePlaylistID < CPlaylists.NumPlaylists) + { + int e = 0 + Offset; + for (int i = 0; i < PlaylistElements.Count; i++ ) + { + if (e < PlaylistElementContents.Count) + { + PlaylistElements[i].Background.Visible = true; + PlaylistElements[i].Cover.Visible = true; + PlaylistElements[i].SelectSlide.Visible = true; + PlaylistElements[i].Text1.Visible = true; + PlaylistElements[i].Text2.Visible = true; + PlaylistElements[i].Text3.Visible = true; + PlaylistElements[i].Cover.Texture = CSongs.GetSong(PlaylistElementContents[e].SongID).CoverTextureSmall; + string t1 = _Theme.Text1.Text.Replace("%a", CSongs.GetSong(PlaylistElementContents[e].SongID).Artist).Replace("%t", CSongs.GetSong(PlaylistElementContents[e].SongID).Title); + string t2 = _Theme.Text2.Text.Replace("%a", CSongs.GetSong(PlaylistElementContents[e].SongID).Artist).Replace("%t", CSongs.GetSong(PlaylistElementContents[e].SongID).Title); + string t3 = _Theme.Text3.Text.Replace("%a", CSongs.GetSong(PlaylistElementContents[e].SongID).Artist).Replace("%t", CSongs.GetSong(PlaylistElementContents[e].SongID).Title); + PlaylistElements[i].Text1.Text = t1; + PlaylistElements[i].Text2.Text = t2; + PlaylistElements[i].Text3.Text = t3; + for (int g = 0; g < PlaylistElementContents[e].Modes.Length; g++) + { + PlaylistElements[i].SelectSlide.AddValue(Enum.GetName(typeof(GameModes.EGameMode), PlaylistElementContents[e].Modes[g])); + if (PlaylistElementContents[e].Modes[g] == PlaylistElementContents[e].Mode) + PlaylistElements[i].SelectSlide.SetSelectionByValueIndex(g); + } + e++; + } + else + { + PlaylistElements[i].Background.Visible = false; + PlaylistElements[i].Cover.Visible = false; + PlaylistElements[i].SelectSlide.Visible = false; + PlaylistElements[i].Text1.Visible = false; + PlaylistElements[i].Text2.Visible = false; + PlaylistElements[i].Text3.Visible = false; + } + } + } + } + + #region ThemeEdit + public void MoveElement(int stepX, int stepY) + { + Rect.X += stepX; + Rect.Y += stepY; + } + + public void ResizeElement(int stepW, int stepH) + { + Rect.W += stepW; + if (Rect.W <= 0) + Rect.W = 1; + + Rect.H += stepH; + if (Rect.H <= 0) + Rect.H = 1; + } + #endregion ThemeEdit + } +} From 2d400469cf7d6fa1902e1770c7d9670b77faede7 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sun, 8 Jul 2012 21:38:37 +0200 Subject: [PATCH 18/70] Added first mouse-handling. RB to delete PlaylistEntry. --- Vocaluxe/Lib/Playlist/CPlaylist.cs | 5 ++ Vocaluxe/Menu/CPlaylist.cs | 81 ++++++++++++++++++++++++++++-- Vocaluxe/Screens/CScreenSong.cs | 11 ++++ 3 files changed, 94 insertions(+), 3 deletions(-) diff --git a/Vocaluxe/Lib/Playlist/CPlaylist.cs b/Vocaluxe/Lib/Playlist/CPlaylist.cs index 86e5e320..dd77d8ff 100644 --- a/Vocaluxe/Lib/Playlist/CPlaylist.cs +++ b/Vocaluxe/Lib/Playlist/CPlaylist.cs @@ -228,5 +228,10 @@ namespace Vocaluxe.Lib.Playlist Songs.Add(song); } + + public void DeleteSong(int SongNr) + { + Songs.RemoveAt(SongNr); + } } } diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs index 3725196b..617ad876 100644 --- a/Vocaluxe/Menu/CPlaylist.cs +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -39,14 +39,14 @@ namespace Vocaluxe.Menu class CPlaylist : IMenuElement { - struct PlaylistElementContent + class PlaylistElementContent { public EGameMode[] Modes; public int SongID; public EGameMode Mode; } - struct PlaylistElement + class PlaylistElement { public CStatic Cover; public CStatic Background; @@ -54,6 +54,7 @@ namespace Vocaluxe.Menu public CText Text2; public CText Text3; public CSelectSlide SelectSlide; + public int Content; } private SThemePlaylist _Theme; @@ -70,6 +71,7 @@ namespace Vocaluxe.Menu public int ActivePlaylistID = 0; public int Offset = 0; + public int ActiveHover = -1; public CPlaylist() { @@ -266,6 +268,76 @@ namespace Vocaluxe.Menu LoadTextures(); } + public bool HandleInput(KeyEvent kevent) + { + switch (kevent.Key) + { + } + return false; + } + + public bool HandleMouse(MouseEvent mevent) + { + if (CHelper.IsInBounds(Rect, mevent)) + { + if (mevent.Wheel > 0) + { + return true; + } + else if (mevent.Wheel < 0) + { + if (PlaylistElements.Count + Offset + mevent.Wheel <= PlaylistElementContents.Count) + { + Offset = Offset + mevent.Wheel; + return true; + } + if (Offset - mevent.Wheel >= 0) + { + Offset = Offset - mevent.Wheel; + return true; + } + } + + for (int i = 0; i < PlaylistElements.Count; i++) + { + //Hover for playlist-element + if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, mevent)) + { + PlaylistElements[i].Background.Texture = CTheme.GetSkinTexture(_Theme.STextureBackgroundName); + PlaylistElements[i].Background.Color = BackgroundSColor; + ActiveHover = i; + } + else + { + PlaylistElements[i].Background.Texture = CTheme.GetSkinTexture(_Theme.TextureBackgroundName); + PlaylistElements[i].Background.Color = BackgroundColor; + } + //Delete Entry with RB + if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, mevent) && mevent.RB && PlaylistElements[i].Content != -1) + { + CPlaylists.Playlists[ActivePlaylistID].DeleteSong(PlaylistElements[i].Content); + UpdatePlaylist(); + return true; + } + //Change order with holding LB + else if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, mevent) && mevent.LBH && PlaylistElements[i].Content != -1) + { + return true; + } + } + } + else + { + if (ActiveHover != -1) + { + PlaylistElements[ActiveHover].Background.Texture = CTheme.GetSkinTexture(_Theme.TextureBackgroundName); + PlaylistElements[ActiveHover].Background.Color = BackgroundColor; + ActiveHover = -1; + } + } + return false; + } + private void PrepareList() { PlaylistElements.Clear(); @@ -292,6 +364,7 @@ namespace Vocaluxe.Menu en.SelectSlide.TextColor = _Theme.SelectSlideGameMode.TextColor; en.SelectSlide.TextH = _Theme.SelectSlideGameMode.TextH; en.SelectSlide.Visible = true; + en.Content = -1; PlaylistElements.Add(en); } } @@ -340,6 +413,7 @@ namespace Vocaluxe.Menu { if (e < PlaylistElementContents.Count) { + PlaylistElements[i].Content = e; PlaylistElements[i].Background.Visible = true; PlaylistElements[i].Cover.Visible = true; PlaylistElements[i].SelectSlide.Visible = true; @@ -359,7 +433,7 @@ namespace Vocaluxe.Menu if (PlaylistElementContents[e].Modes[g] == PlaylistElementContents[e].Mode) PlaylistElements[i].SelectSlide.SetSelectionByValueIndex(g); } - e++; + e++; } else { @@ -369,6 +443,7 @@ namespace Vocaluxe.Menu PlaylistElements[i].Text1.Visible = false; PlaylistElements[i].Text2.Visible = false; PlaylistElements[i].Text3.Visible = false; + PlaylistElements[i].Content = -1; } } } diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 9b18ab2f..55dd2abf 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -97,6 +97,12 @@ namespace Vocaluxe.Screens { base.HandleInput(KeyEvent); + + if (Playlists[htPlaylists(Playlist)].HandleInput(KeyEvent)) + { + return true; + } + if (!_SongOptionsActive) { @@ -255,6 +261,11 @@ namespace Vocaluxe.Screens { base.HandleMouse(MouseEvent); + if (Playlists[htPlaylists(Playlist)].HandleMouse(MouseEvent)) + { + return true; + } + if (!_SongOptionsActive) { From 9a3e2653700bb0c0272b2d6db569ddfb964b69a5 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Mon, 9 Jul 2012 11:09:05 +0200 Subject: [PATCH 19/70] First keyboard-handling. Still buggy. --- Vocaluxe/Lib/Playlist/CPlaylist.cs | 16 +++++ Vocaluxe/Menu/CInteraction.cs | 3 +- Vocaluxe/Menu/CMenu.cs | 4 +- Vocaluxe/Menu/CPlaylist.cs | 105 ++++++++++++++++++++++++++++- Vocaluxe/Screens/CScreenSong.cs | 5 +- 5 files changed, 124 insertions(+), 9 deletions(-) diff --git a/Vocaluxe/Lib/Playlist/CPlaylist.cs b/Vocaluxe/Lib/Playlist/CPlaylist.cs index dd77d8ff..47e59ca6 100644 --- a/Vocaluxe/Lib/Playlist/CPlaylist.cs +++ b/Vocaluxe/Lib/Playlist/CPlaylist.cs @@ -233,5 +233,21 @@ namespace Vocaluxe.Lib.Playlist { Songs.RemoveAt(SongNr); } + + public void SongDown(int SongNr) + { + if (SongNr != 0) + { + Songs.Reverse(SongNr - 1, 2); + } + } + + public void SongUp(int SongNr) + { + if (SongNr + 1 < Songs.Count) + { + Songs.Reverse(SongNr, 2); + } + } } } diff --git a/Vocaluxe/Menu/CInteraction.cs b/Vocaluxe/Menu/CInteraction.cs index 8f7afe8d..8937df1f 100644 --- a/Vocaluxe/Menu/CInteraction.cs +++ b/Vocaluxe/Menu/CInteraction.cs @@ -43,7 +43,8 @@ namespace Vocaluxe.Menu _Type == EType.TStatic || _Type == EType.TSongMenu || _Type == EType.TLyric || - _Type == EType.TSingNote); + _Type == EType.TSingNote || + _Type == EType.TPlaylist); } } diff --git a/Vocaluxe/Menu/CMenu.cs b/Vocaluxe/Menu/CMenu.cs index e27a7c51..386abe0a 100644 --- a/Vocaluxe/Menu/CMenu.cs +++ b/Vocaluxe/Menu/CMenu.cs @@ -1685,7 +1685,7 @@ namespace Vocaluxe.Menu _NameSelections[_Interactions[_Selection].Num].Selected = true; break; case EType.TPlaylist: - //_Playlists[_Interactions[_Selection].Num].Selected = true; + _Playlists[_Interactions[_Selection].Num].Selected = true; break; } } @@ -1716,7 +1716,7 @@ namespace Vocaluxe.Menu _NameSelections[_Interactions[_Selection].Num].Selected = false; break; case EType.TPlaylist: - //_Playlists[_Interactions[_Selection].Num].Selected = true; + _Playlists[_Interactions[_Selection].Num].Selected = false; break; } } diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs index 617ad876..fcd641cb 100644 --- a/Vocaluxe/Menu/CPlaylist.cs +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text; using System.Xml; using System.Xml.XPath; +using System.Windows.Forms; using Vocaluxe.Base; using Vocaluxe.Lib.Draw; @@ -68,10 +69,12 @@ namespace Vocaluxe.Menu public SColorF BackgroundSColor; public bool Visible; + public bool Selected; public int ActivePlaylistID = 0; public int Offset = 0; public int ActiveHover = -1; + public int CurrentPlaylistElement = -1; public CPlaylist() { @@ -90,6 +93,7 @@ namespace Vocaluxe.Menu PlaylistElementContents = new List(); Visible = false; + Selected = false; } public void Init() @@ -236,6 +240,16 @@ namespace Vocaluxe.Menu for (int i = 0; i < PlaylistElements.Count; i++ ) { + if (i == ActiveHover) + { + PlaylistElements[i].Background.Texture = CTheme.GetSkinTexture(_Theme.STextureBackgroundName); + PlaylistElements[i].Background.Color = BackgroundSColor; + } + else + { + PlaylistElements[i].Background.Texture = CTheme.GetSkinTexture(_Theme.TextureBackgroundName); + PlaylistElements[i].Background.Color = BackgroundColor; + } PlaylistElements[i].Background.Draw(); PlaylistElements[i].Cover.Draw(); PlaylistElements[i].Text1.Draw(); @@ -270,8 +284,93 @@ namespace Vocaluxe.Menu public bool HandleInput(KeyEvent kevent) { - switch (kevent.Key) + if (Visible) { + switch (kevent.Key) + { + case Keys.Up: + if (CurrentPlaylistElement == -1) + CurrentPlaylistElement = 0; + else if (CurrentPlaylistElement - 1 > 0) + CurrentPlaylistElement--; + else if (CurrentPlaylistElement - 1 == 0) + { + CurrentPlaylistElement--; + if (Offset > 0) + { + Offset--; + Update(); + } + } + ActiveHover = CurrentPlaylistElement; + return true; + + case Keys.Down: + if (CurrentPlaylistElement == -1) + CurrentPlaylistElement = 0; + else if (CurrentPlaylistElement + 1 < PlaylistElements.Count) + { + if (PlaylistElements[CurrentPlaylistElement + 1].Content != -1) + { + CurrentPlaylistElement++; + } + } + else if (CurrentPlaylistElement + 1 >= PlaylistElements.Count && CurrentPlaylistElement + Offset + 1 < PlaylistElementContents.Count) + { + if (PlaylistElementContents[CurrentPlaylistElement + Offset + 1].SongID != -1) + { + Offset++; + Update(); + } + } + ActiveHover = CurrentPlaylistElement; + return true; + + case Keys.Delete: + if (CurrentPlaylistElement != -1) + { + CPlaylists.Playlists[ActivePlaylistID].DeleteSong(PlaylistElements[CurrentPlaylistElement].Content); + UpdatePlaylist(); + return true; + } + return false; + + case Keys.PageUp: + if (CurrentPlaylistElement != -1) + { + CPlaylists.Playlists[ActivePlaylistID].SongDown(CurrentPlaylistElement+Offset); + if (CurrentPlaylistElement - 1 > -1) + { + CurrentPlaylistElement--; + ActiveHover = CurrentPlaylistElement; + } + else if(Offset > 0) + { + Offset--; + } + UpdatePlaylist(); + return true; + } + break; + + case Keys.PageDown: + if (CurrentPlaylistElement != -1) + { + CPlaylists.Playlists[ActivePlaylistID].SongUp(CurrentPlaylistElement+Offset); + if (CurrentPlaylistElement + 1 < PlaylistElements.Count) + { + CurrentPlaylistElement++; + ActiveHover = CurrentPlaylistElement; + } + else if (Offset + CurrentPlaylistElement < PlaylistElementContents.Count) + { + Offset++; + } + UpdatePlaylist(); + return true; + } + break; + } } return false; } @@ -306,6 +405,7 @@ namespace Vocaluxe.Menu PlaylistElements[i].Background.Texture = CTheme.GetSkinTexture(_Theme.STextureBackgroundName); PlaylistElements[i].Background.Color = BackgroundSColor; ActiveHover = i; + CurrentPlaylistElement = -1; } else { @@ -330,9 +430,8 @@ namespace Vocaluxe.Menu { if (ActiveHover != -1) { - PlaylistElements[ActiveHover].Background.Texture = CTheme.GetSkinTexture(_Theme.TextureBackgroundName); - PlaylistElements[ActiveHover].Background.Color = BackgroundColor; ActiveHover = -1; + CurrentPlaylistElement = -1; } } return false; diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 55dd2abf..39a8266f 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -96,12 +96,11 @@ namespace Vocaluxe.Screens public override bool HandleInput(KeyEvent KeyEvent) { base.HandleInput(KeyEvent); - + if (KeyEvent.Handled) + return true; if (Playlists[htPlaylists(Playlist)].HandleInput(KeyEvent)) - { return true; - } if (!_SongOptionsActive) { From ad66fdb07b5f53a3ff5e2e55de777195ad8a2d5d Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Tue, 10 Jul 2012 17:06:40 +0200 Subject: [PATCH 20/70] Forget to add new color-sheme. --- Output/Themes/Ambient/Skin Blue.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Output/Themes/Ambient/Skin Blue.xml b/Output/Themes/Ambient/Skin Blue.xml index 3cb2b0db..7ddf916d 100644 --- a/Output/Themes/Ambient/Skin Blue.xml +++ b/Output/Themes/Ambient/Skin Blue.xml @@ -130,6 +130,12 @@ 0,969 1,000 + + 0,675 + 0,890 + 0,969 + 0,500 + 0,675 0,890 From 9b1e2b858032540c84fdc8535af854f43f9f9d5a Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Tue, 10 Jul 2012 17:48:01 +0200 Subject: [PATCH 21/70] First part of fixing SelectSlide for Playlist. --- Output/Themes/Ambient/Screens/ScreenSong.xml | 6 +++--- Vocaluxe/Menu/CPlaylist.cs | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Output/Themes/Ambient/Screens/ScreenSong.xml b/Output/Themes/Ambient/Screens/ScreenSong.xml index 24f56698..1a140efe 100644 --- a/Output/Themes/Ambient/Screens/ScreenSong.xml +++ b/Output/Themes/Ambient/Screens/ScreenSong.xml @@ -1127,13 +1127,13 @@ 54 30 - 0,00 + -1,02 20 20 - 110 + 235 30 - 0,00 + -1,02 20 20 diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs index fcd641cb..2735f11c 100644 --- a/Vocaluxe/Menu/CPlaylist.cs +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -457,6 +457,7 @@ namespace Vocaluxe.Menu en.SelectSlide.HColor = _Theme.SelectSlideGameMode.HColor; en.SelectSlide.Highlighted = _Theme.SelectSlideGameMode.Highlighted; en.SelectSlide.MaxW = _Theme.SelectSlideGameMode.MaxW; + en.SelectSlide.NumVisible = _Theme.SelectSlideGameMode.NumVisible; en.SelectSlide.SColor = _Theme.SelectSlideGameMode.SColor; en.SelectSlide.SColorArrow = _Theme.SelectSlideGameMode.SColorArrow; en.SelectSlide.STextColor = _Theme.SelectSlideGameMode.STextColor; From b007c79d22e427701bdfe5a819eb42e11fe7591a Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Wed, 11 Jul 2012 12:52:44 +0200 Subject: [PATCH 22/70] More input-handling. Keyboard doesn't work atm. --- Vocaluxe/Menu/CPlaylist.cs | 49 +++++++++++++++++++++------------ Vocaluxe/Menu/CSelectSlide.cs | 7 ++++- Vocaluxe/Screens/CScreenSong.cs | 6 ++-- 3 files changed, 41 insertions(+), 21 deletions(-) diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs index 2735f11c..3ddc6320 100644 --- a/Vocaluxe/Menu/CPlaylist.cs +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -284,7 +284,7 @@ namespace Vocaluxe.Menu public bool HandleInput(KeyEvent kevent) { - if (Visible) + if (Selected) { switch (kevent.Key) { @@ -370,6 +370,22 @@ namespace Vocaluxe.Menu return true; } break; + + case Keys.Left: + if (CurrentPlaylistElement != -1) + { + PlaylistElements[CurrentPlaylistElement].SelectSlide.PrevValue(); + return true; + } + return false; + + case Keys.Right: + if (CurrentPlaylistElement != -1) + { + PlaylistElements[CurrentPlaylistElement].SelectSlide.NextValue(); + return true; + } + return false; } } return false; @@ -377,7 +393,7 @@ namespace Vocaluxe.Menu public bool HandleMouse(MouseEvent mevent) { - if (CHelper.IsInBounds(Rect, mevent)) + if (CHelper.IsInBounds(Rect, mevent) && Visible) { if (mevent.Wheel > 0) { @@ -396,6 +412,14 @@ namespace Vocaluxe.Menu return true; } } + if (mevent.LB) + { + if (CurrentPlaylistElement != -1) + { + PlaylistElements[CurrentPlaylistElement].SelectSlide.ProcessMouseLBClick(mevent.X, mevent.Y); + return true; + } + } for (int i = 0; i < PlaylistElements.Count; i++) { @@ -405,13 +429,15 @@ namespace Vocaluxe.Menu PlaylistElements[i].Background.Texture = CTheme.GetSkinTexture(_Theme.STextureBackgroundName); PlaylistElements[i].Background.Color = BackgroundSColor; ActiveHover = i; - CurrentPlaylistElement = -1; + CurrentPlaylistElement = i; } else { PlaylistElements[i].Background.Texture = CTheme.GetSkinTexture(_Theme.TextureBackgroundName); PlaylistElements[i].Background.Color = BackgroundColor; } + //Hover for SelectSlide-Arrow + PlaylistElements[i].SelectSlide.ProcessMouseMove(mevent.X, mevent.Y); //Delete Entry with RB if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, mevent) && mevent.RB && PlaylistElements[i].Content != -1) { @@ -440,7 +466,7 @@ namespace Vocaluxe.Menu private void PrepareList() { PlaylistElements.Clear(); - for (int i = 0; i < (Rect.H / _Theme.EntryHeight); i++) + for (int i = 0; i < Math.Floor(Rect.H / _Theme.EntryHeight); i++) { PlaylistElement en = new PlaylistElement(); en.Background = new CStatic(_Theme.TextureBackgroundName, BackgroundColor, new SRectF(Rect.X, Rect.Y + (i * _Theme.EntryHeight), Rect.W, _Theme.EntryHeight, Rect.Z)); @@ -448,22 +474,10 @@ namespace Vocaluxe.Menu en.Text1 = new CText(Rect.X + _Theme.Text1.X, Rect.Y + _Theme.Text1.Y + (i * _Theme.EntryHeight), _Theme.Text1.Z, _Theme.Text1.Height, _Theme.Text1.MaxWidth, _Theme.Text1.Align, _Theme.Text1.Style, _Theme.Text1.Fon, _Theme.Text1.Color, "", _Theme.Text1.ReflectionSpace, _Theme.Text1.ReflectionHeight); en.Text2 = new CText(Rect.X + _Theme.Text2.X, Rect.Y + _Theme.Text2.Y + (i * _Theme.EntryHeight), _Theme.Text2.Z, _Theme.Text2.Height, _Theme.Text2.MaxWidth, _Theme.Text2.Align, _Theme.Text2.Style, _Theme.Text2.Fon, _Theme.Text2.Color, "", _Theme.Text2.ReflectionSpace, _Theme.Text2.ReflectionHeight); en.Text3 = new CText(Rect.X + _Theme.Text3.X, Rect.Y + _Theme.Text3.Y + (i * _Theme.EntryHeight), _Theme.Text3.Z, _Theme.Text3.Height, _Theme.Text3.MaxWidth, _Theme.Text3.Align, _Theme.Text3.Style, _Theme.Text3.Fon, _Theme.Text3.Color, "", _Theme.Text3.ReflectionSpace, _Theme.Text3.ReflectionHeight); - en.SelectSlide = new CSelectSlide(); + en.SelectSlide = (CSelectSlide)_Theme.SelectSlideGameMode.Clone(); en.SelectSlide.Rect = new SRectF(Rect.X + _Theme.SelectSlideGameMode.Rect.X, Rect.Y + _Theme.SelectSlideGameMode.Rect.Y + (i * _Theme.EntryHeight), _Theme.SelectSlideGameMode.Rect.W, _Theme.SelectSlideGameMode.Rect.H, _Theme.SelectSlideGameMode.Rect.Z); en.SelectSlide.RectArrowLeft = new SRectF(Rect.X + _Theme.SelectSlideGameMode.RectArrowLeft.X, Rect.Y + _Theme.SelectSlideGameMode.RectArrowLeft.Y + (i * _Theme.EntryHeight), _Theme.SelectSlideGameMode.RectArrowLeft.W, _Theme.SelectSlideGameMode.RectArrowLeft.H, _Theme.SelectSlideGameMode.RectArrowLeft.Z); en.SelectSlide.RectArrowRight = new SRectF(Rect.X + _Theme.SelectSlideGameMode.RectArrowRight.X, Rect.Y + _Theme.SelectSlideGameMode.RectArrowRight.Y + (i * _Theme.EntryHeight), _Theme.SelectSlideGameMode.RectArrowRight.W, _Theme.SelectSlideGameMode.RectArrowRight.H, _Theme.SelectSlideGameMode.RectArrowRight.Z); - en.SelectSlide.Color = _Theme.SelectSlideGameMode.Color; - en.SelectSlide.ColorArrow = _Theme.SelectSlideGameMode.ColorArrow; - en.SelectSlide.HColor = _Theme.SelectSlideGameMode.HColor; - en.SelectSlide.Highlighted = _Theme.SelectSlideGameMode.Highlighted; - en.SelectSlide.MaxW = _Theme.SelectSlideGameMode.MaxW; - en.SelectSlide.NumVisible = _Theme.SelectSlideGameMode.NumVisible; - en.SelectSlide.SColor = _Theme.SelectSlideGameMode.SColor; - en.SelectSlide.SColorArrow = _Theme.SelectSlideGameMode.SColorArrow; - en.SelectSlide.STextColor = _Theme.SelectSlideGameMode.STextColor; - en.SelectSlide.TextColor = _Theme.SelectSlideGameMode.TextColor; - en.SelectSlide.TextH = _Theme.SelectSlideGameMode.TextH; - en.SelectSlide.Visible = true; en.Content = -1; PlaylistElements.Add(en); } @@ -527,6 +541,7 @@ namespace Vocaluxe.Menu PlaylistElements[i].Text1.Text = t1; PlaylistElements[i].Text2.Text = t2; PlaylistElements[i].Text3.Text = t3; + PlaylistElements[i].SelectSlide.Clear(); for (int g = 0; g < PlaylistElementContents[e].Modes.Length; g++) { PlaylistElements[i].SelectSlide.AddValue(Enum.GetName(typeof(GameModes.EGameMode), PlaylistElementContents[e].Modes[g])); diff --git a/Vocaluxe/Menu/CSelectSlide.cs b/Vocaluxe/Menu/CSelectSlide.cs index 126ec839..afa321c1 100644 --- a/Vocaluxe/Menu/CSelectSlide.cs +++ b/Vocaluxe/Menu/CSelectSlide.cs @@ -38,7 +38,7 @@ namespace Vocaluxe.Menu public EStyle TextStyle; } - class CSelectSlide : IMenuElement + class CSelectSlide : IMenuElement, ICloneable { private SThemeSelectSlide _Theme; private bool _ThemeLoaded; @@ -754,6 +754,11 @@ namespace Vocaluxe.Menu LoadTextures(); } + public object Clone() + { + return base.MemberwiseClone(); + } + #region ThemeEdit public void MoveElement(int stepX, int stepY) { diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 39a8266f..72e52066 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -95,11 +95,11 @@ namespace Vocaluxe.Screens public override bool HandleInput(KeyEvent KeyEvent) { - base.HandleInput(KeyEvent); - if (KeyEvent.Handled) + if (Playlists[htPlaylists(Playlist)].HandleInput(KeyEvent)) return true; - if (Playlists[htPlaylists(Playlist)].HandleInput(KeyEvent)) + base.HandleInput(KeyEvent); + if (KeyEvent.Handled) return true; if (!_SongOptionsActive) From f31dd0903f8804fa8e7768a853af838e29c77832 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Wed, 11 Jul 2012 13:18:44 +0200 Subject: [PATCH 23/70] First fix for keyboard-handling. --- Vocaluxe/Menu/CInteraction.cs | 3 +-- Vocaluxe/Menu/CPlaylist.cs | 42 ++++++++++++++++++++++++++++++----- 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/Vocaluxe/Menu/CInteraction.cs b/Vocaluxe/Menu/CInteraction.cs index 8937df1f..74cfc641 100644 --- a/Vocaluxe/Menu/CInteraction.cs +++ b/Vocaluxe/Menu/CInteraction.cs @@ -43,8 +43,7 @@ namespace Vocaluxe.Menu _Type == EType.TStatic || _Type == EType.TSongMenu || _Type == EType.TLyric || - _Type == EType.TSingNote || - _Type == EType.TPlaylist); + _Type == EType.TSingNote ); } } diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs index 3ddc6320..0070f61b 100644 --- a/Vocaluxe/Menu/CPlaylist.cs +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -71,6 +71,7 @@ namespace Vocaluxe.Menu public bool Visible; public bool Selected; + public bool changeOrder = false; public int ActivePlaylistID = 0; public int Offset = 0; public int ActiveHover = -1; @@ -290,9 +291,17 @@ namespace Vocaluxe.Menu { case Keys.Up: if (CurrentPlaylistElement == -1) + { CurrentPlaylistElement = 0; + ActiveHover = CurrentPlaylistElement; + return true; + } else if (CurrentPlaylistElement - 1 > 0) + { CurrentPlaylistElement--; + ActiveHover = CurrentPlaylistElement; + return true; + } else if (CurrentPlaylistElement - 1 == 0) { CurrentPlaylistElement--; @@ -301,18 +310,25 @@ namespace Vocaluxe.Menu Offset--; Update(); } + ActiveHover = CurrentPlaylistElement; + return true; } - ActiveHover = CurrentPlaylistElement; - return true; + return false; case Keys.Down: if (CurrentPlaylistElement == -1) + { CurrentPlaylistElement = 0; + ActiveHover = CurrentPlaylistElement; + return true; + } else if (CurrentPlaylistElement + 1 < PlaylistElements.Count) { if (PlaylistElements[CurrentPlaylistElement + 1].Content != -1) { CurrentPlaylistElement++; + ActiveHover = CurrentPlaylistElement; + return true; } } else if (CurrentPlaylistElement + 1 >= PlaylistElements.Count && CurrentPlaylistElement + Offset + 1 < PlaylistElementContents.Count) @@ -321,10 +337,11 @@ namespace Vocaluxe.Menu { Offset++; Update(); + ActiveHover = CurrentPlaylistElement; + return true; } } - ActiveHover = CurrentPlaylistElement; - return true; + return false; case Keys.Delete: if (CurrentPlaylistElement != -1) @@ -446,9 +463,22 @@ namespace Vocaluxe.Menu return true; } //Change order with holding LB - else if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, mevent) && mevent.LBH && PlaylistElements[i].Content != -1) + else if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, mevent) && mevent.LBH && PlaylistElements[i].Content != -1 && !changeOrder) { - return true; + changeOrder = true; + CurrentPlaylistElement = i; + } + else if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, mevent) && mevent.LBH && PlaylistElements[i].Content != -1 && changeOrder) + { + if (PlaylistElements.Count < CurrentPlaylistElement + 1) + { + } + else if (PlaylistElementContents.Count < CurrentPlaylistElement + 1 + Offset) + { + } + if (mevent.Y < PlaylistElements[CurrentPlaylistElement + 1].Background.Rect.Y) + { + } } } } From f40d250dc30a1ef77602da948a91a36bd37eae13 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Wed, 11 Jul 2012 13:30:10 +0200 Subject: [PATCH 24/70] Changing of selectslide-values changes now game-mode. --- Vocaluxe/Menu/CPlaylist.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs index 0070f61b..abdd604a 100644 --- a/Vocaluxe/Menu/CPlaylist.cs +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -391,7 +391,10 @@ namespace Vocaluxe.Menu case Keys.Left: if (CurrentPlaylistElement != -1) { + int oldValue = PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection; PlaylistElements[CurrentPlaylistElement].SelectSlide.PrevValue(); + if (oldValue != PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection) + CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; return true; } return false; @@ -399,7 +402,10 @@ namespace Vocaluxe.Menu case Keys.Right: if (CurrentPlaylistElement != -1) { + int oldValue = PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection; PlaylistElements[CurrentPlaylistElement].SelectSlide.NextValue(); + if (oldValue != PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection) + CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; return true; } return false; @@ -433,7 +439,10 @@ namespace Vocaluxe.Menu { if (CurrentPlaylistElement != -1) { + int oldValue = PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection; PlaylistElements[CurrentPlaylistElement].SelectSlide.ProcessMouseLBClick(mevent.X, mevent.Y); + if (oldValue != PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection) + CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; return true; } } @@ -470,6 +479,7 @@ namespace Vocaluxe.Menu } else if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, mevent) && mevent.LBH && PlaylistElements[i].Content != -1 && changeOrder) { + /* if (PlaylistElements.Count < CurrentPlaylistElement + 1) { } @@ -479,6 +489,7 @@ namespace Vocaluxe.Menu if (mevent.Y < PlaylistElements[CurrentPlaylistElement + 1].Background.Rect.Y) { } + */ } } } From 9ddff4d56728514347d24ca8a59e973a69188584 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Wed, 11 Jul 2012 14:17:34 +0200 Subject: [PATCH 25/70] Move Playlist-related elements (buttons, texts, statics) to playlist-element. --- Output/Themes/Ambient/Screens/ScreenSong.xml | 500 +++++++++---------- Vocaluxe/Menu/CButton.cs | 5 + Vocaluxe/Menu/CPlaylist.cs | 87 +++- Vocaluxe/Screens/CScreenSong.cs | 142 ++---- 4 files changed, 378 insertions(+), 356 deletions(-) diff --git a/Output/Themes/Ambient/Screens/ScreenSong.xml b/Output/Themes/Ambient/Screens/ScreenSong.xml index 1a140efe..6250bf88 100644 --- a/Output/Themes/Ambient/Screens/ScreenSong.xml +++ b/Output/Themes/Ambient/Screens/ScreenSong.xml @@ -72,38 +72,6 @@ 26 - - - Menu - - 970 - 40 - -1,00 - 295 - 40 - - - StaticColor - - - - - - - Menu - - 970 - 550 - -1,00 - 295 - 40 - - - StaticColor - - - - Button @@ -245,194 +213,6 @@ - - - CloseIcon - - CloseIcon - - 1215 - 42 - -1,01 - 35 - 35 - - - ButtonColor - - - ButtonSColor - - - 180 - 5 - - 30 - - 350 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - - - Outline - - - - - - - - - - - - - SingIcon - - SingIcon - - 975 - 553 - -1,01 - 35 - 35 - - - ButtonColor - - - ButtonSColor - - - 180 - 5 - - 30 - - 350 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - - - Outline - - - - - - - - - - - - - SaveIcon - - SaveIcon - - 1175 - 553 - -1,01 - 35 - 35 - - - ButtonColor - - - ButtonSColor - - - 180 - 5 - - 30 - - 350 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - - - Outline - - - - - - - - - - - - - DeleteIcon - - DeleteIcon - - 1215 - 553 - -1,01 - 35 - 35 - - - ButtonColor - - - ButtonSColor - - - 180 - 5 - - 30 - - 350 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - - - Outline - - - - - - - - - - 200 @@ -587,36 +367,6 @@ - - - 975 - 45 - - -1,01 - - 30 - - 220 - - - StaticColor - - - TextSColor - - Left - - Center - - - - Outline - - - - - - Button @@ -1087,6 +837,36 @@ + + + 975 + 45 + + -1,01 + + 30 + + 220 + + + StaticColor + + + TextSColor + + Left + + Center + + + + Outline + + + + + + @@ -1103,6 +883,226 @@ + + + Menu + + 970 + 40 + -1,00 + 295 + 40 + + + StaticColor + + + + + + + Menu + + 970 + 550 + -1,00 + 295 + 40 + + + StaticColor + + + + + + + CloseIcon + + CloseIcon + + 1215 + 42 + -1,01 + 35 + 35 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + + + Outline + + + + + + + + + + + + + SingIcon + + SingIcon + + 975 + 553 + -1,01 + 35 + 35 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + + + Outline + + + + + + + + + + + + + SaveIcon + + SaveIcon + + 1175 + 553 + -1,01 + 35 + 35 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + + + Outline + + + + + + + + + + + + + DeleteIcon + + DeleteIcon + + 1215 + 553 + -1,01 + 35 + 35 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + + + Outline + + + + + + + + + + Button diff --git a/Vocaluxe/Menu/CButton.cs b/Vocaluxe/Menu/CButton.cs index d4b5d231..9e688fbb 100644 --- a/Vocaluxe/Menu/CButton.cs +++ b/Vocaluxe/Menu/CButton.cs @@ -262,6 +262,11 @@ namespace Vocaluxe.Menu } } + public void ProzessMouseMove(int x, int y) + { + Selected = CHelper.IsInBounds(Rect, x, y); + } + public void UnloadTextures() { Text.UnloadTextures(); diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs index abdd604a..6a3902ee 100644 --- a/Vocaluxe/Menu/CPlaylist.cs +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -32,8 +32,16 @@ namespace Vocaluxe.Menu public CText Text1; public CText Text2; public CText Text3; + public CText TextPlaylistHeader; public CStatic StaticCover; + public CStatic StaticPlaylistHeader; + public CStatic StaticPlaylistFooter; + + public CButton ButtonPlaylistClose; + public CButton ButtonPlaylistSave; + public CButton ButtonPlaylistDelete; + public CButton ButtonPlaylistSing; public CSelectSlide SelectSlideGameMode; } @@ -72,7 +80,7 @@ namespace Vocaluxe.Menu public bool Selected; public bool changeOrder = false; - public int ActivePlaylistID = 0; + public int ActivePlaylistID = -1; public int Offset = 0; public int ActiveHover = -1; public int CurrentPlaylistElement = -1; @@ -83,7 +91,14 @@ namespace Vocaluxe.Menu _Theme.Text1 = new CText(); _Theme.Text2 = new CText(); _Theme.Text3 = new CText(); + _Theme.TextPlaylistHeader = new CText(); _Theme.StaticCover = new CStatic(); + _Theme.StaticPlaylistFooter = new CStatic(); + _Theme.StaticPlaylistHeader = new CStatic(); + _Theme.ButtonPlaylistClose = new CButton(); + _Theme.ButtonPlaylistDelete = new CButton(); + _Theme.ButtonPlaylistSave = new CButton(); + _Theme.ButtonPlaylistSing = new CButton(); _Theme.SelectSlideGameMode = new CSelectSlide(); Rect = new SRectF(); @@ -141,12 +156,22 @@ namespace Vocaluxe.Menu _ThemeLoaded &= _Theme.Text1.LoadTheme(item, "TextPart1", navigator, SkinIndex); _ThemeLoaded &= _Theme.Text2.LoadTheme(item, "TextPart2", navigator, SkinIndex); _ThemeLoaded &= _Theme.Text2.LoadTheme(item, "TextPart3", navigator, SkinIndex); + _ThemeLoaded &= _Theme.TextPlaylistHeader.LoadTheme(item, "TextPlaylistHeader", navigator, SkinIndex); _Theme.StringText1 = _Theme.Text1.Text; _Theme.StringText2 = _Theme.Text2.Text; _Theme.StringText3 = _Theme.Text3.Text; _ThemeLoaded &= _Theme.StaticCover.LoadTheme(item, "StaticCover", navigator, SkinIndex); + _ThemeLoaded &= _Theme.StaticPlaylistHeader.LoadTheme(item, "StaticPlaylistHeader", navigator, SkinIndex); + _ThemeLoaded &= _Theme.StaticPlaylistFooter.LoadTheme(item, "StaticPlaylistFooter", navigator, SkinIndex); + + _ThemeLoaded &= _Theme.ButtonPlaylistSing.LoadTheme(item, "ButtonPlaylistSing", navigator, SkinIndex); + _ThemeLoaded &= _Theme.ButtonPlaylistClose.LoadTheme(item, "ButtonPlaylistClose", navigator, SkinIndex); + _ThemeLoaded &= _Theme.ButtonPlaylistSave.LoadTheme(item, "ButtonPlaylistSave", navigator, SkinIndex); + _ThemeLoaded &= _Theme.ButtonPlaylistDelete.LoadTheme(item, "ButtonPlaylistDelete", navigator, SkinIndex); + _ThemeLoaded &= _Theme.SelectSlideGameMode.LoadTheme(item, "SelectSlideGameMode", navigator, SkinIndex); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/EntryHeight", navigator, ref _Theme.EntryHeight); if (_ThemeLoaded) { @@ -258,6 +283,13 @@ namespace Vocaluxe.Menu PlaylistElements[i].Text3.Draw(); PlaylistElements[i].SelectSlide.Draw(); } + _Theme.ButtonPlaylistSing.Draw(); + _Theme.ButtonPlaylistSave.Draw(); + _Theme.ButtonPlaylistDelete.Draw(); + _Theme.ButtonPlaylistClose.Draw(); + _Theme.StaticPlaylistHeader.Draw(); + _Theme.StaticPlaylistFooter.Draw(); + _Theme.TextPlaylistHeader.Draw(); } public void UnloadTextures() @@ -501,6 +533,34 @@ namespace Vocaluxe.Menu CurrentPlaylistElement = -1; } } + + if (ActivePlaylistID > -1) + { + _Theme.ButtonPlaylistClose.ProzessMouseMove(mevent.X, mevent.Y); + _Theme.ButtonPlaylistSing.ProzessMouseMove(mevent.X, mevent.Y); + _Theme.ButtonPlaylistSave.ProzessMouseMove(mevent.X, mevent.Y); + _Theme.ButtonPlaylistDelete.ProzessMouseMove(mevent.X, mevent.Y); + if (mevent.LB) + { + if (CHelper.IsInBounds(_Theme.ButtonPlaylistClose.Rect, mevent)) + { + ClosePlaylist(); + } + else if (CHelper.IsInBounds(_Theme.ButtonPlaylistSing.Rect, mevent)) + { + StartPlaylistSongs(); + } + else if (CHelper.IsInBounds(_Theme.ButtonPlaylistSave.Rect, mevent)) + { + CPlaylists.SavePlaylist(ActivePlaylistID); + } + else if (CHelper.IsInBounds(_Theme.ButtonPlaylistDelete.Rect, mevent)) + { + CPlaylists.DeletePlaylist(ActivePlaylistID); + ClosePlaylist(); + } + } + } return false; } @@ -528,6 +588,7 @@ namespace Vocaluxe.Menu { if (PlaylistID > -1 && PlaylistID < CPlaylists.NumPlaylists) { + _Theme.TextPlaylistHeader.Text = CPlaylists.Playlists[ActivePlaylistID].PlaylistName; ActivePlaylistID = PlaylistID; PlaylistElementContents.Clear(); for (int i = 0; i < CPlaylists.Playlists[ActivePlaylistID].Songs.Count; i++) @@ -559,6 +620,30 @@ namespace Vocaluxe.Menu Update(); } + private void StartPlaylistSongs() + { + CGame.Reset(); + CGame.ClearSongs(); + + if (ActivePlaylistID > -1 && ActivePlaylistID < CPlaylists.NumPlaylists) + { + for (int i = 0; i < CPlaylists.Playlists[ActivePlaylistID].Songs.Count; i++) + { + CGame.AddSong(CPlaylists.Playlists[ActivePlaylistID].Songs[i].SongID, CPlaylists.Playlists[ActivePlaylistID].Songs[i].GameMode); + } + if (CGame.GetNumSongs() > 0) + CGraphics.FadeTo(EScreens.ScreenNames); + } + } + + + private void ClosePlaylist() + { + Visible = false; + Selected = false; + ActivePlaylistID = -1; + } + public void Update() { if (ActivePlaylistID > -1 && ActivePlaylistID < CPlaylists.NumPlaylists) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 72e52066..de464dfd 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -25,23 +25,16 @@ namespace Vocaluxe.Screens private const string TextSearchBarTitle = "TextSearchBarTitle"; private const string TextSearchBar = "TextSearchBar"; private const string TextOptionsTitle = "TextOptionsTitle"; - private const string TextPlaylistHeader = "TextPlaylistHeader"; private const string ButtonOptionsSing = "ButtonOptionsSing"; private const string ButtonOptionsPlaylist = "ButtonOptionsPlaylist"; private const string ButtonOptionsClose = "ButtonOptionsClose"; - private const string ButtonPlaylistClose = "ButtonPlaylistClose"; - private const string ButtonPlaylistSing = "ButtonPlaylistSing"; - private const string ButtonPlaylistSave = "ButtonPlaylistSave"; - private const string ButtonPlaylistDelete = "ButtonPlaylistDelete"; private const string SelectSlideOptionsMode = "SelectSlideOptionsMode"; private const string SelectSlideOptionsPlaylist = "SelectSlideOptionsPlaylist"; private const string StaticSearchBar = "StaticSearchBar"; private const string StaticOptionsBG = "StaticOptionsBG"; - private const string StaticPlaylistHeader = "StaticPlaylistHeader"; - private const string StaticPlaylistFooter = "StaticPlaylistFooter"; private const string SongMenu = "SongMenu"; private const string Playlist = "Playlist"; @@ -49,7 +42,6 @@ namespace Vocaluxe.Screens private bool _SearchActive = false; private bool _SongOptionsActive = false; - private int _OpenedPlaylist = -1; private List _AvailableGameModes; public CScreenSong() @@ -65,9 +57,9 @@ namespace Vocaluxe.Screens _ThemeName = "ScreenSong"; _ScreenVersion = ScreenVersion; - _ThemeStatics = new string[] { StaticSearchBar, StaticOptionsBG, StaticPlaylistHeader, StaticPlaylistFooter }; - _ThemeTexts = new string[] { TextCategory, TextSelection, TextSearchBarTitle, TextSearchBar, TextOptionsTitle, TextPlaylistHeader }; - _ThemeButtons = new string[] { ButtonOptionsClose, ButtonOptionsPlaylist, ButtonOptionsSing, ButtonPlaylistClose, ButtonPlaylistSing, ButtonPlaylistSave, ButtonPlaylistDelete }; + _ThemeStatics = new string[] { StaticSearchBar, StaticOptionsBG }; + _ThemeTexts = new string[] { TextCategory, TextSelection, TextSearchBarTitle, TextSearchBar, TextOptionsTitle }; + _ThemeButtons = new string[] { ButtonOptionsClose, ButtonOptionsPlaylist, ButtonOptionsSing }; _ThemeSelectSlides = new string[] { SelectSlideOptionsMode, SelectSlideOptionsPlaylist }; _ThemeSongMenus = new string[] { SongMenu }; _ThemePlaylists = new string[] { Playlist }; @@ -81,15 +73,8 @@ namespace Vocaluxe.Screens Buttons[htButtons(ButtonOptionsClose)].Visible = false; Buttons[htButtons(ButtonOptionsSing)].Visible = false; Buttons[htButtons(ButtonOptionsPlaylist)].Visible = false; - Buttons[htButtons(ButtonPlaylistClose)].Visible = false; - Buttons[htButtons(ButtonPlaylistSing)].Visible = false; - Buttons[htButtons(ButtonPlaylistSave)].Visible = false; - Buttons[htButtons(ButtonPlaylistDelete)].Visible = false; Texts[htTexts(TextOptionsTitle)].Visible = false; - Texts[htTexts(TextPlaylistHeader)].Visible = false; Statics[htStatics(StaticOptionsBG)].Visible = false; - Statics[htStatics(StaticPlaylistHeader)].Visible = false; - Statics[htStatics(StaticPlaylistFooter)].Visible = false; Playlists[htPlaylists(Playlist)].Visible = false; } @@ -221,25 +206,26 @@ namespace Vocaluxe.Screens else if (Buttons[htButtons(ButtonOptionsPlaylist)].Selected) { //Open a playlist and add song - if (_OpenedPlaylist != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1)) + if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1)) { - _OpenedPlaylist = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1; - if (_OpenedPlaylist < 0) - _OpenedPlaylist = CPlaylists.NewPlaylist(); - CPlaylists.Playlists[_OpenedPlaylist].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); - OpenPlaylist(_OpenedPlaylist); + if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1 < 0) + Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); + else + Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection; + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); } //Create a new playlist and add song else if ((SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1) == -1) { - _OpenedPlaylist = CPlaylists.NewPlaylist(); - CPlaylists.Playlists[_OpenedPlaylist].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); - OpenPlaylist(_OpenedPlaylist); + Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); } //Add song to loaded playlist else { - CPlaylists.Playlists[_OpenedPlaylist].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); Playlists[htPlaylists(Playlist)].UpdatePlaylist(); } ToggleSongOptions(); @@ -308,27 +294,26 @@ namespace Vocaluxe.Screens else if (Buttons[htButtons(ButtonOptionsPlaylist)].Selected) { //Open a playlist and add song - if (_OpenedPlaylist != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1)) + if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1)) { - _OpenedPlaylist = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1; - if (_OpenedPlaylist < 0) - _OpenedPlaylist = CPlaylists.NewPlaylist(); - CPlaylists.Playlists[_OpenedPlaylist].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); - OpenPlaylist(_OpenedPlaylist); + if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1 < 0) + Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); + else + Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection; + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); } //Create a new playlist and add song else if ((SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1) == -1) { - _OpenedPlaylist = CPlaylists.NewPlaylist(); - CPlaylists.Playlists[_OpenedPlaylist].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); - OpenPlaylist(_OpenedPlaylist); - UpdatePlaylistNames(); - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].NumValues - 1; + Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); } //Add song to loaded playlist - else + else { - CPlaylists.Playlists[_OpenedPlaylist].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); Playlists[htPlaylists(Playlist)].UpdatePlaylist(); } ToggleSongOptions(); @@ -340,31 +325,6 @@ namespace Vocaluxe.Screens } } - if (_OpenedPlaylist > -1) - { - if (MouseEvent.LB && IsMouseOver(MouseEvent)) - { - if (Buttons[htButtons(ButtonPlaylistClose)].Selected) - { - ClosePlaylist(); - } - else if (Buttons[htButtons(ButtonPlaylistSing)].Selected) - { - StartPlaylistSongs(); - } - else if (Buttons[htButtons(ButtonPlaylistSave)].Selected) - { - CPlaylists.SavePlaylist(_OpenedPlaylist); - } - else if (Buttons[htButtons(ButtonPlaylistDelete)].Selected) - { - CPlaylists.DeletePlaylist(_OpenedPlaylist); - ClosePlaylist(); - UpdatePlaylistNames(); - } - } - } - return true; } @@ -374,15 +334,16 @@ namespace Vocaluxe.Screens CGame.EnterNormalGame(); SongMenus[htSongMenus(SongMenu)].OnShow(); Playlists[htPlaylists(Playlist)].Init(); - if(_OpenedPlaylist != -1) - Playlists[htPlaylists(Playlist)].LoadPlaylist(_OpenedPlaylist); + if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != -1) + Playlists[htPlaylists(Playlist)].LoadPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); UpdatePlaylistNames(); } public override bool UpdateGame() { SongMenus[htSongMenus(SongMenu)].Update(); - Playlists[htPlaylists(Playlist)].Visible = SongMenus[htSongMenus(SongMenu)].IsSmallView(); + if (SongMenus[htSongMenus(SongMenu)].IsSmallView()) + CheckPlaylist(); Texts[htTexts(TextCategory)].Text = CSongs.GetActualCategoryName(); if (CSongs.Category > -1 || CConfig.Tabs == EOffOn.TR_CONFIG_OFF) @@ -478,22 +439,6 @@ namespace Vocaluxe.Screens } } - private void StartPlaylistSongs() - { - CGame.Reset(); - CGame.ClearSongs(); - - if (_OpenedPlaylist > -1 && _OpenedPlaylist < CPlaylists.NumPlaylists) - { - for (int i = 0; i < CPlaylists.Playlists[_OpenedPlaylist].Songs.Count; i++) - { - CGame.AddSong(CPlaylists.Playlists[_OpenedPlaylist].Songs[i].SongID, CPlaylists.Playlists[_OpenedPlaylist].Songs[i].GameMode); - } - if (CGame.GetNumSongs() > 0) - CGraphics.FadeTo(EScreens.ScreenNames); - } - } - private void StartRandomAllSongs() { CGame.Reset(); @@ -643,38 +588,25 @@ namespace Vocaluxe.Screens } } + public void CheckPlaylist() + { + if (Playlists[htPlaylists(Playlist)].ActivePlaylistID == -1) + ClosePlaylist(); + } + private void OpenPlaylist(int PlaylistID) { if (CPlaylists.Playlists.Length > PlaylistID && PlaylistID > -1) { - _OpenedPlaylist = PlaylistID; - Playlists[htPlaylists(Playlist)].LoadPlaylist(_OpenedPlaylist); + Playlists[htPlaylists(Playlist)].LoadPlaylist(PlaylistID); SongMenus[htSongMenus(SongMenu)].SetSmallView(true); Playlists[htPlaylists(Playlist)].Visible = true; - Statics[htStatics(StaticPlaylistHeader)].Visible = true; - Statics[htStatics(StaticPlaylistFooter)].Visible = true; - Texts[htTexts(TextPlaylistHeader)].Visible = true; - Texts[htTexts(TextPlaylistHeader)].Text = CPlaylists.Playlists[PlaylistID].PlaylistName; - Buttons[htButtons(ButtonPlaylistClose)].Visible = true; - Buttons[htButtons(ButtonPlaylistSing)].Visible = true; - Buttons[htButtons(ButtonPlaylistSave)].Visible = true; - Buttons[htButtons(ButtonPlaylistDelete)].Visible = true; } } private void ClosePlaylist() { - _OpenedPlaylist = -1; SongMenus[htSongMenus(SongMenu)].SetSmallView(false); - Playlists[htPlaylists(Playlist)].Visible = false; - Statics[htStatics(StaticPlaylistHeader)].Visible = false; - Statics[htStatics(StaticPlaylistFooter)].Visible = false; - Texts[htTexts(TextPlaylistHeader)].Visible = false; - Texts[htTexts(TextPlaylistHeader)].Text = String.Empty; - Buttons[htButtons(ButtonPlaylistClose)].Visible = false; - Buttons[htButtons(ButtonPlaylistSing)].Visible = false; - Buttons[htButtons(ButtonPlaylistSave)].Visible = false; - Buttons[htButtons(ButtonPlaylistDelete)].Visible = false; } private void UpdatePlaylistNames() From d41fd5059792dc1d25fba1f8b38602ab9f954310 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Wed, 11 Jul 2012 14:29:21 +0200 Subject: [PATCH 26/70] Fix loading of playlist. --- Vocaluxe/Screens/CScreenSong.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index de464dfd..38d0431f 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -299,7 +299,7 @@ namespace Vocaluxe.Screens if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1 < 0) Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); else - Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection; + Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1; CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); } From dbb51574205b4a5da5bbc0aed7cc6dc0d77ee64d Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Wed, 11 Jul 2012 19:46:23 +0200 Subject: [PATCH 27/70] Try to fix song-bug (don't work yet) --- Vocaluxe/GameModes/CGameMode.cs | 3 ++- Vocaluxe/Lib/Song/CNotes.cs | 8 +++++++- Vocaluxe/Lib/Song/CSong.cs | 7 ++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Vocaluxe/GameModes/CGameMode.cs b/Vocaluxe/GameModes/CGameMode.cs index 6dfe5ca5..2560e98d 100644 --- a/Vocaluxe/GameModes/CGameMode.cs +++ b/Vocaluxe/GameModes/CGameMode.cs @@ -247,7 +247,8 @@ namespace Vocaluxe.GameModes { if (_CurrentSong >= 0 && _CurrentSong < _SongQueque.Count) { - CSong song = CSongs.GetSong(_SongQueque[_CurrentSong].SongID); + CSong song = (CSong)CSongs.GetSong(_SongQueque[_CurrentSong].SongID).Clone(); + song.Notes = (CNotes)CSongs.GetSong(_SongQueque[_CurrentSong].SongID).Notes.Clone(); switch (GetCurrentGameMode()) { diff --git a/Vocaluxe/Lib/Song/CNotes.cs b/Vocaluxe/Lib/Song/CNotes.cs index d38dc820..ad33380a 100644 --- a/Vocaluxe/Lib/Song/CNotes.cs +++ b/Vocaluxe/Lib/Song/CNotes.cs @@ -6,7 +6,7 @@ using Vocaluxe.Base; namespace Vocaluxe.Lib.Song { - class CNotes + class CNotes : ICloneable { private List _Lines = new List(); @@ -79,6 +79,11 @@ namespace Vocaluxe.Lib.Song lines.SetMedley(StartBeat, EndBeat); } } + + public object Clone() + { + return base.MemberwiseClone(); + } } public enum ENoteType @@ -549,6 +554,7 @@ namespace Vocaluxe.Lib.Song updateMinMaxBeat(note); } } + #endregion Methods } diff --git a/Vocaluxe/Lib/Song/CSong.cs b/Vocaluxe/Lib/Song/CSong.cs index 2cb63c36..22a24fa0 100644 --- a/Vocaluxe/Lib/Song/CSong.cs +++ b/Vocaluxe/Lib/Song/CSong.cs @@ -48,7 +48,7 @@ namespace Vocaluxe.Lib.Song } } - class CSong + class CSong : ICloneable { private bool _CoverLoaded = false; private bool _NotesLoaded = false; @@ -980,5 +980,10 @@ namespace Vocaluxe.Lib.Song ShortEnd = stop; } + + public object Clone() + { + return base.MemberwiseClone(); + } } } From 5062eb4b168eb191b351409cad7c71c2fff0bbf6 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Wed, 11 Jul 2012 20:00:47 +0200 Subject: [PATCH 28/70] Fixed song-bug. Thx Darkice. --- Vocaluxe/GameModes/CGameMode.cs | 6 ++++-- Vocaluxe/Lib/Song/CNotes.cs | 7 +------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Vocaluxe/GameModes/CGameMode.cs b/Vocaluxe/GameModes/CGameMode.cs index 2560e98d..52355046 100644 --- a/Vocaluxe/GameModes/CGameMode.cs +++ b/Vocaluxe/GameModes/CGameMode.cs @@ -108,6 +108,7 @@ namespace Vocaluxe.GameModes protected List _SongQueque; protected int _CurrentSong; protected CPoints _Points; + private CSong CopiedSong; #region Implementation public virtual void Init() @@ -228,6 +229,7 @@ namespace Vocaluxe.GameModes _SongQueque[_CurrentSong].GameMode == EGameMode.TR_GAMEMODE_MEDLEY, _SongQueque[_CurrentSong].GameMode == EGameMode.TR_GAMEMODE_DUET, _SongQueque[_CurrentSong].GameMode == EGameMode.TR_GAMEMODE_SHORTSONG); + CSongs.AllSongs[_CurrentSong] = CopiedSong; } _CurrentSong++; } @@ -247,8 +249,8 @@ namespace Vocaluxe.GameModes { if (_CurrentSong >= 0 && _CurrentSong < _SongQueque.Count) { - CSong song = (CSong)CSongs.GetSong(_SongQueque[_CurrentSong].SongID).Clone(); - song.Notes = (CNotes)CSongs.GetSong(_SongQueque[_CurrentSong].SongID).Notes.Clone(); + CSong song = CSongs.GetSong(_SongQueque[_CurrentSong].SongID); + CopiedSong = (CSong)song.Clone(); switch (GetCurrentGameMode()) { diff --git a/Vocaluxe/Lib/Song/CNotes.cs b/Vocaluxe/Lib/Song/CNotes.cs index ad33380a..d6203ca0 100644 --- a/Vocaluxe/Lib/Song/CNotes.cs +++ b/Vocaluxe/Lib/Song/CNotes.cs @@ -6,7 +6,7 @@ using Vocaluxe.Base; namespace Vocaluxe.Lib.Song { - class CNotes : ICloneable + class CNotes { private List _Lines = new List(); @@ -79,11 +79,6 @@ namespace Vocaluxe.Lib.Song lines.SetMedley(StartBeat, EndBeat); } } - - public object Clone() - { - return base.MemberwiseClone(); - } } public enum ENoteType From 435a205f57c2805f245d29be9cddd3d0f8e03985 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Wed, 11 Jul 2012 21:08:12 +0200 Subject: [PATCH 29/70] Really fixed song-bug. Thx brunzel! --- Vocaluxe/GameModes/CGameMode.cs | 4 +--- Vocaluxe/Lib/Song/CSong.cs | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Vocaluxe/GameModes/CGameMode.cs b/Vocaluxe/GameModes/CGameMode.cs index 52355046..1cbbb771 100644 --- a/Vocaluxe/GameModes/CGameMode.cs +++ b/Vocaluxe/GameModes/CGameMode.cs @@ -108,7 +108,6 @@ namespace Vocaluxe.GameModes protected List _SongQueque; protected int _CurrentSong; protected CPoints _Points; - private CSong CopiedSong; #region Implementation public virtual void Init() @@ -229,7 +228,6 @@ namespace Vocaluxe.GameModes _SongQueque[_CurrentSong].GameMode == EGameMode.TR_GAMEMODE_MEDLEY, _SongQueque[_CurrentSong].GameMode == EGameMode.TR_GAMEMODE_DUET, _SongQueque[_CurrentSong].GameMode == EGameMode.TR_GAMEMODE_SHORTSONG); - CSongs.AllSongs[_CurrentSong] = CopiedSong; } _CurrentSong++; } @@ -250,7 +248,7 @@ namespace Vocaluxe.GameModes if (_CurrentSong >= 0 && _CurrentSong < _SongQueque.Count) { CSong song = CSongs.GetSong(_SongQueque[_CurrentSong].SongID); - CopiedSong = (CSong)song.Clone(); + song = new CSong(song); switch (GetCurrentGameMode()) { diff --git a/Vocaluxe/Lib/Song/CSong.cs b/Vocaluxe/Lib/Song/CSong.cs index 22a24fa0..34690afd 100644 --- a/Vocaluxe/Lib/Song/CSong.cs +++ b/Vocaluxe/Lib/Song/CSong.cs @@ -48,7 +48,7 @@ namespace Vocaluxe.Lib.Song } } - class CSong : ICloneable + class CSong { private bool _CoverLoaded = false; private bool _NotesLoaded = false; From bc9d1882cf5794e4f0c33f418d211c3738de32be Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Thu, 12 Jul 2012 15:08:32 +0200 Subject: [PATCH 30/70] Added skip-function. Press CTRL + S or go to pause-menu. --- Output/Languages/Deutsch.xml | 1 + Output/Languages/English.xml | 1 + Output/Themes/Ambient/Screens/ScreenSing.xml | 65 +++++++++++++++++-- .../Themes/Changelog/Changelog_ScreenSing.txt | 6 ++ Vocaluxe/Base/CGame.cs | 5 ++ Vocaluxe/Screens/CScreenSing.cs | 27 ++++++-- 6 files changed, 97 insertions(+), 8 deletions(-) diff --git a/Output/Languages/Deutsch.xml b/Output/Languages/Deutsch.xml index 845b01ae..6a7c86c7 100644 --- a/Output/Languages/Deutsch.xml +++ b/Output/Languages/Deutsch.xml @@ -135,6 +135,7 @@ Pause Lied beenden Fortfahren + Lied überspringen Auswertung Bewertung diff --git a/Output/Languages/English.xml b/Output/Languages/English.xml index 1639ea9d..9b61a467 100644 --- a/Output/Languages/English.xml +++ b/Output/Languages/English.xml @@ -135,6 +135,7 @@ Pause Stop singing Continue + Skip this song Scores Rating diff --git a/Output/Themes/Ambient/Screens/ScreenSing.xml b/Output/Themes/Ambient/Screens/ScreenSing.xml index 4d33b2f0..1fa77550 100644 --- a/Output/Themes/Ambient/Screens/ScreenSing.xml +++ b/Output/Themes/Ambient/Screens/ScreenSing.xml @@ -1,7 +1,7 @@  - 4 + 5 None @@ -2333,7 +2333,7 @@ Button - 670 + 775 300 -2,11 150 @@ -2390,7 +2390,7 @@ Button - 460 + 355 300 -2,11 150 @@ -2441,6 +2441,63 @@ 26 + + + Button + + Button + + 565 + 300 + -2,11 + 150 + 50 + + + ButtonColor + + + ButtonSColor + + + 75 + 10 + + 32 + + 142 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + TR_SCREENSING_BUTTON_SKIP + + + + + + 10 + 26 + + + + + + 10 + 26 + + 637 @@ -2656,4 +2713,4 @@ - \ No newline at end of file + diff --git a/Output/Themes/Changelog/Changelog_ScreenSing.txt b/Output/Themes/Changelog/Changelog_ScreenSing.txt index 22c5fa99..6b857430 100644 --- a/Output/Themes/Changelog/Changelog_ScreenSing.txt +++ b/Output/Themes/Changelog/Changelog_ScreenSing.txt @@ -1,5 +1,11 @@ ScreenSing +++++++++++ +Version 5: + +Add: + + ++++++++++ Version 4: Added Elements for 6-player-singing! diff --git a/Vocaluxe/Base/CGame.cs b/Vocaluxe/Base/CGame.cs index 53f1b1c3..8e136d32 100644 --- a/Vocaluxe/Base/CGame.cs +++ b/Vocaluxe/Base/CGame.cs @@ -190,6 +190,11 @@ namespace Vocaluxe.Base return _GameMode.GetPoints(); } + public static int NumRounds + { + get { return _GameMode.GetNumSongs(); } + } + public static int NumPlayer { get { return _NumPlayer; } diff --git a/Vocaluxe/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs index 5d9848b2..908f0b92 100644 --- a/Vocaluxe/Screens/CScreenSing.cs +++ b/Vocaluxe/Screens/CScreenSing.cs @@ -17,7 +17,7 @@ namespace Vocaluxe.Screens class CScreenSing : CMenu { // Version number for theme files. Increment it, if you've changed something on the theme files! - const int ScreenVersion = 4; + const int ScreenVersion = 5; struct TimeRect { @@ -51,6 +51,7 @@ namespace Vocaluxe.Screens private const string ButtonCancel = "ButtonCancel"; private const string ButtonContinue = "ButtonContinue"; + private const string ButtonSkip = "ButtonSkip"; private const string LyricMain = "LyricMain"; private const string LyricSub = "LyricSub"; @@ -127,6 +128,7 @@ namespace Vocaluxe.Screens List buttons = new List(); buttons.Add(ButtonCancel); buttons.Add(ButtonContinue); + buttons.Add(ButtonSkip); _ThemeButtons = buttons.ToArray(); _ThemeLyrics = new string[] { LyricMain, LyricSub, LyricMainDuet, LyricSubDuet, LyricMainTop, LyricSubTop }; @@ -200,12 +202,21 @@ namespace Vocaluxe.Screens SetVisuability(); break; + case Keys.S: + if(CGame.NumRounds > CGame.RoundNr) + if(KeyEvent.ModCTRL) + LoadNextSong(); + break; + case Keys.Enter: if (Buttons[htButtons(ButtonContinue)].Selected && _Pause) - TogglePause(); - + TogglePause(); if (Buttons[htButtons(ButtonCancel)].Selected && _Pause) - Stop(); + Stop(); + if (Buttons[htButtons(ButtonSkip)].Selected && _Pause) + { + LoadNextSong(); + } break; } } @@ -232,6 +243,11 @@ namespace Vocaluxe.Screens if (Buttons[htButtons(ButtonCancel)].Selected && _Pause) Stop(); + if (Buttons[htButtons(ButtonSkip)].Selected && _Pause) + { + LoadNextSong(); + TogglePause(); + } } @@ -708,11 +724,14 @@ namespace Vocaluxe.Screens { Buttons[htButtons(ButtonCancel)].Visible = true; Buttons[htButtons(ButtonContinue)].Visible = true; + if (CGame.NumRounds > CGame.RoundNr) + Buttons[htButtons(ButtonSkip)].Visible = true; CSound.Pause(_CurrentStream); }else { Buttons[htButtons(ButtonCancel)].Visible = false; Buttons[htButtons(ButtonContinue)].Visible = false; + Buttons[htButtons(ButtonSkip)].Visible = false; CSound.Play(_CurrentStream); } } From 53ab3fd667eea8c3d2266835b6f8f75c130b725e Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Thu, 12 Jul 2012 16:03:09 +0200 Subject: [PATCH 31/70] Added overall score to ScreenScore. --- Output/Languages/Deutsch.xml | 1 + Output/Languages/English.xml | 1 + Vocaluxe/Screens/CScreenScore.cs | 76 ++++++++++++++++++++++++++------ 3 files changed, 64 insertions(+), 14 deletions(-) diff --git a/Output/Languages/Deutsch.xml b/Output/Languages/Deutsch.xml index 6a7c86c7..51994228 100644 --- a/Output/Languages/Deutsch.xml +++ b/Output/Languages/Deutsch.xml @@ -141,6 +141,7 @@ Bewertung Punkte Schwierigkeit + Gesamtpunktzahl Highscore diff --git a/Output/Languages/English.xml b/Output/Languages/English.xml index 9b61a467..915d5efb 100644 --- a/Output/Languages/English.xml +++ b/Output/Languages/English.xml @@ -141,6 +141,7 @@ Rating Points Difficulty + Overall score Highscore diff --git a/Vocaluxe/Screens/CScreenScore.cs b/Vocaluxe/Screens/CScreenScore.cs index 21b0a92f..af44c2aa 100644 --- a/Vocaluxe/Screens/CScreenScore.cs +++ b/Vocaluxe/Screens/CScreenScore.cs @@ -117,9 +117,23 @@ namespace Vocaluxe.Screens public override bool UpdateGame() { - SPlayer[] player = new SPlayer[CGame.NumPlayer]; - player = _Points.GetPlayer(_Round - 1, CGame.NumPlayer); + if (_Round != 0) + player = _Points.GetPlayer(_Round - 1, CGame.NumPlayer); + else { + for (int i = 0; i < CGame.NumRounds; i++) + { + SPlayer[] points = _Points.GetPlayer(i, CGame.NumPlayer); + for (int p = 0; p < player.Length; p++) + { + player[p].Points += points[p].Points; + } + } + for (int p = 0; p < player.Length; p++) + { + player[p].Points = (int)(player[p].Points/CGame.NumRounds); + } + } for (int p = 0; p < player.Length; p++) { if (StaticPointsBarDrawnPoints[p] < player[p].Points) @@ -244,18 +258,42 @@ namespace Vocaluxe.Screens private void UpdateRatings() { - CSong song = CGame.GetSong(_Round); - if (song == null) - return; - - Texts[htTexts(TextSong)].Text = song.Artist + " - " + song.Title; - if (_Points.NumRounds > 1) - { - Texts[htTexts(TextSong)].Text += " (" + _Round + "/" + _Points.NumRounds + ")"; - } - SPlayer[] player = new SPlayer[CGame.NumPlayer]; - player = _Points.GetPlayer(_Round - 1, CGame.NumPlayer); + if (_Round != 0) + { + CSong song = CGame.GetSong(_Round); + if (song == null) + return; + + Texts[htTexts(TextSong)].Text = song.Artist + " - " + song.Title; + if (_Points.NumRounds > 1) + { + Texts[htTexts(TextSong)].Text += " (" + _Round + "/" + _Points.NumRounds + ")"; + } + player = _Points.GetPlayer(_Round - 1, CGame.NumPlayer); + } + else + { + Texts[htTexts(TextSong)].Text = "TR_SCREENSCORE_OVERALLSCORE"; + for (int i = 0; i < CGame.NumRounds; i++) + { + SPlayer[] points = _Points.GetPlayer(i, CGame.NumPlayer); + for (int p = 0; p < player.Length; p++) + { + if (i < 1) + { + player[p].ProfileID = points[p].ProfileID; + player[p].Name = points[p].Name; + player[p].Difficulty = points[p].Difficulty; + } + player[p].Points += points[p].Points; + } + } + for (int p = 0; p < player.Length; p++) + { + player[p].Points = (int)(player[p].Points / CGame.NumRounds); + } + } for (int p = 0; p < player.Length; p++) { Texts[htTexts(TextNames[p, CGame.NumPlayer - 1])].Text = player[p].Name; @@ -315,11 +353,21 @@ namespace Vocaluxe.Screens private void ChangeRound(int Num) { - if ((_Round + Num) <= _Points.NumRounds && (_Round + Num) > 0) + if ((_Round + Num) <= _Points.NumRounds && (_Round + Num) > 0 && _Round != 0) { _Round += Num; UpdateRatings(); } + else if(Num > 0 && _Round != 0 && CGame.NumRounds > 1) + { + _Round = 0; + UpdateRatings(); + } + else if (Num < 0 && _Round == 0) + { + _Round = CGame.NumRounds; + UpdateRatings(); + } } } } \ No newline at end of file From 6aaa308e39d20e5a34c55fcc3ccd568ec088ed81 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Fri, 13 Jul 2012 14:14:26 +0200 Subject: [PATCH 32/70] Fix scrolling. --- Vocaluxe/Menu/CPlaylist.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs index 6a3902ee..f64a5ddf 100644 --- a/Vocaluxe/Menu/CPlaylist.cs +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -452,18 +452,20 @@ namespace Vocaluxe.Menu { if (mevent.Wheel > 0) { + if (PlaylistElements.Count + Offset + mevent.Wheel <= PlaylistElementContents.Count) + { + Offset = Offset + mevent.Wheel; + Update(); + return true; + } return true; } else if (mevent.Wheel < 0) { - if (PlaylistElements.Count + Offset + mevent.Wheel <= PlaylistElementContents.Count) + if (Offset + mevent.Wheel >= 0) { Offset = Offset + mevent.Wheel; - return true; - } - if (Offset - mevent.Wheel >= 0) - { - Offset = Offset - mevent.Wheel; + Update(); return true; } } From bb2ccb713dd02515f5f2b69834273b23ed6d044d Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 12 Aug 2012 14:43:03 +0200 Subject: [PATCH 33/70] fixed typo --- Vocaluxe/Menu/CInteraction.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vocaluxe/Menu/CInteraction.cs b/Vocaluxe/Menu/CInteraction.cs index c8b26c9b..03e0eb64 100644 --- a/Vocaluxe/Menu/CInteraction.cs +++ b/Vocaluxe/Menu/CInteraction.cs @@ -15,7 +15,7 @@ namespace Vocaluxe.Menu TLyric, TSingNote, TNameSelection, - TEqualizer + TEqualizer, TPlaylist } From 25988a645c4a093c89e5ad8ff0b7b89c95525826 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 12 Aug 2012 15:09:18 +0200 Subject: [PATCH 34/70] added missing text translation --- Output/Languages/Deutsch.xml | 1 + Output/Languages/English.xml | 1 + Output/Languages/French.xml | 1 + Output/Languages/Spanish.xml | 1 + 4 files changed, 4 insertions(+) diff --git a/Output/Languages/Deutsch.xml b/Output/Languages/Deutsch.xml index 51994228..70908b0c 100644 --- a/Output/Languages/Deutsch.xml +++ b/Output/Languages/Deutsch.xml @@ -122,6 +122,7 @@ Lied singen Zur Playlist hinzufügen Schließen + Neue Playlist Lied-Optionen Suche: Ohne Sprache diff --git a/Output/Languages/English.xml b/Output/Languages/English.xml index 915d5efb..56fce85b 100644 --- a/Output/Languages/English.xml +++ b/Output/Languages/English.xml @@ -122,6 +122,7 @@ Sing Add to playlist Close + New Playlist Song Options Search: No Language diff --git a/Output/Languages/French.xml b/Output/Languages/French.xml index f60e82a3..6da3296d 100644 --- a/Output/Languages/French.xml +++ b/Output/Languages/French.xml @@ -117,6 +117,7 @@ Rechercher: Pas de Langue Pas d'Année + TODO: New Playlist Pas de Genre Pas d'Edition Toutes les chansons diff --git a/Output/Languages/Spanish.xml b/Output/Languages/Spanish.xml index 483e30a3..2c4a8456 100644 --- a/Output/Languages/Spanish.xml +++ b/Output/Languages/Spanish.xml @@ -116,6 +116,7 @@ Selección de Canciones Buscar: Sin Idioma + TODO: New Playlist Sin Año Sin Género Sin Edición From bd936175668fcd3f47c79f4f3ba554eccba54168 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 12 Aug 2012 15:39:33 +0200 Subject: [PATCH 35/70] fixed crashing when adding songs to playlist by key --- Vocaluxe/Screens/CScreenSong.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 38d0431f..a8c0481c 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -80,7 +80,8 @@ namespace Vocaluxe.Screens public override bool HandleInput(KeyEvent KeyEvent) { - if (Playlists[htPlaylists(Playlist)].HandleInput(KeyEvent)) + KeyEvent.Handled = Playlists[htPlaylists(Playlist)].HandleInput(KeyEvent); + if (KeyEvent.Handled) return true; base.HandleInput(KeyEvent); @@ -89,7 +90,6 @@ namespace Vocaluxe.Screens if (!_SongOptionsActive) { - if (KeyEvent.KeyPressed && !Char.IsControl(KeyEvent.Unicode)) { if (_SearchActive) @@ -211,7 +211,7 @@ namespace Vocaluxe.Screens if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1 < 0) Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); else - Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection; + Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1; CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); } From d63fb099a404feef68b6b47d3869423eb6f7d837 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 12 Aug 2012 16:53:34 +0200 Subject: [PATCH 36/70] modified songmenu playlist handling --- Vocaluxe/Menu/CInteraction.cs | 3 +- Vocaluxe/Menu/CMenu.cs | 68 +++++++++++++++----- Vocaluxe/Menu/CPlaylist.cs | 21 ++++-- Vocaluxe/Menu/SongMenu/CSongMenu.cs | 10 +++ Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs | 12 ++++ Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs | 7 +- Vocaluxe/Menu/SongMenu/ISongMenu.cs | 3 + Vocaluxe/Screens/CScreenSong.cs | 49 ++++++++++++-- 8 files changed, 144 insertions(+), 29 deletions(-) diff --git a/Vocaluxe/Menu/CInteraction.cs b/Vocaluxe/Menu/CInteraction.cs index 03e0eb64..a95e450b 100644 --- a/Vocaluxe/Menu/CInteraction.cs +++ b/Vocaluxe/Menu/CInteraction.cs @@ -45,7 +45,8 @@ namespace Vocaluxe.Menu _Type == EType.TSongMenu || _Type == EType.TLyric || _Type == EType.TSingNote || - _Type == EType.TEqualizer); + _Type == EType.TEqualizer || + _Type == EType.TPlaylist); } } diff --git a/Vocaluxe/Menu/CMenu.cs b/Vocaluxe/Menu/CMenu.cs index 2f70b117..ffbd6281 100644 --- a/Vocaluxe/Menu/CMenu.cs +++ b/Vocaluxe/Menu/CMenu.cs @@ -878,22 +878,24 @@ namespace Vocaluxe.Menu if (KeyEvent.Key == Keys.Left) { if (_Interactions.Count > 0 && _Interactions[_Selection].Type == EType.TSelectSlide && KeyEvent.Mod != Modifier.Shift) - PrevElement(); - else - _NextInteraction(KeyEvent); + KeyEvent.Handled = PrevElement(); + + if (!KeyEvent.Handled) + KeyEvent.Handled = _NextInteraction(KeyEvent); } if (KeyEvent.Key == Keys.Right) { if (_Interactions.Count > 0 && _Interactions[_Selection].Type == EType.TSelectSlide && KeyEvent.Mod != Modifier.Shift) - NextElement(); - else - _NextInteraction(KeyEvent); + KeyEvent.Handled = NextElement(); + + if (!KeyEvent.Handled) + KeyEvent.Handled = _NextInteraction(KeyEvent); } if (KeyEvent.Key == Keys.Up || KeyEvent.Key == Keys.Down) { - _NextInteraction(KeyEvent); + KeyEvent.Handled = _NextInteraction(KeyEvent); } } else @@ -1242,16 +1244,28 @@ namespace Vocaluxe.Menu _PrevInteraction(); } - public void NextElement() + /// + /// Selects the next element in a menu interaction. + /// + /// True if the next element is selected. False if either there is no next element or the interaction does not provide such a method. + public bool NextElement() { if (_Interactions.Count > 0) - _NextElement(); + return _NextElement(); + + return false; } - public void PrevElement() + /// + /// Selects the previous element in a menu interaction. + /// + /// True if the previous element is selected. False if either there is no next element or the interaction does not provide such a method. + public bool PrevElement() { if (_Interactions.Count > 0) - _PrevElement(); + return _PrevElement(); + + return false; } public bool SetInteractionToButton(CButton button) @@ -1502,7 +1516,12 @@ namespace Vocaluxe.Menu _SetSelected(); } - private void _NextInteraction(KeyEvent Key) + /// + /// Selects the next best interaction in a menu. + /// + /// + /// + private bool _NextInteraction(KeyEvent Key) { KeyEvent[] Directions = new KeyEvent[4]; float[] Distances = new float[4]; @@ -1568,8 +1587,11 @@ namespace Vocaluxe.Menu _Selection = element; _SetSelected(); _SetHighlighted(_Selection); + + return true; } } + return false; } private int _GetNextElement(KeyEvent Key, out float Distance, out int Stage) @@ -1728,16 +1750,30 @@ namespace Vocaluxe.Menu return distance; } - private void _NextElement() + /// + /// Selects the next element in a menu interaction. + /// + /// True if the next element is selected. False if either there is no next element or the interaction does not provide such a method. + private bool _NextElement() { if (_Interactions[_Selection].Type == EType.TSelectSlide) - _SelectSlides[_Interactions[_Selection].Num].NextValue(); + return _SelectSlides[_Interactions[_Selection].Num].NextValue(); + + return false; } - private void _PrevElement() + /// + /// Selects the previous element in a menu interaction. + /// + /// + /// True if the previous element is selected. False if either there is no previous element or the interaction does not provide such a method. + /// + private bool _PrevElement() { if (_Interactions[_Selection].Type == EType.TSelectSlide) - _SelectSlides[_Interactions[_Selection].Num].PrevValue(); + return _SelectSlides[_Interactions[_Selection].Num].PrevValue(); + + return false; } private void _SetSelected() diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs index f64a5ddf..9d3fd36a 100644 --- a/Vocaluxe/Menu/CPlaylist.cs +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -77,7 +77,21 @@ namespace Vocaluxe.Menu public SColorF BackgroundSColor; public bool Visible; - public bool Selected; + + private bool _Selected; + public bool Selected + { + get { return _Selected; } + set + { + _Selected = value; + if (CurrentPlaylistElement == -1 && _Selected) + { + CurrentPlaylistElement = 0; + ActiveHover = CurrentPlaylistElement; + } + } + } public bool changeOrder = false; public int ActivePlaylistID = -1; @@ -266,7 +280,7 @@ namespace Vocaluxe.Menu for (int i = 0; i < PlaylistElements.Count; i++ ) { - if (i == ActiveHover) + if (i == ActiveHover && _Selected) { PlaylistElements[i].Background.Texture = CTheme.GetSkinTexture(_Theme.STextureBackgroundName); PlaylistElements[i].Background.Color = BackgroundSColor; @@ -484,7 +498,7 @@ namespace Vocaluxe.Menu for (int i = 0; i < PlaylistElements.Count; i++) { //Hover for playlist-element - if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, mevent)) + if (PlaylistElementContents.Count - 1 >= i && CHelper.IsInBounds(PlaylistElements[i].Background.Rect, mevent)) { PlaylistElements[i].Background.Texture = CTheme.GetSkinTexture(_Theme.STextureBackgroundName); PlaylistElements[i].Background.Color = BackgroundSColor; @@ -638,7 +652,6 @@ namespace Vocaluxe.Menu } } - private void ClosePlaylist() { Visible = false; diff --git a/Vocaluxe/Menu/SongMenu/CSongMenu.cs b/Vocaluxe/Menu/SongMenu/CSongMenu.cs index 57ef11b6..48fdf61f 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenu.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenu.cs @@ -73,6 +73,16 @@ namespace Vocaluxe.Menu.SongMenu _SongMenu.Draw(); } + public bool IsActive() + { + return _SongMenu.IsActive(); + } + + public void SetActive(bool Active) + { + _SongMenu.SetActive(Active); + } + public int GetSelectedSong() { return _SongMenu.GetSelectedSong(); diff --git a/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs b/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs index dc917994..b32037ee 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs @@ -115,6 +115,7 @@ namespace Vocaluxe.Menu.SongMenu protected long _PendingTime = 500L; private int _LockedInternal = -1; + protected bool _Active = false; protected int _PreviewSelected //for preview only { @@ -217,6 +218,7 @@ namespace Vocaluxe.Menu.SongMenu public void SetSelected(bool Selected) { _Selected = Selected; + SetActive(Selected); } public bool IsVisible() @@ -516,6 +518,16 @@ namespace Vocaluxe.Menu.SongMenu } + public virtual bool IsActive() + { + return _Active; + } + + public virtual void SetActive(bool Active) + { + _Active = Active; + } + public virtual int GetSelectedSong() { return -1; diff --git a/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs b/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs index cb000ad1..9dafa1bb 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs @@ -148,6 +148,11 @@ namespace Vocaluxe.Menu.SongMenu } else { + if (!(KeyEvent.Key == Keys.Left || KeyEvent.Key == Keys.Right || KeyEvent.Key == Keys.Up || KeyEvent.Key == Keys.Down || + KeyEvent.Key == Keys.Escape || KeyEvent.Key == Keys.Back || KeyEvent.Key == Keys.Enter || + KeyEvent.Key == Keys.PageDown || KeyEvent.Key == Keys.PageUp)) + return; + bool sel = false; foreach (CStatic tile in _Tiles) { @@ -400,7 +405,7 @@ namespace Vocaluxe.Menu.SongMenu { foreach (CStatic tile in _Tiles) { - if (tile.Selected) + if (tile.Selected && _Active) tile.Draw(1.2f, tile.Rect.Z - 0.1f, true, false); else { diff --git a/Vocaluxe/Menu/SongMenu/ISongMenu.cs b/Vocaluxe/Menu/SongMenu/ISongMenu.cs index a7e20542..a859e84b 100644 --- a/Vocaluxe/Menu/SongMenu/ISongMenu.cs +++ b/Vocaluxe/Menu/SongMenu/ISongMenu.cs @@ -20,6 +20,9 @@ namespace Vocaluxe.Menu.SongMenu int GetSelectedSong(); void SetSelectedSong(int VisibleSongNr); + bool IsActive(); + void SetActive(bool Active); + int GetSelectedCategory(); int GetActualSelection(); diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index a8c0481c..83988d94 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -42,6 +42,7 @@ namespace Vocaluxe.Screens private bool _SearchActive = false; private bool _SongOptionsActive = false; + private bool _PlaylistActive = false; private List _AvailableGameModes; public CScreenSong() @@ -80,14 +81,24 @@ namespace Vocaluxe.Screens public override bool HandleInput(KeyEvent KeyEvent) { - KeyEvent.Handled = Playlists[htPlaylists(Playlist)].HandleInput(KeyEvent); - if (KeyEvent.Handled) - return true; - base.HandleInput(KeyEvent); if (KeyEvent.Handled) return true; + if (_PlaylistActive) + { + if (!KeyEvent.KeyPressed && KeyEvent.Key == Keys.Tab) + { + _PlaylistActive = !_PlaylistActive; + Playlists[htPlaylists(Playlist)].Selected = _PlaylistActive; + SongMenus[htSongMenus(SongMenu)].SetActive(!_PlaylistActive); + return true; + } + + Playlists[htPlaylists(Playlist)].HandleInput(KeyEvent); + return true; + } + if (!_SongOptionsActive) { if (KeyEvent.KeyPressed && !Char.IsControl(KeyEvent.Unicode)) @@ -104,7 +115,6 @@ namespace Vocaluxe.Screens else { SongMenus[htSongMenus(SongMenu)].HandleInput(ref KeyEvent); - if (KeyEvent.Handled) return true; @@ -123,6 +133,15 @@ namespace Vocaluxe.Screens } break; + case Keys.Tab: + if (Playlists[htPlaylists(Playlist)].Visible) + { + _PlaylistActive = !_PlaylistActive; + Playlists[htPlaylists(Playlist)].Selected = _PlaylistActive; + SongMenus[htSongMenus(SongMenu)].SetActive(!_PlaylistActive); + } + break; + case Keys.Back: if (_SearchText.Length > 0) { @@ -147,6 +166,7 @@ namespace Vocaluxe.Screens } break; + //TODO: Move that to the new menu and delete it! case Keys.A: if (!_SearchActive && KeyEvent.Mod == Modifier.None) { @@ -158,6 +178,7 @@ namespace Vocaluxe.Screens } break; + //TODO: Delete that from here and from wiki! case Keys.F: if (KeyEvent.Mod == Modifier.Ctrl) { @@ -174,6 +195,7 @@ namespace Vocaluxe.Screens } break; + //TODO: We need another key for random! case Keys.R: if (CSongs.Category != -1 && KeyEvent.Mod == Modifier.Ctrl) { @@ -181,6 +203,7 @@ namespace Vocaluxe.Screens } break; + //TODO: Delete that! case Keys.S: if (CSongs.NumVisibleSongs > 0) StartMedleySong(SongMenus[htSongMenus(SongMenu)].GetSelectedSong()); @@ -246,11 +269,22 @@ namespace Vocaluxe.Screens { base.HandleMouse(MouseEvent); - if (Playlists[htPlaylists(Playlist)].HandleMouse(MouseEvent)) + if (CHelper.IsInBounds(Playlists[htPlaylists(Playlist)].Rect, MouseEvent.X, MouseEvent.Y)) { - return true; + _PlaylistActive = true; + Playlists[htPlaylists(Playlist)].Selected = _PlaylistActive; + SongMenus[htSongMenus(SongMenu)].SetActive(!_PlaylistActive); + } + else if (CHelper.IsInBounds(SongMenus[htSongMenus(SongMenu)].Rect, MouseEvent.X, MouseEvent.Y)) + { + _PlaylistActive = false; + Playlists[htPlaylists(Playlist)].Selected = _PlaylistActive; + SongMenus[htSongMenus(SongMenu)].SetActive(!_PlaylistActive); } + if (Playlists[htPlaylists(Playlist)].HandleMouse(MouseEvent)) + return true; + if (!_SongOptionsActive) { @@ -333,6 +367,7 @@ namespace Vocaluxe.Screens base.OnShow(); CGame.EnterNormalGame(); SongMenus[htSongMenus(SongMenu)].OnShow(); + SongMenus[htSongMenus(SongMenu)].SetActive(!_PlaylistActive); Playlists[htPlaylists(Playlist)].Init(); if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != -1) Playlists[htPlaylists(Playlist)].LoadPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); From 6e1a28052e139a440f97cdb2e1d00c8ef3db99c3 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 12 Aug 2012 17:17:38 +0200 Subject: [PATCH 37/70] some more bugfixes and additions to songmenu playlist handling --- Vocaluxe/Menu/CPlaylist.cs | 19 ++++++++++++++++--- Vocaluxe/Screens/CScreenSong.cs | 3 +++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs index 9d3fd36a..f5a664ed 100644 --- a/Vocaluxe/Menu/CPlaylist.cs +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -85,7 +85,7 @@ namespace Vocaluxe.Menu set { _Selected = value; - if (CurrentPlaylistElement == -1 && _Selected) + if (CurrentPlaylistElement == -1 && _Selected && PlaylistElementContents.Count > 0) { CurrentPlaylistElement = 0; ActiveHover = CurrentPlaylistElement; @@ -336,7 +336,7 @@ namespace Vocaluxe.Menu switch (kevent.Key) { case Keys.Up: - if (CurrentPlaylistElement == -1) + if (CurrentPlaylistElement == -1 && PlaylistElementContents.Count > 0) { CurrentPlaylistElement = 0; ActiveHover = CurrentPlaylistElement; @@ -362,7 +362,7 @@ namespace Vocaluxe.Menu return false; case Keys.Down: - if (CurrentPlaylistElement == -1) + if (CurrentPlaylistElement == -1 && PlaylistElementContents.Count > 0) { CurrentPlaylistElement = 0; ActiveHover = CurrentPlaylistElement; @@ -398,6 +398,14 @@ namespace Vocaluxe.Menu } return false; + case Keys.Back: + ClosePlaylist(); + break; + + case Keys.Enter: + StartPlaylistSongs(); + break; + case Keys.PageUp: if (CurrentPlaylistElement != -1) { @@ -634,6 +642,11 @@ namespace Vocaluxe.Menu PlaylistElementContents.Add(pec); } Update(); + if (PlaylistElementContents.Count - 1 < ActiveHover || PlaylistElementContents.Count - 1 < CurrentPlaylistElement) + { + ActiveHover = PlaylistElementContents.Count - 1; + CurrentPlaylistElement = PlaylistElementContents.Count - 1; + } } private void StartPlaylistSongs() diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 83988d94..33e66de9 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -642,6 +642,9 @@ namespace Vocaluxe.Screens private void ClosePlaylist() { SongMenus[htSongMenus(SongMenu)].SetSmallView(false); + _PlaylistActive = false; + Playlists[htPlaylists(Playlist)].Selected = _PlaylistActive; + SongMenus[htSongMenus(SongMenu)].SetActive(!_PlaylistActive); } private void UpdatePlaylistNames() From 8cbc0a1ae64af5b9db115d856d0e24384024c245 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 12 Aug 2012 17:21:05 +0200 Subject: [PATCH 38/70] fixed typo --- Vocaluxe/Lib/Sound/COpenALPlay.cs | 2 +- Vocaluxe/Menu/CButton.cs | 2 +- Vocaluxe/Menu/CPlaylist.cs | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Vocaluxe/Lib/Sound/COpenALPlay.cs b/Vocaluxe/Lib/Sound/COpenALPlay.cs index 99215d7a..85e17cd4 100644 --- a/Vocaluxe/Lib/Sound/COpenALPlay.cs +++ b/Vocaluxe/Lib/Sound/COpenALPlay.cs @@ -804,7 +804,7 @@ namespace Vocaluxe.Lib.Sound { AL.GetSource(_source, ALGetSourcei.BuffersProcessed, out processed_count); doit = false; - Console.WriteLine("Buffers Prozessed on Stream " + _source.ToString() + " = " + processed_count.ToString()); + Console.WriteLine("Buffers Processed on Stream " + _source.ToString() + " = " + processed_count.ToString()); if (processed_count < 1) return; } diff --git a/Vocaluxe/Menu/CButton.cs b/Vocaluxe/Menu/CButton.cs index e03992c6..49e27c7c 100644 --- a/Vocaluxe/Menu/CButton.cs +++ b/Vocaluxe/Menu/CButton.cs @@ -284,7 +284,7 @@ namespace Vocaluxe.Menu } } - public void ProzessMouseMove(int x, int y) + public void ProcessMouseMove(int x, int y) { Selected = CHelper.IsInBounds(Rect, x, y); } diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs index f5a664ed..d4d270f7 100644 --- a/Vocaluxe/Menu/CPlaylist.cs +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -560,10 +560,10 @@ namespace Vocaluxe.Menu if (ActivePlaylistID > -1) { - _Theme.ButtonPlaylistClose.ProzessMouseMove(mevent.X, mevent.Y); - _Theme.ButtonPlaylistSing.ProzessMouseMove(mevent.X, mevent.Y); - _Theme.ButtonPlaylistSave.ProzessMouseMove(mevent.X, mevent.Y); - _Theme.ButtonPlaylistDelete.ProzessMouseMove(mevent.X, mevent.Y); + _Theme.ButtonPlaylistClose.ProcessMouseMove(mevent.X, mevent.Y); + _Theme.ButtonPlaylistSing.ProcessMouseMove(mevent.X, mevent.Y); + _Theme.ButtonPlaylistSave.ProcessMouseMove(mevent.X, mevent.Y); + _Theme.ButtonPlaylistDelete.ProcessMouseMove(mevent.X, mevent.Y); if (mevent.LB) { if (CHelper.IsInBounds(_Theme.ButtonPlaylistClose.Rect, mevent)) From 6f2fe5f1a70f88465fa050c35c750234b9527d4e Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 12 Aug 2012 22:55:50 +0200 Subject: [PATCH 39/70] new interaction handling for playlist (there are still some minor bugs) --- Output/Themes/Ambient/Screens/ScreenSong.xml | 2 +- Vocaluxe/Base/CPlaylists.cs | 12 +- .../{CPlaylist.cs => CPlaylistFile.cs} | 6 +- Vocaluxe/Menu/CBackground.cs | 5 + Vocaluxe/Menu/CButton.cs | 5 + Vocaluxe/Menu/CEqualizer.cs | 5 + Vocaluxe/Menu/CLyric.cs | 5 + Vocaluxe/Menu/CMenu.cs | 6 +- Vocaluxe/Menu/CNameSelection.cs | 5 + Vocaluxe/Menu/CPlaylist.cs | 322 +++++++++++++----- Vocaluxe/Menu/CSelectSlide.cs | 55 +++ Vocaluxe/Menu/CStatic.cs | 5 + Vocaluxe/Menu/CText.cs | 6 + Vocaluxe/Menu/IMenuElement.cs | 1 + Vocaluxe/Menu/SingNotes/CSingNotes.cs | 5 + Vocaluxe/Menu/SongMenu/CSongMenu.cs | 5 + Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs | 5 + Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs | 2 + Vocaluxe/Screens/CScreenSong.cs | 4 +- Vocaluxe/Vocaluxe.csproj | 3 +- 20 files changed, 360 insertions(+), 104 deletions(-) rename Vocaluxe/Lib/Playlist/{CPlaylist.cs => CPlaylistFile.cs} (98%) diff --git a/Output/Themes/Ambient/Screens/ScreenSong.xml b/Output/Themes/Ambient/Screens/ScreenSong.xml index 6250bf88..aff97838 100644 --- a/Output/Themes/Ambient/Screens/ScreenSong.xml +++ b/Output/Themes/Ambient/Screens/ScreenSong.xml @@ -741,7 +741,7 @@ 80 295 460 - -1,00 + -0,90 50,00 CoverTile CoverTile diff --git a/Vocaluxe/Base/CPlaylists.cs b/Vocaluxe/Base/CPlaylists.cs index 8ab1dfe5..c9babd16 100644 --- a/Vocaluxe/Base/CPlaylists.cs +++ b/Vocaluxe/Base/CPlaylists.cs @@ -13,10 +13,10 @@ namespace Vocaluxe.Base static class CPlaylists { - private static List _Playlists; + private static List _Playlists; private static CHelper Helper = new CHelper(); - public static CPlaylist[] Playlists + public static CPlaylistFile[] Playlists { get { return _Playlists.ToArray(); } } @@ -46,13 +46,13 @@ namespace Vocaluxe.Base public static void LoadPlaylists() { - _Playlists = new List(); + _Playlists = new List(); List files = new List(); files.AddRange(Helper.ListFiles(CSettings.sFolderPlaylists, "*.xml", true, true)); foreach (string file in files) { - CPlaylist playlist = new CPlaylist(file); + CPlaylistFile playlist = new CPlaylistFile(file); _Playlists.Add(playlist); } @@ -66,7 +66,7 @@ namespace Vocaluxe.Base _Playlists.Sort(CompareByPlaylistName); } - private static int CompareByPlaylistName(CPlaylist a, CPlaylist b) + private static int CompareByPlaylistName(CPlaylistFile a, CPlaylistFile b) { return String.Compare(a.PlaylistName, b.PlaylistName); } @@ -98,7 +98,7 @@ namespace Vocaluxe.Base public static int NewPlaylist() { - CPlaylist pl = new CPlaylist(); + CPlaylistFile pl = new CPlaylistFile(); pl.PlaylistName = "New Playlist"; _Playlists.Add(pl); return (_Playlists.Count - 1); diff --git a/Vocaluxe/Lib/Playlist/CPlaylist.cs b/Vocaluxe/Lib/Playlist/CPlaylistFile.cs similarity index 98% rename from Vocaluxe/Lib/Playlist/CPlaylist.cs rename to Vocaluxe/Lib/Playlist/CPlaylistFile.cs index 47e59ca6..0bef3b65 100644 --- a/Vocaluxe/Lib/Playlist/CPlaylist.cs +++ b/Vocaluxe/Lib/Playlist/CPlaylistFile.cs @@ -29,7 +29,7 @@ namespace Vocaluxe.Lib.Playlist } } - public class CPlaylist + public class CPlaylistFile { private static XmlWriterSettings _settings = new XmlWriterSettings(); private static CHelper Helper = new CHelper(); @@ -38,14 +38,14 @@ namespace Vocaluxe.Lib.Playlist public string PlaylistFile; public List Songs = new List(); - public CPlaylist() + public CPlaylistFile() { Init(); PlaylistName = string.Empty; PlaylistFile = string.Empty; } - public CPlaylist(string file) + public CPlaylistFile(string file) { Init(); PlaylistFile = file; diff --git a/Vocaluxe/Menu/CBackground.cs b/Vocaluxe/Menu/CBackground.cs index cedc4eb5..1b6b0b83 100644 --- a/Vocaluxe/Menu/CBackground.cs +++ b/Vocaluxe/Menu/CBackground.cs @@ -38,6 +38,11 @@ namespace Vocaluxe.Menu public SColorF Color; + public string GetThemeName() + { + return _Theme.Name; + } + #region Constructors public CBackground() { diff --git a/Vocaluxe/Menu/CButton.cs b/Vocaluxe/Menu/CButton.cs index 49e27c7c..b25c6482 100644 --- a/Vocaluxe/Menu/CButton.cs +++ b/Vocaluxe/Menu/CButton.cs @@ -55,6 +55,11 @@ namespace Vocaluxe.Menu } public bool Visible; + public string GetThemeName() + { + return _Theme.Name; + } + public CButton() { _Theme = new SThemeButton(); diff --git a/Vocaluxe/Menu/CEqualizer.cs b/Vocaluxe/Menu/CEqualizer.cs index a3c6767d..89fe35c3 100644 --- a/Vocaluxe/Menu/CEqualizer.cs +++ b/Vocaluxe/Menu/CEqualizer.cs @@ -47,6 +47,11 @@ namespace Vocaluxe.Menu public bool Visible; public bool ScreenHandles; + public string GetThemeName() + { + return _Theme.Name; + } + private float[] _Bars; public CEqualizer() diff --git a/Vocaluxe/Menu/CLyric.cs b/Vocaluxe/Menu/CLyric.cs index bc4bbbab..21929681 100644 --- a/Vocaluxe/Menu/CLyric.cs +++ b/Vocaluxe/Menu/CLyric.cs @@ -47,6 +47,11 @@ namespace Vocaluxe.Menu private float _Alpha = 1f; + public string GetThemeName() + { + return _Theme.Name; + } + public SRectF Rect { get { return new SRectF(_X, _Y, _MaxW, _H, _Z); } diff --git a/Vocaluxe/Menu/CMenu.cs b/Vocaluxe/Menu/CMenu.cs index ffbd6281..7089747f 100644 --- a/Vocaluxe/Menu/CMenu.cs +++ b/Vocaluxe/Menu/CMenu.cs @@ -879,8 +879,7 @@ namespace Vocaluxe.Menu { if (_Interactions.Count > 0 && _Interactions[_Selection].Type == EType.TSelectSlide && KeyEvent.Mod != Modifier.Shift) KeyEvent.Handled = PrevElement(); - - if (!KeyEvent.Handled) + else KeyEvent.Handled = _NextInteraction(KeyEvent); } @@ -888,8 +887,7 @@ namespace Vocaluxe.Menu { if (_Interactions.Count > 0 && _Interactions[_Selection].Type == EType.TSelectSlide && KeyEvent.Mod != Modifier.Shift) KeyEvent.Handled = NextElement(); - - if (!KeyEvent.Handled) + else KeyEvent.Handled = _NextInteraction(KeyEvent); } diff --git a/Vocaluxe/Menu/CNameSelection.cs b/Vocaluxe/Menu/CNameSelection.cs index 5a539c7c..5d426a89 100644 --- a/Vocaluxe/Menu/CNameSelection.cs +++ b/Vocaluxe/Menu/CNameSelection.cs @@ -49,6 +49,11 @@ namespace Vocaluxe.Menu private SThemeNameSelection _Theme; private bool _ThemeLoaded; + public string GetThemeName() + { + return _Theme.Name; + } + public bool Selected = false; public bool Visible = true; diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs index d4d270f7..ecd01d59 100644 --- a/Vocaluxe/Menu/CPlaylist.cs +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -8,6 +8,7 @@ using System.Windows.Forms; using Vocaluxe.Base; using Vocaluxe.Lib.Draw; +using Vocaluxe.Lib.Song; using Vocaluxe.GameModes; namespace Vocaluxe.Menu @@ -69,6 +70,13 @@ namespace Vocaluxe.Menu private SThemePlaylist _Theme; private bool _ThemeLoaded; + public string GetThemeName() + { + return _Theme.Name; + } + + private CObjectInteractions _Interactions; + private List PlaylistElements; private List PlaylistElementContents; @@ -85,6 +93,7 @@ namespace Vocaluxe.Menu set { _Selected = value; + _Interactions.Active = value; if (CurrentPlaylistElement == -1 && _Selected && PlaylistElementContents.Count > 0) { CurrentPlaylistElement = 0; @@ -122,13 +131,26 @@ namespace Vocaluxe.Menu PlaylistElements = new List(); PlaylistElementContents = new List(); + _Interactions = new CObjectInteractions(); + Visible = false; - Selected = false; + Selected = false; } public void Init() { PrepareList(); + _Interactions.AddText(_Theme.Text1); + _Interactions.AddText(_Theme.Text2); + _Interactions.AddText(_Theme.Text3); + _Interactions.AddText(_Theme.TextPlaylistHeader); + _Interactions.AddStatic(_Theme.StaticCover); + _Interactions.AddStatic(_Theme.StaticPlaylistFooter); + _Interactions.AddStatic(_Theme.StaticPlaylistHeader); + _Interactions.AddButton(_Theme.ButtonPlaylistClose); + _Interactions.AddButton(_Theme.ButtonPlaylistDelete); + _Interactions.AddButton(_Theme.ButtonPlaylistSave); + _Interactions.AddButton(_Theme.ButtonPlaylistSing); } public bool LoadTheme(string XmlPath, string ElementName, XPathNavigator navigator, int SkinIndex) @@ -290,20 +312,14 @@ namespace Vocaluxe.Menu PlaylistElements[i].Background.Texture = CTheme.GetSkinTexture(_Theme.TextureBackgroundName); PlaylistElements[i].Background.Color = BackgroundColor; } - PlaylistElements[i].Background.Draw(); - PlaylistElements[i].Cover.Draw(); - PlaylistElements[i].Text1.Draw(); - PlaylistElements[i].Text2.Draw(); - PlaylistElements[i].Text3.Draw(); - PlaylistElements[i].SelectSlide.Draw(); } - _Theme.ButtonPlaylistSing.Draw(); - _Theme.ButtonPlaylistSave.Draw(); - _Theme.ButtonPlaylistDelete.Draw(); - _Theme.ButtonPlaylistClose.Draw(); - _Theme.StaticPlaylistHeader.Draw(); - _Theme.StaticPlaylistFooter.Draw(); - _Theme.TextPlaylistHeader.Draw(); + + _Interactions.Draw(); + } + + public bool IsMouseOver(MouseEvent MouseEvent) + { + return CHelper.IsInBounds(Rect, MouseEvent.X, MouseEvent.Y) || _Interactions.IsMouseOver(MouseEvent); } public void UnloadTextures() @@ -329,34 +345,77 @@ namespace Vocaluxe.Menu LoadTextures(); } - public bool HandleInput(KeyEvent kevent) + public bool HandleInput(KeyEvent KeyEvent) { if (Selected) { - switch (kevent.Key) + int PrevPlaylistElement = CurrentPlaylistElement; + int CurrPlaylistElement = -1; + //_Interactions.HandleInput(KeyEvent); + + for (int i = 0; i < PlaylistElements.Count; i++) + { + //Hover for playlist-element + if (PlaylistElementContents.Count - 1 >= i && PlaylistElements[i].SelectSlide.Selected) + CurrPlaylistElement = i; + } + + switch (KeyEvent.Key) { case Keys.Up: if (CurrentPlaylistElement == -1 && PlaylistElementContents.Count > 0) { - CurrentPlaylistElement = 0; + _Interactions.HandleInput(KeyEvent); + SetSelectionToLastEntry(); + return true; + } + else if (CurrentPlaylistElement == 0 || PlaylistElementContents.Count == 0 || KeyEvent.ModSHIFT) + { + CurrentPlaylistElement = -1; ActiveHover = CurrentPlaylistElement; + _Interactions.SetInteractionToSelectSlide(PlaylistElements[0].SelectSlide); + _Interactions.HandleInput(KeyEvent); + + int selection = GetSelectedSelectionNr(); + if (selection != -1 && PlaylistElementContents.Count > selection) + { + CurrentPlaylistElement = selection; + ActiveHover = CurrentPlaylistElement; + } return true; } else if (CurrentPlaylistElement - 1 > 0) { - CurrentPlaylistElement--; - ActiveHover = CurrentPlaylistElement; + _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); + _Interactions.HandleInput(KeyEvent); + + int selection = GetSelectedSelectionNr(); + + if (selection != -1 && PlaylistElementContents.Count > selection) + { + CurrentPlaylistElement = selection; + ActiveHover = CurrentPlaylistElement; + } return true; } else if (CurrentPlaylistElement - 1 == 0) { - CurrentPlaylistElement--; if (Offset > 0) { Offset--; Update(); } - ActiveHover = CurrentPlaylistElement; + + _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); + _Interactions.HandleInput(KeyEvent); + + int selection = GetSelectedSelectionNr(); + if (selection != -1 && PlaylistElementContents.Count > selection) + { + CurrentPlaylistElement = selection; + ActiveHover = CurrentPlaylistElement; + } + return true; } return false; @@ -364,28 +423,63 @@ namespace Vocaluxe.Menu case Keys.Down: if (CurrentPlaylistElement == -1 && PlaylistElementContents.Count > 0) { - CurrentPlaylistElement = 0; - ActiveHover = CurrentPlaylistElement; + _Interactions.HandleInput(KeyEvent); + SetSelectionToFirstEntry(); return true; } - else if (CurrentPlaylistElement + 1 < PlaylistElements.Count) + else if (CurrentPlaylistElement == PlaylistElements.Count -1 || PlaylistElementContents.Count == 0 || KeyEvent.ModSHIFT) { - if (PlaylistElements[CurrentPlaylistElement + 1].Content != -1) + CurrentPlaylistElement = -1; + ActiveHover = CurrentPlaylistElement; + + int sel = PlaylistElementContents.Count - 1; + if (sel > PlaylistElements.Count - 1) + sel = PlaylistElements.Count - 1; + + _Interactions.SetInteractionToSelectSlide(PlaylistElements[sel].SelectSlide); + _Interactions.HandleInput(KeyEvent); + + int selection = GetSelectedSelectionNr(); + if (selection != -1 && PlaylistElementContents.Count > selection) { - CurrentPlaylistElement++; + CurrentPlaylistElement = selection; ActiveHover = CurrentPlaylistElement; - return true; } + return true; } - else if (CurrentPlaylistElement + 1 >= PlaylistElements.Count && CurrentPlaylistElement + Offset + 1 < PlaylistElementContents.Count) + else if (CurrentPlaylistElement + 1 < PlaylistElements.Count - 1) + { + _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); + _Interactions.HandleInput(KeyEvent); + + int selection = GetSelectedSelectionNr(); + + if (selection != -1 && PlaylistElementContents.Count > selection) + { + CurrentPlaylistElement = selection; + ActiveHover = CurrentPlaylistElement; + } + return true; + } + else if (CurrentPlaylistElement + 1 >= PlaylistElements.Count - 1 && CurrentPlaylistElement + Offset + 1 < PlaylistElementContents.Count) { if (PlaylistElementContents[CurrentPlaylistElement + Offset + 1].SongID != -1) { Offset++; - Update(); - ActiveHover = CurrentPlaylistElement; - return true; + Update(); } + + _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); + _Interactions.HandleInput(KeyEvent); + + int selection = GetSelectedSelectionNr(); + if (selection != -1 && PlaylistElementContents.Count > selection) + { + CurrentPlaylistElement = selection; + ActiveHover = CurrentPlaylistElement; + } + + return true; } return false; @@ -394,6 +488,8 @@ namespace Vocaluxe.Menu { CPlaylists.Playlists[ActivePlaylistID].DeleteSong(PlaylistElements[CurrentPlaylistElement].Content); UpdatePlaylist(); + if (CurrentPlaylistElement != -1) + _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); return true; } return false; @@ -420,6 +516,7 @@ namespace Vocaluxe.Menu Offset--; } UpdatePlaylist(); + _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); return true; } break; @@ -438,28 +535,27 @@ namespace Vocaluxe.Menu Offset++; } UpdatePlaylist(); + _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); return true; } break; case Keys.Left: + _Interactions.HandleInput(KeyEvent); if (CurrentPlaylistElement != -1) { - int oldValue = PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection; - PlaylistElements[CurrentPlaylistElement].SelectSlide.PrevValue(); - if (oldValue != PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection) - CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; + CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; + UpdatePlaylist(); return true; } return false; case Keys.Right: + _Interactions.HandleInput(KeyEvent); if (CurrentPlaylistElement != -1) { - int oldValue = PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection; - PlaylistElements[CurrentPlaylistElement].SelectSlide.NextValue(); - if (oldValue != PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection) - CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; + CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; + UpdatePlaylist(); return true; } return false; @@ -468,72 +564,117 @@ namespace Vocaluxe.Menu return false; } - public bool HandleMouse(MouseEvent mevent) + private void SetSelectionToLastEntry() { - if (CHelper.IsInBounds(Rect, mevent) && Visible) + if (PlaylistElementContents.Count == 0) + return; + + int selection = GetSelectedSelectionNr(); + if (selection == -1) + return; + + int off = PlaylistElementContents.Count - PlaylistElements.Count; + if (off >= 0) { - if (mevent.Wheel > 0) + Offset = off; + Update(); + } + + if (PlaylistElementContents.Count > selection) + { + CurrentPlaylistElement = selection; + ActiveHover = CurrentPlaylistElement; + } + } + + private void SetSelectionToFirstEntry() + { + if (PlaylistElementContents.Count == 0) + return; + + int selection = GetSelectedSelectionNr(); + if (selection == -1) + return; + + Offset = 0; + Update(); + + if (PlaylistElementContents.Count > selection) + { + CurrentPlaylistElement = selection; + ActiveHover = CurrentPlaylistElement; + } + } + + private int GetSelectedSelectionNr() + { + for (int i = 0; i < PlaylistElements.Count; i++) + { + if (PlaylistElements[i].SelectSlide.Selected) + return i; + } + return -1; + } + + public bool HandleMouse(MouseEvent MouseEvent) + { + _Interactions.HandleMouse(MouseEvent); + + if (CHelper.IsInBounds(Rect, MouseEvent) && Visible) + { + if (MouseEvent.Wheel > 0) { - if (PlaylistElements.Count + Offset + mevent.Wheel <= PlaylistElementContents.Count) + if (PlaylistElements.Count + Offset + MouseEvent.Wheel <= PlaylistElementContents.Count) { - Offset = Offset + mevent.Wheel; + Offset += MouseEvent.Wheel; Update(); return true; } return true; } - else if (mevent.Wheel < 0) + else if (MouseEvent.Wheel < 0) { - if (Offset + mevent.Wheel >= 0) + if (Offset + MouseEvent.Wheel >= 0) { - Offset = Offset + mevent.Wheel; + Offset += MouseEvent.Wheel; Update(); return true; } } - if (mevent.LB) + + if (MouseEvent.LB) { if (CurrentPlaylistElement != -1) { - int oldValue = PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection; - PlaylistElements[CurrentPlaylistElement].SelectSlide.ProcessMouseLBClick(mevent.X, mevent.Y); - if (oldValue != PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection) - CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; + CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; + UpdatePlaylist(); return true; } } for (int i = 0; i < PlaylistElements.Count; i++) - { + { //Hover for playlist-element - if (PlaylistElementContents.Count - 1 >= i && CHelper.IsInBounds(PlaylistElements[i].Background.Rect, mevent)) + if (PlaylistElementContents.Count - 1 >= i && CHelper.IsInBounds(PlaylistElements[i].Background.Rect, MouseEvent)) { - PlaylistElements[i].Background.Texture = CTheme.GetSkinTexture(_Theme.STextureBackgroundName); - PlaylistElements[i].Background.Color = BackgroundSColor; ActiveHover = i; CurrentPlaylistElement = i; } - else - { - PlaylistElements[i].Background.Texture = CTheme.GetSkinTexture(_Theme.TextureBackgroundName); - PlaylistElements[i].Background.Color = BackgroundColor; - } - //Hover for SelectSlide-Arrow - PlaylistElements[i].SelectSlide.ProcessMouseMove(mevent.X, mevent.Y); + //Delete Entry with RB - if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, mevent) && mevent.RB && PlaylistElements[i].Content != -1) + if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, MouseEvent) && MouseEvent.RB && PlaylistElements[i].Content != -1) { CPlaylists.Playlists[ActivePlaylistID].DeleteSong(PlaylistElements[i].Content); UpdatePlaylist(); return true; } //Change order with holding LB - else if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, mevent) && mevent.LBH && PlaylistElements[i].Content != -1 && !changeOrder) + else if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, MouseEvent) && MouseEvent.LBH && PlaylistElements[i].Content != -1 && !changeOrder) { changeOrder = true; CurrentPlaylistElement = i; } - else if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, mevent) && mevent.LBH && PlaylistElements[i].Content != -1 && changeOrder) + else if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, MouseEvent) && MouseEvent.LBH && PlaylistElements[i].Content != -1 && changeOrder) { /* if (PlaylistElements.Count < CurrentPlaylistElement + 1) @@ -560,25 +701,21 @@ namespace Vocaluxe.Menu if (ActivePlaylistID > -1) { - _Theme.ButtonPlaylistClose.ProcessMouseMove(mevent.X, mevent.Y); - _Theme.ButtonPlaylistSing.ProcessMouseMove(mevent.X, mevent.Y); - _Theme.ButtonPlaylistSave.ProcessMouseMove(mevent.X, mevent.Y); - _Theme.ButtonPlaylistDelete.ProcessMouseMove(mevent.X, mevent.Y); - if (mevent.LB) + if (MouseEvent.LB) { - if (CHelper.IsInBounds(_Theme.ButtonPlaylistClose.Rect, mevent)) + if (_Theme.ButtonPlaylistClose.Selected) { ClosePlaylist(); } - else if (CHelper.IsInBounds(_Theme.ButtonPlaylistSing.Rect, mevent)) + else if (_Theme.ButtonPlaylistSing.Selected) { StartPlaylistSongs(); } - else if (CHelper.IsInBounds(_Theme.ButtonPlaylistSave.Rect, mevent)) + else if (_Theme.ButtonPlaylistSave.Selected) { CPlaylists.SavePlaylist(ActivePlaylistID); } - else if (CHelper.IsInBounds(_Theme.ButtonPlaylistDelete.Rect, mevent)) + else if (_Theme.ButtonPlaylistDelete.Selected) { CPlaylists.DeletePlaylist(ActivePlaylistID); ClosePlaylist(); @@ -599,12 +736,20 @@ namespace Vocaluxe.Menu en.Text1 = new CText(Rect.X + _Theme.Text1.X, Rect.Y + _Theme.Text1.Y + (i * _Theme.EntryHeight), _Theme.Text1.Z, _Theme.Text1.Height, _Theme.Text1.MaxWidth, _Theme.Text1.Align, _Theme.Text1.Style, _Theme.Text1.Fon, _Theme.Text1.Color, "", _Theme.Text1.ReflectionSpace, _Theme.Text1.ReflectionHeight); en.Text2 = new CText(Rect.X + _Theme.Text2.X, Rect.Y + _Theme.Text2.Y + (i * _Theme.EntryHeight), _Theme.Text2.Z, _Theme.Text2.Height, _Theme.Text2.MaxWidth, _Theme.Text2.Align, _Theme.Text2.Style, _Theme.Text2.Fon, _Theme.Text2.Color, "", _Theme.Text2.ReflectionSpace, _Theme.Text2.ReflectionHeight); en.Text3 = new CText(Rect.X + _Theme.Text3.X, Rect.Y + _Theme.Text3.Y + (i * _Theme.EntryHeight), _Theme.Text3.Z, _Theme.Text3.Height, _Theme.Text3.MaxWidth, _Theme.Text3.Align, _Theme.Text3.Style, _Theme.Text3.Fon, _Theme.Text3.Color, "", _Theme.Text3.ReflectionSpace, _Theme.Text3.ReflectionHeight); - en.SelectSlide = (CSelectSlide)_Theme.SelectSlideGameMode.Clone(); + + + en.SelectSlide = new CSelectSlide(_Theme.SelectSlideGameMode); en.SelectSlide.Rect = new SRectF(Rect.X + _Theme.SelectSlideGameMode.Rect.X, Rect.Y + _Theme.SelectSlideGameMode.Rect.Y + (i * _Theme.EntryHeight), _Theme.SelectSlideGameMode.Rect.W, _Theme.SelectSlideGameMode.Rect.H, _Theme.SelectSlideGameMode.Rect.Z); en.SelectSlide.RectArrowLeft = new SRectF(Rect.X + _Theme.SelectSlideGameMode.RectArrowLeft.X, Rect.Y + _Theme.SelectSlideGameMode.RectArrowLeft.Y + (i * _Theme.EntryHeight), _Theme.SelectSlideGameMode.RectArrowLeft.W, _Theme.SelectSlideGameMode.RectArrowLeft.H, _Theme.SelectSlideGameMode.RectArrowLeft.Z); en.SelectSlide.RectArrowRight = new SRectF(Rect.X + _Theme.SelectSlideGameMode.RectArrowRight.X, Rect.Y + _Theme.SelectSlideGameMode.RectArrowRight.Y + (i * _Theme.EntryHeight), _Theme.SelectSlideGameMode.RectArrowRight.W, _Theme.SelectSlideGameMode.RectArrowRight.H, _Theme.SelectSlideGameMode.RectArrowRight.Z); en.Content = -1; PlaylistElements.Add(en); + _Interactions.AddSelectSlide(en.SelectSlide); + _Interactions.AddText(en.Text1); + _Interactions.AddText(en.Text2); + _Interactions.AddText(en.Text3); + _Interactions.AddStatic(en.Background); + _Interactions.AddStatic(en.Cover); } } @@ -637,7 +782,7 @@ namespace Vocaluxe.Menu { PlaylistElementContent pec = new PlaylistElementContent(); pec.SongID = CPlaylists.Playlists[ActivePlaylistID].Songs[i].SongID; - pec.Modes = CSongs.AllSongs[CPlaylists.Playlists[ActivePlaylistID].Songs[i].SongID].AvailableGameModes; + pec.Modes = CSongs.AllSongs[pec.SongID].AvailableGameModes; pec.Mode = CPlaylists.Playlists[ActivePlaylistID].Songs[i].GameMode; PlaylistElementContents.Add(pec); } @@ -679,30 +824,31 @@ namespace Vocaluxe.Menu int e = 0 + Offset; for (int i = 0; i < PlaylistElements.Count; i++ ) { - if (e < PlaylistElementContents.Count) + if (e + i < PlaylistElementContents.Count) { - PlaylistElements[i].Content = e; + PlaylistElements[i].Content = e+i; PlaylistElements[i].Background.Visible = true; PlaylistElements[i].Cover.Visible = true; PlaylistElements[i].SelectSlide.Visible = true; PlaylistElements[i].Text1.Visible = true; PlaylistElements[i].Text2.Visible = true; PlaylistElements[i].Text3.Visible = true; - PlaylistElements[i].Cover.Texture = CSongs.GetSong(PlaylistElementContents[e].SongID).CoverTextureSmall; - string t1 = _Theme.Text1.Text.Replace("%a", CSongs.GetSong(PlaylistElementContents[e].SongID).Artist).Replace("%t", CSongs.GetSong(PlaylistElementContents[e].SongID).Title); - string t2 = _Theme.Text2.Text.Replace("%a", CSongs.GetSong(PlaylistElementContents[e].SongID).Artist).Replace("%t", CSongs.GetSong(PlaylistElementContents[e].SongID).Title); - string t3 = _Theme.Text3.Text.Replace("%a", CSongs.GetSong(PlaylistElementContents[e].SongID).Artist).Replace("%t", CSongs.GetSong(PlaylistElementContents[e].SongID).Title); + PlaylistElementContent pec = PlaylistElementContents[e + i]; + CSong song = CSongs.GetSong(pec.SongID); + PlaylistElements[i].Cover.Texture = song.CoverTextureSmall; + string t1 = _Theme.Text1.Text.Replace("%a", song.Artist).Replace("%t", song.Title); + string t2 = _Theme.Text2.Text.Replace("%a", song.Artist).Replace("%t", song.Title); + string t3 = _Theme.Text3.Text.Replace("%a", song.Artist).Replace("%t", song.Title); PlaylistElements[i].Text1.Text = t1; PlaylistElements[i].Text2.Text = t2; PlaylistElements[i].Text3.Text = t3; PlaylistElements[i].SelectSlide.Clear(); - for (int g = 0; g < PlaylistElementContents[e].Modes.Length; g++) + for (int g = 0; g < pec.Modes.Length; g++) { - PlaylistElements[i].SelectSlide.AddValue(Enum.GetName(typeof(GameModes.EGameMode), PlaylistElementContents[e].Modes[g])); - if (PlaylistElementContents[e].Modes[g] == PlaylistElementContents[e].Mode) + PlaylistElements[i].SelectSlide.AddValue(Enum.GetName(typeof(GameModes.EGameMode), pec.Modes[g])); + if (pec.Modes[g] == pec.Mode) PlaylistElements[i].SelectSlide.SetSelectionByValueIndex(g); - } - e++; + } } else { diff --git a/Vocaluxe/Menu/CSelectSlide.cs b/Vocaluxe/Menu/CSelectSlide.cs index 76893d78..28fb9493 100644 --- a/Vocaluxe/Menu/CSelectSlide.cs +++ b/Vocaluxe/Menu/CSelectSlide.cs @@ -43,6 +43,11 @@ namespace Vocaluxe.Menu private SThemeSelectSlide _Theme; private bool _ThemeLoaded; + public string GetThemeName() + { + return _Theme.Name; + } + public SRectF Rect; public SRectF RectArrowLeft; public SRectF RectArrowRight; @@ -159,6 +164,56 @@ namespace Vocaluxe.Menu _ValueNames = new List(); } + public CSelectSlide(CSelectSlide slide) + { + _Theme = new SThemeSelectSlide(); + + _Theme.TextureArrowLeftName = slide._Theme.TextureArrowLeftName; + _Theme.TextureArrowRightName = slide._Theme.TextureArrowRightName; + + _Theme.STextureName = slide._Theme.STextureName; + _Theme.STextureArrowLeftName = slide._Theme.STextureArrowLeftName; + _Theme.STextureArrowRightName = slide._Theme.STextureArrowRightName; + + _Theme.HTextureName = slide._Theme.HTextureName; + + _Theme.ColorName = slide._Theme.ColorName; + _Theme.SColorName = slide._Theme.SColorName; + _Theme.HColorName = slide._Theme.HColorName; + + _Theme.ArrowColorName = slide._Theme.ArrowColorName; + _Theme.SArrowColorName = slide._Theme.SArrowColorName; + + _Theme.TextColorName = slide._Theme.TextColorName; + _Theme.STextColorName = slide._Theme.STextColorName; + + _Theme.TextFont = slide._Theme.TextFont; + _Theme.TextStyle = slide._Theme.TextStyle; + + _ThemeLoaded = false; + + Rect = new SRectF(slide.Rect); + RectArrowLeft = new SRectF(slide.RectArrowLeft); + RectArrowRight = new SRectF(slide.RectArrowRight); + + Color = new SColorF(slide.Color); + SColor = new SColorF(slide.SColor); + + ColorArrow = new SColorF(slide.ColorArrow); + SColorArrow = new SColorF(slide.SColorArrow); + + TextColor = new SColorF(slide.TextColor); + STextColor = new SColorF(slide.STextColor); + TextH = slide.TextH; + MaxW = slide.MaxW; + + _Selected = false; + _Textures = new List(); + _ValueIndexes = new List(); + _ValueNames = new List(); + _NumVisible = slide._NumVisible; + } + public bool LoadTheme(string XmlPath, string ElementName, XPathNavigator navigator, int SkinIndex) { string item = XmlPath + "/" + ElementName; diff --git a/Vocaluxe/Menu/CStatic.cs b/Vocaluxe/Menu/CStatic.cs index 98e4e9f4..37d29d04 100644 --- a/Vocaluxe/Menu/CStatic.cs +++ b/Vocaluxe/Menu/CStatic.cs @@ -22,6 +22,11 @@ namespace Vocaluxe.Menu private SThemeStatic _Theme; private bool _ThemeLoaded; + public string GetThemeName() + { + return _Theme.Name; + } + private STexture _Texture; public STexture Texture { diff --git a/Vocaluxe/Menu/CText.cs b/Vocaluxe/Menu/CText.cs index 012709dc..df5ccf23 100644 --- a/Vocaluxe/Menu/CText.cs +++ b/Vocaluxe/Menu/CText.cs @@ -41,6 +41,12 @@ namespace Vocaluxe.Menu { private SThemeText _Theme; private bool _ThemeLoaded; + + public string GetThemeName() + { + return _Theme.Name; + } + private bool _ButtonText; private bool _PositionNeedsUpdate = true; diff --git a/Vocaluxe/Menu/IMenuElement.cs b/Vocaluxe/Menu/IMenuElement.cs index 25e56c50..152e4ec1 100644 --- a/Vocaluxe/Menu/IMenuElement.cs +++ b/Vocaluxe/Menu/IMenuElement.cs @@ -8,6 +8,7 @@ namespace Vocaluxe.Menu { interface IMenuElement { + string GetThemeName(); bool LoadTheme(string XmlPath, string ElementName, XPathNavigator navigator, int SkinIndex); bool SaveTheme(XmlWriter writer); diff --git a/Vocaluxe/Menu/SingNotes/CSingNotes.cs b/Vocaluxe/Menu/SingNotes/CSingNotes.cs index fef6da24..244d380b 100644 --- a/Vocaluxe/Menu/SingNotes/CSingNotes.cs +++ b/Vocaluxe/Menu/SingNotes/CSingNotes.cs @@ -75,6 +75,11 @@ namespace Vocaluxe.Menu.SingNotes _ActID = 0; } + public string GetThemeName() + { + return _Theme.Name; + } + public bool LoadTheme(string XmlPath, string ElementName, XPathNavigator navigator, int SkinIndex) { string item = XmlPath + "/" + ElementName; diff --git a/Vocaluxe/Menu/SongMenu/CSongMenu.cs b/Vocaluxe/Menu/SongMenu/CSongMenu.cs index 48fdf61f..7f437ab0 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenu.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenu.cs @@ -141,6 +141,11 @@ namespace Vocaluxe.Menu.SongMenu #endregion ISongMenu #region IMenuElement + public string GetThemeName() + { + return _SongMenu.GetThemeName(); + } + public bool LoadTheme(string XmlPath, string ElementName, XPathNavigator navigator, int SkinIndex) { return _SongMenu.LoadTheme(XmlPath, ElementName, navigator, SkinIndex); diff --git a/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs b/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs index b32037ee..6f59fa36 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs @@ -249,6 +249,11 @@ namespace Vocaluxe.Menu.SongMenu _ThemeLoaded = false; } + public string GetThemeName() + { + return _Theme.Name; + } + public bool LoadTheme(string XmlPath, string ElementName, XPathNavigator navigator, int SkinIndex) { string item = XmlPath + "/" + ElementName; diff --git a/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs b/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs index 9dafa1bb..64104010 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs @@ -692,6 +692,7 @@ namespace Vocaluxe.Menu.SongMenu } } + _Rect = _Theme.songMenuTileBoard.TileRectSmall; _ScrollRect = new SRectF(0, 0, CSettings.iRenderW, CSettings.iRenderH, _Theme.songMenuTileBoard.TileRectSmall.Z); } else @@ -717,6 +718,7 @@ namespace Vocaluxe.Menu.SongMenu } } + _Rect = _Theme.songMenuTileBoard.TileRect; _ScrollRect = new SRectF(0, 0, CSettings.iRenderW, CSettings.iRenderH, _Theme.songMenuTileBoard.TileRect.Z); } diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 33e66de9..bbc0f021 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -269,7 +269,7 @@ namespace Vocaluxe.Screens { base.HandleMouse(MouseEvent); - if (CHelper.IsInBounds(Playlists[htPlaylists(Playlist)].Rect, MouseEvent.X, MouseEvent.Y)) + if (Playlists[htPlaylists(Playlist)].IsMouseOver(MouseEvent)) { _PlaylistActive = true; Playlists[htPlaylists(Playlist)].Selected = _PlaylistActive; @@ -377,8 +377,10 @@ namespace Vocaluxe.Screens public override bool UpdateGame() { SongMenus[htSongMenus(SongMenu)].Update(); + if (SongMenus[htSongMenus(SongMenu)].IsSmallView()) CheckPlaylist(); + Texts[htTexts(TextCategory)].Text = CSongs.GetActualCategoryName(); if (CSongs.Category > -1 || CConfig.Tabs == EOffOn.TR_CONFIG_OFF) diff --git a/Vocaluxe/Vocaluxe.csproj b/Vocaluxe/Vocaluxe.csproj index 212abf5a..156dd856 100644 --- a/Vocaluxe/Vocaluxe.csproj +++ b/Vocaluxe/Vocaluxe.csproj @@ -189,7 +189,7 @@ Form - + @@ -215,6 +215,7 @@ + From f079d458c657f60bae750c2a507c68329d1d8092 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Mon, 13 Aug 2012 07:27:05 +0200 Subject: [PATCH 40/70] added missing file --- Vocaluxe/Menu/CObjectInteractions.cs | 1091 ++++++++++++++++++++++++++ 1 file changed, 1091 insertions(+) create mode 100644 Vocaluxe/Menu/CObjectInteractions.cs diff --git a/Vocaluxe/Menu/CObjectInteractions.cs b/Vocaluxe/Menu/CObjectInteractions.cs new file mode 100644 index 00000000..30dd279c --- /dev/null +++ b/Vocaluxe/Menu/CObjectInteractions.cs @@ -0,0 +1,1091 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Text; +using System.Windows.Forms; +using System.Xml; +using System.Xml.XPath; + +using Vocaluxe.Base; +using Vocaluxe.Lib.Draw; +using Vocaluxe.Menu; +using Vocaluxe.Menu.SingNotes; +using Vocaluxe.Menu.SongMenu; + +namespace Vocaluxe.Menu +{ + class CObjectInteractions + { + private List _Interactions; + private int _Selection = 0; + + private List _Statics; + private List _Texts; + private List _Buttons; + private List _SelectSlides; + + private int _PrevMouseX; + private int _PrevMouseY; + + protected int _MouseDX; + protected int _MouseDY; + + public bool Active; + + protected SRectF _ScreenArea; + + public SRectF ScreenArea + { + get { return _ScreenArea; } + } + + public CObjectInteractions() + { + Init(); + } + + protected virtual void Init() + { + _Interactions = new List(); + _Selection = 0; + + _Statics = new List(); + _Texts = new List(); + _Buttons = new List(); + _SelectSlides = new List(); + + _PrevMouseX = 0; + _PrevMouseY = 0; + + _MouseDX = 0; + _MouseDY = 0; + + Active = false; + _ScreenArea = new SRectF(0f, 0f, CSettings.iRenderW, CSettings.iRenderH, 0f); + } + #region GetLists + public List GetButtons() + { + return _Buttons; + } + + public List GetSelectSlides() + { + return _SelectSlides; + } + #endregion GetLists + + #region ElementHandler + #region Get Arrays + public CButton[] Buttons + { + get + { + return _Buttons.ToArray(); + } + } + + public CSelectSlide[] SelectSlides + { + get + { + return _SelectSlides.ToArray(); + } + } + #endregion Get Arrays + #endregion ElementHandler + + #region MenuHandler + public bool HandleInput(KeyEvent KeyEvent) + { + if (!CSettings.TabNavigation) + { + if (KeyEvent.Key == Keys.Left) + { + if (_Interactions.Count > 0 && _Interactions[_Selection].Type == EType.TSelectSlide && KeyEvent.Mod != Modifier.Shift) + KeyEvent.Handled = PrevElement(); + else + KeyEvent.Handled = _NextInteraction(KeyEvent); + } + + if (KeyEvent.Key == Keys.Right) + { + if (_Interactions.Count > 0 && _Interactions[_Selection].Type == EType.TSelectSlide && KeyEvent.Mod != Modifier.Shift) + KeyEvent.Handled = NextElement(); + else + KeyEvent.Handled = _NextInteraction(KeyEvent); + } + + if (KeyEvent.Key == Keys.Up || KeyEvent.Key == Keys.Down) + { + KeyEvent.Handled = _NextInteraction(KeyEvent); + } + } + else + { + if (KeyEvent.Key == Keys.Tab) + { + if (KeyEvent.Mod == Modifier.Shift) + PrevInteraction(); + else + NextInteraction(); + } + + if (KeyEvent.Key == Keys.Left) + PrevElement(); + + if (KeyEvent.Key == Keys.Right) + NextElement(); + } + + return true; + } + + public bool HandleMouse(MouseEvent MouseEvent) + { + int selection = _Selection; + ProcessMouseMove(MouseEvent.X, MouseEvent.Y); + if (selection != _Selection) + { + _UnsetHighlighted(selection); + _SetHighlighted(_Selection); + } + + if (MouseEvent.LB) + ProcessMouseClick(MouseEvent.X, MouseEvent.Y); + + _PrevMouseX = MouseEvent.X; + _PrevMouseY = MouseEvent.Y; + + return true; + } + + public bool HandleInputThemeEditor(KeyEvent KeyEvent) + { + _UnsetHighlighted(_Selection); + if (KeyEvent.KeyPressed) + { + + } + else + { + switch (KeyEvent.Key) + { + case Keys.S: + CGraphics.SaveTheme(); + break; + + case Keys.Up: + if (KeyEvent.Mod == Modifier.Ctrl) + MoveElement(0, -1); + + if (KeyEvent.Mod == Modifier.Shift) + ResizeElement(0, 1); + + break; + case Keys.Down: + if (KeyEvent.Mod == Modifier.Ctrl) + MoveElement(0, 1); + + if (KeyEvent.Mod == Modifier.Shift) + ResizeElement(0, -1); + + break; + + case Keys.Right: + if (KeyEvent.Mod == Modifier.Ctrl) + MoveElement(1, 0); + + if (KeyEvent.Mod == Modifier.Shift) + ResizeElement(1, 0); + + if (KeyEvent.Mod == Modifier.None) + NextInteraction(); + break; + case Keys.Left: + if (KeyEvent.Mod == Modifier.Ctrl) + MoveElement(-1, 0); + + if (KeyEvent.Mod == Modifier.Shift) + ResizeElement(-1, 0); + + if (KeyEvent.Mod == Modifier.None) + PrevInteraction(); + break; + } + } + return true; + } + + public bool HandleMouseThemeEditor(MouseEvent MouseEvent) + { + _UnsetHighlighted(_Selection); + _MouseDX = MouseEvent.X - _PrevMouseX; + _MouseDY = MouseEvent.Y - _PrevMouseY; + + int stepX = 0; + int stepY = 0; + + if ((MouseEvent.Mod & Modifier.Ctrl) == Modifier.Ctrl) + { + _PrevMouseX = MouseEvent.X; + _PrevMouseY = MouseEvent.Y; + } + else + { + while (Math.Abs(MouseEvent.X - _PrevMouseX) >= 5) + { + if (MouseEvent.X - _PrevMouseX >= 5) + stepX += 5; + + if (MouseEvent.X - _PrevMouseX <= -5) + stepX -= 5; + + _PrevMouseX = MouseEvent.X - (_MouseDX - stepX); + } + + while (Math.Abs(MouseEvent.Y - _PrevMouseY) >= 5) + { + if (MouseEvent.Y - _PrevMouseY >= 5) + stepY += 5; + + if (MouseEvent.Y - _PrevMouseY <= -5) + stepY -= 5; + + _PrevMouseY = MouseEvent.Y - (_MouseDY - stepY); + } + } + + if (MouseEvent.LBH) + { + //if (IsMouseOver(MouseEvent.X, _PrevMouseY)) + //{ + if (MouseEvent.Mod == Modifier.None) + MoveElement(stepX, stepY); + + if (MouseEvent.Mod == Modifier.Ctrl) + MoveElement(_MouseDX, _MouseDY); + + if (MouseEvent.Mod == Modifier.Shift) + ResizeElement(stepX, stepY); + + if (MouseEvent.Mod == (Modifier.Shift | Modifier.Ctrl)) + ResizeElement(_MouseDX, _MouseDY); + //} + } + else + ProcessMouseMove(MouseEvent.X, MouseEvent.Y); + + return true; + } + #endregion MenuHandler + + #region Drawing + public void Draw() + { + if (_Interactions.Count <= 0) + return; + + List items = new List(); + + for (int i = 0; i < _Interactions.Count; i++) + { + if (_IsVisible(i) && ( + _Interactions[i].Type == EType.TButton || + _Interactions[i].Type == EType.TSelectSlide || + _Interactions[i].Type == EType.TStatic || + _Interactions[i].Type == EType.TNameSelection || + _Interactions[i].Type == EType.TText || + _Interactions[i].Type == EType.TSongMenu || + _Interactions[i].Type == EType.TEqualizer)) + { + ZSort zs = new ZSort(); + zs.ID = i; + zs.z = _GetZValue(i); + items.Add(zs); + } + } + + if (items.Count <= 0) + return; + + + items.Sort(delegate(ZSort s1, ZSort s2) { return (s2.z.CompareTo(s1.z)); }); + + for (int i = 0; i < items.Count; i++) + { + _DrawInteraction(items[i].ID); + } + + } + #endregion Drawing + + #region Elements + public int AddStatic(CStatic stat) + { + _Statics.Add(stat); + _AddInteraction(_Statics.Count - 1, EType.TStatic); + return _Statics.Count - 1; + } + + public int AddText(CText text) + { + _Texts.Add(text); + _AddInteraction(_Texts.Count - 1, EType.TText); + return _Texts.Count - 1; + } + + public int AddButton(CButton button) + { + _Buttons.Add(button); + _AddInteraction(_Buttons.Count - 1, EType.TButton); + return _Buttons.Count - 1; + } + + public int AddSelectSlide(CSelectSlide slide) + { + _SelectSlides.Add(slide); + _AddInteraction(_SelectSlides.Count - 1, EType.TSelectSlide); + return _SelectSlides.Count - 1; + } + #endregion Elements + + #region InteractionHandling + public void NextInteraction() + { + if (_Interactions.Count > 0) + _NextInteraction(); + } + + public void PrevInteraction() + { + if (_Interactions.Count > 0) + _PrevInteraction(); + } + + /// + /// Selects the next element in a menu interaction. + /// + /// True if the next element is selected. False if either there is no next element or the interaction does not provide such a method. + public bool NextElement() + { + if (_Interactions.Count > 0) + return _NextElement(); + + return false; + } + + /// + /// Selects the previous element in a menu interaction. + /// + /// True if the previous element is selected. False if either there is no next element or the interaction does not provide such a method. + public bool PrevElement() + { + if (_Interactions.Count > 0) + return _PrevElement(); + + return false; + } + + public bool SetInteractionToButton(CButton button) + { + for (int i = 0; i < _Interactions.Count; i++) + { + if (_Interactions[i].Type == EType.TButton) + { + if (_Buttons[_Interactions[i].Num].Visible && _Buttons[_Interactions[i].Num] == button) + { + _UnsetSelected(); + _UnsetHighlighted(_Selection); + _Selection = i; + _SetSelected(); + return true; + } + } + } + return false; + } + + public bool SetInteractionToSelectSlide(CSelectSlide slide) + { + for (int i = 0; i < _Interactions.Count; i++) + { + if (_Interactions[i].Type == EType.TSelectSlide) + { + if (_SelectSlides[_Interactions[i].Num].Visible && _SelectSlides[_Interactions[i].Num] == slide) + { + _UnsetSelected(); + _UnsetHighlighted(_Selection); + _Selection = i; + _SetSelected(); + return true; + } + } + } + return false; + } + + public void ProcessMouseClick(int x, int y) + { + if (_Selection >= _Interactions.Count || _Selection < 0) + return; + + if (_Interactions[_Selection].Type == EType.TSelectSlide) + { + if (_SelectSlides[_Interactions[_Selection].Num].Visible) + { + _SelectSlides[_Interactions[_Selection].Num].ProcessMouseLBClick(x, y); + } + } + } + + public void ProcessMouseMove(int x, int y) + { + SelectByMouse(x, y); + + if (_Selection >= _Interactions.Count || _Selection < 0) + return; + + if (_Interactions[_Selection].Type == EType.TSelectSlide) + { + if (_SelectSlides[_Interactions[_Selection].Num].Visible) + { + _SelectSlides[_Interactions[_Selection].Num].ProcessMouseMove(x, y); + } + } + } + + public void SelectByMouse(int x, int y) + { + float z = CSettings.zFar; + for (int i = 0; i < _Interactions.Count; i++) + { + if ((CSettings.GameState == EGameState.EditTheme) || (!_Interactions[i].ThemeEditorOnly && _IsVisible(i))) + { + if (_IsMouseOver(x, y, _Interactions[i])) + { + if (_GetZValue(_Interactions[i]) <= z) + { + z = _GetZValue(_Interactions[i]); + _UnsetSelected(); + _Selection = i; + _SetSelected(); + } + } + } + } + } + + public bool IsMouseOver(MouseEvent MouseEvent) + { + return IsMouseOver(MouseEvent.X, MouseEvent.Y); + } + + public bool IsMouseOver(int x, int y) + { + if (_Selection >= _Interactions.Count || _Selection < 0) + return false; + + if (_Interactions.Count > 0) + return _IsMouseOver(x, y, _Interactions[_Selection]); + else + return false; + } + + private bool _IsMouseOver(int x, int y, CInteraction interact) + { + switch (interact.Type) + { + case EType.TButton: + if (CHelper.IsInBounds(_Buttons[interact.Num].Rect, x, y)) + return true; + break; + case EType.TSelectSlide: + if (CHelper.IsInBounds(_SelectSlides[interact.Num].Rect, x, y) || + CHelper.IsInBounds(_SelectSlides[interact.Num].RectArrowLeft, x, y) || + CHelper.IsInBounds(_SelectSlides[interact.Num].RectArrowRight, x, y)) + return true; + break; + } + return false; + } + + private float _GetZValue(CInteraction interact) + { + switch (interact.Type) + { + case EType.TStatic: + return _Statics[interact.Num].Rect.Z; + case EType.TText: + return _Texts[interact.Num].Z; + case EType.TButton: + return _Buttons[interact.Num].Rect.Z; + case EType.TSelectSlide: + return _SelectSlides[interact.Num].Rect.Z; + } + return CSettings.zFar; + } + + private float _GetZValue(int interaction) + { + switch (_Interactions[interaction].Type) + { + case EType.TStatic: + return _Statics[_Interactions[interaction].Num].Rect.Z; + case EType.TText: + return _Texts[_Interactions[interaction].Num].Z; + case EType.TButton: + return _Buttons[_Interactions[interaction].Num].Rect.Z; + case EType.TSelectSlide: + return _SelectSlides[_Interactions[interaction].Num].Rect.Z; + } + + return CSettings.zFar; + } + + private void _NextInteraction() + { + _UnsetSelected(); + if (CSettings.GameState != EGameState.EditTheme) + { + bool found = false; + int start = _Selection; + do + { + start++; + if (start > _Interactions.Count - 1) + start = 0; + + if ((start == _Selection) || (!_Interactions[start].ThemeEditorOnly && _IsVisible(start))) + found = true; + } while (!found); + _Selection = start; + } + else + { + _Selection++; + if (_Selection > _Interactions.Count - 1) + _Selection = 0; + } + _SetSelected(); + } + + private void _PrevInteraction() + { + _UnsetSelected(); + if (CSettings.GameState != EGameState.EditTheme) + { + bool found = false; + int start = _Selection; + do + { + start--; + if (start < 0) + start = _Interactions.Count - 1; + + if ((start == _Selection) || (!_Interactions[start].ThemeEditorOnly && _IsVisible(start))) + found = true; + } while (!found); + _Selection = start; + } + else + { + _Selection--; + if (_Selection < 0) + _Selection = _Interactions.Count - 1; + } + _SetSelected(); + } + + /// + /// Selects the next best interaction in a menu. + /// + /// + /// + private bool _NextInteraction(KeyEvent Key) + { + KeyEvent[] Directions = new KeyEvent[4]; + float[] Distances = new float[4]; + int[] stages = new int[4]; + int[] elements = new int[4]; + + for (int i = 0; i < 4; i++) + { + Directions[i] = new KeyEvent(); + } + + Directions[0].Key = Keys.Up; + Directions[1].Key = Keys.Right; + Directions[2].Key = Keys.Down; + Directions[3].Key = Keys.Left; + + for (int i = 0; i < 4; i++) + { + elements[i] = _GetNextElement(Directions[i], out Distances[i], out stages[i]); + } + + int element = _Selection; + int stage = int.MaxValue; + float distance = float.MaxValue; + int direction = -1; + + int mute = -1; + switch (Key.Key) + { + case Keys.Up: + mute = 2; + break; + case Keys.Right: + mute = 3; + break; + case Keys.Down: + mute = 0; + break; + case Keys.Left: + mute = 1; + break; + } + + for (int i = 0; i < 4; i++) + { + if (i != mute && elements[i] != _Selection && (stages[i] < stage || (stages[i] == stage && Directions[i].Key == Key.Key))) + { + stage = stages[i]; + element = elements[i]; + distance = Distances[i]; + direction = i; + } + } + + if (direction != -1) + { + // select the new element + if (Directions[direction].Key == Key.Key) + { + _UnsetHighlighted(_Selection); + _UnsetSelected(); + + _Selection = element; + _SetSelected(); + _SetHighlighted(_Selection); + + return true; + } + } + return false; + } + + private int _GetNextElement(KeyEvent Key, out float Distance, out int Stage) + { + Distance = float.MaxValue; + int min = _Selection; + SRectF actualRect = _GetRect(_Selection); + Stage = int.MaxValue; + + for (int i = 0; i < _Interactions.Count; i++) + { + if (i != _Selection && !_Interactions[i].ThemeEditorOnly && _IsVisible(i)) + { + SRectF targetRect = _GetRect(i); + float dist = _GetDistanceDirect(Key, actualRect, targetRect); + if (dist >= 0f && dist < Distance) + { + Distance = dist; + min = i; + Stage = 10; + } + } + } + + if (min == _Selection) + { + for (int i = 0; i < _Interactions.Count; i++) + { + if (i != _Selection && !_Interactions[i].ThemeEditorOnly && _IsVisible(i)) + { + SRectF targetRect = _GetRect(i); + float dist = _GetDistance180(Key, actualRect, targetRect); + if (dist >= 0f && dist < Distance) + { + Distance = dist; + min = i; + Stage = 20; + } + } + } + } + + if (min == _Selection) + { + switch (Key.Key) + { + case Keys.Up: + actualRect = new SRectF(actualRect.X, CSettings.iRenderH, 1, 1, actualRect.Z); + break; + case Keys.Down: + actualRect = new SRectF(actualRect.X, 0, 1, 1, actualRect.Z); + break; + case Keys.Left: + actualRect = new SRectF(CSettings.iRenderW, actualRect.Y, 1, 1, actualRect.Z); + break; + case Keys.Right: + actualRect = new SRectF(0, actualRect.Y, 1, 1, actualRect.Z); + break; + default: + break; + } + + for (int i = 0; i < _Interactions.Count; i++) + { + if (i != _Selection && !_Interactions[i].ThemeEditorOnly && _IsVisible(i)) + { + SRectF targetRect = _GetRect(i); + float dist = _GetDistance180(Key, actualRect, targetRect); + if (dist >= 0f && dist < Distance) + { + Distance = dist; + min = i; + Stage = 30; + } + } + } + } + return min; + } + + private float _GetDistanceDirect(KeyEvent Key, SRectF actualRect, SRectF targetRect) + { + PointF source = new PointF(actualRect.X + actualRect.W / 2f, actualRect.Y + actualRect.H / 2f); + PointF dest = new PointF(targetRect.X + targetRect.W / 2f, targetRect.Y + targetRect.H / 2f); + + PointF vector = new PointF(dest.X - source.X, dest.Y - source.Y); + float distance = (float)Math.Sqrt(vector.X * vector.X + vector.Y * vector.Y); + bool inDirection = false; + switch (Key.Key) + { + case Keys.Up: + if (vector.Y < 0f && (targetRect.X + targetRect.W > actualRect.X || actualRect.X + actualRect.W > targetRect.X)) + inDirection = true; + break; + + case Keys.Down: + if (vector.Y > 0f && (targetRect.X + targetRect.W > actualRect.X || actualRect.X + actualRect.W > targetRect.X)) + inDirection = true; + break; + + case Keys.Left: + if (vector.X < 0f && (targetRect.Y + targetRect.H > actualRect.Y || actualRect.Y + actualRect.H > targetRect.Y)) + inDirection = true; + break; + + case Keys.Right: + if (vector.X > 0f && (targetRect.Y + targetRect.H > actualRect.Y || actualRect.Y + actualRect.H > targetRect.Y)) + inDirection = true; + break; + + default: + break; + } + if (!inDirection) + return float.MaxValue; + else + return distance; + } + + private float _GetDistance180(KeyEvent Key, SRectF actualRect, SRectF targetRect) + { + PointF source = new PointF(actualRect.X + actualRect.W / 2f, actualRect.Y + actualRect.H / 2f); + PointF dest = new PointF(targetRect.X + targetRect.W / 2f, targetRect.Y + targetRect.H / 2f); + + PointF vector = new PointF(dest.X - source.X, dest.Y - source.Y); + float distance = (float)Math.Sqrt(vector.X * vector.X + vector.Y * vector.Y); + bool inDirection = false; + switch (Key.Key) + { + case Keys.Up: + if (vector.Y < 0f) + inDirection = true; + break; + + case Keys.Down: + if (vector.Y > 0f) + inDirection = true; + break; + + case Keys.Left: + if (vector.X < 0f) + inDirection = true; + break; + + case Keys.Right: + if (vector.X > 0f) + inDirection = true; + break; + + default: + break; + } + if (!inDirection) + return float.MaxValue; + else + return distance; + } + + /// + /// Selects the next element in a menu interaction. + /// + /// True if the next element is selected. False if either there is no next element or the interaction does not provide such a method. + private bool _NextElement() + { + if (_Interactions[_Selection].Type == EType.TSelectSlide) + return _SelectSlides[_Interactions[_Selection].Num].NextValue(); + + return false; + } + + /// + /// Selects the previous element in a menu interaction. + /// + /// + /// True if the previous element is selected. False if either there is no previous element or the interaction does not provide such a method. + /// + private bool _PrevElement() + { + if (_Interactions[_Selection].Type == EType.TSelectSlide) + return _SelectSlides[_Interactions[_Selection].Num].PrevValue(); + + return false; + } + + private void _SetSelected() + { + switch (_Interactions[_Selection].Type) + { + case EType.TButton: + _Buttons[_Interactions[_Selection].Num].Selected = true; + break; + case EType.TSelectSlide: + _SelectSlides[_Interactions[_Selection].Num].Selected = true; + break; + } + } + + private void _UnsetSelected() + { + switch (_Interactions[_Selection].Type) + { + case EType.TButton: + _Buttons[_Interactions[_Selection].Num].Selected = false; + break; + case EType.TSelectSlide: + _SelectSlides[_Interactions[_Selection].Num].Selected = false; + break; + } + } + + private void _SetHighlighted(int selection) + { + if (selection >= _Interactions.Count || selection < 0) + return; + + switch (_Interactions[selection].Type) + { + case EType.TButton: + //_Buttons[_Interactions[selection].Num].Selected = true; + break; + case EType.TSelectSlide: + _SelectSlides[_Interactions[selection].Num].Highlighted = true; + break; + case EType.TStatic: + //_Statics[_Interactions[selection].Num].Selected = true; + break; + case EType.TText: + //_Texts[_Interactions[selection].Num].Selected = true; + break; + case EType.TSongMenu: + //_SongMenus[_Interactions[selection].Num].Selected = true; + break; + case EType.TLyric: + //_Lyrics[_Interactions[selection].Num].Selected = true; + break; + case EType.TNameSelection: + //_NameSelections[_Interactions[selection].Num].Selected = true; + break; + case EType.TPlaylist: + //_Playlists[_Interactions[_Selection].Num].Selected = true; + break; + } + } + + private void _UnsetHighlighted(int selection) + { + if (selection >= _Interactions.Count || selection < 0) + return; + + switch (_Interactions[selection].Type) + { + case EType.TButton: + //_Buttons[_Interactions[selection].Num].Selected = false; + break; + case EType.TSelectSlide: + _SelectSlides[_Interactions[selection].Num].Highlighted = false; + break; + case EType.TStatic: + //_Statics[_Interactions[selection].Num].Selected = false; + break; + case EType.TText: + //_Texts[_Interactions[selection].Num].Selected = false; + break; + case EType.TSongMenu: + //_SongMenus[_Interactions[selection].Num].Selected = false; + break; + case EType.TLyric: + //_Lyrics[_Interactions[selection].Num].Selected = false; + break; + case EType.TNameSelection: + //_NameSelections[_Interactions[selection].Num].Selected = false; + break; + case EType.TPlaylist: + //_Playlists[_Interactions[_Selection].Num].Selected = true; + break; + } + } + + private void _ToggleHighlighted() + { + if (_Selection >= _Interactions.Count || _Selection < 0) + return; + + if (_Interactions[_Selection].Type == EType.TSelectSlide) + { + _SelectSlides[_Interactions[_Selection].Num].Highlighted = !_SelectSlides[_Interactions[_Selection].Num].Highlighted; + } + } + + private bool _IsHighlighted() + { + if (_Selection >= _Interactions.Count || _Selection < 0) + return false; + + if (_Interactions[_Selection].Type == EType.TSelectSlide) + return _SelectSlides[_Interactions[_Selection].Num].Highlighted; + + return false; + } + + private bool _IsVisible(int interaction) + { + switch (_Interactions[interaction].Type) + { + case EType.TStatic: + return _Statics[_Interactions[interaction].Num].Visible; + + case EType.TText: + return _Texts[_Interactions[interaction].Num].Visible; + + case EType.TButton: + return _Buttons[_Interactions[interaction].Num].Visible; + + case EType.TSelectSlide: + return _SelectSlides[_Interactions[interaction].Num].Visible; + } + + return false; + } + + private SRectF _GetRect(int interaction) + { + SRectF Result = new SRectF(); + switch (_Interactions[interaction].Type) + { + case EType.TButton: + return _Buttons[_Interactions[interaction].Num].Rect; + + case EType.TSelectSlide: + return _SelectSlides[_Interactions[interaction].Num].Rect; + } + + return Result; + } + + private void _AddInteraction(int num, EType type) + { + _Interactions.Add(new CInteraction(num, type)); + if (!_Interactions[_Selection].ThemeEditorOnly) + _SetSelected(); + else + _NextInteraction(); + } + + private void _DrawInteraction(int interaction) + { + bool sel = false; + switch (_Interactions[interaction].Type) + { + case EType.TStatic: + _Statics[_Interactions[interaction].Num].Draw(); + break; + + case EType.TText: + _Texts[_Interactions[interaction].Num].Draw(); + break; + + case EType.TButton: + sel = _Buttons[_Interactions[interaction].Num].Selected; + if (!Active) + _Buttons[_Interactions[interaction].Num].Selected = false; + _Buttons[_Interactions[interaction].Num].Draw(); + _Buttons[_Interactions[interaction].Num].Selected = sel; + break; + + case EType.TSelectSlide: + sel = _SelectSlides[_Interactions[interaction].Num].Selected; + if (!Active) + _SelectSlides[_Interactions[interaction].Num].Selected = false; + _SelectSlides[_Interactions[interaction].Num].Draw(); + _SelectSlides[_Interactions[interaction].Num].Selected = sel; + break; + } + } + + #endregion InteractionHandling + + #region Theme Handling + private void MoveElement(int stepX, int stepY) + { + if (_Interactions.Count > 0) + { + switch (_Interactions[_Selection].Type) + { + case EType.TButton: + _Buttons[_Interactions[_Selection].Num].MoveElement(stepX, stepY); + break; + + case EType.TSelectSlide: + _SelectSlides[_Interactions[_Selection].Num].MoveElement(stepX, stepY); + break; + } + } + } + + private void ResizeElement(int stepW, int stepH) + { + if (_Interactions.Count > 0) + { + switch (_Interactions[_Selection].Type) + { + case EType.TButton: + _Buttons[_Interactions[_Selection].Num].ResizeElement(stepW, stepH); + break; + + case EType.TSelectSlide: + _SelectSlides[_Interactions[_Selection].Num].ResizeElement(stepW, stepH); + break; + } + } + } + #endregion Theme Handling + } +} From 4e42b47b5c8ef065829e8172d4ca651d4b825c38 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Mon, 13 Aug 2012 21:51:42 +0200 Subject: [PATCH 41/70] fixed theme saving for equalizer, playlist, text and songmenu --- .../Screens/PopupScreenPlayerControl.xml | 18 +- .../Ambient/Screens/ScreenHighscore.xml | 86 +- Output/Themes/Ambient/Screens/ScreenLoad.xml | 6 +- Output/Themes/Ambient/Screens/ScreenMain.xml | 8 +- Output/Themes/Ambient/Screens/ScreenNames.xml | 266 ++-- .../Themes/Ambient/Screens/ScreenOptions.xml | 14 +- .../Ambient/Screens/ScreenOptionsGame.xml | 16 +- .../Ambient/Screens/ScreenOptionsLyrics.xml | 8 +- .../Ambient/Screens/ScreenOptionsRecord.xml | 123 +- .../Ambient/Screens/ScreenOptionsSound.xml | 10 +- .../Ambient/Screens/ScreenOptionsTheme.xml | 20 +- .../Ambient/Screens/ScreenOptionsVideo.xml | 12 +- .../Themes/Ambient/Screens/ScreenProfiles.xml | 22 +- Output/Themes/Ambient/Screens/ScreenScore.xml | 172 +-- Output/Themes/Ambient/Screens/ScreenSing.xml | 214 +-- Output/Themes/Ambient/Screens/ScreenSong.xml | 1167 ++++++++--------- Output/Themes/Ambient/Skin Blue.xml | 34 +- Output/Themes/Ambient/Skin Green.xml | 32 +- Output/Themes/Ambient/Skin Red.xml | 34 +- Output/Themes/Ambient/Skin Yellow.xml | 34 +- Vocaluxe/Menu/CEqualizer.cs | 2 +- Vocaluxe/Menu/CPlaylist.cs | 58 +- Vocaluxe/Menu/CText.cs | 2 +- Vocaluxe/Menu/SongMenu/CSongMenuFramework.cs | 17 +- Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs | 2 + 25 files changed, 1149 insertions(+), 1228 deletions(-) diff --git a/Output/Themes/Ambient/Screens/PopupScreenPlayerControl.xml b/Output/Themes/Ambient/Screens/PopupScreenPlayerControl.xml index c8330637..bc07248e 100644 --- a/Output/Themes/Ambient/Screens/PopupScreenPlayerControl.xml +++ b/Output/Themes/Ambient/Screens/PopupScreenPlayerControl.xml @@ -58,7 +58,7 @@ Outline - + @@ -103,7 +103,7 @@ Normal - + @@ -152,7 +152,7 @@ Normal - + @@ -201,7 +201,7 @@ Normal - + @@ -250,7 +250,7 @@ Normal - + @@ -299,7 +299,7 @@ Normal - + @@ -348,7 +348,7 @@ Normal - + @@ -397,7 +397,7 @@ Normal - + @@ -446,7 +446,7 @@ Normal - + diff --git a/Output/Themes/Ambient/Screens/ScreenHighscore.xml b/Output/Themes/Ambient/Screens/ScreenHighscore.xml index caf13c13..b036b823 100644 --- a/Output/Themes/Ambient/Screens/ScreenHighscore.xml +++ b/Output/Themes/Ambient/Screens/ScreenHighscore.xml @@ -68,7 +68,7 @@ Outline - + TR_SCREENHIGHSCORE_HIGHSCORE @@ -97,7 +97,7 @@ Outline - + @@ -126,7 +126,7 @@ Outline - + @@ -155,7 +155,7 @@ Outline - + @@ -184,7 +184,7 @@ Outline - + @@ -213,7 +213,7 @@ Outline - + @@ -242,7 +242,7 @@ Outline - + @@ -271,7 +271,7 @@ Outline - + @@ -300,7 +300,7 @@ Outline - + @@ -329,7 +329,7 @@ Outline - + @@ -358,7 +358,7 @@ Outline - + @@ -387,7 +387,7 @@ Outline - + @@ -416,7 +416,7 @@ Outline - + @@ -445,7 +445,7 @@ Outline - + @@ -474,7 +474,7 @@ Outline - + @@ -503,7 +503,7 @@ Outline - + @@ -532,7 +532,7 @@ Outline - + @@ -561,7 +561,7 @@ Outline - + @@ -590,7 +590,7 @@ Outline - + @@ -619,7 +619,7 @@ Outline - + @@ -648,7 +648,7 @@ Outline - + @@ -677,7 +677,7 @@ Outline - + @@ -706,7 +706,7 @@ Outline - + @@ -735,7 +735,7 @@ Outline - + @@ -764,7 +764,7 @@ Outline - + @@ -793,7 +793,7 @@ Outline - + @@ -822,7 +822,7 @@ Outline - + @@ -851,7 +851,7 @@ Outline - + @@ -880,7 +880,7 @@ Outline - + @@ -909,7 +909,7 @@ Outline - + @@ -938,7 +938,7 @@ Outline - + @@ -967,7 +967,7 @@ Outline - + @@ -996,7 +996,7 @@ Outline - + @@ -1025,7 +1025,7 @@ Outline - + @@ -1054,7 +1054,7 @@ Outline - + @@ -1083,7 +1083,7 @@ Outline - + @@ -1112,7 +1112,7 @@ Outline - + @@ -1141,7 +1141,7 @@ Outline - + @@ -1170,7 +1170,7 @@ Outline - + @@ -1199,7 +1199,7 @@ Outline - + @@ -1228,7 +1228,7 @@ Outline - + @@ -1257,7 +1257,7 @@ Outline - + @@ -1286,7 +1286,7 @@ Outline - + diff --git a/Output/Themes/Ambient/Screens/ScreenLoad.xml b/Output/Themes/Ambient/Screens/ScreenLoad.xml index a4030b21..6f78787d 100644 --- a/Output/Themes/Ambient/Screens/ScreenLoad.xml +++ b/Output/Themes/Ambient/Screens/ScreenLoad.xml @@ -52,7 +52,7 @@ Outline - + TR_PROGRAM_NAME @@ -81,7 +81,7 @@ Outline - + TR_SCREENLOAD_LOADING @@ -110,7 +110,7 @@ Outline - + diff --git a/Output/Themes/Ambient/Screens/ScreenMain.xml b/Output/Themes/Ambient/Screens/ScreenMain.xml index 6c195ea0..71116b93 100644 --- a/Output/Themes/Ambient/Screens/ScreenMain.xml +++ b/Output/Themes/Ambient/Screens/ScreenMain.xml @@ -68,7 +68,7 @@ Outline - + TR_SCREENMAIN_BUTTON_SING @@ -125,7 +125,7 @@ Outline - + TR_SCREENMAIN_BUTTON_OPTIONS @@ -182,7 +182,7 @@ Outline - + TR_SCREENMAIN_BUTTON_PROFILES @@ -239,7 +239,7 @@ Outline - + TR_BUTTON_EXIT diff --git a/Output/Themes/Ambient/Screens/ScreenNames.xml b/Output/Themes/Ambient/Screens/ScreenNames.xml index c35f8b0f..86d907e3 100644 --- a/Output/Themes/Ambient/Screens/ScreenNames.xml +++ b/Output/Themes/Ambient/Screens/ScreenNames.xml @@ -28,7 +28,7 @@ - + PlayerSelector @@ -276,7 +276,7 @@ Outline - + TR_SCREENNAMES_MENU @@ -306,7 +306,7 @@ Outline - + @@ -336,7 +336,7 @@ Outline - + @@ -365,7 +365,7 @@ Outline - + @@ -394,7 +394,7 @@ Outline - + @@ -423,7 +423,7 @@ Outline - + @@ -452,7 +452,7 @@ Outline - + @@ -481,7 +481,7 @@ Outline - + @@ -510,7 +510,7 @@ Outline - + @@ -555,7 +555,7 @@ Outline - + TR_BUTTON_BACK @@ -612,7 +612,7 @@ Outline - + TR_BUTTON_START @@ -1128,167 +1128,167 @@ - - - Invisible - + + + Invisible + 21 152 -4,00 108 - 60 - - 8 - - 2,00 - - - - - Player1Dim2 - - - Player1Dim - - TR_CONFIG_OFF + 60 + + 8 + + 2,00 + + + + TR_CONFIG_OFF + + + Player1Dim2 + + + Player1Dim2 - - - - Invisible - + + + + Invisible + 21 307 -4,00 108 - 60 - - 8 - - 2,00 - - - - - Player2Dim2 - - - Player2Dim - - TR_CONFIG_OFF + 60 + + 8 + + 2,00 + + + + TR_CONFIG_OFF + + + Player2Dim2 + + + Player2Dim2 - - - - Invisible - + + + + Invisible + 21 467 -4,00 108 - 60 - - 8 - - 2,00 - - - - - Player3Dim2 - - - Player3Dim - - TR_CONFIG_OFF + 60 + + 8 + + 2,00 + + + + TR_CONFIG_OFF + + + Player3Dim2 + + + Player3Dim2 - - - - Invisible - + + + + Invisible + 1153 152 -4,00 108 - 60 - - 8 - - 2,00 - - - - - Player4Dim2 - - - Player4Dim - - TR_CONFIG_OFF + 60 + + 8 + + 2,00 + + + + TR_CONFIG_OFF + + + Player4Dim2 + + + Player4Dim2 - - - - Invisible - + + + + Invisible + 1153 307 -4,00 108 - 60 - - 8 - - 2,00 - - - - - Player5Dim2 - - - Player5Dim - - TR_CONFIG_OFF + 60 + + 8 + + 2,00 + + + + TR_CONFIG_OFF + + + Player5Dim2 + + + Player5Dim2 - - - - Invisible - + + + + Invisible + 1153 467 -4,00 108 - 60 - - 8 - - 2,00 - - - - - Player6Dim2 - - - Player6Dim - - TR_CONFIG_OFF + 60 + + 8 + + 2,00 + + + + TR_CONFIG_OFF + + + Player6Dim2 + + + Player6Dim2 - + - + \ No newline at end of file diff --git a/Output/Themes/Ambient/Screens/ScreenOptions.xml b/Output/Themes/Ambient/Screens/ScreenOptions.xml index 5ce06914..808f1d29 100644 --- a/Output/Themes/Ambient/Screens/ScreenOptions.xml +++ b/Output/Themes/Ambient/Screens/ScreenOptions.xml @@ -52,7 +52,7 @@ Outline - + TR_SCREENO_OPTIONS @@ -97,7 +97,7 @@ Outline - + TR_SCREENO_BUTTON_GAME @@ -154,7 +154,7 @@ Outline - + TR_SCRENNO_BUTTON_SOUND @@ -211,7 +211,7 @@ Outline - + TR_SCREENO_BUTTON_RECORD @@ -268,7 +268,7 @@ Outline - + TR_SCREENO_BUTTON_VIDEO @@ -325,7 +325,7 @@ Outline - + TR_SCREENO_BUTTON_LYRICS @@ -382,7 +382,7 @@ Outline - + TR_SCREENO_BUTTON_THEME diff --git a/Output/Themes/Ambient/Screens/ScreenOptionsGame.xml b/Output/Themes/Ambient/Screens/ScreenOptionsGame.xml index 28e4b3d2..bdd2f750 100644 --- a/Output/Themes/Ambient/Screens/ScreenOptionsGame.xml +++ b/Output/Themes/Ambient/Screens/ScreenOptionsGame.xml @@ -148,7 +148,7 @@ Outline - + TR_SCREENOGAME_OPTIONS @@ -177,7 +177,7 @@ Outline - + TR_SCREENOGAME_LANGUAGE @@ -206,7 +206,7 @@ Outline - + TR_SCREENOGAME_DEBUGLEVEL @@ -235,7 +235,7 @@ Outline - + TR_SCREENOGAME_SONGMENU @@ -264,7 +264,7 @@ Outline - + TR_SCREENOGAME_SONGSORTING @@ -293,7 +293,7 @@ Outline - + TR_SCREENOGAME_TABS @@ -322,7 +322,7 @@ Outline - + TR_SCREENOGAME_TIMERMODE @@ -367,7 +367,7 @@ Outline - + TR_BUTTON_BACK diff --git a/Output/Themes/Ambient/Screens/ScreenOptionsLyrics.xml b/Output/Themes/Ambient/Screens/ScreenOptionsLyrics.xml index 521fd578..d544a49f 100644 --- a/Output/Themes/Ambient/Screens/ScreenOptionsLyrics.xml +++ b/Output/Themes/Ambient/Screens/ScreenOptionsLyrics.xml @@ -52,7 +52,7 @@ Outline - + TR_SCREENOLYRICS_OPTIONS @@ -81,7 +81,7 @@ Outline - + TR_SCREENOLYRICS_STYLE @@ -110,7 +110,7 @@ Outline - + TR_SCREENOLYRICS_ONTOP @@ -155,7 +155,7 @@ Outline - + TR_BUTTON_BACK diff --git a/Output/Themes/Ambient/Screens/ScreenOptionsRecord.xml b/Output/Themes/Ambient/Screens/ScreenOptionsRecord.xml index 7375fd34..2100c33e 100644 --- a/Output/Themes/Ambient/Screens/ScreenOptionsRecord.xml +++ b/Output/Themes/Ambient/Screens/ScreenOptionsRecord.xml @@ -180,7 +180,7 @@ Outline - + TR_SCREENORECORD_OPTIONS @@ -209,7 +209,7 @@ Outline - + TR_SCREENORECORD_DEVICE @@ -238,7 +238,7 @@ Outline - + TR_SCREENORECORD_INPUT @@ -267,7 +267,7 @@ Outline - + TR_SCREENORECORD_CHANNEL_1 @@ -296,7 +296,7 @@ Outline - + TR_SCREENORECORD_CHANNEL_2 @@ -325,7 +325,7 @@ Outline - + TR_SCREENORECORD_MIC_DELAY @@ -355,7 +355,7 @@ Outline - + TR_SCREENORECORD_MIC_WARNING @@ -384,7 +384,7 @@ Outline - + @@ -413,7 +413,7 @@ Outline - + @@ -458,7 +458,7 @@ Outline - + TR_BUTTON_BACK @@ -515,7 +515,7 @@ Outline - + TR_SCREENORECORD_BUTTON_DELAYTEST @@ -858,66 +858,67 @@ 5 - - - Invisible - - 50 - 400 - 230 - 150 - -1,00 - - 10 - 2,00 - - - - - ButtonColor - - - ButtonSColor - - TR_CONFIG_OFF + + + Invisible + + 50 + 400 + -1,00 + 230 + 150 + + 10 + + 2,00 + + + + TR_CONFIG_OFF + + + ButtonColor + + + ButtonColor 10 26 - - - - - Invisible - - 400 - 400 - 230 - 150 - -1,00 - - 10 - - 2,00 - - - - - ButtonColor - - - ButtonSColor - - TR_CONFIG_OFF + + + + + Invisible + + 400 + 400 + -1,00 + 230 + 150 + + 10 + + 2,00 + + + + TR_CONFIG_OFF + + + ButtonColor + + + ButtonColor 10 26 - - + + - + \ No newline at end of file diff --git a/Output/Themes/Ambient/Screens/ScreenOptionsSound.xml b/Output/Themes/Ambient/Screens/ScreenOptionsSound.xml index 597e24f4..3f23d55c 100644 --- a/Output/Themes/Ambient/Screens/ScreenOptionsSound.xml +++ b/Output/Themes/Ambient/Screens/ScreenOptionsSound.xml @@ -52,7 +52,7 @@ Outline - + TR_SCREENOSOUND_OPTIONS @@ -81,7 +81,7 @@ Outline - + TR_SCREENOSOUND_BACKGROUNDMUSIC @@ -110,7 +110,7 @@ Outline - + TR_SCREENOSOUND_BACKGROUNDMUSICVOLUME @@ -139,7 +139,7 @@ Outline - + TR_SCREENOSOUND_BACKGROUNDMUSICSOURCE @@ -184,7 +184,7 @@ Outline - + TR_BUTTON_BACK diff --git a/Output/Themes/Ambient/Screens/ScreenOptionsTheme.xml b/Output/Themes/Ambient/Screens/ScreenOptionsTheme.xml index fbb7f91c..15c6492b 100644 --- a/Output/Themes/Ambient/Screens/ScreenOptionsTheme.xml +++ b/Output/Themes/Ambient/Screens/ScreenOptionsTheme.xml @@ -180,7 +180,7 @@ Outline - + TR_SCREENOTHEME_OPTIONS @@ -209,7 +209,7 @@ Outline - + TR_SCREENOTHEME_THEME @@ -238,7 +238,7 @@ Outline - + TR_SCREENOTHEME_SKIN @@ -267,7 +267,7 @@ Outline - + TR_SCREENOTHEME_COVERTHEME @@ -296,7 +296,7 @@ Outline - + TR_SCREENOTHEME_NOTELINES @@ -325,7 +325,7 @@ Outline - + TR_SCREENOTHEME_TONEHELPER @@ -354,7 +354,7 @@ Outline - + TR_SCREENOTHEME_TIMERLOOK @@ -383,7 +383,7 @@ Outline - + TR_SCREENOTHEME_FADEINFO @@ -412,7 +412,7 @@ Outline - + TR_SCREENOTHEME_COVERLOADING @@ -457,7 +457,7 @@ Outline - + TR_BUTTON_BACK diff --git a/Output/Themes/Ambient/Screens/ScreenOptionsVideo.xml b/Output/Themes/Ambient/Screens/ScreenOptionsVideo.xml index 0bacb58b..74d6bfac 100644 --- a/Output/Themes/Ambient/Screens/ScreenOptionsVideo.xml +++ b/Output/Themes/Ambient/Screens/ScreenOptionsVideo.xml @@ -100,7 +100,7 @@ Outline - + TR_SCREENOVIDEO_OPTIONS @@ -129,7 +129,7 @@ Outline - + TR_SCREENOVIDEO_VIDEOBACKGROUNDS @@ -158,7 +158,7 @@ Outline - + TR_SCREENOVIDEO_VIDEOPREVIEW @@ -187,7 +187,7 @@ Outline - + TR_SCREENOVIDEO_VIDEOINSONGS @@ -216,7 +216,7 @@ Normal - + TR_SCREENO_VIDEO_VIDEOSTOBACKGROUND @@ -261,7 +261,7 @@ Outline - + TR_BUTTON_BACK diff --git a/Output/Themes/Ambient/Screens/ScreenProfiles.xml b/Output/Themes/Ambient/Screens/ScreenProfiles.xml index 128a373b..7bd59c6b 100644 --- a/Output/Themes/Ambient/Screens/ScreenProfiles.xml +++ b/Output/Themes/Ambient/Screens/ScreenProfiles.xml @@ -148,7 +148,7 @@ Outline - + TR_SCREENPROFILES_PROFILES @@ -177,7 +177,7 @@ Outline - + TR_SCREENPROFILES_PLAYERNAME @@ -206,7 +206,7 @@ Outline - + TR_SCREENPROFILES_GAMEDIFFICULTY @@ -235,7 +235,7 @@ Outline - + TR_SCREENPROFILES_AVATAR @@ -264,7 +264,7 @@ Outline - + TR_SCREENPROFILES_GUESTPROFILE @@ -293,7 +293,7 @@ Outline - + TR_SCREENPROFILES_ACTIVE @@ -338,7 +338,7 @@ Outline - + @@ -387,7 +387,7 @@ Outline - + TR_BUTTON_BACK @@ -444,7 +444,7 @@ Outline - + TR_BUTTON_SAVE @@ -501,7 +501,7 @@ Outline - + TR_SCREENPROFILES_BUTTON_NEW @@ -558,7 +558,7 @@ Outline - + TR_SCREENPROFILES_BUTTON_DELETE diff --git a/Output/Themes/Ambient/Screens/ScreenScore.xml b/Output/Themes/Ambient/Screens/ScreenScore.xml index cccaaae3..814efcfe 100644 --- a/Output/Themes/Ambient/Screens/ScreenScore.xml +++ b/Output/Themes/Ambient/Screens/ScreenScore.xml @@ -1226,7 +1226,7 @@ Outline - + TR_SCREENSCORE_SCORES @@ -1255,7 +1255,7 @@ Outline - + @@ -1284,7 +1284,7 @@ Outline - + @@ -1313,7 +1313,7 @@ Outline - + @@ -1342,7 +1342,7 @@ Outline - + @@ -1371,7 +1371,7 @@ Outline - + @@ -1400,7 +1400,7 @@ Outline - + @@ -1429,7 +1429,7 @@ Outline - + @@ -1458,7 +1458,7 @@ Outline - + @@ -1487,7 +1487,7 @@ Outline - + @@ -1516,7 +1516,7 @@ Outline - + @@ -1545,7 +1545,7 @@ Outline - + @@ -1574,7 +1574,7 @@ Outline - + @@ -1603,7 +1603,7 @@ Outline - + @@ -1632,7 +1632,7 @@ Outline - + @@ -1661,7 +1661,7 @@ Outline - + @@ -1690,7 +1690,7 @@ Outline - + @@ -1719,7 +1719,7 @@ Outline - + @@ -1748,7 +1748,7 @@ Outline - + @@ -1777,7 +1777,7 @@ Outline - + @@ -1806,7 +1806,7 @@ Outline - + @@ -1835,7 +1835,7 @@ Outline - + @@ -1864,7 +1864,7 @@ Outline - + @@ -1893,7 +1893,7 @@ Outline - + @@ -1922,7 +1922,7 @@ Outline - + @@ -1951,7 +1951,7 @@ Outline - + @@ -1980,7 +1980,7 @@ Outline - + @@ -2009,7 +2009,7 @@ Outline - + @@ -2039,7 +2039,7 @@ Outline - + @@ -2068,7 +2068,7 @@ Outline - + @@ -2097,7 +2097,7 @@ Outline - + @@ -2126,7 +2126,7 @@ Outline - + @@ -2156,7 +2156,7 @@ Outline - + @@ -2185,7 +2185,7 @@ Outline - + @@ -2214,7 +2214,7 @@ Outline - + @@ -2243,7 +2243,7 @@ Outline - + @@ -2273,7 +2273,7 @@ Outline - + @@ -2302,7 +2302,7 @@ Outline - + @@ -2331,7 +2331,7 @@ Outline - + @@ -2360,7 +2360,7 @@ Outline - + @@ -2390,7 +2390,7 @@ Outline - + @@ -2419,7 +2419,7 @@ Outline - + @@ -2449,7 +2449,7 @@ Outline - + @@ -2479,7 +2479,7 @@ Outline - + @@ -2509,7 +2509,7 @@ Outline - + @@ -2539,7 +2539,7 @@ Outline - + @@ -2569,7 +2569,7 @@ Outline - + @@ -2599,7 +2599,7 @@ Outline - + @@ -2629,7 +2629,7 @@ Outline - + @@ -2659,7 +2659,7 @@ Outline - + @@ -2689,7 +2689,7 @@ Outline - + @@ -2719,7 +2719,7 @@ Outline - + @@ -2749,7 +2749,7 @@ Outline - + @@ -2779,7 +2779,7 @@ Outline - + @@ -2809,7 +2809,7 @@ Outline - + @@ -2839,7 +2839,7 @@ Outline - + @@ -2869,7 +2869,7 @@ Outline - + @@ -2899,7 +2899,7 @@ Outline - + @@ -2929,7 +2929,7 @@ Outline - + @@ -2959,7 +2959,7 @@ Outline - + @@ -2989,7 +2989,7 @@ Outline - + @@ -3019,7 +3019,7 @@ Outline - + @@ -3049,7 +3049,7 @@ Outline - + @@ -3079,7 +3079,7 @@ Outline - + @@ -3109,7 +3109,7 @@ Outline - + @@ -3139,7 +3139,7 @@ Outline - + @@ -3169,7 +3169,7 @@ Outline - + @@ -3199,7 +3199,7 @@ Outline - + @@ -3229,7 +3229,7 @@ Outline - + @@ -3259,7 +3259,7 @@ Outline - + @@ -3289,7 +3289,7 @@ Outline - + @@ -3319,7 +3319,7 @@ Outline - + @@ -3349,7 +3349,7 @@ Outline - + @@ -3379,7 +3379,7 @@ Outline - + @@ -3409,7 +3409,7 @@ Outline - + @@ -3439,7 +3439,7 @@ Outline - + @@ -3469,7 +3469,7 @@ Outline - + @@ -3499,7 +3499,7 @@ Outline - + @@ -3529,7 +3529,7 @@ Outline - + @@ -3559,7 +3559,7 @@ Outline - + @@ -3589,7 +3589,7 @@ Outline - + @@ -3619,7 +3619,7 @@ Outline - + @@ -3649,7 +3649,7 @@ Outline - + @@ -3679,7 +3679,7 @@ Outline - + @@ -3709,7 +3709,7 @@ Outline - + @@ -3739,7 +3739,7 @@ Outline - + diff --git a/Output/Themes/Ambient/Screens/ScreenSing.xml b/Output/Themes/Ambient/Screens/ScreenSing.xml index 7f0ab682..21d12061 100644 --- a/Output/Themes/Ambient/Screens/ScreenSing.xml +++ b/Output/Themes/Ambient/Screens/ScreenSing.xml @@ -958,64 +958,6 @@ - - - 40 - 80 - - -1,00 - - 35 - - - - TextSColor - - - TextSColor - - Left - - Center - - - - Outline - - - - - - - - - 40 - 585 - - -1,00 - - 35 - - - - TextSColor - - - TextSColor - - Left - - Center - - - - Outline - - - - - - 640 @@ -1040,7 +982,7 @@ Normal - + @@ -1069,7 +1011,7 @@ Normal - + @@ -1098,12 +1040,70 @@ Normal - + TR_SCREENSING_PAUSE + + + 40 + 80 + + -1,00 + + 35 + + + + TextSColor + + + TextSColor + + Left + + Center + + + + Outline + + + + + + + + + 40 + 585 + + -1,00 + + 35 + + + + TextSColor + + + TextSColor + + Left + + Center + + + + Outline + + + + + + 1240 @@ -1127,7 +1127,7 @@ Normal - + @@ -1159,7 +1159,7 @@ Outline - + @@ -1188,7 +1188,7 @@ Normal - + @@ -1220,7 +1220,7 @@ Outline - + @@ -1249,7 +1249,7 @@ Normal - + @@ -1281,7 +1281,7 @@ Outline - + @@ -1310,7 +1310,7 @@ Normal - + @@ -1342,7 +1342,7 @@ Outline - + @@ -1371,7 +1371,7 @@ Normal - + @@ -1403,7 +1403,7 @@ Outline - + @@ -1432,7 +1432,7 @@ Normal - + @@ -1464,7 +1464,7 @@ Outline - + @@ -1493,7 +1493,7 @@ Normal - + @@ -1525,7 +1525,7 @@ Outline - + @@ -1554,7 +1554,7 @@ Normal - + @@ -1586,7 +1586,7 @@ Outline - + @@ -1615,7 +1615,7 @@ Normal - + @@ -1647,7 +1647,7 @@ Outline - + @@ -1676,7 +1676,7 @@ Normal - + @@ -1708,7 +1708,7 @@ Outline - + @@ -1737,7 +1737,7 @@ Normal - + @@ -1769,7 +1769,7 @@ Outline - + @@ -1798,7 +1798,7 @@ Normal - + @@ -1830,7 +1830,7 @@ Outline - + @@ -1859,7 +1859,7 @@ Normal - + @@ -1891,7 +1891,7 @@ Outline - + @@ -1920,7 +1920,7 @@ Normal - + @@ -1952,7 +1952,7 @@ Outline - + @@ -1981,7 +1981,7 @@ Normal - + @@ -2013,7 +2013,7 @@ Outline - + @@ -2042,7 +2042,7 @@ Normal - + @@ -2074,7 +2074,7 @@ Outline - + @@ -2103,7 +2103,7 @@ Normal - + @@ -2135,7 +2135,7 @@ Outline - + @@ -2164,7 +2164,7 @@ Normal - + @@ -2196,7 +2196,7 @@ Outline - + @@ -2225,7 +2225,7 @@ Normal - + @@ -2257,7 +2257,7 @@ Outline - + @@ -2286,7 +2286,7 @@ Normal - + @@ -2318,7 +2318,7 @@ Outline - + @@ -2347,7 +2347,7 @@ Normal - + @@ -2379,7 +2379,7 @@ Outline - + @@ -2424,7 +2424,7 @@ Outline - + TR_SCREENSING_BUTTON_CANCEL @@ -2481,7 +2481,7 @@ Outline - + TR_SCREENSING_BUTTON_CONTINUE @@ -2538,7 +2538,7 @@ Outline - + TR_SCREENSING_BUTTON_SKIP @@ -2771,4 +2771,4 @@ - + \ No newline at end of file diff --git a/Output/Themes/Ambient/Screens/ScreenSong.xml b/Output/Themes/Ambient/Screens/ScreenSong.xml index aff97838..acf1b0c5 100644 --- a/Output/Themes/Ambient/Screens/ScreenSong.xml +++ b/Output/Themes/Ambient/Screens/ScreenSong.xml @@ -33,25 +33,6 @@ 26 - - - SongMenuBG - - 40 - 40 - -2,10 - 360 - 360 - - - 1 - 1 - 1 - 1 - - - - Menu @@ -72,175 +53,25 @@ 26 - + - Button - - Button - + SongMenuBG + 40 - 90 - -2,11 + 40 + -2,10 360 - 40 - + 360 + - ButtonColor - - - ButtonSColor - - - 180 - 5 - - 30 - - 350 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - - - Outline - - TR_SCREENSONG_BUTTON_SING - + 1,00 + 1,00 + 1,00 + 1,00 - - - - - - - Button - - Button - - 40 - 235 - -2,11 - 360 - 40 - - - ButtonColor - - - ButtonSColor - - - 180 - 5 - - 30 - - 350 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - - - Outline - - TR_SCREENSONG_BUTTON_PLAYLIST - - - - - - - - - - - Button - - Button - - 40 - 290 - -2,11 - 360 - 40 - - - ButtonColor - - - ButtonSColor - - - 180 - 5 - - 30 - - 350 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - - - Outline - - TR_SCREENSONG_BUTTON_CANCEL - - - - - - - - - - - 200 - 45 - - -2,11 - - 40 - - 350 - - - StaticColor - - - TextSColor - - Center - - - - Outline - - TR_SCREENSONG_SONGOPTIONS - - - - + 220 @@ -265,7 +96,7 @@ Outline - + @@ -299,7 +130,7 @@ Outline - + @@ -332,7 +163,7 @@ Outline - + TR_SCREENSONG_SEARCH @@ -361,12 +192,189 @@ Outline - + + + + 200 + 45 + + -2,11 + + 40 + + 350 + + + StaticColor + + + TextSColor + + Center + + Center + + + + Outline + + TR_SCREENSONG_SONGOPTIONS + + + + + + + Button + + Button + + 40 + 290 + -2,11 + 360 + 40 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + TR_SCREENSONG_BUTTON_CANCEL + + + + + + + + + + + Button + + Button + + 40 + 235 + -2,11 + 360 + 40 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + TR_SCREENSONG_BUTTON_PLAYLIST + + + + + + + + + + + Button + + Button + + 40 + 90 + -2,11 + 360 + 40 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + TR_SCREENSONG_BUTTON_SING + + + + + + + + Button @@ -422,16 +430,16 @@ TextSColor - 30 + 30,00 - 280 + 280,00 Outline Bold 1 - + Button @@ -487,16 +495,16 @@ TextSColor - 30 + 30,00 - 280 + 280,00 Outline Bold 1 - + CoverTile @@ -510,12 +518,6 @@ MedleyCalcIcon MedleyTagIcon - - 40 - 100 - -1,00 - 1200 - 530 1,00 @@ -528,21 +530,21 @@ 6 4 - - 4 - - 4 10,00 10,00 + + 4 + + 4 410 40 -1,00 830 550 - + 410 40 -1,00 @@ -572,7 +574,7 @@ Outline - + @@ -602,7 +604,7 @@ Outline - + @@ -632,7 +634,7 @@ Outline - + @@ -737,62 +739,229 @@ - 970 - 80 - 295 - 460 - -0,90 - 50,00 - CoverTile - CoverTile - StaticColorAlpha - StaticColor - + + 970 + 80 + -0,90 + 295 + 460 + 50,00 + + CoverTile + + CoverTile + + + StaticColorAlpha + + + StaticColor + + + + + 54 + 4 + + -1,01 + + 24 + + 235 + + + StaticColor + + + TextSColor + + Left + + Top + + + + Outline + + + + + + + + + 975 + 45 + + -1,01 + + 30 + + 220 + + + StaticColor + + + TextSColor + + Left + + Center + + + + Outline + + + + + + + + + Menu + + 970 + 550 + -1,00 + 295 + 40 + + + StaticColor + + + + + + + Menu + + 970 + 40 + -1,00 + 295 + 40 + + + StaticColor + + + + + + + + + 4 + 2 + -1,00 + 46 + 46 + + + Visible + + + + + + + Button + + SelectSlideArrowLeft + + SelectSlideArrowRight + + SelectSlide + + SelectSlideArrowLeft + + SelectSlideArrowRight + + SelectSlide + + 54 + 28 + -1,01 + 235 + 24 + + 54 + 30 + -1,02 + 20 + 20 + + 235 + 30 + -1,02 + 20 + 20 + + + ButtonColor + + + ButtonSColor + + + SelectSlideHColor + + + ArrowColor + + + ArrowSColor + + + TextColor + + + TextSColor + + 24,00 + + 230,00 + + Outline + + Bold + + 1 + + + + CloseIcon + + CloseIcon + + 1215 + 42 + -1,01 + 35 + 35 + + + ButtonColor + + + ButtonSColor + - 54 - 4 - - -1,01 + 180 + 5 - 24 + 30 - 235 + 350 - StaticColor + ButtonTextColor - TextSColor - - Left - - Top - - - - Outline - - %a - %t - - - - - - - 222 - 456 - - -1,01 - - 38 - - 340 - - - StaticColor - - - TextSColor + ButtonTextSColor Center @@ -801,28 +970,47 @@ Outline - + - - - - - + + + + + + + + + + + DeleteIcon + + DeleteIcon + + 1215 + 553 + -1,01 + 35 + 35 + + + ButtonColor + + + ButtonSColor + - 222 - 456 - - -1,01 + 180 + 5 - 38 + 30 - 340 + 350 - StaticColor + ButtonTextColor - TextSColor + ButtonTextSColor Center @@ -831,343 +1019,114 @@ Outline - + - - - - - - - 975 - 45 - - -1,01 - - 30 - - 220 - - - StaticColor - - - TextSColor - - Left - - Center - - - - Outline - - - - - - - - - - - 4 - 2 - -1,00 - 46 - 46 - + + + + + + + + + + + SaveIcon + + SaveIcon + + 1175 + 553 + -1,01 + 35 + 35 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + - Visible - - - - - - - Menu - - 970 - 40 - -1,00 - 295 - 40 - - - StaticColor - - - - - - - Menu - - 970 - 550 - -1,00 - 295 - 40 - - - StaticColor - - - - - - - CloseIcon - - CloseIcon - - 1215 - 42 - -1,01 - 35 - 35 - - - ButtonColor - - - ButtonSColor - - - 180 - 5 - - 30 - - 350 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - - - Outline - - - - - - - - - - - - - SingIcon - - SingIcon - - 975 - 553 - -1,01 - 35 - 35 - - - ButtonColor - - - ButtonSColor - - - 180 - 5 - - 30 - - 350 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - - - Outline - - - - - - - - - - - - - SaveIcon - - SaveIcon - - 1175 - 553 - -1,01 - 35 - 35 - - - ButtonColor - - - ButtonSColor - - - 180 - 5 - - 30 - - 350 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - - - Outline - - - - - - - - - - - - - DeleteIcon - - DeleteIcon - - 1215 - 553 - -1,01 - 35 - 35 - - - ButtonColor - - - ButtonSColor - - - 180 - 5 - - 30 - - 350 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - - - Outline - - - - - - - - - - - - - Button - - SelectSlideArrowLeft - - SelectSlideArrowRight - - SelectSlide - - SelectSlideArrowLeft - - SelectSlideArrowRight - - SelectSlide - - 54 - 28 - -1,01 - 235 - 24 - - 54 - 30 - -1,02 - 20 - 20 - - 235 - 30 - -1,02 - 20 - 20 - - - ButtonColor - - - ButtonSColor - - - SelectSlideHColor - - - ArrowColor - - - ArrowSColor - - - TextColor - - - TextSColor - - 24,00 - - 230,00 - - Outline - - Bold - - 1 - + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + + + + + + + + + + + + SingIcon + + SingIcon + + 975 + 553 + -1,01 + 35 + 35 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + + + + + + + + + - + \ No newline at end of file diff --git a/Output/Themes/Ambient/Skin Blue.xml b/Output/Themes/Ambient/Skin Blue.xml index 7ddf916d..64b055f6 100644 --- a/Output/Themes/Ambient/Skin Blue.xml +++ b/Output/Themes/Ambient/Skin Blue.xml @@ -117,7 +117,7 @@ 0,000 0,500 0,400 - + 0,000 0,000 @@ -263,11 +263,11 @@ 1,000 - 0,00 - 0,00 - 1,00 - 0,50 - + 0,000 + 0,000 + 1,000 + 0,500 + 0,800 0,950 @@ -321,16 +321,16 @@ MedleyTagIcon.png Invisible.png PlayerSelector.png - PreviousIcon.png - NextIcon.png - PlayIcon.png - PauseIcon.png - RepeatIcon.png - SongMenuBG.png - Close.png - Delete.png - Save.png - Sing.png + PreviousIcon.png + NextIcon.png + PlayIcon.png + PauseIcon.png + RepeatIcon.png + SongMenuBG.png + Close.png + Delete.png + Save.png + Sing.png [Blue]BG_Video.mp4 @@ -338,4 +338,4 @@ [Blue]IntroMid.mp4 [Blue]IntroOut.mp4 - + \ No newline at end of file diff --git a/Output/Themes/Ambient/Skin Green.xml b/Output/Themes/Ambient/Skin Green.xml index 663faf5c..20c3ebe3 100644 --- a/Output/Themes/Ambient/Skin Green.xml +++ b/Output/Themes/Ambient/Skin Green.xml @@ -117,7 +117,7 @@ 0,000 0,500 0,400 - + 0,000 0,750 @@ -257,10 +257,10 @@ 1,000 - 0,00 - 1,00 - 0,00 - 0,50 + 0,000 + 1,000 + 0,000 + 0,500 0,800 @@ -315,16 +315,16 @@ MedleyTagIcon.png Invisible.png PlayerSelector.png - PreviousIcon.png - NextIcon.png - PlayIcon.png - PauseIcon.png - RepeatIcon.png - SongMenuBG.png - Close.png - Delete.png - Save.png - Sing.png + PreviousIcon.png + NextIcon.png + PlayIcon.png + PauseIcon.png + RepeatIcon.png + SongMenuBG.png + Close.png + Delete.png + Save.png + Sing.png [Green]BG_Video.mp4 @@ -332,4 +332,4 @@ [Green]IntroMid.mp4 [Green]IntroOut.mp4 - + \ No newline at end of file diff --git a/Output/Themes/Ambient/Skin Red.xml b/Output/Themes/Ambient/Skin Red.xml index 9d3f1f8d..3a187e67 100644 --- a/Output/Themes/Ambient/Skin Red.xml +++ b/Output/Themes/Ambient/Skin Red.xml @@ -117,7 +117,7 @@ 0,000 0,500 0,400 - + 0,750 0,000 @@ -257,11 +257,11 @@ 1,000 - 1,00 - 0,00 - 0,00 - 0,50 - + 1,000 + 0,000 + 0,000 + 0,500 + 1,000 0,800 @@ -315,16 +315,16 @@ MedleyTagIcon.png Invisible.png PlayerSelector.png - PreviousIcon.png - NextIcon.png - PlayIcon.png - PauseIcon.png - RepeatIcon.png - SongMenuBG.png - Close.png - Delete.png - Save.png - Sing.png + PreviousIcon.png + NextIcon.png + PlayIcon.png + PauseIcon.png + RepeatIcon.png + SongMenuBG.png + Close.png + Delete.png + Save.png + Sing.png [Red]BG_Video.mp4 @@ -332,4 +332,4 @@ [Red]IntroMid.mp4 [Red]IntroOut.mp4 - + \ No newline at end of file diff --git a/Output/Themes/Ambient/Skin Yellow.xml b/Output/Themes/Ambient/Skin Yellow.xml index fcb4664a..9735075b 100644 --- a/Output/Themes/Ambient/Skin Yellow.xml +++ b/Output/Themes/Ambient/Skin Yellow.xml @@ -117,7 +117,7 @@ 0,000 0,500 0,400 - + 0,750 0,750 @@ -257,11 +257,11 @@ 1,000 - 1,00 - 1,00 - 0,00 - 0,50 - + 1,000 + 1,000 + 0,000 + 0,500 + 0,949 1,000 @@ -315,16 +315,16 @@ MedleyTagIcon.png Invisible.png PlayerSelector.png - PreviousIcon.png - NextIcon.png - PlayIcon.png - PauseIcon.png - RepeatIcon.png - SongMenuBG.png - Close.png - Delete.png - Save.png - Sing.png + PreviousIcon.png + NextIcon.png + PlayIcon.png + PauseIcon.png + RepeatIcon.png + SongMenuBG.png + Close.png + Delete.png + Save.png + Sing.png [Yellow]BG_Video.mp4 @@ -332,4 +332,4 @@ [Yellow]IntroMid.mp4 [Yellow]IntroOut.mp4 - + \ No newline at end of file diff --git a/Vocaluxe/Menu/CEqualizer.cs b/Vocaluxe/Menu/CEqualizer.cs index 89fe35c3..4b8c3997 100644 --- a/Vocaluxe/Menu/CEqualizer.cs +++ b/Vocaluxe/Menu/CEqualizer.cs @@ -163,7 +163,7 @@ namespace Vocaluxe.Menu writer.WriteComment(" - - Outline - - - - - - Menu @@ -931,6 +901,55 @@ 1 + + + Invisible + + Invisible + + 975 + 45 + -1,01 + 220 + 30 + + + ButtonColor + + + ButtonSColor + + + 0 + 0 + + 30 + + 220 + + + ButtonTextColor + + + ButtonTextSColor + + Left + + Center + + + + Outline + + + + + + + + + + CloseIcon @@ -1129,4 +1148,4 @@ - \ No newline at end of file + diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs index f00d7663..96d90907 100644 --- a/Vocaluxe/Menu/CPlaylist.cs +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -13,6 +13,12 @@ using Vocaluxe.GameModes; namespace Vocaluxe.Menu { + enum EEditMode + { + None, + PlaylistName, + ChangeOrder + } struct SThemePlaylist { @@ -27,12 +33,12 @@ namespace Vocaluxe.Menu public float EntryHeight; public CText Text1; - public CText TextPlaylistHeader; public CStatic StaticCover; public CStatic StaticPlaylistHeader; public CStatic StaticPlaylistFooter; + public CButton ButtonPlaylistName; public CButton ButtonPlaylistClose; public CButton ButtonPlaylistSave; public CButton ButtonPlaylistDelete; @@ -72,6 +78,7 @@ namespace Vocaluxe.Menu private List PlaylistElements; private List PlaylistElementContents; + public SRectF CompleteRect; public SRectF Rect; public SColorF BackgroundColor; public SColorF BackgroundSColor; @@ -94,7 +101,7 @@ namespace Vocaluxe.Menu } } - public bool changeOrder = false; + public EEditMode _EditMode; public int ActivePlaylistID = -1; public int Offset = 0; public int ActiveHover = -1; @@ -104,16 +111,17 @@ namespace Vocaluxe.Menu { _Theme = new SThemePlaylist(); _Theme.Text1 = new CText(); - _Theme.TextPlaylistHeader = new CText(); _Theme.StaticCover = new CStatic(); _Theme.StaticPlaylistFooter = new CStatic(); _Theme.StaticPlaylistHeader = new CStatic(); + _Theme.ButtonPlaylistName = new CButton(); _Theme.ButtonPlaylistClose = new CButton(); _Theme.ButtonPlaylistDelete = new CButton(); _Theme.ButtonPlaylistSave = new CButton(); _Theme.ButtonPlaylistSing = new CButton(); _Theme.SelectSlideGameMode = new CSelectSlide(); + CompleteRect = new SRectF(); Rect = new SRectF(); BackgroundColor = new SColorF(); BackgroundSColor = new SColorF(); @@ -131,10 +139,10 @@ namespace Vocaluxe.Menu { _Interactions.Clear(); PrepareList(); - _Interactions.AddText(_Theme.TextPlaylistHeader); _Interactions.AddStatic(_Theme.StaticCover); _Interactions.AddStatic(_Theme.StaticPlaylistFooter); _Interactions.AddStatic(_Theme.StaticPlaylistHeader); + _Interactions.AddButton(_Theme.ButtonPlaylistName); _Interactions.AddButton(_Theme.ButtonPlaylistClose); _Interactions.AddButton(_Theme.ButtonPlaylistDelete); _Interactions.AddButton(_Theme.ButtonPlaylistSave); @@ -178,12 +186,12 @@ namespace Vocaluxe.Menu } _ThemeLoaded &= _Theme.Text1.LoadTheme(item, "TextPart1", navigator, SkinIndex); - _ThemeLoaded &= _Theme.TextPlaylistHeader.LoadTheme(item, "TextPlaylistHeader", navigator, SkinIndex); _ThemeLoaded &= _Theme.StaticCover.LoadTheme(item, "StaticCover", navigator, SkinIndex); _ThemeLoaded &= _Theme.StaticPlaylistHeader.LoadTheme(item, "StaticPlaylistHeader", navigator, SkinIndex); _ThemeLoaded &= _Theme.StaticPlaylistFooter.LoadTheme(item, "StaticPlaylistFooter", navigator, SkinIndex); + _ThemeLoaded &= _Theme.ButtonPlaylistName.LoadTheme(item, "ButtonPlaylistName", navigator, SkinIndex); _ThemeLoaded &= _Theme.ButtonPlaylistSing.LoadTheme(item, "ButtonPlaylistSing", navigator, SkinIndex); _ThemeLoaded &= _Theme.ButtonPlaylistClose.LoadTheme(item, "ButtonPlaylistClose", navigator, SkinIndex); _ThemeLoaded &= _Theme.ButtonPlaylistSave.LoadTheme(item, "ButtonPlaylistSave", navigator, SkinIndex); @@ -195,6 +203,53 @@ namespace Vocaluxe.Menu if (_ThemeLoaded) { _Theme.Name = ElementName; + //Check for highest x/y-coords + CompleteRect = Rect; + //ButtonPlaylistClose + if (_Theme.ButtonPlaylistClose.Rect.X < CompleteRect.X) + CompleteRect.X = _Theme.ButtonPlaylistClose.Rect.X; + if (_Theme.ButtonPlaylistClose.Rect.Y < CompleteRect.Y) + CompleteRect.Y = _Theme.ButtonPlaylistClose.Rect.Y; + if (_Theme.ButtonPlaylistClose.Rect.W + _Theme.ButtonPlaylistClose.Rect.X > CompleteRect.W + CompleteRect.X) + CompleteRect.W += _Theme.ButtonPlaylistClose.Rect.W + _Theme.ButtonPlaylistClose.Rect.X - CompleteRect.X; + if (_Theme.ButtonPlaylistClose.Rect.Y + _Theme.ButtonPlaylistClose.Rect.H > CompleteRect.Y + CompleteRect.H) + CompleteRect.H += _Theme.ButtonPlaylistClose.Rect.H + _Theme.ButtonPlaylistClose.Rect.Y - CompleteRect.Y; + //ButtonPlaylistName + if (_Theme.ButtonPlaylistName.Rect.X < CompleteRect.X) + CompleteRect.X = _Theme.ButtonPlaylistName.Rect.X; + if (_Theme.ButtonPlaylistName.Rect.Y < CompleteRect.Y) + CompleteRect.Y = _Theme.ButtonPlaylistName.Rect.Y; + if (_Theme.ButtonPlaylistName.Rect.W + _Theme.ButtonPlaylistName.Rect.X > CompleteRect.W + CompleteRect.X) + CompleteRect.W += _Theme.ButtonPlaylistName.Rect.W + _Theme.ButtonPlaylistName.Rect.X - CompleteRect.X; + if (_Theme.ButtonPlaylistName.Rect.Y + _Theme.ButtonPlaylistName.Rect.H > CompleteRect.Y + CompleteRect.H) + CompleteRect.H += _Theme.ButtonPlaylistName.Rect.H + _Theme.ButtonPlaylistName.Rect.Y - CompleteRect.Y; + //ButtonPlaylistSing + if (_Theme.ButtonPlaylistSing.Rect.X < CompleteRect.X) + CompleteRect.X = _Theme.ButtonPlaylistSing.Rect.X; + if (_Theme.ButtonPlaylistSing.Rect.Y < CompleteRect.Y) + CompleteRect.Y = _Theme.ButtonPlaylistSing.Rect.Y; + if (_Theme.ButtonPlaylistSing.Rect.W + _Theme.ButtonPlaylistSing.Rect.X > CompleteRect.W + CompleteRect.X) + CompleteRect.W += _Theme.ButtonPlaylistSing.Rect.W + _Theme.ButtonPlaylistSing.Rect.X - CompleteRect.X; + if (_Theme.ButtonPlaylistSing.Rect.Y + _Theme.ButtonPlaylistSing.Rect.H > CompleteRect.Y + CompleteRect.H) + CompleteRect.H += _Theme.ButtonPlaylistSing.Rect.H + _Theme.ButtonPlaylistSing.Rect.Y - CompleteRect.Y; + //ButtonPlaylistSave + if (_Theme.ButtonPlaylistSave.Rect.X < CompleteRect.X) + CompleteRect.X = _Theme.ButtonPlaylistSave.Rect.X; + if (_Theme.ButtonPlaylistSave.Rect.Y < CompleteRect.Y) + CompleteRect.Y = _Theme.ButtonPlaylistSave.Rect.Y; + if (_Theme.ButtonPlaylistSave.Rect.W + _Theme.ButtonPlaylistSave.Rect.X > CompleteRect.W + CompleteRect.X) + CompleteRect.W += _Theme.ButtonPlaylistSave.Rect.W + _Theme.ButtonPlaylistSave.Rect.X - CompleteRect.X; + if (_Theme.ButtonPlaylistSave.Rect.Y + _Theme.ButtonPlaylistSave.Rect.H > CompleteRect.Y + CompleteRect.H) + CompleteRect.H += _Theme.ButtonPlaylistSave.Rect.H + _Theme.ButtonPlaylistSave.Rect.Y - CompleteRect.Y; + //ButtonPlaylistDelete + if (_Theme.ButtonPlaylistDelete.Rect.X < CompleteRect.X) + CompleteRect.X = _Theme.ButtonPlaylistDelete.Rect.X; + if (_Theme.ButtonPlaylistDelete.Rect.Y < CompleteRect.Y) + CompleteRect.Y = _Theme.ButtonPlaylistDelete.Rect.Y; + if (_Theme.ButtonPlaylistDelete.Rect.W + _Theme.ButtonPlaylistDelete.Rect.X > CompleteRect.W + CompleteRect.X) + CompleteRect.W += _Theme.ButtonPlaylistDelete.Rect.W + _Theme.ButtonPlaylistDelete.Rect.X - CompleteRect.X; + if (_Theme.ButtonPlaylistDelete.Rect.Y + _Theme.ButtonPlaylistDelete.Rect.H > CompleteRect.Y + CompleteRect.H) + CompleteRect.H += _Theme.ButtonPlaylistDelete.Rect.H + _Theme.ButtonPlaylistDelete.Rect.Y - CompleteRect.Y; LoadTextures(); } return _ThemeLoaded; @@ -252,11 +307,11 @@ namespace Vocaluxe.Menu writer.WriteComment("Positions of , , , and are relative to playlist-entry!"); writer.WriteComment("Use placeholders for Text of , and : %t, %a, %l"); _Theme.Text1.SaveTheme(writer); - _Theme.TextPlaylistHeader.SaveTheme(writer); _Theme.StaticPlaylistFooter.SaveTheme(writer); _Theme.StaticPlaylistHeader.SaveTheme(writer); _Theme.StaticCover.SaveTheme(writer); _Theme.SelectSlideGameMode.SaveTheme(writer); + _Theme.ButtonPlaylistName.SaveTheme(writer); _Theme.ButtonPlaylistClose.SaveTheme(writer); _Theme.ButtonPlaylistDelete.SaveTheme(writer); _Theme.ButtonPlaylistSave.SaveTheme(writer); @@ -346,205 +401,261 @@ namespace Vocaluxe.Menu CurrPlaylistElement = i; } - switch (KeyEvent.Key) + //Active EditMode ignores other input! + if (_EditMode == EEditMode.PlaylistName) { - case Keys.Up: - if (CurrentPlaylistElement == -1 && PlaylistElementContents.Count > 0) - { - _Interactions.HandleInput(KeyEvent); - SetSelectionToLastEntry(); - return true; - } - else if (CurrentPlaylistElement == 0 || PlaylistElementContents.Count == 0 || KeyEvent.ModSHIFT) - { - CurrentPlaylistElement = -1; - ActiveHover = CurrentPlaylistElement; - _Interactions.SetInteractionToSelectSlide(PlaylistElements[0].SelectSlide); - _Interactions.HandleInput(KeyEvent); + if (KeyEvent.KeyPressed && !Char.IsControl(KeyEvent.Unicode)) + { + _Theme.ButtonPlaylistName.Text.Text = _Theme.ButtonPlaylistName.Text.Text + KeyEvent.Unicode; + } + else if (KeyEvent.Key == Keys.Enter) + { + CPlaylists.Playlists[ActivePlaylistID].PlaylistName = _Theme.ButtonPlaylistName.Text.Text; + CPlaylists.Playlists[ActivePlaylistID].SavePlaylist(); + _EditMode = EEditMode.None; + } + else if (KeyEvent.Key == Keys.Escape) + { + _Theme.ButtonPlaylistName.Text.Text = CPlaylists.Playlists[ActivePlaylistID].PlaylistName; + _EditMode = EEditMode.None; + } + else if (KeyEvent.Key == Keys.Back || KeyEvent.Key == Keys.Delete) + { + if (_Theme.ButtonPlaylistName.Text.Text.Length > 0) + _Theme.ButtonPlaylistName.Text.Text = _Theme.ButtonPlaylistName.Text.Text.Remove(_Theme.ButtonPlaylistName.Text.Text.Length - 1); + } - int selection = GetSelectedSelectionNr(); - if (selection != -1 && PlaylistElementContents.Count > selection) + } + else + { + switch (KeyEvent.Key) + { + case Keys.Up: + if (CurrentPlaylistElement == -1 && PlaylistElementContents.Count > 0) { - CurrentPlaylistElement = selection; + _Interactions.HandleInput(KeyEvent); + SetSelectionToLastEntry(); + return true; + } + else if (CurrentPlaylistElement == 0 || PlaylistElementContents.Count == 0 || KeyEvent.ModSHIFT) + { + CurrentPlaylistElement = -1; ActiveHover = CurrentPlaylistElement; - } - return true; - } - else if (CurrentPlaylistElement - 1 > 0) - { - _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); - _Interactions.HandleInput(KeyEvent); + _Interactions.SetInteractionToSelectSlide(PlaylistElements[0].SelectSlide); + _Interactions.HandleInput(KeyEvent); - int selection = GetSelectedSelectionNr(); - - if (selection != -1 && PlaylistElementContents.Count > selection) + int selection = GetSelectedSelectionNr(); + if (selection != -1 && PlaylistElementContents.Count > selection) + { + CurrentPlaylistElement = selection; + ActiveHover = CurrentPlaylistElement; + } + return true; + } + else if (CurrentPlaylistElement - 1 > 0) { - CurrentPlaylistElement = selection; - ActiveHover = CurrentPlaylistElement; - } - return true; - } - else if (CurrentPlaylistElement - 1 == 0) - { - if (Offset > 0) - { - Offset--; - Update(); - } - - _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); - _Interactions.HandleInput(KeyEvent); - - int selection = GetSelectedSelectionNr(); - if (selection != -1 && PlaylistElementContents.Count > selection) - { - CurrentPlaylistElement = selection; - ActiveHover = CurrentPlaylistElement; - } - - return true; - } - return false; - - case Keys.Down: - if (CurrentPlaylistElement == -1 && PlaylistElementContents.Count > 0) - { - _Interactions.HandleInput(KeyEvent); - SetSelectionToFirstEntry(); - return true; - } - else if (CurrentPlaylistElement == PlaylistElements.Count -1 || PlaylistElementContents.Count == 0 || KeyEvent.ModSHIFT) - { - CurrentPlaylistElement = -1; - ActiveHover = CurrentPlaylistElement; - - int sel = PlaylistElementContents.Count - 1; - if (sel > PlaylistElements.Count - 1) - sel = PlaylistElements.Count - 1; - - _Interactions.SetInteractionToSelectSlide(PlaylistElements[sel].SelectSlide); - _Interactions.HandleInput(KeyEvent); - - int selection = GetSelectedSelectionNr(); - if (selection != -1 && PlaylistElementContents.Count > selection) - { - CurrentPlaylistElement = selection; - ActiveHover = CurrentPlaylistElement; - } - return true; - } - else if (CurrentPlaylistElement + 1 < PlaylistElements.Count - 1) - { - _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); - _Interactions.HandleInput(KeyEvent); - - int selection = GetSelectedSelectionNr(); - - if (selection != -1 && PlaylistElementContents.Count > selection) - { - CurrentPlaylistElement = selection; - ActiveHover = CurrentPlaylistElement; - } - return true; - } - else if (CurrentPlaylistElement + 1 >= PlaylistElements.Count - 1 && CurrentPlaylistElement + Offset + 1 < PlaylistElementContents.Count) - { - if (PlaylistElementContents[CurrentPlaylistElement + Offset + 1].SongID != -1) - { - Offset++; - Update(); - } - - _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); - _Interactions.HandleInput(KeyEvent); - - int selection = GetSelectedSelectionNr(); - if (selection != -1 && PlaylistElementContents.Count > selection) - { - CurrentPlaylistElement = selection; - ActiveHover = CurrentPlaylistElement; - } - - return true; - } - return false; - - case Keys.Delete: - if (CurrentPlaylistElement != -1) - { - CPlaylists.Playlists[ActivePlaylistID].DeleteSong(PlaylistElements[CurrentPlaylistElement].Content); - UpdatePlaylist(); - if (CurrentPlaylistElement != -1) _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); - return true; - } - return false; + _Interactions.HandleInput(KeyEvent); - case Keys.Back: - ClosePlaylist(); - break; + int selection = GetSelectedSelectionNr(); - case Keys.Enter: - StartPlaylistSongs(); - break; - - case Keys.PageUp: - if (CurrentPlaylistElement != -1) - { - CPlaylists.Playlists[ActivePlaylistID].SongDown(CurrentPlaylistElement+Offset); - if (CurrentPlaylistElement - 1 > -1) + if (selection != -1 && PlaylistElementContents.Count > selection) + { + CurrentPlaylistElement = selection; + ActiveHover = CurrentPlaylistElement; + } + return true; + } + else if (CurrentPlaylistElement - 1 == 0) { - CurrentPlaylistElement--; + if (Offset > 0) + { + Offset--; + Update(); + } + + _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); + _Interactions.HandleInput(KeyEvent); + + int selection = GetSelectedSelectionNr(); + if (selection != -1 && PlaylistElementContents.Count > selection) + { + CurrentPlaylistElement = selection; + ActiveHover = CurrentPlaylistElement; + } + + return true; + } + return false; + + case Keys.Down: + if (CurrentPlaylistElement == -1 && PlaylistElementContents.Count > 0) + { + _Interactions.HandleInput(KeyEvent); + SetSelectionToFirstEntry(); + return true; + } + else if (CurrentPlaylistElement == PlaylistElements.Count - 1 || PlaylistElementContents.Count == 0 || KeyEvent.ModSHIFT) + { + CurrentPlaylistElement = -1; ActiveHover = CurrentPlaylistElement; - } - else if(Offset > 0) - { - Offset--; - } - UpdatePlaylist(); - _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); - return true; - } - break; - case Keys.PageDown: - if (CurrentPlaylistElement != -1) - { - CPlaylists.Playlists[ActivePlaylistID].SongUp(CurrentPlaylistElement+Offset); - if (CurrentPlaylistElement + 1 < PlaylistElements.Count) - { - CurrentPlaylistElement++; - ActiveHover = CurrentPlaylistElement; - } - else if (Offset + CurrentPlaylistElement < PlaylistElementContents.Count) - { - Offset++; - } - UpdatePlaylist(); - _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); - return true; - } - break; + int sel = PlaylistElementContents.Count - 1; + if (sel > PlaylistElements.Count - 1) + sel = PlaylistElements.Count - 1; - case Keys.Left: - _Interactions.HandleInput(KeyEvent); - if (CurrentPlaylistElement != -1) - { - CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; - UpdatePlaylist(); - return true; - } - return false; + _Interactions.SetInteractionToSelectSlide(PlaylistElements[sel].SelectSlide); + _Interactions.HandleInput(KeyEvent); - case Keys.Right: - _Interactions.HandleInput(KeyEvent); - if (CurrentPlaylistElement != -1) - { - CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; - UpdatePlaylist(); - return true; - } - return false; + int selection = GetSelectedSelectionNr(); + if (selection != -1 && PlaylistElementContents.Count > selection) + { + CurrentPlaylistElement = selection; + ActiveHover = CurrentPlaylistElement; + } + return true; + } + else if (CurrentPlaylistElement + 1 < PlaylistElements.Count - 1) + { + _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); + _Interactions.HandleInput(KeyEvent); + + int selection = GetSelectedSelectionNr(); + + if (selection != -1 && PlaylistElementContents.Count > selection) + { + CurrentPlaylistElement = selection; + ActiveHover = CurrentPlaylistElement; + } + return true; + } + else if (CurrentPlaylistElement + 1 >= PlaylistElements.Count - 1 && CurrentPlaylistElement + Offset + 1 < PlaylistElementContents.Count) + { + if (PlaylistElementContents[CurrentPlaylistElement + Offset + 1].SongID != -1) + { + Offset++; + Update(); + } + + _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); + _Interactions.HandleInput(KeyEvent); + + int selection = GetSelectedSelectionNr(); + if (selection != -1 && PlaylistElementContents.Count > selection) + { + CurrentPlaylistElement = selection; + ActiveHover = CurrentPlaylistElement; + } + + return true; + } + return false; + + case Keys.Delete: + if (CurrentPlaylistElement != -1) + { + CPlaylists.Playlists[ActivePlaylistID].DeleteSong(PlaylistElements[CurrentPlaylistElement].Content); + UpdatePlaylist(); + if (CurrentPlaylistElement != -1) + _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); + return true; + } + return false; + + case Keys.Back: + ClosePlaylist(); + break; + + case Keys.Enter: + if (KeyEvent.ModSHIFT) + StartPlaylistSongs(); + else + { + if (_Theme.ButtonPlaylistClose.Selected) + { + ClosePlaylist(); + } + else if (_Theme.ButtonPlaylistSing.Selected) + { + StartPlaylistSongs(); + } + else if (_Theme.ButtonPlaylistSave.Selected) + { + CPlaylists.SavePlaylist(ActivePlaylistID); + } + else if (_Theme.ButtonPlaylistDelete.Selected) + { + CPlaylists.DeletePlaylist(ActivePlaylistID); + ClosePlaylist(); + } + else if (_Theme.ButtonPlaylistName.Selected) + { + if (_EditMode != EEditMode.PlaylistName) + _EditMode = EEditMode.PlaylistName; + else + _EditMode = EEditMode.None; + } + } + break; + + case Keys.PageUp: + if (CurrentPlaylistElement != -1) + { + CPlaylists.Playlists[ActivePlaylistID].SongDown(CurrentPlaylistElement + Offset); + if (CurrentPlaylistElement - 1 > -1) + { + CurrentPlaylistElement--; + ActiveHover = CurrentPlaylistElement; + } + else if (Offset > 0) + { + Offset--; + } + UpdatePlaylist(); + _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); + return true; + } + break; + + case Keys.PageDown: + if (CurrentPlaylistElement != -1) + { + CPlaylists.Playlists[ActivePlaylistID].SongUp(CurrentPlaylistElement + Offset); + if (CurrentPlaylistElement + 1 < PlaylistElements.Count) + { + CurrentPlaylistElement++; + ActiveHover = CurrentPlaylistElement; + } + else if (Offset + CurrentPlaylistElement < PlaylistElementContents.Count) + { + Offset++; + } + UpdatePlaylist(); + _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); + return true; + } + break; + + case Keys.Left: + _Interactions.HandleInput(KeyEvent); + if (CurrentPlaylistElement != -1) + { + CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; + UpdatePlaylist(); + return true; + } + return false; + + case Keys.Right: + _Interactions.HandleInput(KeyEvent); + if (CurrentPlaylistElement != -1) + { + CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; + UpdatePlaylist(); + return true; + } + return false; + } } } return false; @@ -606,106 +717,145 @@ namespace Vocaluxe.Menu { _Interactions.HandleMouse(MouseEvent); - if (CHelper.IsInBounds(Rect, MouseEvent) && Visible) + if (CHelper.IsInBounds(CompleteRect, MouseEvent) && Visible) { - if (MouseEvent.Wheel > 0) + switch (_EditMode) { - if (PlaylistElements.Count + Offset + MouseEvent.Wheel <= PlaylistElementContents.Count) - { - Offset += MouseEvent.Wheel; - Update(); - return true; - } - return true; - } - else if (MouseEvent.Wheel < 0) - { - if (Offset + MouseEvent.Wheel >= 0) - { - Offset += MouseEvent.Wheel; - Update(); - return true; - } - } - - if (MouseEvent.LB) - { - if (CurrentPlaylistElement != -1) - { - CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; - UpdatePlaylist(); - return true; - } - } - - for (int i = 0; i < PlaylistElements.Count; i++) - { - //Hover for playlist-element - if (PlaylistElementContents.Count - 1 >= i && CHelper.IsInBounds(PlaylistElements[i].Background.Rect, MouseEvent)) - { - ActiveHover = i; - CurrentPlaylistElement = i; - } - - //Delete Entry with RB - if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, MouseEvent) && MouseEvent.RB && PlaylistElements[i].Content != -1) - { - CPlaylists.Playlists[ActivePlaylistID].DeleteSong(PlaylistElements[i].Content); - UpdatePlaylist(); - return true; - } - //Change order with holding LB - else if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, MouseEvent) && MouseEvent.LBH && PlaylistElements[i].Content != -1 && !changeOrder) - { - changeOrder = true; - CurrentPlaylistElement = i; - } - else if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, MouseEvent) && MouseEvent.LBH && PlaylistElements[i].Content != -1 && changeOrder) - { - /* - if (PlaylistElements.Count < CurrentPlaylistElement + 1) + //Normal mode + case EEditMode.None: + //Scroll + if (MouseEvent.Wheel > 0) { + if (PlaylistElements.Count + Offset + MouseEvent.Wheel <= PlaylistElementContents.Count) + { + Offset += MouseEvent.Wheel; + Update(); + return true; + } + return true; } - else if (PlaylistElementContents.Count < CurrentPlaylistElement + 1 + Offset) + else if (MouseEvent.Wheel < 0) { + if (Offset + MouseEvent.Wheel >= 0) + { + Offset += MouseEvent.Wheel; + Update(); + return true; + } } - if (mevent.Y < PlaylistElements[CurrentPlaylistElement + 1].Background.Rect.Y) + //LB actions + if (MouseEvent.LB) { + if (CurrentPlaylistElement != -1) + { + CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; + UpdatePlaylist(); + } + if (_Theme.ButtonPlaylistClose.Selected) + { + ClosePlaylist(); + return true; + } + else if (_Theme.ButtonPlaylistSing.Selected) + { + StartPlaylistSongs(); + return true; + } + else if (_Theme.ButtonPlaylistSave.Selected) + { + CPlaylists.SavePlaylist(ActivePlaylistID); + return true; + } + else if (_Theme.ButtonPlaylistDelete.Selected) + { + CPlaylists.DeletePlaylist(ActivePlaylistID); + ClosePlaylist(); + return true; + } + else if (_Theme.ButtonPlaylistName.Selected) + { + _EditMode = EEditMode.PlaylistName; + return true; + } } - */ - } - } - } - else - { - if (ActiveHover != -1) - { - ActiveHover = -1; - CurrentPlaylistElement = -1; - } - } + //Actions according to playlist-element + bool hover_set = false; + for (int i = 0; i < PlaylistElements.Count; i++) + { + //Hover for playlist-element + if (PlaylistElementContents.Count - 1 >= i && CHelper.IsInBounds(PlaylistElements[i].Background.Rect, MouseEvent)) + { + hover_set = true; + ActiveHover = i; + CurrentPlaylistElement = i; + } - if (ActivePlaylistID > -1) - { - if (MouseEvent.LB) - { - if (_Theme.ButtonPlaylistClose.Selected) - { - ClosePlaylist(); - } - else if (_Theme.ButtonPlaylistSing.Selected) - { - StartPlaylistSongs(); - } - else if (_Theme.ButtonPlaylistSave.Selected) - { - CPlaylists.SavePlaylist(ActivePlaylistID); - } - else if (_Theme.ButtonPlaylistDelete.Selected) - { - CPlaylists.DeletePlaylist(ActivePlaylistID); - ClosePlaylist(); - } + //Delete Entry with RB + if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, MouseEvent) && MouseEvent.RB && PlaylistElements[i].Content != -1) + { + CPlaylists.Playlists[ActivePlaylistID].DeleteSong(PlaylistElements[i].Content); + UpdatePlaylist(); + return true; + } + } + if(!hover_set) + { + ActiveHover = -1; + CurrentPlaylistElement = -1; + } + break; + + case EEditMode.PlaylistName: + _Interactions.SetInteractionToButton(_Theme.ButtonPlaylistName); + ActiveHover = -1; + CurrentPlaylistElement = -1; + if (MouseEvent.LB) + { + if (_Theme.ButtonPlaylistName.Selected) + { + CPlaylists.Playlists[ActivePlaylistID].PlaylistName = _Theme.ButtonPlaylistName.Text.Text; + CPlaylists.Playlists[ActivePlaylistID].SavePlaylist(); + _EditMode = EEditMode.None; + return true; + } + } + else if (MouseEvent.RB) + { + if (_Theme.ButtonPlaylistName.Selected) + { + _Theme.ButtonPlaylistName.Text.Text = CPlaylists.Playlists[ActivePlaylistID].PlaylistName; + _EditMode = EEditMode.None; + return true; + } + } + break; + + case EEditMode.ChangeOrder: + //Actions according to playlist-element + for (int i = 0; i < PlaylistElements.Count; i++) + { + //Change order with holding LB + if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, MouseEvent) && MouseEvent.LBH && PlaylistElements[i].Content != -1 && _EditMode != EEditMode.ChangeOrder) + { + _EditMode = EEditMode.ChangeOrder; + CurrentPlaylistElement = i; + } + else if (CHelper.IsInBounds(PlaylistElements[i].Background.Rect, MouseEvent) && MouseEvent.LBH && PlaylistElements[i].Content != -1 && _EditMode == EEditMode.ChangeOrder) + { + /* + if (PlaylistElements.Count < CurrentPlaylistElement + 1) + { + } + else if (PlaylistElementContents.Count < CurrentPlaylistElement + 1 + Offset) + { + } + if (mevent.Y < PlaylistElements[CurrentPlaylistElement + 1].Background.Rect.Y) + { + } + */ + } + } + break; } } return false; @@ -738,7 +888,7 @@ namespace Vocaluxe.Menu { if (PlaylistID > -1 && PlaylistID < CPlaylists.NumPlaylists) { - _Theme.TextPlaylistHeader.Text = CPlaylists.Playlists[ActivePlaylistID].PlaylistName; + _Theme.ButtonPlaylistName.Text.Text = CPlaylists.Playlists[ActivePlaylistID].PlaylistName; ActivePlaylistID = PlaylistID; PlaylistElementContents.Clear(); for (int i = 0; i < CPlaylists.Playlists[ActivePlaylistID].Songs.Count; i++) From d3f0fbac0ab57c2dfdd10869772d66cc2d5e4b4f Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 8 Sep 2012 12:23:43 +0200 Subject: [PATCH 44/70] Use selected game-mode for new song in playlist. --- Vocaluxe/Screens/CScreenSong.cs | 72 ++++++++++++++++++++++++++++++--- 1 file changed, 66 insertions(+), 6 deletions(-) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index bbc0f021..687cf9e4 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -231,24 +231,57 @@ namespace Vocaluxe.Screens //Open a playlist and add song if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1)) { + //Check selected game-mode + EGameMode gm; + if (_AvailableGameModes.Count >= SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection) + gm = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; + else + if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) + gm = GameModes.EGameMode.TR_GAMEMODE_DUET; + else + gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; + //Check if Playlist really exists if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1 < 0) Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); else Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1; - CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + //Add song to playlist + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); + //Open playlist OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); } //Create a new playlist and add song else if ((SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1) == -1) { + //Check selected game-mode + EGameMode gm; + if (_AvailableGameModes.Count >= SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection) + gm = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; + else + if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) + gm = GameModes.EGameMode.TR_GAMEMODE_DUET; + else + gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; + //Create new playlist Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); - CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + //Add song to playlist + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); + //Open playlist OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); } //Add song to loaded playlist else { - CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + //Check selected game-mode + EGameMode gm; + if (_AvailableGameModes.Count >= SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection) + gm = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; + else + if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) + gm = GameModes.EGameMode.TR_GAMEMODE_DUET; + else + gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); Playlists[htPlaylists(Playlist)].UpdatePlaylist(); } ToggleSongOptions(); @@ -330,24 +363,51 @@ namespace Vocaluxe.Screens //Open a playlist and add song if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1)) { + //Check selected game-mode + EGameMode gm; + if (_AvailableGameModes.Count >= SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection) + gm = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; + else + if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) + gm = GameModes.EGameMode.TR_GAMEMODE_DUET; + else + gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1 < 0) Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); else Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1; - CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); } //Create a new playlist and add song else if ((SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1) == -1) { + //Check selected game-mode + EGameMode gm; + if (_AvailableGameModes.Count >= SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection) + gm = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; + else + if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) + gm = GameModes.EGameMode.TR_GAMEMODE_DUET; + else + gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); - CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); } //Add song to loaded playlist else { - CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + //Check selected game-mode + EGameMode gm; + if (_AvailableGameModes.Count >= SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection) + gm = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; + else + if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) + gm = GameModes.EGameMode.TR_GAMEMODE_DUET; + else + gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); Playlists[htPlaylists(Playlist)].UpdatePlaylist(); } ToggleSongOptions(); From d3159b9c83a0d4c1d5ad868269ba252180224ad8 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 8 Sep 2012 12:37:37 +0200 Subject: [PATCH 45/70] Save last game-mode selection. --- Vocaluxe/Screens/CScreenSong.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 687cf9e4..3ef04745 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -372,11 +372,14 @@ namespace Vocaluxe.Screens gm = GameModes.EGameMode.TR_GAMEMODE_DUET; else gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; + //Check if playlist really exists if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1 < 0) Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); else Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1; + //Add song to playlist CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); + //Open playlist OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); } //Create a new playlist and add song @@ -391,8 +394,11 @@ namespace Vocaluxe.Screens gm = GameModes.EGameMode.TR_GAMEMODE_DUET; else gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; + //Create new playlist Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); + //Add song to playlist CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); + //Open playlist OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); } //Add song to loaded playlist @@ -407,6 +413,7 @@ namespace Vocaluxe.Screens gm = GameModes.EGameMode.TR_GAMEMODE_DUET; else gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; + //Add song to playlist CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); Playlists[htPlaylists(Playlist)].UpdatePlaylist(); } @@ -645,6 +652,9 @@ namespace Vocaluxe.Screens _SongOptionsActive = !_SongOptionsActive; if (_SongOptionsActive) { + EGameMode LastMode = EGameMode.TR_GAMEMODE_NORMAL; + if (_AvailableGameModes.Count > 0) + LastMode = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; SetInteractionToButton(Buttons[htButtons(ButtonOptionsSing)]); _AvailableGameModes.Clear(); SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Clear(); @@ -665,6 +675,12 @@ namespace Vocaluxe.Screens SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(GameModes.EGameMode), GameModes.EGameMode.TR_GAMEMODE_MEDLEY)); _AvailableGameModes.Add(GameModes.EGameMode.TR_GAMEMODE_MEDLEY); } + //Set SelectSlide-Selection to last selected game-mode if possible + for (int i = 0; i < _AvailableGameModes.Count; i++) + { + if (_AvailableGameModes[i] == LastMode) + SelectSlides[htSelectSlides(SelectSlideOptionsMode)].SetSelectionByValueIndex(i); + } SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible = true; SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Visible = true; Buttons[htButtons(ButtonOptionsClose)].Visible = true; From fa26226701b8862f3fd3099b97ab1a3b4f73d42c Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 8 Sep 2012 12:46:11 +0200 Subject: [PATCH 46/70] Scroll through scores on ScoreScreen with MouseWheel. --- Vocaluxe/Screens/CScreenScore.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Vocaluxe/Screens/CScreenScore.cs b/Vocaluxe/Screens/CScreenScore.cs index af44c2aa..17f7b158 100644 --- a/Vocaluxe/Screens/CScreenScore.cs +++ b/Vocaluxe/Screens/CScreenScore.cs @@ -92,6 +92,11 @@ namespace Vocaluxe.Screens { base.HandleMouse(MouseEvent); + if (MouseEvent.Wheel != 0) + { + ChangeRound(MouseEvent.Wheel); + } + if (MouseEvent.LB) { CGraphics.FadeTo(EScreens.ScreenHighscore); From 11f58a1ca4c803ad2ae3fadd160f25d6246e18df Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 8 Sep 2012 15:06:34 +0200 Subject: [PATCH 47/70] Fix switching through songs on highscore-screen. Use Left/Right or MiddleButton. --- Vocaluxe/Base/CGame.cs | 5 ++ Vocaluxe/GameModes/CGameMode.cs | 8 ++ Vocaluxe/GameModes/IGameMode.cs | 1 + Vocaluxe/Screens/CScreenHighscore.cs | 126 +++++++++++++++------------ Vocaluxe/Screens/CScreenSing.cs | 4 +- 5 files changed, 86 insertions(+), 58 deletions(-) diff --git a/Vocaluxe/Base/CGame.cs b/Vocaluxe/Base/CGame.cs index 8e136d32..a6323536 100644 --- a/Vocaluxe/Base/CGame.cs +++ b/Vocaluxe/Base/CGame.cs @@ -180,6 +180,11 @@ namespace Vocaluxe.Base return _GameMode.GetSong(Num); } + public static EGameMode GetGameMode(int Num) + { + return _GameMode.GetGameMode(Num); + } + public static int GetNumSongs() { return _GameMode.GetNumSongs(); diff --git a/Vocaluxe/GameModes/CGameMode.cs b/Vocaluxe/GameModes/CGameMode.cs index 8b24af9d..b58ca133 100644 --- a/Vocaluxe/GameModes/CGameMode.cs +++ b/Vocaluxe/GameModes/CGameMode.cs @@ -290,6 +290,14 @@ namespace Vocaluxe.GameModes return null; } + public virtual EGameMode GetGameMode(int Num) + { + if(Num - 1 < _SongQueque.Count && Num > -1) + return _SongQueque[Num].GameMode; + + return EGameMode.TR_GAMEMODE_NORMAL; + } + public virtual CPoints GetPoints() { return _Points; diff --git a/Vocaluxe/GameModes/IGameMode.cs b/Vocaluxe/GameModes/IGameMode.cs index 4d83391f..79a8fefc 100644 --- a/Vocaluxe/GameModes/IGameMode.cs +++ b/Vocaluxe/GameModes/IGameMode.cs @@ -38,5 +38,6 @@ namespace Vocaluxe.GameModes int GetNumSongs(); CSong GetSong(); CSong GetSong(int Num); + EGameMode GetGameMode(int Num); } } diff --git a/Vocaluxe/Screens/CScreenHighscore.cs b/Vocaluxe/Screens/CScreenHighscore.cs index 39882a0a..5704ce63 100644 --- a/Vocaluxe/Screens/CScreenHighscore.cs +++ b/Vocaluxe/Screens/CScreenHighscore.cs @@ -23,7 +23,7 @@ namespace Vocaluxe.Screens private string[] TextScore; private string[] TextDate; - private List _Scores; + private List[] _Scores; private List _NewEntryIDs; private int _Round; private int _Pos; @@ -135,6 +135,17 @@ namespace Vocaluxe.Screens CGraphics.FadeTo(EScreens.ScreenSong); } + if (MouseEvent.MB) + { + int LastRound = _Round; + ChangeRound(1); + if (LastRound == _Round) + { + _Round = 0; + UpdateRound(); + } + } + ChangePos(MouseEvent.Wheel); return true; } @@ -143,7 +154,7 @@ namespace Vocaluxe.Screens { for (int p = 0; p < NumEntrys; p++) { - if (_Pos + p < _Scores.Count) + if (_Pos + p < _Scores[_Round].Count) { Texts[htTexts(TextNumber[p])].Visible = true; Texts[htTexts(TextName[p])].Visible = true; @@ -152,16 +163,16 @@ namespace Vocaluxe.Screens Texts[htTexts(TextNumber[p])].Text = (_Pos + p + 1).ToString(); - string name = _Scores[_Pos + p].Name; - name += " [" + CLanguage.Translate(Enum.GetName(typeof(EGameDifficulty), _Scores[_Pos + p].Difficulty)) + "]"; + string name = _Scores[_Round][_Pos + p].Name; + name += " [" + CLanguage.Translate(Enum.GetName(typeof(EGameDifficulty), _Scores[_Round][_Pos + p].Difficulty)) + "]"; if (_IsDuet) - name += " (P" + (_Scores[_Pos + p].LineNr + 1).ToString() + ")"; + name += " (P" + (_Scores[_Round][_Pos + p].LineNr + 1).ToString() + ")"; Texts[htTexts(TextName[p])].Text = name; - Texts[htTexts(TextScore[p])].Text = _Scores[_Pos + p].Score.ToString("00000"); - Texts[htTexts(TextDate[p])].Text = _Scores[_Pos + p].Date; + Texts[htTexts(TextScore[p])].Text = _Scores[_Round][_Pos + p].Score.ToString("00000"); + Texts[htTexts(TextDate[p])].Text = _Scores[_Round][_Pos + p].Date; - if (isNewEntry(_Scores[_Pos + p].ID) == true) + if (isNewEntry(_Scores[_Round][_Pos + p].ID) == true) { Texts[htTexts(TextNumber[p])].Style = EStyle.BoldItalic; Texts[htTexts(TextName[p])].Style = EStyle.BoldItalic; @@ -185,10 +196,16 @@ namespace Vocaluxe.Screens base.OnShow(); _Round = 0; _Pos = 0; - _Scores = new List(); + CPoints _Points = CGame.GetPoints(); + _Scores = new List[_Points.NumRounds]; + for (int i = 0; i < _Scores.Length; i++) + { + _Scores[i] = new List(); + } _NewEntryIDs.Clear(); AddScoresToDB(); LoadScores(); + UpdateRound(); UpdateGame(); } @@ -239,39 +256,47 @@ namespace Vocaluxe.Screens for (int round = 0; round < points.NumRounds; round++) { SPlayer player = points.GetPlayer(round, CGame.NumPlayer)[0]; - CDataBase.LoadScore(ref _Scores, player); + CDataBase.LoadScore(ref _Scores[round], player); + } + } - if (round == _Round) - { - _IsDuet = false; + private void UpdateRound() + { + _IsDuet = false; + CPoints points = CGame.GetPoints(); + SPlayer player = points.GetPlayer(_Round, CGame.NumPlayer)[0]; + CSong song = CGame.GetSong(_Round+1); + if (song == null) + return; - CSong song = CSongs.GetSong(player.SongID); - Texts[htTexts(TextSongName)].Text = song.Artist + " - " + song.Title; + Texts[htTexts(TextSongName)].Text = song.Artist + " - " + song.Title; + if (points.NumRounds > 1) + { + Texts[htTexts(TextSongName)].Text += " (" + (_Round+1) + "/" + points.NumRounds + ")"; + } - switch (CGame.GameMode) - { - case EGameMode.TR_GAMEMODE_NORMAL: - Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_NORMAL"; - break; + switch (CGame.GetGameMode(_Round)) + { + case EGameMode.TR_GAMEMODE_NORMAL: + Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_NORMAL"; + break; - case EGameMode.TR_GAMEMODE_MEDLEY: - Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_MEDLEY"; - break; + case EGameMode.TR_GAMEMODE_MEDLEY: + Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_MEDLEY"; + break; - case EGameMode.TR_GAMEMODE_DUET: - Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_DUET"; - _IsDuet = true; - break; + case EGameMode.TR_GAMEMODE_DUET: + Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_DUET"; + _IsDuet = true; + break; - case EGameMode.TR_GAMEMODE_SHORTSONG: - Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_SHORTSONG"; - break; + case EGameMode.TR_GAMEMODE_SHORTSONG: + Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_SHORTSONG"; + break; - default: - Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_NORMAL"; - break; - } - } + default: + Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_NORMAL"; + break; } } @@ -279,7 +304,7 @@ namespace Vocaluxe.Screens { if (Num > 0) { - if (_Pos + Num + NumEntrys < _Scores.Count) + if (_Pos + Num + NumEntrys < _Scores[_Round].Count) _Pos += Num; } if (Num < 0) @@ -292,27 +317,14 @@ namespace Vocaluxe.Screens private void ChangeRound(int Num) { - CPoints points = CGame.GetPoints(); - if (points.NumRounds < 2) - return; - - _Round += Num; - - if (Num > 0) - { - if (_Round >= points.NumRounds) - _Round = 0; - - LoadScores(); - } - - if (Num < 0) - { - if (_Round < 0) - _Round = points.NumRounds - 1; - - LoadScores(); - } + CPoints _Points = CGame.GetPoints(); + if (_Round + Num < _Points.NumRounds && _Round + Num > -1) + _Round += Num; + else if (_Round + Num >= _Points.NumRounds) + _Round = _Points.NumRounds - 1; + else if (_Round + Num < 0) + _Round = 0; + UpdateRound(); } } } diff --git a/Vocaluxe/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs index 1843757d..0eee0001 100644 --- a/Vocaluxe/Screens/CScreenSing.cs +++ b/Vocaluxe/Screens/CScreenSing.cs @@ -658,7 +658,9 @@ namespace Vocaluxe.Screens private void Stop() { - CGame.NextRound(); + //Need this to set other songs to points-var + while(!CGame.IsFinished()) + CGame.NextRound(); CGraphics.FadeTo(EScreens.ScreenScore); _FadeOut = true; From 9907c56909f69bb1e627bc5cbd2a69d670cfcb05 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 8 Sep 2012 15:35:34 +0200 Subject: [PATCH 48/70] Fix visibility of skip-button in pause-menu. --- Vocaluxe/Screens/CScreenSing.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vocaluxe/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs index 0eee0001..76fbbdff 100644 --- a/Vocaluxe/Screens/CScreenSing.cs +++ b/Vocaluxe/Screens/CScreenSing.cs @@ -766,7 +766,7 @@ namespace Vocaluxe.Screens { Buttons[htButtons(ButtonCancel)].Visible = true; Buttons[htButtons(ButtonContinue)].Visible = true; - if (CGame.NumRounds > CGame.RoundNr) + if (CGame.NumRounds > CGame.RoundNr && CGame.NumRounds != 1) Buttons[htButtons(ButtonSkip)].Visible = true; CSound.Pause(_CurrentStream); }else From 2d51ad649c9a2c6f910ddc5ffec61b2522552416 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Thu, 1 Nov 2012 14:26:53 +0100 Subject: [PATCH 49/70] Fix adding of new playlist. --- Vocaluxe/Screens/CScreenSong.cs | 181 ++++++++++++-------------------- 1 file changed, 66 insertions(+), 115 deletions(-) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 3ef04745..9b36d03d 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -228,63 +228,7 @@ namespace Vocaluxe.Screens } else if (Buttons[htButtons(ButtonOptionsPlaylist)].Selected) { - //Open a playlist and add song - if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1)) - { - //Check selected game-mode - EGameMode gm; - if (_AvailableGameModes.Count >= SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection) - gm = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; - else - if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) - gm = GameModes.EGameMode.TR_GAMEMODE_DUET; - else - gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; - //Check if Playlist really exists - if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1 < 0) - Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); - else - Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1; - //Add song to playlist - CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); - //Open playlist - OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); - } - //Create a new playlist and add song - else if ((SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1) == -1) - { - //Check selected game-mode - EGameMode gm; - if (_AvailableGameModes.Count >= SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection) - gm = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; - else - if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) - gm = GameModes.EGameMode.TR_GAMEMODE_DUET; - else - gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; - //Create new playlist - Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); - //Add song to playlist - CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); - //Open playlist - OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); - } - //Add song to loaded playlist - else - { - //Check selected game-mode - EGameMode gm; - if (_AvailableGameModes.Count >= SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection) - gm = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; - else - if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) - gm = GameModes.EGameMode.TR_GAMEMODE_DUET; - else - gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; - CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); - Playlists[htPlaylists(Playlist)].UpdatePlaylist(); - } - ToggleSongOptions(); + OpenPlaylistAction(); } break; @@ -360,64 +304,7 @@ namespace Vocaluxe.Screens } else if (Buttons[htButtons(ButtonOptionsPlaylist)].Selected) { - //Open a playlist and add song - if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1)) - { - //Check selected game-mode - EGameMode gm; - if (_AvailableGameModes.Count >= SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection) - gm = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; - else - if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) - gm = GameModes.EGameMode.TR_GAMEMODE_DUET; - else - gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; - //Check if playlist really exists - if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1 < 0) - Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); - else - Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1; - //Add song to playlist - CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); - //Open playlist - OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); - } - //Create a new playlist and add song - else if ((SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1) == -1) - { - //Check selected game-mode - EGameMode gm; - if (_AvailableGameModes.Count >= SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection) - gm = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; - else - if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) - gm = GameModes.EGameMode.TR_GAMEMODE_DUET; - else - gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; - //Create new playlist - Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); - //Add song to playlist - CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); - //Open playlist - OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); - } - //Add song to loaded playlist - else - { - //Check selected game-mode - EGameMode gm; - if (_AvailableGameModes.Count >= SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection) - gm = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; - else - if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) - gm = GameModes.EGameMode.TR_GAMEMODE_DUET; - else - gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; - //Add song to playlist - CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); - Playlists[htPlaylists(Playlist)].UpdatePlaylist(); - } - ToggleSongOptions(); + OpenPlaylistAction(); } } if (MouseEvent.RB) @@ -731,5 +618,69 @@ namespace Vocaluxe.Screens SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].AddValue("TR_SCREENSONG_NEWPLAYLIST"); SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].AddValues(CPlaylists.PlaylistNames); } + + private void OpenPlaylistAction() + { + //Open a playlist and add song + if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1)) + { + //Check selected game-mode + EGameMode gm; + if (_AvailableGameModes.Count >= SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection) + gm = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; + else + if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) + gm = GameModes.EGameMode.TR_GAMEMODE_DUET; + else + gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; + //Check if Playlist really exists + if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1 < 0) + Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); + else + Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1; + //Add song to playlist + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); + //Open playlist + OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); + } + //Create a new playlist and add song + else if ((SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1) == -1) + { + //Check selected game-mode + EGameMode gm; + if (_AvailableGameModes.Count >= SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection) + gm = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; + else + if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) + gm = GameModes.EGameMode.TR_GAMEMODE_DUET; + else + gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; + //Create new playlist + Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); + //Add song to playlist + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); + //Open playlist + OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); + //Add new playlist to select-slide + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].AddValue(CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].PlaylistName); + + } + //Add song to loaded playlist + else + { + //Check selected game-mode + EGameMode gm; + if (_AvailableGameModes.Count >= SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection) + gm = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; + else + if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) + gm = GameModes.EGameMode.TR_GAMEMODE_DUET; + else + gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); + Playlists[htPlaylists(Playlist)].UpdatePlaylist(); + } + ToggleSongOptions(); + } } } From 8671178e4b1663bef9781379b527f6563945a194 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Thu, 1 Nov 2012 14:40:56 +0100 Subject: [PATCH 50/70] Fix Skip-Song-Button in pause-menu. --- Vocaluxe/Screens/CScreenSing.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Vocaluxe/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs index 76fbbdff..7f697b5e 100644 --- a/Vocaluxe/Screens/CScreenSing.cs +++ b/Vocaluxe/Screens/CScreenSing.cs @@ -766,8 +766,10 @@ namespace Vocaluxe.Screens { Buttons[htButtons(ButtonCancel)].Visible = true; Buttons[htButtons(ButtonContinue)].Visible = true; - if (CGame.NumRounds > CGame.RoundNr && CGame.NumRounds != 1) + if (CGame.NumRounds > CGame.RoundNr && CGame.NumRounds > 1) Buttons[htButtons(ButtonSkip)].Visible = true; + else + Buttons[htButtons(ButtonSkip)].Visible = false; CSound.Pause(_CurrentStream); }else { From 5537d78f5d16d1b427c4ddf1f7655d0628487fae Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Thu, 1 Nov 2012 14:43:57 +0100 Subject: [PATCH 51/70] Create playlist-folder if not exists and remove Test.xml. --- Output/Playlists/Test.xml | 23 ----------------------- Vocaluxe/Base/CSettings.cs | 1 + 2 files changed, 1 insertion(+), 23 deletions(-) delete mode 100644 Output/Playlists/Test.xml diff --git a/Output/Playlists/Test.xml b/Output/Playlists/Test.xml deleted file mode 100644 index 8e5b1b98..00000000 --- a/Output/Playlists/Test.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - Test - - - - 2raumwohnung - 36 grad - TR_GAMEMODE_NORMAL - - - Aura Dione - Geronimo - TR_GAMEMODE_SHORTSONG - - - Die Toten Hosen - Tage wie diese - TR_GAMEMODE_MEDLEY - - - \ No newline at end of file diff --git a/Vocaluxe/Base/CSettings.cs b/Vocaluxe/Base/CSettings.cs index 0d844070..7fb800f8 100644 --- a/Vocaluxe/Base/CSettings.cs +++ b/Vocaluxe/Base/CSettings.cs @@ -185,6 +185,7 @@ namespace Vocaluxe.Base Folders.Add(sFolderScreenshots); Folders.Add(sFolderBackgroundMusic); Folders.Add(sFolderSounds); + Folders.Add(sFolderPlaylists); foreach (string folder in Folders) { From 2115e75717846b782e632f51482a4ddc76ad162e Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Thu, 1 Nov 2012 14:54:17 +0100 Subject: [PATCH 52/70] Added new command-line-parameter for playlist-folder: "PlaylistFolder". --- Vocaluxe/Base/CConfig.cs | 5 +++++ Vocaluxe/Base/CSettings.cs | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Vocaluxe/Base/CConfig.cs b/Vocaluxe/Base/CConfig.cs index 4589654e..60a30d7d 100644 --- a/Vocaluxe/Base/CConfig.cs +++ b/Vocaluxe/Base/CConfig.cs @@ -933,6 +933,11 @@ namespace Vocaluxe.Base CSettings.sFileHighscoreDB = value; } break; + + case "playlistfolder": + CSettings.CreateFolder(value); + CSettings.sFolderPlaylists = value; + break; } } } diff --git a/Vocaluxe/Base/CSettings.cs b/Vocaluxe/Base/CSettings.cs index 7fb800f8..5fe0fb8b 100644 --- a/Vocaluxe/Base/CSettings.cs +++ b/Vocaluxe/Base/CSettings.cs @@ -94,7 +94,7 @@ namespace Vocaluxe.Base public const string sFolderLanguages = "Languages"; public const string sFolderScreenshots = "Screenshots"; public const string sFolderBackgroundMusic = "BackgroundMusic"; - public const string sFolderPlaylists = "Playlists"; + public static string sFolderPlaylists = "Playlists"; //public const String[] ToneStrings = new String[]{ "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B" }; public const int ToneMin = -36; @@ -194,5 +194,11 @@ namespace Vocaluxe.Base Directory.CreateDirectory(path); } } + + public static void CreateFolder(string path) + { + if (!Directory.Exists(path)) + Directory.CreateDirectory(path); + } } } From 0a1f5e31d51bb3510c9ba581bb4f5b580c01b036 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Thu, 1 Nov 2012 16:30:03 +0100 Subject: [PATCH 53/70] Added another song-menu for general options: select random, sing all/visible, open playlist. Open this menu with space or clicking on song-video. --- Output/Languages/Deutsch.xml | 4 + Output/Languages/English.xml | 4 + Output/Themes/Ambient/Screens/ScreenSong.xml | 318 ++++++++++++++++++- Vocaluxe/Screens/CScreenSong.cs | 208 ++++++++---- 4 files changed, 476 insertions(+), 58 deletions(-) diff --git a/Output/Languages/Deutsch.xml b/Output/Languages/Deutsch.xml index 70908b0c..8fe726bf 100644 --- a/Output/Languages/Deutsch.xml +++ b/Output/Languages/Deutsch.xml @@ -122,6 +122,10 @@ Lied singen Zur Playlist hinzufügen Schließen + Zufälligen Song wählen + Alle Songs singen + Alle sichtbaren Song singen + Playlist öffnen Neue Playlist Lied-Optionen Suche: diff --git a/Output/Languages/English.xml b/Output/Languages/English.xml index 56fce85b..10b2e4fa 100644 --- a/Output/Languages/English.xml +++ b/Output/Languages/English.xml @@ -122,6 +122,10 @@ Sing Add to playlist Close + Select a random song + Sing all songs + Sing all visible songs + Open playlist New Playlist Song Options Search: diff --git a/Output/Themes/Ambient/Screens/ScreenSong.xml b/Output/Themes/Ambient/Screens/ScreenSong.xml index cce3abd5..3d744951 100644 --- a/Output/Themes/Ambient/Screens/ScreenSong.xml +++ b/Output/Themes/Ambient/Screens/ScreenSong.xml @@ -200,7 +200,7 @@ - 200 + 220 45 -2,11 @@ -235,7 +235,7 @@ Button 40 - 290 + 360 -2,11 360 40 @@ -375,6 +375,251 @@ + + + Button + + Button + + 40 + 135 + -2,11 + 360 + 40 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + TR_SCREENSONG_BUTTON_SINGALL + + + + + + + + + + + Button + + Button + + 40 + 180 + -2,11 + 360 + 40 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + TR_SCREENSONG_BUTTON_SINGALLVISIBLE + + + + + + + + + + + Button + + Button + + 40 + 90 + -2,11 + 360 + 40 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + TR_SCREENSONG_BUTTON_RANDOM + + + + + + + + + + + Button + + Button + + 40 + 275 + -2,11 + 360 + 40 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + TR_SCREENSONG_BUTTON_OPENPLAYLIST + + + + + + + + + + + Invisible + + Invisible + + 40 + 40 + -1,01 + 360 + 360 + + + Invisible + + + Invisible + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + + + + + + + + + Button @@ -440,7 +685,7 @@ 1 - + Button @@ -504,7 +749,72 @@ Bold 1 - + + + + Button + + SelectSlideArrowLeft + + SelectSlideArrowRight + + SelectSlide + + SelectSlideArrowLeft + + SelectSlideArrowRight + + SelectSlide + + 40 + 230 + -2,11 + 360 + 40 + + 45 + 235 + -2,12 + 30 + 30 + + 365 + 235 + -2,12 + 30 + 30 + + + ButtonColor + + + ButtonSColor + + + SelectSlideHColor + + + ArrowColor + + + ArrowSColor + + + TextColor + + + TextSColor + + 30,00 + + 280,00 + + Outline + + Bold + + 1 + CoverTile diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 9b36d03d..d50d391d 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -17,6 +17,13 @@ namespace Vocaluxe.Screens { class CScreenSong : CMenu { + enum ESongOptionsView + { + None, + Song, + General + } + // Version number for theme files. Increment it, if you've changed something on the theme files! const int ScreenVersion = 3; @@ -26,12 +33,18 @@ namespace Vocaluxe.Screens private const string TextSearchBar = "TextSearchBar"; private const string TextOptionsTitle = "TextOptionsTitle"; + private const string ButtonOpenOptions = "ButtonOpenOptions"; private const string ButtonOptionsSing = "ButtonOptionsSing"; private const string ButtonOptionsPlaylist = "ButtonOptionsPlaylist"; private const string ButtonOptionsClose = "ButtonOptionsClose"; + private const string ButtonOptionsRandom = "ButtonOptionsRandom"; + private const string ButtonOptionsSingAll = "ButtonOptionsSingAll"; + private const string ButtonOptionsSingAllVisible = "ButtonOptionsSingAllVisible"; + private const string ButtonOptionsOpenPlaylist = "ButtonOptionsOpenPlaylist"; private const string SelectSlideOptionsMode = "SelectSlideOptionsMode"; - private const string SelectSlideOptionsPlaylist = "SelectSlideOptionsPlaylist"; + private const string SelectSlideOptionsPlaylistAdd = "SelectSlideOptionsPlaylistAdd"; + private const string SelectSlideOptionsPlaylistOpen = "SelectSlideOptionsPlaylistOpen"; private const string StaticSearchBar = "StaticSearchBar"; private const string StaticOptionsBG = "StaticOptionsBG"; @@ -60,8 +73,8 @@ namespace Vocaluxe.Screens _ScreenVersion = ScreenVersion; _ThemeStatics = new string[] { StaticSearchBar, StaticOptionsBG }; _ThemeTexts = new string[] { TextCategory, TextSelection, TextSearchBarTitle, TextSearchBar, TextOptionsTitle }; - _ThemeButtons = new string[] { ButtonOptionsClose, ButtonOptionsPlaylist, ButtonOptionsSing }; - _ThemeSelectSlides = new string[] { SelectSlideOptionsMode, SelectSlideOptionsPlaylist }; + _ThemeButtons = new string[] { ButtonOptionsClose, ButtonOptionsPlaylist, ButtonOptionsSing, ButtonOptionsRandom, ButtonOptionsSingAll, ButtonOptionsSingAllVisible, ButtonOptionsOpenPlaylist, ButtonOpenOptions }; + _ThemeSelectSlides = new string[] { SelectSlideOptionsMode, SelectSlideOptionsPlaylistAdd, SelectSlideOptionsPlaylistOpen }; _ThemeSongMenus = new string[] { SongMenu }; _ThemePlaylists = new string[] { Playlist }; } @@ -70,10 +83,15 @@ namespace Vocaluxe.Screens { base.LoadTheme(); SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible = false; - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Visible = false; + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Visible = false; + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Visible = false; Buttons[htButtons(ButtonOptionsClose)].Visible = false; Buttons[htButtons(ButtonOptionsSing)].Visible = false; Buttons[htButtons(ButtonOptionsPlaylist)].Visible = false; + Buttons[htButtons(ButtonOptionsRandom)].Visible = false; + Buttons[htButtons(ButtonOptionsSingAll)].Visible = false; + Buttons[htButtons(ButtonOptionsSingAllVisible)].Visible = false; + Buttons[htButtons(ButtonOptionsOpenPlaylist)].Visible = false; Texts[htTexts(TextOptionsTitle)].Visible = false; Statics[htStatics(StaticOptionsBG)].Visible = false; Playlists[htPlaylists(Playlist)].Visible = false; @@ -129,7 +147,7 @@ namespace Vocaluxe.Screens if (CSongs.NumVisibleSongs > 0) { if (SongMenus[htSongMenus(SongMenu)].GetSelectedSong() != -1 && !_SongOptionsActive) - ToggleSongOptions(); + ToggleSongOptions(ESongOptionsView.Song); } break; @@ -153,6 +171,10 @@ namespace Vocaluxe.Screens break; + case Keys.Space: + ToggleSongOptions(ESongOptionsView.General); + break; + case Keys.F3: if (_SearchActive) { @@ -166,7 +188,7 @@ namespace Vocaluxe.Screens } break; - //TODO: Move that to the new menu and delete it! + //TODO: Delete it! ??? Shouldn't we keep this as shortcut? case Keys.A: if (!_SearchActive && KeyEvent.Mod == Modifier.None) { @@ -219,14 +241,33 @@ namespace Vocaluxe.Screens case Keys.Enter: if (Buttons[htButtons(ButtonOptionsClose)].Selected) { - ToggleSongOptions(); + ToggleSongOptions(ESongOptionsView.None); } else if (Buttons[htButtons(ButtonOptionsSing)].Selected) { - ToggleSongOptions(); + ToggleSongOptions(ESongOptionsView.None); StartSong(SongMenus[htSongMenus(SongMenu)].GetSelectedSong()); } else if (Buttons[htButtons(ButtonOptionsPlaylist)].Selected) + { + OpenAndAddPlaylistAction(); + } + else if (Buttons[htButtons(ButtonOptionsRandom)].Selected) + { + if (CSongs.Category != -1) + { + SongMenus[htSongMenus(SongMenu)].SetSelectedSong(CSongs.GetRandomSong()); + } + } + else if (Buttons[htButtons(ButtonOptionsSingAll)].Selected) + { + StartRandomAllSongs(); + } + else if (Buttons[htButtons(ButtonOptionsSingAllVisible)].Selected) + { + StartRandomVisibleSongs(); + } + else if (Buttons[htButtons(ButtonOptionsOpenPlaylist)].Selected) { OpenPlaylistAction(); } @@ -234,7 +275,8 @@ namespace Vocaluxe.Screens case Keys.Escape: case Keys.Back: - ToggleSongOptions(); + case Keys.Space: + ToggleSongOptions(ESongOptionsView.None); break; } } @@ -270,7 +312,7 @@ namespace Vocaluxe.Screens CGraphics.FadeTo(EScreens.ScreenMain); } else if (MouseEvent.RB && _SongOptionsActive) - ToggleSongOptions(); + ToggleSongOptions(ESongOptionsView.None); if (MouseEvent.MB && CSongs.Category != -1) { @@ -284,7 +326,14 @@ namespace Vocaluxe.Screens { if (SongMenus[htSongMenus(SongMenu)].GetSelectedSong() != -1 && !_SongOptionsActive) { - ToggleSongOptions(); + ToggleSongOptions(ESongOptionsView.Song); + } + } + else if (MouseEvent.LB && IsMouseOver(MouseEvent)) + { + if (Buttons[htButtons(ButtonOpenOptions)].Selected) + { + ToggleSongOptions(ESongOptionsView.General); } } } @@ -295,21 +344,42 @@ namespace Vocaluxe.Screens { if (Buttons[htButtons(ButtonOptionsClose)].Selected) { - ToggleSongOptions(); + ToggleSongOptions(ESongOptionsView.None); } else if (Buttons[htButtons(ButtonOptionsSing)].Selected) { - ToggleSongOptions(); + ToggleSongOptions(ESongOptionsView.None); StartSong(SongMenus[htSongMenus(SongMenu)].GetSelectedSong()); } else if (Buttons[htButtons(ButtonOptionsPlaylist)].Selected) + { + OpenAndAddPlaylistAction(); + } + else if (Buttons[htButtons(ButtonOptionsRandom)].Selected) + { + if (CSongs.Category != -1) + { + SongMenus[htSongMenus(SongMenu)].SetSelectedSong(CSongs.GetRandomSong()); + } + } + else if (Buttons[htButtons(ButtonOptionsSingAll)].Selected) + { + ToggleSongOptions(ESongOptionsView.None); + StartRandomAllSongs(); + } + else if (Buttons[htButtons(ButtonOptionsSingAllVisible)].Selected) + { + ToggleSongOptions(ESongOptionsView.None); + StartRandomVisibleSongs(); + } + else if (Buttons[htButtons(ButtonOptionsOpenPlaylist)].Selected) { OpenPlaylistAction(); } } if (MouseEvent.RB) { - ToggleSongOptions(); + ToggleSongOptions(ESongOptionsView.None); } } @@ -534,55 +604,71 @@ namespace Vocaluxe.Screens SongMenus[htSongMenus(SongMenu)].OnShow(); } - private void ToggleSongOptions() + private void ToggleSongOptions(ESongOptionsView view) { _SongOptionsActive = !_SongOptionsActive; if (_SongOptionsActive) { - EGameMode LastMode = EGameMode.TR_GAMEMODE_NORMAL; - if (_AvailableGameModes.Count > 0) - LastMode = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; - SetInteractionToButton(Buttons[htButtons(ButtonOptionsSing)]); - _AvailableGameModes.Clear(); - SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Clear(); - if (!CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) + if (view == ESongOptionsView.Song) { - SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(GameModes.EGameMode), GameModes.EGameMode.TR_GAMEMODE_NORMAL)); - _AvailableGameModes.Add(GameModes.EGameMode.TR_GAMEMODE_NORMAL); - SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(GameModes.EGameMode), GameModes.EGameMode.TR_GAMEMODE_SHORTSONG)); - _AvailableGameModes.Add(GameModes.EGameMode.TR_GAMEMODE_SHORTSONG); + EGameMode LastMode = EGameMode.TR_GAMEMODE_NORMAL; + if (_AvailableGameModes.Count > 0) + LastMode = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; + SetInteractionToButton(Buttons[htButtons(ButtonOptionsSing)]); + _AvailableGameModes.Clear(); + SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Clear(); + if (!CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) + { + SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(GameModes.EGameMode), GameModes.EGameMode.TR_GAMEMODE_NORMAL)); + _AvailableGameModes.Add(GameModes.EGameMode.TR_GAMEMODE_NORMAL); + SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(GameModes.EGameMode), GameModes.EGameMode.TR_GAMEMODE_SHORTSONG)); + _AvailableGameModes.Add(GameModes.EGameMode.TR_GAMEMODE_SHORTSONG); + } + if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) + { + SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(GameModes.EGameMode), GameModes.EGameMode.TR_GAMEMODE_DUET)); + _AvailableGameModes.Add(GameModes.EGameMode.TR_GAMEMODE_DUET); + } + if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].Medley.Source != EMedleySource.None) + { + SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(GameModes.EGameMode), GameModes.EGameMode.TR_GAMEMODE_MEDLEY)); + _AvailableGameModes.Add(GameModes.EGameMode.TR_GAMEMODE_MEDLEY); + } + //Set SelectSlide-Selection to last selected game-mode if possible + for (int i = 0; i < _AvailableGameModes.Count; i++) + { + if (_AvailableGameModes[i] == LastMode) + SelectSlides[htSelectSlides(SelectSlideOptionsMode)].SetSelectionByValueIndex(i); + } + SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible = true; + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Visible = true; + Buttons[htButtons(ButtonOptionsSing)].Visible = true; + Buttons[htButtons(ButtonOptionsPlaylist)].Visible = true; } - if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) + else if (view == ESongOptionsView.General) { - SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(GameModes.EGameMode), GameModes.EGameMode.TR_GAMEMODE_DUET)); - _AvailableGameModes.Add(GameModes.EGameMode.TR_GAMEMODE_DUET); + Buttons[htButtons(ButtonOptionsRandom)].Visible = CSongs.Category != -1; + Buttons[htButtons(ButtonOptionsSingAll)].Visible = true; + Buttons[htButtons(ButtonOptionsSingAllVisible)].Visible = true; + Buttons[htButtons(ButtonOptionsOpenPlaylist)].Visible = true; + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Visible = true; } - if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].Medley.Source != EMedleySource.None) - { - SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(GameModes.EGameMode), GameModes.EGameMode.TR_GAMEMODE_MEDLEY)); - _AvailableGameModes.Add(GameModes.EGameMode.TR_GAMEMODE_MEDLEY); - } - //Set SelectSlide-Selection to last selected game-mode if possible - for (int i = 0; i < _AvailableGameModes.Count; i++) - { - if (_AvailableGameModes[i] == LastMode) - SelectSlides[htSelectSlides(SelectSlideOptionsMode)].SetSelectionByValueIndex(i); - } - SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible = true; - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Visible = true; Buttons[htButtons(ButtonOptionsClose)].Visible = true; - Buttons[htButtons(ButtonOptionsSing)].Visible = true; - Buttons[htButtons(ButtonOptionsPlaylist)].Visible = true; Texts[htTexts(TextOptionsTitle)].Visible = true; Statics[htStatics(StaticOptionsBG)].Visible = true; } else { SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible = false; - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Visible = false; + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Visible = false; + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Visible = false; Buttons[htButtons(ButtonOptionsClose)].Visible = false; Buttons[htButtons(ButtonOptionsSing)].Visible = false; Buttons[htButtons(ButtonOptionsPlaylist)].Visible = false; + Buttons[htButtons(ButtonOptionsRandom)].Visible = false; + Buttons[htButtons(ButtonOptionsSingAll)].Visible = false; + Buttons[htButtons(ButtonOptionsSingAllVisible)].Visible = false; + Buttons[htButtons(ButtonOptionsOpenPlaylist)].Visible = false; Texts[htTexts(TextOptionsTitle)].Visible = false; Statics[htStatics(StaticOptionsBG)].Visible = false; } @@ -614,15 +700,29 @@ namespace Vocaluxe.Screens private void UpdatePlaylistNames() { - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Clear(); - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].AddValue("TR_SCREENSONG_NEWPLAYLIST"); - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].AddValues(CPlaylists.PlaylistNames); + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Clear(); + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].AddValue("TR_SCREENSONG_NEWPLAYLIST"); + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].AddValues(CPlaylists.PlaylistNames); + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Clear(); + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].AddValues(CPlaylists.PlaylistNames); } private void OpenPlaylistAction() + { + //Open a playlist + if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Selection)) + { + Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Selection; + //Open playlist + OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); + } + ToggleSongOptions(ESongOptionsView.None); + } + + private void OpenAndAddPlaylistAction() { //Open a playlist and add song - if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1)) + if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Selection - 1)) { //Check selected game-mode EGameMode gm; @@ -634,17 +734,17 @@ namespace Vocaluxe.Screens else gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; //Check if Playlist really exists - if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1 < 0) + if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Selection - 1 < 0) Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); else - Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1; + Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Selection - 1; //Add song to playlist CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); //Open playlist OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); } //Create a new playlist and add song - else if ((SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1) == -1) + else if ((SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Selection - 1) == -1) { //Check selected game-mode EGameMode gm; @@ -662,7 +762,7 @@ namespace Vocaluxe.Screens //Open playlist OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); //Add new playlist to select-slide - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].AddValue(CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].PlaylistName); + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].AddValue(CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].PlaylistName); } //Add song to loaded playlist @@ -680,7 +780,7 @@ namespace Vocaluxe.Screens CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); Playlists[htPlaylists(Playlist)].UpdatePlaylist(); } - ToggleSongOptions(); + ToggleSongOptions(ESongOptionsView.Song); } } } From 754a4acf57f318e8e7dfe231d6be6ca9850435a4 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Thu, 1 Nov 2012 16:33:00 +0100 Subject: [PATCH 54/70] Update screensong-changelog. --- Output/Themes/Changelog/Changelog_ScreenSong.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Output/Themes/Changelog/Changelog_ScreenSong.txt b/Output/Themes/Changelog/Changelog_ScreenSong.txt index e78df639..c1402b34 100644 --- a/Output/Themes/Changelog/Changelog_ScreenSong.txt +++ b/Output/Themes/Changelog/Changelog_ScreenSong.txt @@ -4,10 +4,10 @@ ScreenSong Version 3: Add: -, , -, -, , , , , , -, + + +, , , , , , , +, , and as a new Screen-Element. For details, look at ScreenSong.xml From 3e8f34569d8c31c0a897ca9767e405950b3e9449 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Thu, 1 Nov 2012 16:56:54 +0100 Subject: [PATCH 55/70] Fix crashing when start singing of background-music-song. --- Vocaluxe/Screens/CPopupScreenPlayerControl.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vocaluxe/Screens/CPopupScreenPlayerControl.cs b/Vocaluxe/Screens/CPopupScreenPlayerControl.cs index e3d614d8..8e7d8ad9 100644 --- a/Vocaluxe/Screens/CPopupScreenPlayerControl.cs +++ b/Vocaluxe/Screens/CPopupScreenPlayerControl.cs @@ -218,7 +218,7 @@ namespace Vocaluxe.Screens CGame.ClearSongs(); EGameMode gm = EGameMode.TR_GAMEMODE_NORMAL; - if (CSongs.VisibleSongs[SongNr].IsDuet) + if (CSongs.AllSongs[SongNr].IsDuet) gm = EGameMode.TR_GAMEMODE_DUET; CGame.AddSong(SongNr, gm); From ade608e1bd91ce42ecd711fce3e9b9bab7f16424 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Fri, 2 Nov 2012 11:54:06 +0100 Subject: [PATCH 56/70] Fix singig all visible songs. --- Vocaluxe/Screens/CScreenSong.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index d50d391d..75b66d10 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -543,7 +543,7 @@ namespace Vocaluxe.Screens int SongNr = IDs[CGame.Rand.Next(IDs.Count)]; EGameMode gm = EGameMode.TR_GAMEMODE_NORMAL; - if (CSongs.VisibleSongs[SongNr].IsDuet) + if (CSongs.AllSongs[SongNr].IsDuet) gm = EGameMode.TR_GAMEMODE_DUET; CGame.AddSong(SongNr, gm); From 64a1fade5cbefa247d8c51d7652d79617c833ade Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Thu, 29 Nov 2012 20:12:55 +0100 Subject: [PATCH 57/70] fixed mouse hover in song menu --- Vocaluxe/Screens/CScreenSong.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 75b66d10..f5809c12 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -288,12 +288,12 @@ namespace Vocaluxe.Screens { base.HandleMouse(MouseEvent); - if (Playlists[htPlaylists(Playlist)].IsMouseOver(MouseEvent)) + if (Playlists[htPlaylists(Playlist)].Visible && Playlists[htPlaylists(Playlist)].IsMouseOver(MouseEvent)) { _PlaylistActive = true; Playlists[htPlaylists(Playlist)].Selected = _PlaylistActive; SongMenus[htSongMenus(SongMenu)].SetActive(!_PlaylistActive); - } + } else if (CHelper.IsInBounds(SongMenus[htSongMenus(SongMenu)].Rect, MouseEvent.X, MouseEvent.Y)) { _PlaylistActive = false; @@ -301,7 +301,7 @@ namespace Vocaluxe.Screens SongMenus[htSongMenus(SongMenu)].SetActive(!_PlaylistActive); } - if (Playlists[htPlaylists(Playlist)].HandleMouse(MouseEvent)) + if (Playlists[htPlaylists(Playlist)].Visible && Playlists[htPlaylists(Playlist)].HandleMouse(MouseEvent)) return true; if (!_SongOptionsActive) From b10a10cc9f73354f5686cc9699e7ca10372786db Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sat, 1 Dec 2012 13:00:09 +0100 Subject: [PATCH 58/70] better keyboard navigation --- Vocaluxe/Menu/CMenu.cs | 8 ++++---- Vocaluxe/Menu/CObjectInteractions.cs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Vocaluxe/Menu/CMenu.cs b/Vocaluxe/Menu/CMenu.cs index 7089747f..fd4aed88 100644 --- a/Vocaluxe/Menu/CMenu.cs +++ b/Vocaluxe/Menu/CMenu.cs @@ -1681,22 +1681,22 @@ namespace Vocaluxe.Menu switch (Key.Key) { case Keys.Up: - if (vector.Y < 0f && (targetRect.X + targetRect.W > actualRect.X || actualRect.X + actualRect.W > targetRect.X)) + if (vector.Y < 0f && (targetRect.X + targetRect.W > actualRect.X && actualRect.X + actualRect.W > targetRect.X)) inDirection = true; break; case Keys.Down: - if (vector.Y > 0f && (targetRect.X + targetRect.W > actualRect.X || actualRect.X + actualRect.W > targetRect.X)) + if (vector.Y > 0f && (targetRect.X + targetRect.W > actualRect.X && actualRect.X + actualRect.W > targetRect.X)) inDirection = true; break; case Keys.Left: - if (vector.X < 0f && (targetRect.Y + targetRect.H > actualRect.Y || actualRect.Y + actualRect.H > targetRect.Y)) + if (vector.X < 0f && (targetRect.Y + targetRect.H > actualRect.Y && actualRect.Y + actualRect.H > targetRect.Y)) inDirection = true; break; case Keys.Right: - if (vector.X > 0f && (targetRect.Y + targetRect.H > actualRect.Y || actualRect.Y + actualRect.H > targetRect.Y)) + if (vector.X > 0f && (targetRect.Y + targetRect.H > actualRect.Y && actualRect.Y + actualRect.H > targetRect.Y)) inDirection = true; break; diff --git a/Vocaluxe/Menu/CObjectInteractions.cs b/Vocaluxe/Menu/CObjectInteractions.cs index 854d5fd9..f6363187 100644 --- a/Vocaluxe/Menu/CObjectInteractions.cs +++ b/Vocaluxe/Menu/CObjectInteractions.cs @@ -785,22 +785,22 @@ namespace Vocaluxe.Menu switch (Key.Key) { case Keys.Up: - if (vector.Y < 0f && (targetRect.X + targetRect.W > actualRect.X || actualRect.X + actualRect.W > targetRect.X)) + if (vector.Y < 0f && (targetRect.X + targetRect.W > actualRect.X && actualRect.X + actualRect.W > targetRect.X)) inDirection = true; break; case Keys.Down: - if (vector.Y > 0f && (targetRect.X + targetRect.W > actualRect.X || actualRect.X + actualRect.W > targetRect.X)) + if (vector.Y > 0f && (targetRect.X + targetRect.W > actualRect.X && actualRect.X + actualRect.W > targetRect.X)) inDirection = true; break; case Keys.Left: - if (vector.X < 0f && (targetRect.Y + targetRect.H > actualRect.Y || actualRect.Y + actualRect.H > targetRect.Y)) + if (vector.X < 0f && (targetRect.Y + targetRect.H > actualRect.Y && actualRect.Y + actualRect.H > targetRect.Y)) inDirection = true; break; case Keys.Right: - if (vector.X > 0f && (targetRect.Y + targetRect.H > actualRect.Y || actualRect.Y + actualRect.H > targetRect.Y)) + if (vector.X > 0f && (targetRect.Y + targetRect.H > actualRect.Y && actualRect.Y + actualRect.H > targetRect.Y)) inDirection = true; break; From 0b0f0caf546805f3f6f0bae32f9b864ab45fdb38 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 2 Dec 2012 14:20:09 +0100 Subject: [PATCH 59/70] fixed playlist keyboard handling --- Vocaluxe/Lib/Playlist/CPlaylistFile.cs | 6 +- Vocaluxe/Menu/CButton.cs | 14 +- Vocaluxe/Menu/CPlaylist.cs | 516 +++++++++++++------------ Vocaluxe/Menu/CText.cs | 30 +- Vocaluxe/Screens/CScreenSong.cs | 12 +- 5 files changed, 325 insertions(+), 253 deletions(-) diff --git a/Vocaluxe/Lib/Playlist/CPlaylistFile.cs b/Vocaluxe/Lib/Playlist/CPlaylistFile.cs index 0bef3b65..79588ef1 100644 --- a/Vocaluxe/Lib/Playlist/CPlaylistFile.cs +++ b/Vocaluxe/Lib/Playlist/CPlaylistFile.cs @@ -234,7 +234,7 @@ namespace Vocaluxe.Lib.Playlist Songs.RemoveAt(SongNr); } - public void SongDown(int SongNr) + public void SongUp(int SongNr) { if (SongNr != 0) { @@ -242,9 +242,9 @@ namespace Vocaluxe.Lib.Playlist } } - public void SongUp(int SongNr) + public void SongDown(int SongNr) { - if (SongNr + 1 < Songs.Count) + if (SongNr < Songs.Count - 1) { Songs.Reverse(SongNr, 2); } diff --git a/Vocaluxe/Menu/CButton.cs b/Vocaluxe/Menu/CButton.cs index b25c6482..2e018ffa 100644 --- a/Vocaluxe/Menu/CButton.cs +++ b/Vocaluxe/Menu/CButton.cs @@ -42,8 +42,19 @@ namespace Vocaluxe.Menu public float SReflectionSpace; public float SReflectionHeight; - private bool _Selected; public bool Pressed; + + public bool EditMode + { + get { return Text.EditMode; } + set + { + Text.EditMode = value; + SText.EditMode = value; + } + } + + private bool _Selected; public bool Selected { get { return _Selected; } @@ -72,6 +83,7 @@ namespace Vocaluxe.Menu SText = new CText(); Selected = false; Visible = true; + EditMode = false; Reflection = false; ReflectionSpace = 0f; diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs index 96d90907..0e926d45 100644 --- a/Vocaluxe/Menu/CPlaylist.cs +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -96,7 +96,6 @@ namespace Vocaluxe.Menu if (CurrentPlaylistElement == -1 && _Selected && PlaylistElementContents.Count > 0) { CurrentPlaylistElement = 0; - ActiveHover = CurrentPlaylistElement; } } } @@ -104,7 +103,6 @@ namespace Vocaluxe.Menu public EEditMode _EditMode; public int ActivePlaylistID = -1; public int Offset = 0; - public int ActiveHover = -1; public int CurrentPlaylistElement = -1; public CPlaylist() @@ -203,6 +201,7 @@ namespace Vocaluxe.Menu if (_ThemeLoaded) { _Theme.Name = ElementName; + //Check for highest x/y-coords CompleteRect = Rect; //ButtonPlaylistClose @@ -345,7 +344,7 @@ namespace Vocaluxe.Menu for (int i = 0; i < PlaylistElements.Count; i++ ) { - if (i == ActiveHover && _Selected) + if (i == CurrentPlaylistElement && _Selected) { PlaylistElements[i].Background.Texture = CTheme.GetSkinTexture(_Theme.STextureBackgroundName); PlaylistElements[i].Background.Color = BackgroundSColor; @@ -390,17 +389,6 @@ namespace Vocaluxe.Menu { if (Selected) { - int PrevPlaylistElement = CurrentPlaylistElement; - int CurrPlaylistElement = -1; - //_Interactions.HandleInput(KeyEvent); - - for (int i = 0; i < PlaylistElements.Count; i++) - { - //Hover for playlist-element - if (PlaylistElementContents.Count - 1 >= i && PlaylistElements[i].SelectSlide.Selected) - CurrPlaylistElement = i; - } - //Active EditMode ignores other input! if (_EditMode == EEditMode.PlaylistName) { @@ -413,252 +401,294 @@ namespace Vocaluxe.Menu CPlaylists.Playlists[ActivePlaylistID].PlaylistName = _Theme.ButtonPlaylistName.Text.Text; CPlaylists.Playlists[ActivePlaylistID].SavePlaylist(); _EditMode = EEditMode.None; + _Theme.ButtonPlaylistName.EditMode = false; } else if (KeyEvent.Key == Keys.Escape) { _Theme.ButtonPlaylistName.Text.Text = CPlaylists.Playlists[ActivePlaylistID].PlaylistName; _EditMode = EEditMode.None; + _Theme.ButtonPlaylistName.EditMode = false; } else if (KeyEvent.Key == Keys.Back || KeyEvent.Key == Keys.Delete) { if (_Theme.ButtonPlaylistName.Text.Text.Length > 0) _Theme.ButtonPlaylistName.Text.Text = _Theme.ButtonPlaylistName.Text.Text.Remove(_Theme.ButtonPlaylistName.Text.Text.Length - 1); } - } else { - switch (KeyEvent.Key) + if (CurrentPlaylistElement == -1 || PlaylistElementContents.Count == 0 || KeyEvent.ModSHIFT) //no song is selected { - case Keys.Up: - if (CurrentPlaylistElement == -1 && PlaylistElementContents.Count > 0) - { - _Interactions.HandleInput(KeyEvent); - SetSelectionToLastEntry(); - return true; - } - else if (CurrentPlaylistElement == 0 || PlaylistElementContents.Count == 0 || KeyEvent.ModSHIFT) - { - CurrentPlaylistElement = -1; - ActiveHover = CurrentPlaylistElement; - _Interactions.SetInteractionToSelectSlide(PlaylistElements[0].SelectSlide); - _Interactions.HandleInput(KeyEvent); + _Interactions.HandleInput(KeyEvent); + CurrentPlaylistElement = GetSelectedSelectionNr(); - int selection = GetSelectedSelectionNr(); - if (selection != -1 && PlaylistElementContents.Count > selection) + if (CurrentPlaylistElement != -1) + return true; + } + else if (CurrentPlaylistElement != -1) //a song is selected + { + int ScrollLimit = PlaylistElements.Count / 2; + + //special actions if a song is selected + switch (KeyEvent.Key) + { + case Keys.Up: + if (KeyEvent.ModSHIFT) { - CurrentPlaylistElement = selection; - ActiveHover = CurrentPlaylistElement; + _Interactions.SetInteractionToSelectSlide(PlaylistElements[0].SelectSlide); + _Interactions.HandleInput(KeyEvent); + CurrentPlaylistElement = GetSelectedSelectionNr(); } - return true; - } - else if (CurrentPlaylistElement - 1 > 0) - { - _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); - _Interactions.HandleInput(KeyEvent); - - int selection = GetSelectedSelectionNr(); - - if (selection != -1 && PlaylistElementContents.Count > selection) + else if (CurrentPlaylistElement > ScrollLimit || PlaylistElementContents.Count == 0) { - CurrentPlaylistElement = selection; - ActiveHover = CurrentPlaylistElement; + _Interactions.HandleInput(KeyEvent); + CurrentPlaylistElement = GetSelectedSelectionNr(); } - return true; - } - else if (CurrentPlaylistElement - 1 == 0) - { - if (Offset > 0) + else if (CurrentPlaylistElement <= ScrollLimit) { - Offset--; - Update(); + if (Offset > 0) + { + Offset--; + Update(); + } + else + { + _Interactions.HandleInput(KeyEvent); + CurrentPlaylistElement = GetSelectedSelectionNr(); + } } + break; - _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); - _Interactions.HandleInput(KeyEvent); - - int selection = GetSelectedSelectionNr(); - if (selection != -1 && PlaylistElementContents.Count > selection) + case Keys.Down: + if (KeyEvent.ModSHIFT) { - CurrentPlaylistElement = selection; - ActiveHover = CurrentPlaylistElement; + for (int i = PlaylistElements.Count - 1; i >= 0; i--) + { + if (PlaylistElements[i].SelectSlide.Visible) + { + _Interactions.SetInteractionToSelectSlide(PlaylistElements[0].SelectSlide); + _Interactions.HandleInput(KeyEvent); + CurrentPlaylistElement = GetSelectedSelectionNr(); + } + } } - - return true; - } - return false; - - case Keys.Down: - if (CurrentPlaylistElement == -1 && PlaylistElementContents.Count > 0) - { - _Interactions.HandleInput(KeyEvent); - SetSelectionToFirstEntry(); - return true; - } - else if (CurrentPlaylistElement == PlaylistElements.Count - 1 || PlaylistElementContents.Count == 0 || KeyEvent.ModSHIFT) - { - CurrentPlaylistElement = -1; - ActiveHover = CurrentPlaylistElement; - - int sel = PlaylistElementContents.Count - 1; - if (sel > PlaylistElements.Count - 1) - sel = PlaylistElements.Count - 1; - - _Interactions.SetInteractionToSelectSlide(PlaylistElements[sel].SelectSlide); - _Interactions.HandleInput(KeyEvent); - - int selection = GetSelectedSelectionNr(); - if (selection != -1 && PlaylistElementContents.Count > selection) + else if (CurrentPlaylistElement >= ScrollLimit) { - CurrentPlaylistElement = selection; - ActiveHover = CurrentPlaylistElement; + if (Offset < PlaylistElementContents.Count - PlaylistElements.Count) + { + Offset++; + Update(); + } + else + { + _Interactions.HandleInput(KeyEvent); + CurrentPlaylistElement = GetSelectedSelectionNr(); + } } - return true; - } - else if (CurrentPlaylistElement + 1 < PlaylistElements.Count - 1) - { - _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); - _Interactions.HandleInput(KeyEvent); - - int selection = GetSelectedSelectionNr(); - - if (selection != -1 && PlaylistElementContents.Count > selection) + else if (CurrentPlaylistElement < ScrollLimit) { - CurrentPlaylistElement = selection; - ActiveHover = CurrentPlaylistElement; - } - return true; - } - else if (CurrentPlaylistElement + 1 >= PlaylistElements.Count - 1 && CurrentPlaylistElement + Offset + 1 < PlaylistElementContents.Count) - { - if (PlaylistElementContents[CurrentPlaylistElement + Offset + 1].SongID != -1) - { - Offset++; - Update(); + _Interactions.HandleInput(KeyEvent); + CurrentPlaylistElement = GetSelectedSelectionNr(); } + break; - _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); - _Interactions.HandleInput(KeyEvent); - - int selection = GetSelectedSelectionNr(); - if (selection != -1 && PlaylistElementContents.Count > selection) - { - CurrentPlaylistElement = selection; - ActiveHover = CurrentPlaylistElement; - } - - return true; - } - return false; - - case Keys.Delete: - if (CurrentPlaylistElement != -1) - { + case Keys.Delete: CPlaylists.Playlists[ActivePlaylistID].DeleteSong(PlaylistElements[CurrentPlaylistElement].Content); UpdatePlaylist(); + + if (Offset > 0) + Offset--; + + Update(); + + if (PlaylistElementContents.Count - 1 < CurrentPlaylistElement) + { + CurrentPlaylistElement = PlaylistElementContents.Count - 1; + } + if (CurrentPlaylistElement != -1) _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); - return true; - } - return false; + break; + case Keys.Back: + ClosePlaylist(); //really? or better global? + break; + + case Keys.Enter: + StartPlaylistSongs(); + break; + + case Keys.Add: //move the selected song up + if (PlaylistElementContents.Count > 1 && (CurrentPlaylistElement > 0 || Offset > 0)) + { + CPlaylists.Playlists[ActivePlaylistID].SongUp(CurrentPlaylistElement + Offset); + UpdatePlaylist(); + + KeyEvent key = new KeyEvent(); + key.Key = Keys.Up; + + if (CurrentPlaylistElement > ScrollLimit) + { + _Interactions.HandleInput(key); + CurrentPlaylistElement = GetSelectedSelectionNr(); + } + else if (CurrentPlaylistElement <= ScrollLimit) + { + if (Offset > 0) + { + Offset--; + Update(); + } + else + { + _Interactions.HandleInput(key); + CurrentPlaylistElement = GetSelectedSelectionNr(); + } + } + } + break; + + case Keys.Subtract: //move the selected song down + if (PlaylistElementContents.Count > 1 && CurrentPlaylistElement + Offset < PlaylistElementContents.Count - 1) + { + CPlaylists.Playlists[ActivePlaylistID].SongDown(CurrentPlaylistElement + Offset); + UpdatePlaylist(); + + KeyEvent key = new KeyEvent(); + key.Key = Keys.Down; + + if (CurrentPlaylistElement >= ScrollLimit) + { + if (Offset < PlaylistElementContents.Count - PlaylistElements.Count) + { + Offset++; + Update(); + } + else + { + _Interactions.HandleInput(key); + CurrentPlaylistElement = GetSelectedSelectionNr(); + } + } + else if (CurrentPlaylistElement < ScrollLimit) + { + _Interactions.HandleInput(key); + CurrentPlaylistElement = GetSelectedSelectionNr(); + } + } + break; + + case Keys.PageUp: //scroll up + if (PlaylistElementContents.Count > 0) + { + Offset -= PlaylistElements.Count; + + if (Offset < 0) + Offset = 0; + + Update(); + CurrentPlaylistElement = 0; + } + break; + + case Keys.PageDown: //scroll down + if (PlaylistElementContents.Count > 0) + { + Offset += PlaylistElements.Count; + + if (Offset > PlaylistElementContents.Count - PlaylistElements.Count) + Offset = PlaylistElementContents.Count - PlaylistElements.Count; + + if (Offset < 0) + Offset = 0; + + Update(); + + for (int i = PlaylistElements.Count - 1; i >= 0; i--) + { + if (PlaylistElements[i].SelectSlide.Visible) + { + CurrentPlaylistElement = i; + break; + } + } + } + break; + + case Keys.Left: + _Interactions.HandleInput(KeyEvent); + CurrentPlaylistElement = GetSelectedSelectionNr(); + + if (CurrentPlaylistElement != -1) + { + CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; + UpdatePlaylist(); + } + break; + + case Keys.Right: + _Interactions.HandleInput(KeyEvent); + CurrentPlaylistElement = GetSelectedSelectionNr(); + + if (CurrentPlaylistElement != -1) + { + CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; + UpdatePlaylist(); + } + break; + } + return true; + } + + //default actions + switch (KeyEvent.Key) + { case Keys.Back: - ClosePlaylist(); + if (_Theme.ButtonPlaylistName.Selected) + { + _EditMode = EEditMode.PlaylistName; + _Theme.ButtonPlaylistName.EditMode = true; + } + else + ClosePlaylist(); break; case Keys.Enter: - if (KeyEvent.ModSHIFT) + if (_Theme.ButtonPlaylistClose.Selected) + { + ClosePlaylist(); + } + else if (_Theme.ButtonPlaylistSing.Selected) + { StartPlaylistSongs(); - else + } + else if (_Theme.ButtonPlaylistSave.Selected) { - if (_Theme.ButtonPlaylistClose.Selected) + CPlaylists.SavePlaylist(ActivePlaylistID); + } + else if (_Theme.ButtonPlaylistDelete.Selected) + { + CPlaylists.DeletePlaylist(ActivePlaylistID); + ClosePlaylist(); + } + else if (_Theme.ButtonPlaylistName.Selected) + { + if (_EditMode != EEditMode.PlaylistName) { - ClosePlaylist(); + _EditMode = EEditMode.PlaylistName; + _Theme.ButtonPlaylistName.EditMode = true; } - else if (_Theme.ButtonPlaylistSing.Selected) + else { - StartPlaylistSongs(); - } - else if (_Theme.ButtonPlaylistSave.Selected) - { - CPlaylists.SavePlaylist(ActivePlaylistID); - } - else if (_Theme.ButtonPlaylistDelete.Selected) - { - CPlaylists.DeletePlaylist(ActivePlaylistID); - ClosePlaylist(); - } - else if (_Theme.ButtonPlaylistName.Selected) - { - if (_EditMode != EEditMode.PlaylistName) - _EditMode = EEditMode.PlaylistName; - else - _EditMode = EEditMode.None; + _EditMode = EEditMode.None; + _Theme.ButtonPlaylistName.EditMode = false; } } break; - - case Keys.PageUp: - if (CurrentPlaylistElement != -1) - { - CPlaylists.Playlists[ActivePlaylistID].SongDown(CurrentPlaylistElement + Offset); - if (CurrentPlaylistElement - 1 > -1) - { - CurrentPlaylistElement--; - ActiveHover = CurrentPlaylistElement; - } - else if (Offset > 0) - { - Offset--; - } - UpdatePlaylist(); - _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); - return true; - } - break; - - case Keys.PageDown: - if (CurrentPlaylistElement != -1) - { - CPlaylists.Playlists[ActivePlaylistID].SongUp(CurrentPlaylistElement + Offset); - if (CurrentPlaylistElement + 1 < PlaylistElements.Count) - { - CurrentPlaylistElement++; - ActiveHover = CurrentPlaylistElement; - } - else if (Offset + CurrentPlaylistElement < PlaylistElementContents.Count) - { - Offset++; - } - UpdatePlaylist(); - _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); - return true; - } - break; - - case Keys.Left: - _Interactions.HandleInput(KeyEvent); - if (CurrentPlaylistElement != -1) - { - CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; - UpdatePlaylist(); - return true; - } - return false; - - case Keys.Right: - _Interactions.HandleInput(KeyEvent); - if (CurrentPlaylistElement != -1) - { - CPlaylists.Playlists[ActivePlaylistID].Songs[CurrentPlaylistElement + Offset].GameMode = PlaylistElementContents[CurrentPlaylistElement + Offset].Modes[PlaylistElements[CurrentPlaylistElement].SelectSlide.Selection]; - UpdatePlaylist(); - return true; - } - return false; } } } - return false; + return true; } private void SetSelectionToLastEntry() @@ -666,21 +696,21 @@ namespace Vocaluxe.Menu if (PlaylistElementContents.Count == 0) return; - int selection = GetSelectedSelectionNr(); - if (selection == -1) - return; - int off = PlaylistElementContents.Count - PlaylistElements.Count; if (off >= 0) - { Offset = off; - Update(); - } + else + Offset = 0; - if (PlaylistElementContents.Count > selection) + Update(); + + for (int i = PlaylistElements.Count - 1; i >= 0; i--) { - CurrentPlaylistElement = selection; - ActiveHover = CurrentPlaylistElement; + if (PlaylistElements[i].SelectSlide.Visible) + { + CurrentPlaylistElement = i; + return; + } } } @@ -689,18 +719,10 @@ namespace Vocaluxe.Menu if (PlaylistElementContents.Count == 0) return; - int selection = GetSelectedSelectionNr(); - if (selection == -1) - return; - Offset = 0; Update(); - if (PlaylistElementContents.Count > selection) - { - CurrentPlaylistElement = selection; - ActiveHover = CurrentPlaylistElement; - } + CurrentPlaylistElement = 0; } private int GetSelectedSelectionNr() @@ -713,6 +735,20 @@ namespace Vocaluxe.Menu return -1; } + public void ScrollToBottom() + { + if (PlaylistElementContents.Count == 0) + return; + + int off = PlaylistElementContents.Count - PlaylistElements.Count; + if (off >= 0) + Offset = off; + else + Offset = 0; + + Update(); + } + public bool HandleMouse(MouseEvent MouseEvent) { _Interactions.HandleMouse(MouseEvent); @@ -742,6 +778,7 @@ namespace Vocaluxe.Menu Update(); return true; } + return true; } //LB actions if (MouseEvent.LB) @@ -775,6 +812,7 @@ namespace Vocaluxe.Menu else if (_Theme.ButtonPlaylistName.Selected) { _EditMode = EEditMode.PlaylistName; + _Theme.ButtonPlaylistName.EditMode = true; return true; } } @@ -786,8 +824,8 @@ namespace Vocaluxe.Menu if (PlaylistElementContents.Count - 1 >= i && CHelper.IsInBounds(PlaylistElements[i].Background.Rect, MouseEvent)) { hover_set = true; - ActiveHover = i; CurrentPlaylistElement = i; + _Interactions.SetInteractionToSelectSlide(PlaylistElements[CurrentPlaylistElement].SelectSlide); } //Delete Entry with RB @@ -800,14 +838,12 @@ namespace Vocaluxe.Menu } if(!hover_set) { - ActiveHover = -1; CurrentPlaylistElement = -1; } break; case EEditMode.PlaylistName: _Interactions.SetInteractionToButton(_Theme.ButtonPlaylistName); - ActiveHover = -1; CurrentPlaylistElement = -1; if (MouseEvent.LB) { @@ -825,6 +861,7 @@ namespace Vocaluxe.Menu { _Theme.ButtonPlaylistName.Text.Text = CPlaylists.Playlists[ActivePlaylistID].PlaylistName; _EditMode = EEditMode.None; + _Theme.ButtonPlaylistName.EditMode = false; return true; } } @@ -917,12 +954,8 @@ namespace Vocaluxe.Menu pec.Mode = CPlaylists.Playlists[ActivePlaylistID].Songs[i].GameMode; PlaylistElementContents.Add(pec); } + Update(); - if (PlaylistElementContents.Count - 1 < ActiveHover || PlaylistElementContents.Count - 1 < CurrentPlaylistElement) - { - ActiveHover = PlaylistElementContents.Count - 1; - CurrentPlaylistElement = PlaylistElementContents.Count - 1; - } } private void StartPlaylistSongs() @@ -952,21 +985,20 @@ namespace Vocaluxe.Menu { if (ActivePlaylistID > -1 && ActivePlaylistID < CPlaylists.NumPlaylists) { - int e = 0 + Offset; for (int i = 0; i < PlaylistElements.Count; i++ ) { - if (e + i < PlaylistElementContents.Count) + if (Offset + i < PlaylistElementContents.Count) { - PlaylistElements[i].Content = e+i; + PlaylistElements[i].Content = Offset + i; PlaylistElements[i].Background.Visible = true; PlaylistElements[i].Cover.Visible = true; PlaylistElements[i].SelectSlide.Visible = true; PlaylistElements[i].Text1.Visible = true; - PlaylistElementContent pec = PlaylistElementContents[e + i]; + PlaylistElementContent pec = PlaylistElementContents[Offset + i]; CSong song = CSongs.GetSong(pec.SongID); PlaylistElements[i].Cover.Texture = song.CoverTextureSmall; string t1 = _Theme.Text1.Text.Replace("%a", song.Artist).Replace("%t", song.Title); - PlaylistElements[i].Text1.Text = song.Artist + " - " + song.Title; + PlaylistElements[i].Text1.Text = /*(Offset + i + 1).ToString() + ") " + */song.Artist + " - " + song.Title; //TODO: Add text field for the number PlaylistElements[i].SelectSlide.Clear(); for (int g = 0; g < pec.Modes.Length; g++) { diff --git a/Vocaluxe/Menu/CText.cs b/Vocaluxe/Menu/CText.cs index 4482308f..c1ccb39a 100644 --- a/Vocaluxe/Menu/CText.cs +++ b/Vocaluxe/Menu/CText.cs @@ -217,6 +217,7 @@ namespace Vocaluxe.Menu public bool Selected; public bool Visible = true; + public bool EditMode = false; public float Alpha = 1f; @@ -602,8 +603,10 @@ namespace Vocaluxe.Menu SColorF color = new SColorF(CurrentColor.R, CurrentColor.G, CurrentColor.B, CurrentColor.A * Alpha); - - CFonts.DrawText(_Text, _DrawPosition.tH, _DrawPosition.X, _DrawPosition.Y, Z, color); + if (!EditMode) + CFonts.DrawText(_Text, _DrawPosition.tH, _DrawPosition.X, _DrawPosition.Y, Z, color); + else + CFonts.DrawText(_Text + "|", _DrawPosition.tH, _DrawPosition.X, _DrawPosition.Y, Z, color); if (Reflection) { @@ -622,7 +625,10 @@ namespace Vocaluxe.Menu default: break; } - CFonts.DrawTextReflection(_Text, _DrawPosition.tH, _DrawPosition.X, _DrawPosition.Y, Z, color, ReflectionSpace + sFactor, ReflectionHeight); + if (!EditMode) + CFonts.DrawTextReflection(_Text, _DrawPosition.tH, _DrawPosition.X, _DrawPosition.Y, Z, color, ReflectionSpace + sFactor, ReflectionHeight); + else + CFonts.DrawTextReflection(_Text + "|", _DrawPosition.tH, _DrawPosition.X, _DrawPosition.Y, Z, color, ReflectionSpace + sFactor, ReflectionHeight); } if (Selected && (CSettings.GameState == EGameState.EditTheme)) @@ -659,7 +665,11 @@ namespace Vocaluxe.Menu CFonts.SetFont(Fon); CFonts.Style = Style; - CFonts.DrawText(Text, Height, x, Y, Z, color, begin, end); + + if (!EditMode) + CFonts.DrawText(Text, Height, x, Y, Z, color, begin, end); + else + CFonts.DrawText(Text + "|", Height, x, Y, Z, color, begin, end); if (Reflection) { @@ -738,13 +748,21 @@ namespace Vocaluxe.Menu CFonts.SetFont(Fon); CFonts.Style = Style; - CFonts.DrawText(_Text, h, x, y, Z, color); + + if (!EditMode) + CFonts.DrawText(_Text, h, x, y, Z, color); + else + CFonts.DrawText(_Text + "|", h, x, y, Z, color); if (reflection) { float space = (rectHeight - Y - bounds.Height) * 2f + reflectionSpace; float height = reflectionHeight - (rectHeight - Y) + bounds.Height; - CFonts.DrawTextReflection(_Text, h, x, y, Z, color, space, height); + + if (!EditMode) + CFonts.DrawTextReflection(_Text, h, x, y, Z, color, space, height); + else + CFonts.DrawTextReflection(_Text + "|", h, x, y, Z, color, space, height); } if (Selected && (CSettings.GameState == EGameState.EditTheme)) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index f5809c12..37f110f6 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -316,7 +316,6 @@ namespace Vocaluxe.Screens if (MouseEvent.MB && CSongs.Category != -1) { - Console.WriteLine("MB pressed"); SongMenus[htSongMenus(SongMenu)].SetSelectedSong(CSongs.GetRandomSong()); } else @@ -713,8 +712,11 @@ namespace Vocaluxe.Screens if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Selection)) { Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Selection; + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Selection = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Selection + 1; + //Open playlist OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); + Playlists[htPlaylists(Playlist)].ScrollToBottom(); } ToggleSongOptions(ESongOptionsView.None); } @@ -733,13 +735,16 @@ namespace Vocaluxe.Screens gm = GameModes.EGameMode.TR_GAMEMODE_DUET; else gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; + //Check if Playlist really exists if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Selection - 1 < 0) Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); else Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Selection - 1; + //Add song to playlist CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); + //Open playlist OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); } @@ -755,12 +760,16 @@ namespace Vocaluxe.Screens gm = GameModes.EGameMode.TR_GAMEMODE_DUET; else gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; + //Create new playlist Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); + //Add song to playlist CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); + //Open playlist OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); + //Add new playlist to select-slide SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].AddValue(CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].PlaylistName); @@ -779,6 +788,7 @@ namespace Vocaluxe.Screens gm = GameModes.EGameMode.TR_GAMEMODE_NORMAL; CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); Playlists[htPlaylists(Playlist)].UpdatePlaylist(); + Playlists[htPlaylists(Playlist)].ScrollToBottom(); } ToggleSongOptions(ESongOptionsView.Song); } From 0c1a60196861bec6d21fde2e1f12cc0559507b88 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 2 Dec 2012 14:32:19 +0100 Subject: [PATCH 60/70] small adjustment in screen song theme for better keyboard navigation in playlist --- Output/Themes/Ambient/Screens/ScreenSong.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Output/Themes/Ambient/Screens/ScreenSong.xml b/Output/Themes/Ambient/Screens/ScreenSong.xml index 3d744951..dfe2d5a7 100644 --- a/Output/Themes/Ambient/Screens/ScreenSong.xml +++ b/Output/Themes/Ambient/Screens/ScreenSong.xml @@ -1162,10 +1162,10 @@ SelectSlide - 54 + 0 28 -1,01 - 235 + 343 24 54 From 4400855d80654bbcc43f81e7b0aaaeb2894a2849 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 2 Dec 2012 14:46:54 +0100 Subject: [PATCH 61/70] fixed typo --- Output/Languages/Deutsch.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Output/Languages/Deutsch.xml b/Output/Languages/Deutsch.xml index 8fe726bf..bc03d2ed 100644 --- a/Output/Languages/Deutsch.xml +++ b/Output/Languages/Deutsch.xml @@ -124,7 +124,7 @@ Schließen Zufälligen Song wählen Alle Songs singen - Alle sichtbaren Song singen + Alle sichtbaren Songs singen Playlist öffnen Neue Playlist Lied-Optionen From 9e5b419f800a085b4e5f16c0ec85f99a7c2a7cd7 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 2 Dec 2012 14:50:24 +0100 Subject: [PATCH 62/70] roadmap update --- Vocaluxe/Doc/Roadmap.txt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Vocaluxe/Doc/Roadmap.txt b/Vocaluxe/Doc/Roadmap.txt index 5cbb31b5..bd0c9c40 100644 --- a/Vocaluxe/Doc/Roadmap.txt +++ b/Vocaluxe/Doc/Roadmap.txt @@ -71,31 +71,32 @@ - PortAudio Record and Playback ------------------------------------------------------------- -+ v0.1.0: ++ v0.1.0 (reached: 07.04.2012): - Menu Background Music + - Jukebox light (bg music controls) - Theme System Update - A nicer Theme! + v0.2.0: - Medley - - WiiMote Support - - Jukebox light (bg music controls) - - Show Avatars and Player Name in Sing Screen (and perhaps some other screens) + - Show Avatars and Player Name in Sing Screen and Score Screen - New Lyric Effects + - More Player at once (up to 6) + - Duet (full support, choose/toggle names) + - Playlist-Support ----------------- just some ideas: + - WiiMote Support - Installer - More Song List Views - Tile Board: Show title and artist under each tile - OnScreen Keyboard? - Kinect Support? - Help System - - Party Mode: Casting Show - - More Player at once - - Mark newly added songs - - Playlist-Support + - Party Mode: Casting Show + - Mark newly added songs - Theme Editor - Jukebox - Tournament Mode @@ -103,5 +104,4 @@ just some ideas: - Party Mode: Tic, Tac, Toe - Party Mode: 4 in a row - Challenge Mode (with more than 2 player at once) - - Song Editor - - Duet (full support, choose/toggle names) \ No newline at end of file + - Song Editor \ No newline at end of file From 9d5fdb67de83373829dbd8ca85087f2a0f6ff49d Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 2 Dec 2012 15:02:02 +0100 Subject: [PATCH 63/70] fixed ButtonOpenOptions handling in song screen --- Vocaluxe/Screens/CScreenSong.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 37f110f6..010e1d73 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -655,6 +655,7 @@ namespace Vocaluxe.Screens Buttons[htButtons(ButtonOptionsClose)].Visible = true; Texts[htTexts(TextOptionsTitle)].Visible = true; Statics[htStatics(StaticOptionsBG)].Visible = true; + Buttons[htButtons(ButtonOpenOptions)].Visible = false; } else { @@ -668,6 +669,7 @@ namespace Vocaluxe.Screens Buttons[htButtons(ButtonOptionsSingAll)].Visible = false; Buttons[htButtons(ButtonOptionsSingAllVisible)].Visible = false; Buttons[htButtons(ButtonOptionsOpenPlaylist)].Visible = false; + Buttons[htButtons(ButtonOpenOptions)].Visible = true; Texts[htTexts(TextOptionsTitle)].Visible = false; Statics[htStatics(StaticOptionsBG)].Visible = false; } From 9b2630ee5f65142e511c4c2afbf49cde545ee13c Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 2 Dec 2012 15:02:28 +0100 Subject: [PATCH 64/70] roadmap update --- Vocaluxe/Doc/Roadmap.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Vocaluxe/Doc/Roadmap.txt b/Vocaluxe/Doc/Roadmap.txt index bd0c9c40..430dc109 100644 --- a/Vocaluxe/Doc/Roadmap.txt +++ b/Vocaluxe/Doc/Roadmap.txt @@ -79,11 +79,12 @@ + v0.2.0: - Medley - - Show Avatars and Player Name in Sing Screen and Score Screen + - Show Avatars and Player Name in Sing Screen - New Lyric Effects - More Player at once (up to 6) - Duet (full support, choose/toggle names) - Playlist-Support + - Spectrum Analyzer (Record Screen) ----------------- From d392ca3a30790902384df48d7b9cbb182985f1bc Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 2 Dec 2012 15:33:20 +0100 Subject: [PATCH 65/70] fixed visibility of lyrics --- Vocaluxe/Lib/Song/CSong.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Vocaluxe/Lib/Song/CSong.cs b/Vocaluxe/Lib/Song/CSong.cs index 72bd1593..1b874dfc 100644 --- a/Vocaluxe/Lib/Song/CSong.cs +++ b/Vocaluxe/Lib/Song/CSong.cs @@ -209,6 +209,7 @@ namespace Vocaluxe.Lib.Song this.VideoAspect = song.VideoAspect; this._CoverLoaded = song._CoverLoaded; this.CoverBigLoaded = song.CoverBigLoaded; + this._NotesLoaded = song._NotesLoaded; this.Artist = song.Artist; this.Title = song.Title; From 2411b4023b90f0a20b3987d4ed632d58b2451b34 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 2 Dec 2012 15:38:39 +0100 Subject: [PATCH 66/70] fixed skip song in sing screen (disable pause) --- Vocaluxe/Screens/CScreenSing.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Vocaluxe/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs index 89f13b91..c75081c3 100644 --- a/Vocaluxe/Screens/CScreenSing.cs +++ b/Vocaluxe/Screens/CScreenSing.cs @@ -224,6 +224,7 @@ namespace Vocaluxe.Screens if (Buttons[htButtons(ButtonSkip)].Selected && _Pause) { LoadNextSong(); + TogglePause(); } break; } From faab09f3553d5e499e0ee3c30c62c2d33e893a04 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 2 Dec 2012 15:51:17 +0100 Subject: [PATCH 67/70] select current playlist for adding songs --- Vocaluxe/Screens/CScreenSong.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 010e1d73..07a99ad8 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -714,7 +714,7 @@ namespace Vocaluxe.Screens if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Selection)) { Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Selection; - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Selection = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Selection + 1; + SetSelectSlidePlaylistToCurrentPlaylist(); //Open playlist OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); @@ -749,6 +749,8 @@ namespace Vocaluxe.Screens //Open playlist OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); + + SetSelectSlidePlaylistToCurrentPlaylist(); } //Create a new playlist and add song else if ((SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Selection - 1) == -1) @@ -775,6 +777,8 @@ namespace Vocaluxe.Screens //Add new playlist to select-slide SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].AddValue(CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].PlaylistName); + SetSelectSlidePlaylistToCurrentPlaylist(); + } //Add song to loaded playlist else @@ -794,5 +798,10 @@ namespace Vocaluxe.Screens } ToggleSongOptions(ESongOptionsView.Song); } + + private void SetSelectSlidePlaylistToCurrentPlaylist() + { + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Selection = Playlists[htPlaylists(Playlist)].ActivePlaylistID + 1; + } } } From 93476adc332328e58f2e892b3a213c514ccaa13b Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 2 Dec 2012 15:51:30 +0100 Subject: [PATCH 68/70] roadmap update --- Vocaluxe/Doc/Roadmap.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Vocaluxe/Doc/Roadmap.txt b/Vocaluxe/Doc/Roadmap.txt index 430dc109..7a73c9ed 100644 --- a/Vocaluxe/Doc/Roadmap.txt +++ b/Vocaluxe/Doc/Roadmap.txt @@ -79,12 +79,13 @@ + v0.2.0: - Medley + - Sing Short Version Mode - Show Avatars and Player Name in Sing Screen - New Lyric Effects - More Player at once (up to 6) - Duet (full support, choose/toggle names) - Playlist-Support - - Spectrum Analyzer (Record Screen) + - Spectrum Analyzer (Record Screen and Player Selection Screen) ----------------- From 38985f2f71ab07727c96f2b12da8a67e51bc76bf Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 2 Dec 2012 16:04:59 +0100 Subject: [PATCH 69/70] fixed playlist menu handling --- Vocaluxe/Screens/CScreenSong.cs | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 07a99ad8..f4df4866 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -114,7 +114,11 @@ namespace Vocaluxe.Screens } Playlists[htPlaylists(Playlist)].HandleInput(KeyEvent); - return true; + + if (CPlaylists.NumPlaylists != SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].NumValues) + UpdatePlaylistNames(); + + return true; } if (!_SongOptionsActive) @@ -648,9 +652,24 @@ namespace Vocaluxe.Screens { Buttons[htButtons(ButtonOptionsRandom)].Visible = CSongs.Category != -1; Buttons[htButtons(ButtonOptionsSingAll)].Visible = true; - Buttons[htButtons(ButtonOptionsSingAllVisible)].Visible = true; - Buttons[htButtons(ButtonOptionsOpenPlaylist)].Visible = true; - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Visible = true; + Buttons[htButtons(ButtonOptionsSingAllVisible)].Visible = CSongs.Category != -1; + + if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].NumValues > 0) + { + Buttons[htButtons(ButtonOptionsOpenPlaylist)].Visible = true; + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Visible = true; + SetInteractionToButton(Buttons[htButtons(ButtonOptionsOpenPlaylist)]); + } + else + { + Buttons[htButtons(ButtonOptionsOpenPlaylist)].Visible = false; + SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Visible = false; + + if (Buttons[htButtons(ButtonOptionsRandom)].Visible) + SetInteractionToButton(Buttons[htButtons(ButtonOptionsRandom)]); + else + SetInteractionToButton(Buttons[htButtons(ButtonOptionsSingAll)]); + } } Buttons[htButtons(ButtonOptionsClose)].Visible = true; Texts[htTexts(TextOptionsTitle)].Visible = true; From d89b942f1a2b134e37db6f3f0768c2bafe9b619f Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 2 Dec 2012 16:29:20 +0100 Subject: [PATCH 70/70] scale text glyphs in according to TextureQuality setting --- Vocaluxe/Base/CFont.cs | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/Vocaluxe/Base/CFont.cs b/Vocaluxe/Base/CFont.cs index 0e13f8e2..1349f672 100644 --- a/Vocaluxe/Base/CFont.cs +++ b/Vocaluxe/Base/CFont.cs @@ -40,13 +40,20 @@ namespace Vocaluxe.Base class CGlyph { - public readonly float SIZEh = 50f; + private float _SIZEh = 50f; + public float SIZEh + { + get { return _SIZEh; } + } + public STexture Texture; public char Chr; public int width; - public CGlyph(char chr) + public CGlyph(char chr, float MaxHigh) { + _SIZEh = MaxHigh; + float outline = CFonts.Outline; TextFormatFlags flags = TextFormatFlags.NoPadding | TextFormatFlags.NoPrefix; @@ -152,7 +159,8 @@ namespace Vocaluxe.Base private Hashtable _htGlyphs; private PrivateFontCollection fonts; private FontFamily family; - + private float SIZEh; + public string FilePath; @@ -181,6 +189,28 @@ namespace Vocaluxe.Base _Glyphs = new List(); _htGlyphs = new Hashtable(); + + switch (CConfig.TextureQuality) + { + case ETextureQuality.TR_CONFIG_TEXTURE_LOWEST: + SIZEh = 25f; + break; + case ETextureQuality.TR_CONFIG_TEXTURE_LOW: + SIZEh = 50f; + break; + case ETextureQuality.TR_CONFIG_TEXTURE_MEDIUM: + SIZEh = 100f; + break; + case ETextureQuality.TR_CONFIG_TEXTURE_HIGH: + SIZEh = 200f; + break; + case ETextureQuality.TR_CONFIG_TEXTURE_HIGHEST: + SIZEh = 400f; + break; + default: + SIZEh = 100f; + break; + } } public void DrawGlyph(char chr, float x, float y, float h, float z, SColorF color) @@ -243,7 +273,7 @@ namespace Vocaluxe.Base return; float h = CFonts.Height; - _Glyphs.Add(new CGlyph(chr)); + _Glyphs.Add(new CGlyph(chr, SIZEh)); _htGlyphs.Add(chr, _Glyphs.Count - 1); CFonts.Height = h; }