diff --git a/Output/Readme.txt b/Output/Readme.txt index 38fc134a..1ec5c587 100644 --- a/Output/Readme.txt +++ b/Output/Readme.txt @@ -109,7 +109,8 @@ Vocaluxe.exe -ConfigFile MyConfig.xml -ScoreFile C:\Vocaluxe\Highscores\MyHighsc Songscreen [CTRL] + [R] to select a random song [F3] to open/close the song search menu -[A] to sing all songs from a category +[A] to sing all songs +[SHIFT] + [A] to sing all songs from a category ================================= diff --git a/Output/Themes/Ambient/Screens/ScreenNames.xml b/Output/Themes/Ambient/Screens/ScreenNames.xml index c1ac532c..c35f8b0f 100644 --- a/Output/Themes/Ambient/Screens/ScreenNames.xml +++ b/Output/Themes/Ambient/Screens/ScreenNames.xml @@ -1,7 +1,7 @@  - 2 + 3 Video @@ -28,7 +28,7 @@ - + PlayerSelector @@ -695,6 +695,396 @@ 6 + + + Invisible + + SelectSlideArrowLeft + + SelectSlideArrowRight + + Button + + SelectSlideArrowLeft + + SelectSlideArrowRight + + Button + + 41 + 105 + -4,00 + 88 + 20 + + 20 + 105 + -4,01 + 20 + 20 + + 20 + 105 + -4,01 + 20 + 20 + + + SelectSlideColor + + + SelectSlideSColor + + + SelectSlideHColor + + + ArrowColor + + + ArrowSColor + + + TextColor + + + TextSColor + + 20,00 + + 86,00 + + Outline + + Bold + + 1 + + + + Invisible + + SelectSlideArrowLeft + + SelectSlideArrowRight + + Button + + SelectSlideArrowLeft + + SelectSlideArrowRight + + Button + + 41 + 260 + -4,00 + 88 + 20 + + 20 + 260 + -4,01 + 20 + 20 + + 20 + 260 + -4,01 + 20 + 20 + + + SelectSlideColor + + + SelectSlideSColor + + + SelectSlideHColor + + + ArrowColor + + + ArrowSColor + + + TextColor + + + TextSColor + + 20,00 + + 86,00 + + Outline + + Bold + + 1 + + + + Invisible + + SelectSlideArrowLeft + + SelectSlideArrowRight + + Button + + SelectSlideArrowLeft + + SelectSlideArrowRight + + Button + + 41 + 415 + -4,00 + 88 + 20 + + 20 + 415 + -4,01 + 20 + 20 + + 20 + 415 + -4,01 + 20 + 20 + + + SelectSlideColor + + + SelectSlideSColor + + + SelectSlideHColor + + + ArrowColor + + + ArrowSColor + + + TextColor + + + TextSColor + + 20,00 + + 86,00 + + Outline + + Bold + + 1 + + + + Invisible + + SelectSlideArrowLeft + + SelectSlideArrowRight + + Button + + SelectSlideArrowLeft + + SelectSlideArrowRight + + Button + + 1152 + 105 + -4,00 + 88 + 20 + + 1240 + 105 + -4,01 + 20 + 20 + + 1240 + 105 + -4,01 + 20 + 20 + + + SelectSlideColor + + + SelectSlideSColor + + + SelectSlideHColor + + + ArrowColor + + + ArrowSColor + + + TextColor + + + TextSColor + + 20,00 + + 86,00 + + Outline + + Bold + + 1 + + + + Invisible + + SelectSlideArrowLeft + + SelectSlideArrowRight + + Button + + SelectSlideArrowLeft + + SelectSlideArrowRight + + Button + + 1152 + 260 + -4,00 + 88 + 20 + + 1240 + 260 + -4,01 + 20 + 20 + + 1240 + 260 + -4,01 + 20 + 20 + + + SelectSlideColor + + + SelectSlideSColor + + + SelectSlideHColor + + + ArrowColor + + + ArrowSColor + + + TextColor + + + TextSColor + + 20,00 + + 86,00 + + Outline + + Bold + + 1 + + + + Invisible + + SelectSlideArrowLeft + + SelectSlideArrowRight + + Button + + SelectSlideArrowLeft + + SelectSlideArrowRight + + Button + + 1152 + 415 + -4,00 + 88 + 20 + + 1240 + 415 + -4,01 + 20 + 20 + + 1240 + 415 + -4,01 + 20 + 20 + + + SelectSlideColor + + + SelectSlideSColor + + + SelectSlideHColor + + + ArrowColor + + + ArrowSColor + + + TextColor + + + TextSColor + + 20,00 + + 86,00 + + Outline + + Bold + + 1 + 172 @@ -738,5 +1128,167 @@ + + + Invisible + + 21 + 152 + -4,00 + 108 + 60 + + 8 + + 2,00 + + + + + Player1Dim2 + + + Player1Dim + + TR_CONFIG_OFF + + + + + + + Invisible + + 21 + 307 + -4,00 + 108 + 60 + + 8 + + 2,00 + + + + + Player2Dim2 + + + Player2Dim + + TR_CONFIG_OFF + + + + + + + Invisible + + 21 + 467 + -4,00 + 108 + 60 + + 8 + + 2,00 + + + + + Player3Dim2 + + + Player3Dim + + TR_CONFIG_OFF + + + + + + + Invisible + + 1153 + 152 + -4,00 + 108 + 60 + + 8 + + 2,00 + + + + + Player4Dim2 + + + Player4Dim + + TR_CONFIG_OFF + + + + + + + Invisible + + 1153 + 307 + -4,00 + 108 + 60 + + 8 + + 2,00 + + + + + Player5Dim2 + + + Player5Dim + + TR_CONFIG_OFF + + + + + + + Invisible + + 1153 + 467 + -4,00 + 108 + 60 + + 8 + + 2,00 + + + + + Player6Dim2 + + + Player6Dim + + TR_CONFIG_OFF + + + + - \ No newline at end of file + diff --git a/Output/Themes/Ambient/Screens/ScreenOptionsRecord.xml b/Output/Themes/Ambient/Screens/ScreenOptionsRecord.xml index 1888fdc0..7375fd34 100644 --- a/Output/Themes/Ambient/Screens/ScreenOptionsRecord.xml +++ b/Output/Themes/Ambient/Screens/ScreenOptionsRecord.xml @@ -1,7 +1,7 @@  - 1 + 2 Video @@ -858,5 +858,66 @@ 5 + + + Invisible + + 50 + 400 + 230 + 150 + -1,00 + + 10 + 2,00 + + + + + ButtonColor + + + ButtonSColor + + TR_CONFIG_OFF + + + + + 10 + 26 + + + + + Invisible + + 400 + 400 + 230 + 150 + -1,00 + + 10 + + 2,00 + + + + + ButtonColor + + + ButtonSColor + + TR_CONFIG_OFF + + + + + 10 + 26 + + - \ No newline at end of file + diff --git a/Output/Themes/Ambient/Screens/ScreenSing.xml b/Output/Themes/Ambient/Screens/ScreenSing.xml index 4d33b2f0..aaeec608 100644 --- a/Output/Themes/Ambient/Screens/ScreenSing.xml +++ b/Output/Themes/Ambient/Screens/ScreenSing.xml @@ -1,7 +1,7 @@  - 4 + 5 None @@ -958,6 +958,64 @@ + + + 40 + 80 + + -1,00 + + 35 + + + + TextSColor + + + TextSColor + + Left + + Center + + + + Outline + + + + + + + + + 40 + 585 + + -1,00 + + 35 + + + + TextSColor + + + TextSColor + + Left + + Center + + + + Outline + + + + + + 640 @@ -2656,4 +2714,4 @@ - \ No newline at end of file + diff --git a/Output/Themes/Changelog/Changelog_ScreenNames.txt b/Output/Themes/Changelog/Changelog_ScreenNames.txt index 47d04016..221c9331 100644 --- a/Output/Themes/Changelog/Changelog_ScreenNames.txt +++ b/Output/Themes/Changelog/Changelog_ScreenNames.txt @@ -1,5 +1,11 @@ SceenNames +++++++++++ +Version 3: + + (One Equalizer for each player): Equalizer shows input from assigned mic for this player. + (One SelectSlide for each player) + ++++++++++ Version 2: diff --git a/Output/Themes/Changelog/Changelog_ScreenOptionsRecord.txt b/Output/Themes/Changelog/Changelog_ScreenOptionsRecord.txt new file mode 100644 index 00000000..89d9465c --- /dev/null +++ b/Output/Themes/Changelog/Changelog_ScreenOptionsRecord.txt @@ -0,0 +1,9 @@ +ScreenOptionsRecord + +++++++++++ +Version 2: + +Add: + and . +This is a new theme-element. Check ScreenOptionsRecord.xml for style-possibilities. +++++++++++ \ No newline at end of file diff --git a/Output/Themes/Changelog/Changelog_ScreenSing.txt b/Output/Themes/Changelog/Changelog_ScreenSing.txt index 22c5fa99..843fb6e9 100644 --- a/Output/Themes/Changelog/Changelog_ScreenSing.txt +++ b/Output/Themes/Changelog/Changelog_ScreenSing.txt @@ -1,5 +1,11 @@ ScreenSing ++++++++++ +Version 5 + +Add: + and (only showed when sining duet) + ++++++++++ Version 4: Added Elements for 6-player-singing! diff --git a/Vocaluxe/Base/CDraw.cs b/Vocaluxe/Base/CDraw.cs index d1743b0a..e468162e 100644 --- a/Vocaluxe/Base/CDraw.cs +++ b/Vocaluxe/Base/CDraw.cs @@ -117,6 +117,11 @@ namespace Vocaluxe.Base _Draw.DrawColor(color, rect); } + public static void DrawColorReflection(SColorF color, SRectF rect, float space, float height) + { + _Draw.DrawColorReflection(color, rect, space, height); + } + public static void ClearScreen() { _Draw.ClearScreen(); diff --git a/Vocaluxe/Base/CSound.cs b/Vocaluxe/Base/CSound.cs index 85112fd3..986476e9 100644 --- a/Vocaluxe/Base/CSound.cs +++ b/Vocaluxe/Base/CSound.cs @@ -315,6 +315,10 @@ namespace Vocaluxe.Base public CBuffer() { _ToneWeigth = new float[_NumHalfTones]; + for (int i = 0; i < _ToneWeigth.Length; i++) + { + _ToneWeigth[i] = 0.99f; + } _Stream = new MemoryStream(); _NewSamples = false; } diff --git a/Vocaluxe/GameModes/CGameMode.cs b/Vocaluxe/GameModes/CGameMode.cs index aa3304f3..86e0a9c5 100644 --- a/Vocaluxe/GameModes/CGameMode.cs +++ b/Vocaluxe/GameModes/CGameMode.cs @@ -256,7 +256,7 @@ namespace Vocaluxe.GameModes public virtual CSong GetSong(int Num) { - if (Num - 1 < _SongQueque.Count) + if (Num - 1 < _SongQueque.Count && Num - 1 > -1) return CSongs.GetSong(_SongQueque[Num - 1].SongID); return null; diff --git a/Vocaluxe/Lib/Draw/CDirect3D.cs b/Vocaluxe/Lib/Draw/CDirect3D.cs index 3141d237..492834c9 100644 --- a/Vocaluxe/Lib/Draw/CDirect3D.cs +++ b/Vocaluxe/Lib/Draw/CDirect3D.cs @@ -836,6 +836,19 @@ namespace Vocaluxe.Lib.Draw { DrawTexture(_BlankTexture, rect, color); } + + /// + /// Draws reflection of a colored rectangle + /// + /// The color in which the rectangle will be drawn in + /// The coordinates in a SRectF struct + /// The space between the texture and the reflection + /// The height of the reflection + public void DrawColorReflection(SColorF color, SRectF rect, float space, float height) + { + DrawTextureReflection(_BlankTexture, rect, color, rect, space, height); + } + #endregion Basic Draw Methods #region Textures #region adding diff --git a/Vocaluxe/Lib/Draw/CDrawWinForm.cs b/Vocaluxe/Lib/Draw/CDrawWinForm.cs index c94f0073..51cc0c4f 100644 --- a/Vocaluxe/Lib/Draw/CDrawWinForm.cs +++ b/Vocaluxe/Lib/Draw/CDrawWinForm.cs @@ -352,6 +352,11 @@ namespace Vocaluxe.Lib.Draw } + public void DrawColorReflection(SColorF color, SRectF rect, float space, float height) + { + + } + public STexture AddTexture(Bitmap bmp) { Bitmap bmp2 = new Bitmap(bmp); diff --git a/Vocaluxe/Lib/Draw/COpenGL.cs b/Vocaluxe/Lib/Draw/COpenGL.cs index 54ee1fcf..06a09e95 100644 --- a/Vocaluxe/Lib/Draw/COpenGL.cs +++ b/Vocaluxe/Lib/Draw/COpenGL.cs @@ -661,6 +661,59 @@ namespace Vocaluxe.Lib.Draw GL.Disable(EnableCap.Blend); } + public void DrawColorReflection(SColorF color, SRectF rect, float space, float height) + { + + if (rect.H < height) + height = rect.H; + + float rx1 = rect.X; + float rx2 = rect.X + rect.W; + float ry1 = rect.Y + rect.H + space; + float ry2 = rect.Y + rect.H + space + height; + + if (rx1 < rect.X) + rx1 = rect.X; + + if (rx2 > rect.X + rect.W) + rx2 = rect.X + rect.W; + + if (ry1 < rect.Y + space) + ry1 = rect.Y + space; + + if (ry2 > rect.Y + rect.H + space + height) + ry2 = rect.Y + rect.H + space + height; + + + GL.Enable(EnableCap.Blend); + + if (rect.Rotation != 0f) + { + GL.Translate(0.5f, 0.5f, 0); + GL.Rotate(-rect.Rotation, 0f, 0f, 1f); + GL.Translate(-0.5f, -0.5f, 0); + } + + GL.Begin(BeginMode.Quads); + + GL.Color4(color.R, color.G, color.B, color.A * CGraphics.GlobalAlpha); + GL.Vertex3(rx2, ry1, rect.Z + CGraphics.ZOffset); + + GL.Color4(color.R, color.G, color.B, 0f); + GL.Vertex3(rx2, ry2, rect.Z + CGraphics.ZOffset); + + GL.Color4(color.R, color.G, color.B, 0f); + GL.Vertex3(rx1, ry2, rect.Z + CGraphics.ZOffset); + + GL.Color4(color.R, color.G, color.B, color.A * CGraphics.GlobalAlpha); + GL.Vertex3(rx1, ry1, rect.Z + CGraphics.ZOffset); + + GL.End(); + + GL.Disable(EnableCap.Blend); + + } + #endregion Basic Draw Methods #region Textures diff --git a/Vocaluxe/Lib/Draw/IDraw.cs b/Vocaluxe/Lib/Draw/IDraw.cs index 2f8bbc82..9a7bf1d6 100644 --- a/Vocaluxe/Lib/Draw/IDraw.cs +++ b/Vocaluxe/Lib/Draw/IDraw.cs @@ -125,6 +125,7 @@ namespace Vocaluxe.Lib.Draw // Basic Draw Methods void DrawLine(int a, int r, int g, int b, int w, int x1, int y1, int x2, int y2); void DrawColor(SColorF color, SRectF rect); + void DrawColorReflection(SColorF color, SRectF rect, float space, float height); void ClearScreen(); STexture CopyScreen(); diff --git a/Vocaluxe/Lib/Song/CSong.cs b/Vocaluxe/Lib/Song/CSong.cs index fee895b1..f325d691 100644 --- a/Vocaluxe/Lib/Song/CSong.cs +++ b/Vocaluxe/Lib/Song/CSong.cs @@ -99,6 +99,9 @@ namespace Vocaluxe.Lib.Song public float Gap = 0f; public float VideoGap = 0f; + public string DuetPart1 = String.Empty; + public string DuetPart2 = String.Empty; + public List Comment = new List(); // Sorting @@ -254,6 +257,18 @@ namespace Vocaluxe.Lib.Song this.ArtistSorting = Value; } break; + case "P1": + if (Value != String.Empty) + { + this.DuetPart1 = Value; + } + break; + case "P2": + if (Value != String.Empty) + { + this.DuetPart2 = Value; + } + break; case "MP3": if (File.Exists(Path.Combine(this.Folder, Value))) { @@ -356,12 +371,12 @@ namespace Vocaluxe.Lib.Song CheckFiles(); //Before saving this tags to .txt: Check, if ArtistSorting and Artist are equal, then don't save this tag. - if (this.ArtistSorting == "") + if (this.ArtistSorting == String.Empty) { this.ArtistSorting = this.Artist; } - if (this.TitleSorting == "") + if (this.TitleSorting == String.Empty) { this.TitleSorting = this.Title; } @@ -420,9 +435,10 @@ namespace Vocaluxe.Lib.Song FileLineNo++; if (TempC.CompareTo('P') == 0) { - char chr = (char)sr.Read(); - int.TryParse(chr.ToString(), out Param1); + char chr; + while ((chr = (char)sr.Read()) == ' '){ } + int.TryParse(chr.ToString(), out Param1); if (Param1 == 1) Player = 0; else if (Param1 == 2) @@ -505,6 +521,8 @@ namespace Vocaluxe.Lib.Song return false; } _NotesLoaded = true; + if(IsDuet) + CheckDuet(); return true; } @@ -570,5 +588,19 @@ namespace Vocaluxe.Lib.Song } } } + + private void CheckDuet() + { + if (DuetPart1 == String.Empty) + { + DuetPart1 = "Part 1"; + CLog.LogError("Warning: Can't find #P1-tag for duets in \"" + this.Artist + " - " + this.Title + "\"."); + } + if (DuetPart2 == String.Empty) + { + DuetPart2 = "Part 2"; + CLog.LogError("Warning: Can't find #P2-tag for duets in \"" + this.Artist + " - " + this.Title + "\"."); + } + } } } diff --git a/Vocaluxe/Menu/Animations/CAnimation.cs b/Vocaluxe/Menu/Animations/CAnimation.cs new file mode 100644 index 00000000..2d062033 --- /dev/null +++ b/Vocaluxe/Menu/Animations/CAnimation.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Text; +using System.Xml; +using System.Xml.XPath; + +using Vocaluxe.Base; +using Vocaluxe.Lib.Draw; + +namespace Vocaluxe.Menu.Animations +{ + public class CAnimation:IAnimation + { + private IAnimation _Animation; + + public CAnimation(EAnimationType Type) + { + setAnimation(Type); + } + + public void Init() + { + _Animation.Init(); + } + + public bool LoadAnimation(string item, XPathNavigator navigator) + { + return _Animation.LoadAnimation(item, navigator); + } + + public bool SaveAnimation(XmlWriter writer) + { + return _Animation.SaveAnimation(writer); + } + + public void StartAnimation() + { + _Animation.StartAnimation(); + } + + public void StopAnimation() + { + _Animation.StopAnimation(); + } + + public void ResetAnimation() + { + _Animation.ResetAnimation(); + } + + public bool AnimationActive() + { + return _Animation.AnimationActive(); + } + + public void Update() + { + _Animation.Update(); + } + + public void setRect(SRectF rect) + { + _Animation.setRect(rect); + } + + public SRectF getRect() + { + return _Animation.getRect(); + } + + public void setColor(SColorF color) + { + _Animation.setColor(color); + } + + public SColorF getColor() + { + return _Animation.getColor(); + } + + public void setAnimation(EAnimationType Type) + { + switch (Type) + { + case EAnimationType.Resize: + _Animation = new CAnimationResize(); + break; + } + } + } +} diff --git a/Vocaluxe/Menu/Animations/CAnimationFramework.cs b/Vocaluxe/Menu/Animations/CAnimationFramework.cs new file mode 100644 index 00000000..3ac3d18c --- /dev/null +++ b/Vocaluxe/Menu/Animations/CAnimationFramework.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Text; +using System.Xml; +using System.Xml.XPath; + +using Vocaluxe.Base; +using Vocaluxe.Lib.Draw; + +namespace Vocaluxe.Menu.Animations +{ + public enum EAnimationType + { + Resize + } + + public enum EAnimationRepeat + { + None, + Reset, + Repeat, + RepeatWithReset + } + + public abstract class CAnimationFramework:IAnimation + { + public bool _AnimationLoaded; + + public EAnimationType Type; + public EAnimationRepeat Repeat; + public float Speed; + + public Stopwatch Timer = new Stopwatch(); + public bool ResetMode = false; + + public abstract void Init(); + + public virtual bool LoadAnimation(string item, XPathNavigator navigator) + { + _AnimationLoaded = true; + + _AnimationLoaded &= CHelper.TryGetFloatValueFromXML(item + "/Speed", navigator, ref Speed); + _AnimationLoaded &= CHelper.TryGetEnumValueFromXML(item + "/Repeat", navigator, ref Repeat); + + return _AnimationLoaded; + } + + public virtual bool SaveAnimation(XmlWriter writer) + { + return false; + } + + public virtual void StartAnimation() + { + Timer.Start(); + } + + public virtual void StopAnimation() + { + Timer.Stop(); + Timer.Reset(); + } + + public virtual void ResetAnimation() + { + ResetMode = !ResetMode; + } + + public virtual bool AnimationActive() + { + return Timer.IsRunning; + } + + public virtual void setRect(SRectF rect) + { + } + + public virtual SRectF getRect() + { + return new SRectF(); + } + + public virtual void setColor(SColorF color) + { + } + + public virtual SColorF getColor() + { + return new SColorF(); + } + + public abstract void Update(); + } +} diff --git a/Vocaluxe/Menu/Animations/CAnimationResize.cs b/Vocaluxe/Menu/Animations/CAnimationResize.cs new file mode 100644 index 00000000..ecc77feb --- /dev/null +++ b/Vocaluxe/Menu/Animations/CAnimationResize.cs @@ -0,0 +1,106 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Text; +using System.Xml; +using System.Xml.XPath; + +using Vocaluxe.Base; +using Vocaluxe.Lib.Draw; + +namespace Vocaluxe.Menu.Animations +{ + public class CAnimationResize : CAnimationFramework + { + public SRectF FinalRect; + public SRectF CurrentRect; + public SRectF OriginalRect; + + public CAnimationResize() + { + } + + public override void Init() + { + Type = EAnimationType.Resize; + } + + public override bool LoadAnimation(string item, XPathNavigator navigator) + { + //Load normal animation-options + _AnimationLoaded &= base.LoadAnimation(item, navigator); + + //Load specific animation-options + _AnimationLoaded &= CHelper.TryGetFloatValueFromXML(item + "/X", navigator, ref FinalRect.X); + _AnimationLoaded &= CHelper.TryGetFloatValueFromXML(item + "/Y", navigator, ref FinalRect.Y); + _AnimationLoaded &= CHelper.TryGetFloatValueFromXML(item + "/W", navigator, ref FinalRect.W); + _AnimationLoaded &= CHelper.TryGetFloatValueFromXML(item + "/H", navigator, ref FinalRect.H); + + return _AnimationLoaded; + } + + public override void setRect(SRectF rect) + { + OriginalRect = rect; + } + + public override SRectF getRect() + { + return CurrentRect; + } + + public override void StartAnimation() + { + base.StartAnimation(); + + CurrentRect = OriginalRect; + } + + public override void Update() + { + //Update CurrentRect + if (!ResetMode) + { + CLog.LogError((CurrentRect.X + ((FinalRect.X - CurrentRect.X) / Speed * Timer.ElapsedMilliseconds)).ToString("#.#####")); + CurrentRect.X = CurrentRect.X + ((FinalRect.X - CurrentRect.X) / Speed * Timer.ElapsedMilliseconds); + CurrentRect.Y = CurrentRect.Y + ((FinalRect.Y - CurrentRect.Y) / Speed * Timer.ElapsedMilliseconds); + CurrentRect.H = CurrentRect.H + ((FinalRect.H - CurrentRect.H) / Speed * Timer.ElapsedMilliseconds); + CurrentRect.W = CurrentRect.W + ((FinalRect.W - CurrentRect.W) / Speed * Timer.ElapsedMilliseconds); + } + else + { + CurrentRect.X = CurrentRect.X + ((OriginalRect.X - CurrentRect.X) / Speed * Timer.ElapsedMilliseconds); + CurrentRect.Y = CurrentRect.Y + ((OriginalRect.Y - CurrentRect.Y) / Speed * Timer.ElapsedMilliseconds); + CurrentRect.H = CurrentRect.H + ((OriginalRect.H - CurrentRect.H) / Speed * Timer.ElapsedMilliseconds); + CurrentRect.W = CurrentRect.W + ((OriginalRect.W - CurrentRect.W) / Speed * Timer.ElapsedMilliseconds); + } + + if (CurrentRect.X == FinalRect.X && CurrentRect.Y == FinalRect.Y && CurrentRect.H == FinalRect.H && CurrentRect.W == FinalRect.W) + { + switch (Repeat) + { + case EAnimationRepeat.Repeat: + StopAnimation(); + CurrentRect = OriginalRect; + StartAnimation(); + break; + + case EAnimationRepeat.RepeatWithReset: + ResetAnimation(); + break; + + case EAnimationRepeat.Reset: + if (!ResetMode) + ResetAnimation(); + else + StopAnimation(); + break; + + case EAnimationRepeat.None: + StopAnimation(); + break; + } + } + } + } +} diff --git a/Vocaluxe/Menu/Animations/IAnimation.cs b/Vocaluxe/Menu/Animations/IAnimation.cs new file mode 100644 index 00000000..444181c7 --- /dev/null +++ b/Vocaluxe/Menu/Animations/IAnimation.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Text; +using System.Xml; +using System.Xml.XPath; + +using Vocaluxe.Base; +using Vocaluxe.Lib.Draw; + +namespace Vocaluxe.Menu.Animations +{ + interface IAnimation + { + void Init(); + bool LoadAnimation(string item, XPathNavigator navigator); + bool SaveAnimation(XmlWriter writer); + + void setRect(SRectF rect); + SRectF getRect(); + void setColor(SColorF color); + SColorF getColor(); + + void StartAnimation(); + void StopAnimation(); + void ResetAnimation(); + bool AnimationActive(); + void Update(); + } +} diff --git a/Vocaluxe/Menu/CButton.cs b/Vocaluxe/Menu/CButton.cs index d4b5d231..a43143fd 100644 --- a/Vocaluxe/Menu/CButton.cs +++ b/Vocaluxe/Menu/CButton.cs @@ -30,7 +30,9 @@ namespace Vocaluxe.Menu public SColorF Color; public SColorF SColor; + public bool SelText; public CText Text; + public CText SText; public bool Reflection; public float ReflectionSpace; @@ -60,7 +62,9 @@ namespace Vocaluxe.Menu Color = new SColorF(); SColor = new SColorF(); + SelText = false; Text = new CText(); + SText = new CText(); Selected = false; Visible = true; @@ -113,6 +117,13 @@ namespace Vocaluxe.Menu _ThemeLoaded &= Text.LoadTheme(item, "Text", navigator, SkinIndex, true); Text.Z = Rect.Z; + if (CHelper.ItemExistsInXML(item + "/SText", navigator)) + { + SelText = true; + _ThemeLoaded &= SText.LoadTheme(item, "SText", navigator, SkinIndex, true); + SText.Z = Rect.Z; + } + //Reflections if (CHelper.ItemExistsInXML(item + "/Reflection", navigator)) @@ -189,6 +200,8 @@ namespace Vocaluxe.Menu } Text.SaveTheme(writer); + if (SelText) + SText.SaveTheme(writer); writer.WriteComment(" If exists:"); writer.WriteComment(" : Reflection Space"); @@ -240,25 +253,34 @@ namespace Vocaluxe.Menu { texture = CTheme.GetSkinTexture(_Theme.TextureName); CDraw.DrawTexture(texture, Rect, Color); + Text.DrawRelative(Rect.X, Rect.Y); if (Reflection) { CDraw.DrawTextureReflection(texture, Rect, Color, Rect, ReflectionSpace, ReflectionHeight); + Text.DrawRelative(Rect.X, Rect.Y, ReflectionSpace, ReflectionHeight, Rect.H); } } - else + else if(!SelText) { texture = CTheme.GetSkinTexture(_Theme.STextureName); CDraw.DrawTexture(texture, Rect, SColor); + Text.DrawRelative(Rect.X, Rect.Y); if (Reflection) { CDraw.DrawTextureReflection(texture, Rect, SColor, Rect, ReflectionSpace, ReflectionHeight); + Text.DrawRelative(Rect.X, Rect.Y, ReflectionSpace, ReflectionHeight, Rect.H); } } - - Text.DrawRelative(Rect.X, Rect.Y); - if (Reflection) + else if(SelText) { - Text.DrawRelative(Rect.X, Rect.Y, ReflectionSpace, ReflectionHeight, Rect.H); + texture = CTheme.GetSkinTexture(_Theme.STextureName); + CDraw.DrawTexture(texture, Rect, SColor); + SText.DrawRelative(Rect.X, Rect.Y); + if (Reflection) + { + CDraw.DrawTextureReflection(texture, Rect, SColor, Rect, ReflectionSpace, ReflectionHeight); + SText.DrawRelative(Rect.X, Rect.Y, ReflectionSpace, ReflectionHeight, Rect.H); + } } } diff --git a/Vocaluxe/Menu/CEqualizer.cs b/Vocaluxe/Menu/CEqualizer.cs new file mode 100644 index 00000000..a3c6767d --- /dev/null +++ b/Vocaluxe/Menu/CEqualizer.cs @@ -0,0 +1,305 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Text; +using System.Xml; +using System.Xml.XPath; + +using Vocaluxe.Base; +using Vocaluxe.Lib.Draw; + +namespace Vocaluxe.Menu +{ + enum EEqualizerStyle + { + Collums + } + + struct SThemeEqualizer + { + public string Name; + + public string ColorName; + public string MaxColorName; + public string TextureName; + + public int NumBars; + + public EEqualizerStyle Style; + public EOffOn DrawNegative; + } + + class CEqualizer : IMenuElement + { + private SThemeEqualizer _Theme; + private bool _ThemeLoaded; + + public SRectF Rect; + public SColorF Color; + public SColorF MaxColor; + public float Space; + + public bool Reflection; + public float ReflectionSpace; + public float ReflectionHeight; + + public bool Selected; + public bool Visible; + public bool ScreenHandles; + + private float[] _Bars; + + public CEqualizer() + { + _Theme = new SThemeEqualizer(); + _ThemeLoaded = false; + + Rect = new SRectF(); + Color = new SColorF(); + MaxColor = new SColorF(); + + Selected = false; + Visible = true; + ScreenHandles = false; + + Reflection = false; + ReflectionSpace = 0f; + ReflectionHeight = 0f; + } + + public bool LoadTheme(string XmlPath, string ElementName, XPathNavigator navigator, int SkinIndex) + { + string item = XmlPath + "/" + ElementName; + _ThemeLoaded = true; + + _ThemeLoaded &= CHelper.GetValueFromXML(item + "/Skin", navigator, ref _Theme.TextureName, 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); + + _ThemeLoaded &= CHelper.TryGetIntValueFromXML(item + "/NumBars", navigator, ref _Theme.NumBars); + + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/Space", navigator, ref Space); + + _ThemeLoaded &= CHelper.TryGetEnumValueFromXML(item + "/Style", navigator, ref _Theme.Style); + + _ThemeLoaded &= CHelper.TryGetEnumValueFromXML(item + "/DrawNegative", navigator, ref _Theme.DrawNegative); + + if (CHelper.GetValueFromXML(item + "/Color", navigator, ref _Theme.ColorName, String.Empty)) + { + _ThemeLoaded &= CTheme.GetColor(_Theme.ColorName, SkinIndex, ref Color); + } + else + { + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/R", navigator, ref Color.R); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/G", navigator, ref Color.G); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/B", navigator, ref Color.B); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/A", navigator, ref Color.A); + } + + if (CHelper.GetValueFromXML(item + "/MaxColor", navigator, ref _Theme.MaxColorName, String.Empty)) + { + _ThemeLoaded &= CTheme.GetColor(_Theme.ColorName, SkinIndex, ref Color); + } + else + { + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/MaxR", navigator, ref MaxColor.R); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/MaxG", navigator, ref MaxColor.G); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/MaxB", navigator, ref MaxColor.B); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/MaxA", navigator, ref MaxColor.A); + } + + //Reflection + if (CHelper.ItemExistsInXML(item + "/Reflection", navigator)) + { + Reflection = true; + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/Reflection/Space", navigator, ref ReflectionSpace); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/Reflection/Height", navigator, ref ReflectionHeight); + } + else + Reflection = false; + + if (_ThemeLoaded) + { + _Theme.Name = ElementName; + _Bars = new float[_Theme.NumBars]; + for (int i = 0; i < _Bars.Length; i++) + { + _Bars[i] = 0f; + } + LoadTextures(); + } + return _ThemeLoaded; + } + + public bool SaveTheme(XmlWriter writer) + { + if (_ThemeLoaded) + { + writer.WriteStartElement(_Theme.Name); + + writer.WriteComment(": Texture name"); + writer.WriteElementString("Skin", _Theme.TextureName); + + writer.WriteComment(", , , , : Equalizer 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.WriteComment(": Number of equalizer-elements."); + writer.WriteElementString("NumBars", _Theme.NumBars.ToString("#0")); + writer.WriteComment(": Space between equalizer-elements."); + writer.WriteElementString("Space", Space.ToString("#0.00")); + writer.WriteComment("