From daf1848e4536b8a3d1cf559e5e0371dd0447abe9 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Tue, 3 Jul 2012 11:16:43 +0200 Subject: [PATCH 01/21] Fix problem of spaces between P and number in duet-files. --- Vocaluxe/Lib/Song/CSong.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Vocaluxe/Lib/Song/CSong.cs b/Vocaluxe/Lib/Song/CSong.cs index fee895b1..fe098426 100644 --- a/Vocaluxe/Lib/Song/CSong.cs +++ b/Vocaluxe/Lib/Song/CSong.cs @@ -420,9 +420,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) From ebef44745a9d46e17151e6fd1ff543b6feb32f06 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Fri, 20 Jul 2012 11:52:38 +0200 Subject: [PATCH 02/21] Added SText to buttons. --- Vocaluxe/Menu/CButton.cs | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) 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); + } } } From 4c07e89904a830ce29e7a06c51c7ebb6e6022b53 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Fri, 20 Jul 2012 12:10:32 +0200 Subject: [PATCH 03/21] Fix wrong assignment of keys. --- Output/Readme.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 ================================= From 65b76df0f7517e52000908055cc98c0ad5bd9c67 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Fri, 27 Jul 2012 12:17:00 +0200 Subject: [PATCH 04/21] Added DrawColorReflection-Method. Buggy with OpenGL - Need some help! --- Vocaluxe/Base/CDraw.cs | 5 ++++ Vocaluxe/Lib/Draw/CDirect3D.cs | 13 +++++++++ Vocaluxe/Lib/Draw/CDrawWinForm.cs | 5 ++++ Vocaluxe/Lib/Draw/COpenGL.cs | 48 +++++++++++++++++++++++++++++++ Vocaluxe/Lib/Draw/IDraw.cs | 1 + 5 files changed, 72 insertions(+) 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/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..0ae4ad0f 100644 --- a/Vocaluxe/Lib/Draw/COpenGL.cs +++ b/Vocaluxe/Lib/Draw/COpenGL.cs @@ -661,6 +661,54 @@ namespace Vocaluxe.Lib.Draw GL.Disable(EnableCap.Blend); } + public void DrawColorReflection(SColorF color, SRectF rect, float space, float height) + { + 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(); From 2484c52e08fb3770da54efc715dc0a79bf3fb6b7 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Fri, 27 Jul 2012 12:21:39 +0200 Subject: [PATCH 05/21] Move Equalizer-Element to Screen-Files. Still some work left. --- Vocaluxe/Menu/CEqualizer.cs | 324 +++++++++++++++++++++++ Vocaluxe/Menu/CInteraction.cs | 3 +- Vocaluxe/Menu/CMenu.cs | 102 ++++++- Vocaluxe/Screens/CScreenOptionsRecord.cs | 114 +------- Vocaluxe/Vocaluxe.csproj | 1 + 5 files changed, 440 insertions(+), 104 deletions(-) create mode 100644 Vocaluxe/Menu/CEqualizer.cs diff --git a/Vocaluxe/Menu/CEqualizer.cs b/Vocaluxe/Menu/CEqualizer.cs new file mode 100644 index 00000000..a33641b4 --- /dev/null +++ b/Vocaluxe/Menu/CEqualizer.cs @@ -0,0 +1,324 @@ +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 + { + Bars, + 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]; + 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(" + 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/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/Vocaluxe/Screens/CScreenOptionsRecord.cs b/Vocaluxe/Screens/CScreenOptionsRecord.cs index 39c96c94..9cf27630 100644 --- a/Vocaluxe/Screens/CScreenOptionsRecord.cs +++ b/Vocaluxe/Screens/CScreenOptionsRecord.cs @@ -21,7 +21,7 @@ namespace Vocaluxe.Screens class CScreenOptionsRecord : 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 float MaxDelayTime = 1f; private const string SelectSlideRecordDevices = "SelectSlideRecordDevices"; From df8f2c10d236e111ab36ae13f7dde95dae440bd2 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Fri, 27 Jul 2012 14:14:47 +0200 Subject: [PATCH 07/21] Added equalizers to ScreenNames to show mic-input. Should be useful with more than 2 mics... --- Output/Themes/Ambient/Screens/ScreenNames.xml | 166 +++++++++++++++++- .../Changelog/Changelog_ScreenNames.txt | 5 + Vocaluxe/Menu/CEqualizer.cs | 68 +++---- Vocaluxe/Screens/CScreenNames.cs | 27 ++- 4 files changed, 218 insertions(+), 48 deletions(-) diff --git a/Output/Themes/Ambient/Screens/ScreenNames.xml b/Output/Themes/Ambient/Screens/ScreenNames.xml index c1ac532c..6c387b93 100644 --- a/Output/Themes/Ambient/Screens/ScreenNames.xml +++ b/Output/Themes/Ambient/Screens/ScreenNames.xml @@ -1,7 +1,7 @@  - 2 + 3 Video @@ -738,5 +738,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 + + 1213 + 152 + -4,00 + 108 + 60 + + 8 + + 2,00 + + + + + Player4Dim2 + + + Player4Dim + + TR_CONFIG_OFF + + + + + + + Invisible + + 1213 + 307 + -4,00 + 108 + 60 + + 8 + + 2,00 + + + + + Player5Dim2 + + + Player5Dim + + TR_CONFIG_OFF + + + + + + + Invisible + + 1213 + 467 + -4,00 + 108 + 60 + + 8 + + 2,00 + + + + + Player6Dim2 + + + Player6Dim + + TR_CONFIG_OFF + + + + - \ No newline at end of file + diff --git a/Output/Themes/Changelog/Changelog_ScreenNames.txt b/Output/Themes/Changelog/Changelog_ScreenNames.txt index 47d04016..60cea8b5 100644 --- a/Output/Themes/Changelog/Changelog_ScreenNames.txt +++ b/Output/Themes/Changelog/Changelog_ScreenNames.txt @@ -1,5 +1,10 @@ SceenNames +++++++++++ +Version 3: + + (One Equalizer for each player): Equalizer shows input from assigned mic for this player. + ++++++++++ Version 2: diff --git a/Vocaluxe/Menu/CEqualizer.cs b/Vocaluxe/Menu/CEqualizer.cs index a33641b4..2f82759c 100644 --- a/Vocaluxe/Menu/CEqualizer.cs +++ b/Vocaluxe/Menu/CEqualizer.cs @@ -127,6 +127,10 @@ namespace Vocaluxe.Menu { _Theme.Name = ElementName; _Bars = new float[_Theme.NumBars]; + for (int i = 0; i < _Bars.Length; i++) + { + _Bars[i] = 0f; + } LoadTextures(); } return _ThemeLoaded; @@ -170,18 +174,18 @@ namespace Vocaluxe.Menu writer.WriteElementString("B", Color.B.ToString("#0.00")); writer.WriteElementString("A", Color.A.ToString("#0.00")); } - writer.WriteComment(": Equalizer color from ColorScheme (high priority)"); - writer.WriteComment("or , , , (lower priority)"); + writer.WriteComment(": Equalizer color for maximal volume from ColorScheme (high priority)"); + writer.WriteComment("or , , , (lower priority)"); if (_Theme.ColorName != String.Empty) { - writer.WriteElementString("Color", _Theme.ColorName); + writer.WriteElementString("MaxColor", _Theme.ColorName); } else { - writer.WriteElementString("R", Color.R.ToString("#0.00")); - writer.WriteElementString("G", Color.G.ToString("#0.00")); - writer.WriteElementString("B", Color.B.ToString("#0.00")); - writer.WriteElementString("A", Color.A.ToString("#0.00")); + writer.WriteElementString("MaxR", Color.R.ToString("#0.00")); + writer.WriteElementString("MaxG", Color.G.ToString("#0.00")); + writer.WriteElementString("MaxB", Color.B.ToString("#0.00")); + writer.WriteElementString("MaxA", Color.A.ToString("#0.00")); } writer.WriteComment(" If exists:"); @@ -207,11 +211,10 @@ namespace Vocaluxe.Menu return; for (int i = 0; i < _Bars.Length; i++) { - if (weights.Length > i){ - _Bars[i] = weights[i]; + _Bars[i] = 1f - weights[i]; if (_Theme.DrawNegative == EOffOn.TR_CONFIG_OFF && weights[i] < 0) - _Bars[i] = 0f; + _Bars[i] = (1f + weights[i]); } else _Bars[i] = 0f; @@ -234,7 +237,7 @@ namespace Vocaluxe.Menu if (_Bars == null) return; - float dx = Rect.W / _Bars.Length + Space; + float dx = (Rect.W ) / _Bars.Length; int max = _Bars.Length - 1; float maxB = _Bars[max]; for (int i = 0; i < _Bars.Length - 1; i++) @@ -246,40 +249,19 @@ namespace Vocaluxe.Menu } } - switch (_Theme.Style){ - case EEqualizerStyle.Collums: - for (int i = 0; i < _Bars.Length; i++) - { - SRectF bar = new SRectF(Rect.X + dx * i, Rect.Y + Rect.H - _Bars[i] * Rect.H, dx - Space, _Bars[i] * Rect.H, Rect.Z); - SColorF color = Color; - if (i == max) - { - color = MaxColor; - } + for (int i = 0; i < _Bars.Length; i++) + { + SRectF bar = new SRectF(Rect.X + dx * i, Rect.Y + Rect.H - _Bars[i] * Rect.H, dx - Space, _Bars[i] * Rect.H, Rect.Z); + SColorF color = Color; + if (i == max) + { + color = MaxColor; + } - CDraw.DrawColor(color, bar); + CDraw.DrawColor(color, bar); - if (Reflection) - CDraw.DrawColorReflection(color, bar, ReflectionSpace, ReflectionHeight); - } - break; - - case EEqualizerStyle.Bars: - for (int i = 0; i < _Bars.Length; i++) - { - SRectF bar = new SRectF(Rect.X + dx * i, Rect.Y + Rect.H - _Bars[i] * Rect.H, dx - Space, _Bars[i] * Rect.H, Rect.Z); - SColorF color = Color; - if (i == max) - { - color = MaxColor; - } - - CDraw.DrawColor(color, bar); - - if (Reflection) - CDraw.DrawColorReflection(color, bar, ReflectionSpace, ReflectionHeight); - } - break; + if (Reflection) + CDraw.DrawColorReflection(color, bar, ReflectionSpace, ReflectionHeight); } } diff --git a/Vocaluxe/Screens/CScreenNames.cs b/Vocaluxe/Screens/CScreenNames.cs index 10258aca..9c8962e4 100644 --- a/Vocaluxe/Screens/CScreenNames.cs +++ b/Vocaluxe/Screens/CScreenNames.cs @@ -12,7 +12,7 @@ namespace Vocaluxe.Screens class CScreenNames : 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 CStatic chooseAvatarStatic; private int OldMouseX; @@ -29,6 +29,7 @@ namespace Vocaluxe.Screens private readonly string[] StaticPlayer = new string[] { "StaticPlayer1", "StaticPlayer2", "StaticPlayer3", "StaticPlayer4", "StaticPlayer5", "StaticPlayer6" }; private readonly string[] StaticPlayerAvatar = new string[] { "StaticPlayerAvatar1", "StaticPlayerAvatar2", "StaticPlayerAvatar3", "StaticPlayerAvatar4", "StaticPlayerAvatar5", "StaticPlayerAvatar6" }; private readonly string[] TextPlayer = new string[] { "TextPlayer1", "TextPlayer2", "TextPlayer3", "TextPlayer4", "TextPlayer5", "TextPlayer6" }; + private readonly string[] EqualizerPlayer = new string[] { "EqualizerPlayer1", "EqualizerPlayer2", "EqualizerPlayer3", "EqualizerPlayer4", "EqualizerPlayer5", "EqualizerPlayer6" }; private STexture[] OriginalPlayerAvatarTextures = new STexture[CSettings.MaxNumPlayer]; private bool selectingMouseActive = false; @@ -84,6 +85,10 @@ namespace Vocaluxe.Screens texts.Add(NameSelection); _ThemeNameSelections = texts.ToArray(); + texts.Clear(); + texts.AddRange(EqualizerPlayer); + _ThemeEqualizers = texts.ToArray(); + chooseAvatarStatic = new CStatic(); chooseAvatarStatic.Visible = false; } @@ -503,13 +508,18 @@ namespace Vocaluxe.Screens public override bool UpdateGame() { - + for (int i = 1; i <= CGame.NumPlayer; i++) + { + CSound.AnalyzeBuffer((i-1)); + Equalizers[htEqualizer("EqualizerPlayer" + i)].Update(CSound.ToneWeigth((i-1))); + } return true; } public override void OnShow() { base.OnShow(); + CSound.RecordStart(); NameSelections[htNameSelections(NameSelection)].Init(); @@ -531,6 +541,12 @@ namespace Vocaluxe.Screens SetInteractionToButton(Buttons[htButtons(ButtonStart)]); } + public override void OnClose() + { + base.OnClose(); + CSound.RecordStop(); + } + public override bool Draw() { base.Draw(); @@ -539,7 +555,10 @@ namespace Vocaluxe.Screens { chooseAvatarStatic.Draw(); } - + for (int i = 1; i <= CGame.NumPlayer; i++) + { + Equalizers[htEqualizer("EqualizerPlayer" + i)].Draw(); + } return true; } @@ -591,12 +610,14 @@ namespace Vocaluxe.Screens { Texts[htTexts("TextPlayer" + i)].Text = CLanguage.Translate("TR_SCREENNAMES_PLAYER") + " " + i.ToString(); } + Equalizers[htEqualizer("EqualizerPlayer" + i)].Visible = true; } else { Statics[htStatics("StaticPlayer" + i)].Visible = false; Statics[htStatics("StaticPlayerAvatar" + i)].Visible = false; Texts[htTexts("TextPlayer" + i)].Visible = false; + Equalizers[htEqualizer("EqualizerPlayer" + i)].Visible = false; } } CConfig.SaveConfig(); From c40f07c2a1f1ae11c3834d9ed38cdc92e05cf2e7 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Fri, 27 Jul 2012 17:44:22 +0200 Subject: [PATCH 08/21] Fix DrawColorReflection (thx Darkice) --- Vocaluxe/Lib/Draw/COpenGL.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Vocaluxe/Lib/Draw/COpenGL.cs b/Vocaluxe/Lib/Draw/COpenGL.cs index 0ae4ad0f..06a09e95 100644 --- a/Vocaluxe/Lib/Draw/COpenGL.cs +++ b/Vocaluxe/Lib/Draw/COpenGL.cs @@ -663,6 +663,10 @@ namespace Vocaluxe.Lib.Draw 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; @@ -680,6 +684,7 @@ namespace Vocaluxe.Lib.Draw if (ry2 > rect.Y + rect.H + space + height) ry2 = rect.Y + rect.H + space + height; + GL.Enable(EnableCap.Blend); if (rect.Rotation != 0f) From 1cca599a74ea1cda67567f40e035d3025aba2070 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Fri, 27 Jul 2012 17:50:50 +0200 Subject: [PATCH 09/21] Equalizers could only used, when they are handled by screen. Later we will give possibility to add "normal" equalizers which shows bg-music. --- Vocaluxe/Menu/CMenu.cs | 3 ++- Vocaluxe/Screens/CScreenNames.cs | 5 +++++ Vocaluxe/Screens/CScreenOptionsRecord.cs | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Vocaluxe/Menu/CMenu.cs b/Vocaluxe/Menu/CMenu.cs index ed731ad2..3677b369 100644 --- a/Vocaluxe/Menu/CMenu.cs +++ b/Vocaluxe/Menu/CMenu.cs @@ -1911,7 +1911,8 @@ namespace Vocaluxe.Menu case EType.TEqualizer: if (!_Equalizers[_Interactions[interaction].Num].ScreenHandles) { - //_Equalizers[_Interactions[interaction].Num].Update(CSound.Get + //TODO: + //Call Update-Method of Equalizer and give infos about bg-sound. //_Equalizers[_Interactions[interaction].Num].Draw(); } break; diff --git a/Vocaluxe/Screens/CScreenNames.cs b/Vocaluxe/Screens/CScreenNames.cs index 9c8962e4..e43e2f5b 100644 --- a/Vocaluxe/Screens/CScreenNames.cs +++ b/Vocaluxe/Screens/CScreenNames.cs @@ -107,6 +107,11 @@ namespace Vocaluxe.Screens { OriginalPlayerAvatarTextures[i] = Statics[htStatics(StaticPlayerAvatar[i])].Texture; } + + for (int i = 1; i <= CSettings.MaxNumPlayer; i++) + { + Equalizers[htEqualizer("EqualizerPlayer" + i)].ScreenHandles = true; + } } public override bool HandleInput(KeyEvent KeyEvent) diff --git a/Vocaluxe/Screens/CScreenOptionsRecord.cs b/Vocaluxe/Screens/CScreenOptionsRecord.cs index 9cf27630..c4566428 100644 --- a/Vocaluxe/Screens/CScreenOptionsRecord.cs +++ b/Vocaluxe/Screens/CScreenOptionsRecord.cs @@ -109,6 +109,9 @@ namespace Vocaluxe.Screens Statics[htStatics(StaticEnergyChannel[i])].Visible = false; ChannelEnergy[i] = 0f; } + + Equalizers[htEqualizer(EqualizerChannel1)].ScreenHandles = true; + Equalizers[htEqualizer(EqualizerChannel2)].ScreenHandles = true; } public override bool HandleInput(KeyEvent KeyEvent) From f6cbc2687bb62e0a46f4a7895b4bc3d53da7b218 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Fri, 27 Jul 2012 18:20:58 +0200 Subject: [PATCH 10/21] Start (un)endless name-selection with "P". "P" for next player, "enter" for select profile, "escape" for stop selecting. --- Vocaluxe/Screens/CScreenNames.cs | 52 +++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 4 deletions(-) diff --git a/Vocaluxe/Screens/CScreenNames.cs b/Vocaluxe/Screens/CScreenNames.cs index e43e2f5b..b5c0d5df 100644 --- a/Vocaluxe/Screens/CScreenNames.cs +++ b/Vocaluxe/Screens/CScreenNames.cs @@ -34,6 +34,7 @@ namespace Vocaluxe.Screens private bool selectingMouseActive = false; private bool selectingKeyboardActive = false; + private bool selectingKeyboardUnendless = false; private int selectingKeyboardPlayerNr = 0; private int SelectedPlayerNr; @@ -137,6 +138,22 @@ namespace Vocaluxe.Screens NameSelections[htNameSelections(NameSelection)].UpdateList(); } break; + + case Keys.P: + if (!selectingKeyboardActive) + { + selectingKeyboardPlayerNr = 1; + selectingKeyboardUnendless = true; + } + else + { + if (selectingKeyboardPlayerNr + 1 <= CGame.NumPlayer) + selectingKeyboardPlayerNr++; + else + selectingKeyboardPlayerNr = 1; + NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, selectingKeyboardPlayerNr); + } + break; } //Check if selecting with keyboard is active if (selectingKeyboardActive) @@ -166,10 +183,29 @@ namespace Vocaluxe.Screens NameSelections[htNameSelections(NameSelection)].UpdateList(); SetInteractionToButton(Buttons[htButtons(ButtonStart)]); } - //Reset all values - selectingKeyboardPlayerNr = 0; - selectingKeyboardActive = false; - NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); + //Started selecting with 'P' + if (selectingKeyboardUnendless) + { + if (selectingKeyboardPlayerNr == CGame.NumPlayer) + { + //Reset all values + selectingKeyboardPlayerNr = 0; + selectingKeyboardActive = false; + NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); + } + else + { + selectingKeyboardPlayerNr++; + NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, selectingKeyboardPlayerNr); + } + } + else + { + //Reset all values + selectingKeyboardPlayerNr = 0; + selectingKeyboardActive = false; + NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); + } break; case Keys.D1: @@ -186,6 +222,7 @@ namespace Vocaluxe.Screens selectingKeyboardPlayerNr = 1; NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, 1); } + selectingKeyboardUnendless = false; break; case Keys.D2: case Keys.NumPad2: @@ -201,6 +238,7 @@ namespace Vocaluxe.Screens selectingKeyboardPlayerNr = 2; NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, 2); } + selectingKeyboardUnendless = false; break; case Keys.D3: case Keys.NumPad3: @@ -216,6 +254,7 @@ namespace Vocaluxe.Screens selectingKeyboardPlayerNr = 3; NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, 3); } + selectingKeyboardUnendless = false; break; case Keys.D4: case Keys.NumPad4: @@ -231,6 +270,7 @@ namespace Vocaluxe.Screens selectingKeyboardPlayerNr = 4; NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, 4); } + selectingKeyboardUnendless = false; break; case Keys.D5: case Keys.NumPad5: @@ -246,6 +286,7 @@ namespace Vocaluxe.Screens selectingKeyboardPlayerNr = 5; NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, 5); } + selectingKeyboardUnendless = false; break; case Keys.D6: case Keys.NumPad6: @@ -261,11 +302,14 @@ namespace Vocaluxe.Screens selectingKeyboardPlayerNr = 6; NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, 6); } + selectingKeyboardUnendless = false; break; + case Keys.Escape: //Reset all values selectingKeyboardPlayerNr = 0; selectingKeyboardActive = false; + selectingKeyboardUnendless = false; NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); break; From 4d6bac2e2bb67a3fa555ff5555bc6d88ec44a39d Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 28 Jul 2012 12:58:49 +0200 Subject: [PATCH 11/21] Fix equalizer-positions. --- Output/Themes/Ambient/Screens/ScreenNames.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Output/Themes/Ambient/Screens/ScreenNames.xml b/Output/Themes/Ambient/Screens/ScreenNames.xml index 6c387b93..416f5f53 100644 --- a/Output/Themes/Ambient/Screens/ScreenNames.xml +++ b/Output/Themes/Ambient/Screens/ScreenNames.xml @@ -823,7 +823,7 @@ Invisible - 1213 + 1153 152 -4,00 108 @@ -850,7 +850,7 @@ Invisible - 1213 + 1153 307 -4,00 108 @@ -877,7 +877,7 @@ Invisible - 1213 + 1153 467 -4,00 108 From 9fda9eb06e0141085d9f4159ba71314b8a1c6919 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 4 Aug 2012 13:55:57 +0200 Subject: [PATCH 12/21] Added possibility to choose duet-part on Name-Selection. Added new tags: #P1 and #P2. --- Output/Themes/Ambient/Screens/ScreenNames.xml | 486 ++++++++++++++++++ Vocaluxe/GameModes/CGameMode.cs | 2 +- Vocaluxe/Lib/Song/CSong.cs | 28 + Vocaluxe/Menu/CSelectSlide.cs | 8 +- Vocaluxe/Menu/SongMenu/CSongMenuDreidel.cs | 21 + Vocaluxe/Screens/CScreenNames.cs | 28 +- Vocaluxe/Screens/CScreenSing.cs | 24 +- 7 files changed, 587 insertions(+), 10 deletions(-) diff --git a/Output/Themes/Ambient/Screens/ScreenNames.xml b/Output/Themes/Ambient/Screens/ScreenNames.xml index 416f5f53..289409b4 100644 --- a/Output/Themes/Ambient/Screens/ScreenNames.xml +++ b/Output/Themes/Ambient/Screens/ScreenNames.xml @@ -29,6 +29,102 @@ + + + SelectSlidePlayer + + 20 + 105 + -4,00 + 108 + 20 + + + SelectSlideColor + + + + + + + SelectSlidePlayer + + 20 + 260 + -4,00 + 108 + 20 + + + SelectSlideColor + + + + + + + SelectSlidePlayer + + 20 + 415 + -4,00 + 108 + 20 + + + SelectSlideColor + + + + + + + SelectSlidePlayer + + 1152 + 105 + -4,00 + 108 + 20 + + + SelectSlideColor + + + + + + + SelectSlidePlayer + + 1152 + 260 + -4,00 + 108 + 20 + + + SelectSlideColor + + + + + + + SelectSlidePlayer + + 1152 + 415 + -4,00 + 108 + 20 + + + SelectSlideColor + + + + PlayerSelector @@ -695,6 +791,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 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/Song/CSong.cs b/Vocaluxe/Lib/Song/CSong.cs index fe098426..f3240472 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))) { @@ -366,6 +381,19 @@ namespace Vocaluxe.Lib.Song this.TitleSorting = this.Title; } + //Check if Duet-Tags are set + if (IsDuet) + { + if (DuetPart1 == String.Empty) + { + DuetPart1 = "Part 1"; + } + if (DuetPart2 == String.Empty) + { + DuetPart2 = "Part 2"; + } + } + return true; } diff --git a/Vocaluxe/Menu/CSelectSlide.cs b/Vocaluxe/Menu/CSelectSlide.cs index 099ef2ea..5b10c514 100644 --- a/Vocaluxe/Menu/CSelectSlide.cs +++ b/Vocaluxe/Menu/CSelectSlide.cs @@ -581,14 +581,14 @@ namespace Vocaluxe.Menu public void ProcessMouseMove(int x, int y) { - _ArrowLeftSelected = CHelper.IsInBounds(RectArrowLeft, x, y); - _ArrowRightSelected = CHelper.IsInBounds(RectArrowRight, x, y); + _ArrowLeftSelected = CHelper.IsInBounds(RectArrowLeft, x, y) && _Selection > 0; + _ArrowRightSelected = CHelper.IsInBounds(RectArrowRight, x, y) && _Selection < _ValueNames.Count - 1; } public void ProcessMouseLBClick(int x, int y) { - _ArrowLeftSelected = CHelper.IsInBounds(RectArrowLeft, x, y); - _ArrowRightSelected = CHelper.IsInBounds(RectArrowRight, x, y); + _ArrowLeftSelected = CHelper.IsInBounds(RectArrowLeft, x, y) && _Selection > 0; + _ArrowRightSelected = CHelper.IsInBounds(RectArrowRight, x, y) && _Selection < _ValueNames.Count - 1; if (_ArrowLeftSelected) PrevValue(); diff --git a/Vocaluxe/Menu/SongMenu/CSongMenuDreidel.cs b/Vocaluxe/Menu/SongMenu/CSongMenuDreidel.cs index c13aff50..7ab6a6af 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenuDreidel.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenuDreidel.cs @@ -1,10 +1,31 @@ using System; using System.Collections.Generic; +using System.Drawing; using System.Text; +using System.Windows.Forms; + +using Vocaluxe.Base; +using Vocaluxe.Lib.Draw; +using Vocaluxe.Lib.Song; namespace Vocaluxe.Menu.SongMenu { class CSongMenuDreidel : CSongMenuFramework { + private SRectF _ScrollRect; + + private CStatic _DuetIcon; + private CStatic _VideoIcon; + + private CText _Artist; + private CText _Title; + private CText _SongLength; + + private int _actualSelection = -1; + + public override int GetActualSelection() + { + return _actualSelection; + } } } diff --git a/Vocaluxe/Screens/CScreenNames.cs b/Vocaluxe/Screens/CScreenNames.cs index b5c0d5df..626863ea 100644 --- a/Vocaluxe/Screens/CScreenNames.cs +++ b/Vocaluxe/Screens/CScreenNames.cs @@ -30,6 +30,7 @@ namespace Vocaluxe.Screens private readonly string[] StaticPlayerAvatar = new string[] { "StaticPlayerAvatar1", "StaticPlayerAvatar2", "StaticPlayerAvatar3", "StaticPlayerAvatar4", "StaticPlayerAvatar5", "StaticPlayerAvatar6" }; private readonly string[] TextPlayer = new string[] { "TextPlayer1", "TextPlayer2", "TextPlayer3", "TextPlayer4", "TextPlayer5", "TextPlayer6" }; private readonly string[] EqualizerPlayer = new string[] { "EqualizerPlayer1", "EqualizerPlayer2", "EqualizerPlayer3", "EqualizerPlayer4", "EqualizerPlayer5", "EqualizerPlayer6" }; + private readonly string[] SelectSlideDuetPlayer = new string[] { "SelectSlideDuetPlayer1", "SelectSlideDuetPlayer2", "SelectSlideDuetPlayer3", "SelectSlideDuetPlayer4", "SelectSlideDuetPlayer5", "SelectSlideDuetPlayer6" }; private STexture[] OriginalPlayerAvatarTextures = new STexture[CSettings.MaxNumPlayer]; private bool selectingMouseActive = false; @@ -65,8 +66,9 @@ namespace Vocaluxe.Screens _ThemeStatics = statics.ToArray(); List texts = new List(); - - _ThemeSelectSlides = new string[] { SelectSlidePlayerNumber }; + texts.Add(SelectSlidePlayerNumber); + texts.AddRange(SelectSlideDuetPlayer); + _ThemeSelectSlides = texts.ToArray(); texts.Clear(); texts.Add(TextWarningMics); @@ -585,6 +587,21 @@ namespace Vocaluxe.Screens Statics[htStatics(StaticPlayerAvatar[i])].Texture = CProfiles.Profiles[CGame.Player[i].ProfileID].Avatar.Texture; Texts[htTexts(TextPlayer[i])].Text = CProfiles.Profiles[CGame.Player[i].ProfileID].PlayerName; } + if (CGame.GetNumSongs() == 1 && CGame.GetSong(1).IsDuet) + { + if (i + 1 <= CGame.NumPlayer) + SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].Visible = true; + else + SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].Visible = false; + SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].AddValue(CGame.GetSong(1).DuetPart1); + SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].AddValue(CGame.GetSong(1).DuetPart2); + if ((i + 1) % 2 == 0) + SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].SetSelectionByValueIndex(1); + else + SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].SetSelectionByValueIndex(0); + } + else + SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].Visible = false; } SetInteractionToButton(Buttons[htButtons(ButtonStart)]); @@ -629,6 +646,10 @@ namespace Vocaluxe.Screens CGame.Player[i].Name = ""; } } + if (CGame.GetNumSongs() == 1 && CGame.GetSong(1).IsDuet) + { + CGame.Player[i].LineNr = SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].Selection; + } } CGraphics.FadeTo(EScreens.ScreenSing); @@ -660,6 +681,8 @@ namespace Vocaluxe.Screens Texts[htTexts("TextPlayer" + i)].Text = CLanguage.Translate("TR_SCREENNAMES_PLAYER") + " " + i.ToString(); } Equalizers[htEqualizer("EqualizerPlayer" + i)].Visible = true; + if (CGame.GetNumSongs() == 1 && CGame.GetSong(1).IsDuet) + SelectSlides[htSelectSlides("SelectSlideDuetPlayer" + i)].Visible = true; } else { @@ -667,6 +690,7 @@ namespace Vocaluxe.Screens Statics[htStatics("StaticPlayerAvatar" + i)].Visible = false; Texts[htTexts("TextPlayer" + i)].Visible = false; Equalizers[htEqualizer("EqualizerPlayer" + i)].Visible = false; + SelectSlides[htSelectSlides("SelectSlideDuetPlayer" + i)].Visible = false; } } CConfig.SaveConfig(); diff --git a/Vocaluxe/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs index 2ddd87dd..fdedcb90 100644 --- a/Vocaluxe/Screens/CScreenSing.cs +++ b/Vocaluxe/Screens/CScreenSing.cs @@ -523,6 +523,12 @@ namespace Vocaluxe.Screens _FinishTime = song.Finish; _TimeToFirstNote = 0f; _TimeToFirstNoteDuet = 0f; + //Save duet-assignment before resetting + int[] duet_player = new int[CGame.NumPlayer]; + for (int i = 0; i < duet_player.Length; i++) + { + duet_player[i] = CGame.Player[i].LineNr; + } CGame.ResetPlayer(); CDraw.RemoveTexture(ref _CurrentVideoTexture); @@ -542,10 +548,22 @@ namespace Vocaluxe.Screens bool LyricsOnTop = (CGame.NumPlayer != 1) && CConfig.LyricsOnTop == EOffOn.TR_CONFIG_ON; if (song.IsDuet) - { - for (int i = 1; i <= CGame.NumPlayer; i = i + 2) + { + //More than one song: Player is not assigned to line by user + //Otherwise, this is done by CScreenNames + if (CGame.GetNumSongs() > 1) { - CGame.Player[i].LineNr = 1; + for (int i = 1; i <= CGame.NumPlayer; i = i + 2) + { + CGame.Player[i].LineNr = 1; + } + } + else + { + for (int i = 0; i < CGame.NumPlayer; i++) + { + CGame.Player[i].LineNr = duet_player[i]; + } } Statics[htStatics(StaticLyricsDuet)].Visible = true; Lyrics[htLyrics(LyricMainDuet)].Visible = true; From 01495362e9e8f61760afc9a98bec8bf46a8043d8 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 4 Aug 2012 14:19:51 +0200 Subject: [PATCH 13/21] Update Changelog for ScreenNames. --- Output/Themes/Changelog/Changelog_ScreenNames.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Output/Themes/Changelog/Changelog_ScreenNames.txt b/Output/Themes/Changelog/Changelog_ScreenNames.txt index 60cea8b5..221c9331 100644 --- a/Output/Themes/Changelog/Changelog_ScreenNames.txt +++ b/Output/Themes/Changelog/Changelog_ScreenNames.txt @@ -4,6 +4,7 @@ SceenNames Version 3: (One Equalizer for each player): Equalizer shows input from assigned mic for this player. + (One SelectSlide for each player) ++++++++++ Version 2: From a97baab9033df465f594fa49935a9411eade3643 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 4 Aug 2012 14:20:24 +0200 Subject: [PATCH 14/21] Fix fading-bug with duets. --- Vocaluxe/Screens/CScreenSing.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Vocaluxe/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs index fdedcb90..3bf27eb1 100644 --- a/Vocaluxe/Screens/CScreenSing.cs +++ b/Vocaluxe/Screens/CScreenSing.cs @@ -286,15 +286,15 @@ namespace Vocaluxe.Screens SingNotes[htSingNotes(SingBars)].SetAlpha(NoteLines[p], Alpha[CGame.Player[p].LineNr * 2]); if (CConfig.FadePlayerInfo == EFadePlayerInfo.TR_CONFIG_FADEPLAYERINFO_INFO || CConfig.FadePlayerInfo == EFadePlayerInfo.TR_CONFIG_FADEPLAYERINFO_ALL) { - Statics[htStatics(StaticAvatars[p,CGame.NumPlayer-1])].Alpha = Alpha[0]; - Texts[htTexts(TextNames[p,CGame.NumPlayer-1])].Alpha = Alpha[0]; + Statics[htStatics(StaticAvatars[p, CGame.NumPlayer - 1])].Alpha = Alpha[CGame.Player[p].LineNr * 2]; + Texts[htTexts(TextNames[p, CGame.NumPlayer - 1])].Alpha = Alpha[CGame.Player[p].LineNr * 2]; } if (CConfig.FadePlayerInfo == EFadePlayerInfo.TR_CONFIG_FADEPLAYERINFO_ALL) { - Statics[htStatics(StaticScores[p, CGame.NumPlayer - 1])].Alpha = Alpha[0]; - Statics[htStatics(StaticAvatars[p, CGame.NumPlayer - 1])].Alpha = Alpha[0]; - Texts[htTexts(TextNames[p, CGame.NumPlayer - 1])].Alpha = Alpha[0]; - Texts[htTexts(TextScores[p, CGame.NumPlayer - 1])].Alpha = Alpha[0]; + Statics[htStatics(StaticScores[p, CGame.NumPlayer - 1])].Alpha = Alpha[CGame.Player[p].LineNr * 2]; + Statics[htStatics(StaticAvatars[p, CGame.NumPlayer - 1])].Alpha = Alpha[CGame.Player[p].LineNr * 2]; + Texts[htTexts(TextNames[p, CGame.NumPlayer - 1])].Alpha = Alpha[CGame.Player[p].LineNr * 2]; + Texts[htTexts(TextScores[p, CGame.NumPlayer - 1])].Alpha = Alpha[CGame.Player[p].LineNr * 2]; } } From 34356f351a0ccd346a69f38b20cbf990f92eabe5 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 4 Aug 2012 15:33:33 +0200 Subject: [PATCH 15/21] Show duet-names on sing-screen for better orientation. --- Output/Themes/Ambient/Screens/ScreenSing.xml | 62 +++++++++- .../Themes/Changelog/Changelog_ScreenSing.txt | 6 + Vocaluxe/Screens/CScreenSing.cs | 107 +++++++++++++++++- 3 files changed, 168 insertions(+), 7 deletions(-) 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_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/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs index 3bf27eb1..e21708f7 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 { @@ -25,10 +25,12 @@ namespace Vocaluxe.Screens public float startBeat; public float endBeat; } - + private const string TextSongName = "TextSongName"; private const string TextTime = "TextTime"; private const string TextPause = "TextPause"; + private const string TextDuetName1 = "TextDuetName1"; + private const string TextDuetName2 = "TextDuetName2"; private string[,] TextScores; private string[,] TextNames; @@ -85,6 +87,8 @@ namespace Vocaluxe.Screens private int[] NoteLines = new int[CSettings.MaxNumPlayer]; private Stopwatch _TimerSongText; + private Stopwatch _TimerDuetText1; + private Stopwatch _TimerDuetText2; private bool _Pause; @@ -104,6 +108,8 @@ namespace Vocaluxe.Screens texts.Add(TextSongName); texts.Add(TextTime); texts.Add(TextPause); + texts.Add(TextDuetName1); + texts.Add(TextDuetName2); BuildTextStrings(ref texts); _ThemeTexts = texts.ToArray(); @@ -134,6 +140,8 @@ namespace Vocaluxe.Screens _TimeRects = new List(); _TimerSongText = new Stopwatch(); + _TimerDuetText1 = new Stopwatch(); + _TimerDuetText2 = new Stopwatch(); } public override void LoadTheme() @@ -257,6 +265,7 @@ namespace Vocaluxe.Screens } UpdateSongText(); + UpdateDuetText(); if (_FadeOut) return true; @@ -484,6 +493,8 @@ namespace Vocaluxe.Screens Lyrics[htLyrics(LyricMainTop)].Clear(); Lyrics[htLyrics(LyricSubTop)].Clear(); Texts[htTexts(TextSongName)].Text = String.Empty; + Texts[htTexts(TextDuetName1)].Text = String.Empty; + Texts[htTexts(TextDuetName2)].Text = String.Empty; } private void LoadNextSong() @@ -523,11 +534,14 @@ namespace Vocaluxe.Screens _FinishTime = song.Finish; _TimeToFirstNote = 0f; _TimeToFirstNoteDuet = 0f; - //Save duet-assignment before resetting int[] duet_player = new int[CGame.NumPlayer]; - for (int i = 0; i < duet_player.Length; i++) + if (song.IsDuet) { - duet_player[i] = CGame.Player[i].LineNr; + //Save duet-assignment before resetting + for (int i = 0; i < duet_player.Length; i++) + { + duet_player[i] = CGame.Player[i].LineNr; + } } CGame.ResetPlayer(); @@ -549,6 +563,8 @@ namespace Vocaluxe.Screens bool LyricsOnTop = (CGame.NumPlayer != 1) && CConfig.LyricsOnTop == EOffOn.TR_CONFIG_ON; if (song.IsDuet) { + Texts[htTexts(TextDuetName1)].Text = song.DuetPart1; + Texts[htTexts(TextDuetName2)].Text = song.DuetPart2; //More than one song: Player is not assigned to line by user //Otherwise, this is done by CScreenNames if (CGame.GetNumSongs() > 1) @@ -604,9 +620,15 @@ namespace Vocaluxe.Screens _TimerSongText.Stop(); _TimerSongText.Reset(); + _TimerDuetText1.Stop(); + _TimerDuetText1.Reset(); + _TimerDuetText2.Stop(); + _TimerDuetText2.Reset(); if (song.Notes.Lines.Length != 2) + { _TimerSongText.Start(); + } StartSong(); } @@ -790,6 +812,8 @@ namespace Vocaluxe.Screens Statics[htStatics(StaticSongText)].Visible = false; Texts[htTexts(TextSongName)].Visible = false; + Texts[htTexts(TextDuetName1)].Visible = false; + Texts[htTexts(TextDuetName2)].Visible = false; for (int numplayer = 0; numplayer < CSettings.MaxNumPlayer; numplayer++) { @@ -1060,6 +1084,79 @@ namespace Vocaluxe.Screens } } + private void UpdateDuetText() + { + if (CGame.GetSong() != null) + { + //Timer for first duet-part + if (_TimerDuetText1.IsRunning) + { + float t = _TimerDuetText1.ElapsedMilliseconds / 1000f; + if (t < 10f) + { + Texts[htTexts(TextDuetName1)].Visible = true; + + if (t < 3f) + { + Texts[htTexts(TextDuetName1)].Color.A = (3f - (3f - t)) / 3f; + } + else if (t < 7f) + { + Texts[htTexts(TextDuetName1)].Color.A = 1f; + } + else + { + Texts[htTexts(TextDuetName1)].Color.A = (3f - (t - 7f)) / 3f; + } + } + else + { + Texts[htTexts(TextDuetName1)].Visible = false; + _TimerDuetText1.Stop(); + } + } + else if (!_TimerDuetText1.IsRunning && _TimerDuetText1.ElapsedMilliseconds == 0 && Lyrics[htLyrics(LyricMainDuet)].Alpha > 0 && CGame.GetSong().IsDuet) + _TimerDuetText1.Start(); + else + { + Texts[htTexts(TextDuetName1)].Visible = false; + } + //Timer for second duet-part + if (_TimerDuetText2.IsRunning) + { + float t = _TimerDuetText2.ElapsedMilliseconds / 1000f; + if (t < 10f) + { + Texts[htTexts(TextDuetName2)].Visible = true; + + if (t < 3f) + { + Texts[htTexts(TextDuetName2)].Color.A = (3f - (3f - t)) / 3f; + } + else if (t < 7f) + { + Texts[htTexts(TextDuetName2)].Color.A = 1f; + } + else + { + Texts[htTexts(TextDuetName2)].Color.A = (3f - (t - 7f)) / 3f; + } + } + else + { + Texts[htTexts(TextDuetName2)].Visible = false; + _TimerDuetText2.Stop(); + } + } + else if (!_TimerDuetText2.IsRunning && _TimerDuetText2.ElapsedMilliseconds == 0 && Lyrics[htLyrics(LyricMain)].Alpha > 0 && CGame.GetSong().IsDuet) + _TimerDuetText2.Start(); + else + { + Texts[htTexts(TextDuetName2)].Visible = false; + } + } + } + private void UpdateTimeLine() { CSong song = CGame.GetSong(); From 1ff2182df6420b32184b38dd09229a15fa577d3b Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 4 Aug 2012 15:55:49 +0200 Subject: [PATCH 16/21] Fix error with reading duet-tags. --- Vocaluxe/Lib/Song/CSong.cs | 33 ++++++++++++---------- Vocaluxe/Menu/SongMenu/CSongMenuDreidel.cs | 17 +++++++++++ Vocaluxe/Screens/CScreenNames.cs | 1 + 3 files changed, 36 insertions(+), 15 deletions(-) diff --git a/Vocaluxe/Lib/Song/CSong.cs b/Vocaluxe/Lib/Song/CSong.cs index f3240472..f325d691 100644 --- a/Vocaluxe/Lib/Song/CSong.cs +++ b/Vocaluxe/Lib/Song/CSong.cs @@ -371,29 +371,16 @@ 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; } - //Check if Duet-Tags are set - if (IsDuet) - { - if (DuetPart1 == String.Empty) - { - DuetPart1 = "Part 1"; - } - if (DuetPart2 == String.Empty) - { - DuetPart2 = "Part 2"; - } - } - return true; } @@ -534,6 +521,8 @@ namespace Vocaluxe.Lib.Song return false; } _NotesLoaded = true; + if(IsDuet) + CheckDuet(); return true; } @@ -599,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/SongMenu/CSongMenuDreidel.cs b/Vocaluxe/Menu/SongMenu/CSongMenuDreidel.cs index 7ab6a6af..6a4aae66 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenuDreidel.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenuDreidel.cs @@ -13,6 +13,8 @@ namespace Vocaluxe.Menu.SongMenu class CSongMenuDreidel : CSongMenuFramework { private SRectF _ScrollRect; + private CStatic _CoverBig; + private CStatic _TextBG; private CStatic _DuetIcon; private CStatic _VideoIcon; @@ -27,5 +29,20 @@ namespace Vocaluxe.Menu.SongMenu { return _actualSelection; } + + public override void Init() + { + base.Init(); + /** + _CoverBig = _Theme.songMenuDreidel.StaticCoverBig; + _TextBG = _Theme.songMenuDreidel.StaticTextBG; + _DuetIcon = _Theme.songMenuDreidel.StaticDuetIcon; + _VideoIcon = _Theme.songMenuDreidel.StaticVideoIcon; + + _Artist = _Theme.songMenuDreidel.TextArtist; + _Title = _Theme.songMenuDreidel.TextTitle; + _SongLength = _Theme.songMenuDreidel.TextSongLength; + **/ + } } } diff --git a/Vocaluxe/Screens/CScreenNames.cs b/Vocaluxe/Screens/CScreenNames.cs index 626863ea..e9f475cc 100644 --- a/Vocaluxe/Screens/CScreenNames.cs +++ b/Vocaluxe/Screens/CScreenNames.cs @@ -589,6 +589,7 @@ namespace Vocaluxe.Screens } if (CGame.GetNumSongs() == 1 && CGame.GetSong(1).IsDuet) { + SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].Clear(); if (i + 1 <= CGame.NumPlayer) SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].Visible = true; else From c9fb10a20bf8b949aa7cb923d8f391924e98c9f2 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 4 Aug 2012 20:12:38 +0200 Subject: [PATCH 17/21] Remove some unused statics. --- Output/Themes/Ambient/Screens/ScreenNames.xml | 98 +--------------- Vocaluxe/Menu/Animations/CAnimation.cs | 92 +++++++++++++++ .../Menu/Animations/CAnimationFramework.cs | 95 ++++++++++++++++ Vocaluxe/Menu/Animations/CAnimationResize.cs | 106 ++++++++++++++++++ Vocaluxe/Menu/Animations/IAnimation.cs | 30 +++++ 5 files changed, 324 insertions(+), 97 deletions(-) create mode 100644 Vocaluxe/Menu/Animations/CAnimation.cs create mode 100644 Vocaluxe/Menu/Animations/CAnimationFramework.cs create mode 100644 Vocaluxe/Menu/Animations/CAnimationResize.cs create mode 100644 Vocaluxe/Menu/Animations/IAnimation.cs diff --git a/Output/Themes/Ambient/Screens/ScreenNames.xml b/Output/Themes/Ambient/Screens/ScreenNames.xml index 289409b4..cbc3beb1 100644 --- a/Output/Themes/Ambient/Screens/ScreenNames.xml +++ b/Output/Themes/Ambient/Screens/ScreenNames.xml @@ -28,103 +28,7 @@ - - - - SelectSlidePlayer - - 20 - 105 - -4,00 - 108 - 20 - - - SelectSlideColor - - - - - - - SelectSlidePlayer - - 20 - 260 - -4,00 - 108 - 20 - - - SelectSlideColor - - - - - - - SelectSlidePlayer - - 20 - 415 - -4,00 - 108 - 20 - - - SelectSlideColor - - - - - - - SelectSlidePlayer - - 1152 - 105 - -4,00 - 108 - 20 - - - SelectSlideColor - - - - - - - SelectSlidePlayer - - 1152 - 260 - -4,00 - 108 - 20 - - - SelectSlideColor - - - - - - - SelectSlidePlayer - - 1152 - 415 - -4,00 - 108 - 20 - - - SelectSlideColor - - - - + PlayerSelector 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(); + } +} From 6f9f90bea7f19a6390e5c817f3810cb8fa746a0f Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 11 Aug 2012 14:27:09 +0200 Subject: [PATCH 18/21] Some clean-up for equalizer. --- Output/Themes/Ambient/Screens/ScreenNames.xml | 12 ++++++------ .../Ambient/Screens/ScreenOptionsRecord.xml | 19 +++++++++++++++++++ Vocaluxe/Menu/CEqualizer.cs | 1 - 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/Output/Themes/Ambient/Screens/ScreenNames.xml b/Output/Themes/Ambient/Screens/ScreenNames.xml index cbc3beb1..c35f8b0f 100644 --- a/Output/Themes/Ambient/Screens/ScreenNames.xml +++ b/Output/Themes/Ambient/Screens/ScreenNames.xml @@ -1141,7 +1141,7 @@ 8 2,00 - + @@ -1168,7 +1168,7 @@ 8 2,00 - + @@ -1195,7 +1195,7 @@ 8 2,00 - + @@ -1222,7 +1222,7 @@ 8 2,00 - + @@ -1249,7 +1249,7 @@ 8 2,00 - + @@ -1274,7 +1274,7 @@ 60 8 - + 2,00 diff --git a/Output/Themes/Ambient/Screens/ScreenOptionsRecord.xml b/Output/Themes/Ambient/Screens/ScreenOptionsRecord.xml index a473d310..7375fd34 100644 --- a/Output/Themes/Ambient/Screens/ScreenOptionsRecord.xml +++ b/Output/Themes/Ambient/Screens/ScreenOptionsRecord.xml @@ -859,17 +859,26 @@ 5 + Invisible + 50 400 230 150 -1,00 + 10 2,00 + + + ButtonColor + + ButtonSColor + TR_CONFIG_OFF @@ -880,17 +889,27 @@ + Invisible + 400 400 230 150 -1,00 + 10 + 2,00 + + + ButtonColor + + ButtonSColor + TR_CONFIG_OFF diff --git a/Vocaluxe/Menu/CEqualizer.cs b/Vocaluxe/Menu/CEqualizer.cs index 2f82759c..a3c6767d 100644 --- a/Vocaluxe/Menu/CEqualizer.cs +++ b/Vocaluxe/Menu/CEqualizer.cs @@ -12,7 +12,6 @@ namespace Vocaluxe.Menu { enum EEqualizerStyle { - Bars, Collums } From 5abd428462179a1b33b69292dbe05df780ce9f52 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 11 Aug 2012 14:50:42 +0200 Subject: [PATCH 19/21] Equalizer-Interaction is ThemeEditorOnly now. --- Vocaluxe/Menu/CInteraction.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Vocaluxe/Menu/CInteraction.cs b/Vocaluxe/Menu/CInteraction.cs index 79a67b8c..de15e592 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.TEqualizer); } } From adb8ee7478e5591b427179e28a3ab32968178705 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 11 Aug 2012 15:20:21 +0200 Subject: [PATCH 20/21] Toggle between duet-part with F10 after selecting player with [1...6] --- Vocaluxe/Screens/CScreenNames.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Vocaluxe/Screens/CScreenNames.cs b/Vocaluxe/Screens/CScreenNames.cs index e9f475cc..51fe1850 100644 --- a/Vocaluxe/Screens/CScreenNames.cs +++ b/Vocaluxe/Screens/CScreenNames.cs @@ -335,6 +335,22 @@ namespace Vocaluxe.Screens //Update Tiles-List NameSelections[htNameSelections(NameSelection)].UpdateList(); break; + + case Keys.F10: + if (CGame.GetNumSongs() == 1 && CGame.GetSong(1).IsDuet) + { + if (SelectSlides[htSelectSlides(SelectSlideDuetPlayer[selectingKeyboardPlayerNr - 1])].Selection == 0) + SelectSlides[htSelectSlides(SelectSlideDuetPlayer[selectingKeyboardPlayerNr - 1])].SetSelectionByValueIndex(1); + else + SelectSlides[htSelectSlides(SelectSlideDuetPlayer[selectingKeyboardPlayerNr - 1])].SetSelectionByValueIndex(0); + //Reset all values + selectingKeyboardPlayerNr = 0; + selectingKeyboardActive = false; + selectingKeyboardUnendless = false; + NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); + SetInteractionToButton(Buttons[htButtons(ButtonStart)]); + } + break; } } From 94b4fd462b87442c666de4d296206db6c2ae34e2 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 11 Aug 2012 15:51:09 +0200 Subject: [PATCH 21/21] Equalizers are "nulled" now. --- Vocaluxe/Base/CSound.cs | 4 ++++ 1 file changed, 4 insertions(+) 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; }