From 79946a17c5592f6ab2ab8d304e58dcea02a879c5 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Thu, 13 Dec 2012 18:19:08 +0100 Subject: [PATCH] First step to eliminate the namespace Vocaluxe.Base from all Vocaluxe.Menu classe. There is still a lot of work... --- Vocaluxe/Base/CConfig.cs | 4 +- Vocaluxe/Base/CCover.cs | 1 + Vocaluxe/Base/CDataBase.cs | 1 + Vocaluxe/Base/CGraphics.cs | 2 + Vocaluxe/Base/CInput.cs | 1 + Vocaluxe/Base/CLanguage.cs | 2 + Vocaluxe/Base/CPlaylists.cs | 1 + Vocaluxe/Base/CProfiles.cs | 1 + Vocaluxe/Base/CSettings.cs | 9 +- Vocaluxe/Base/CUtility.cs | 406 +----------------- Vocaluxe/Base/CVideo.cs | 2 +- Vocaluxe/Base/CWebcam.cs | 4 +- Vocaluxe/Lib/Draw/IDraw.cs | 116 ----- Vocaluxe/Lib/Input/IInput.cs | 1 + Vocaluxe/Lib/Input/WiiMote/CWiiMote.cs | 1 + Vocaluxe/Lib/Input/WiiMote/WiiMoteLib.cs | 1 + Vocaluxe/Lib/Playlist/CPlaylistFile.cs | 1 + Vocaluxe/Lib/Video/CVideoDecoder.cs | 2 +- Vocaluxe/Lib/Video/CVideoDecoderFFmpeg.cs | 1 + Vocaluxe/Lib/Video/IVideoDecoder.cs | 1 + Vocaluxe/Lib/Webcam/CAForgeNet.cs | 2 + Vocaluxe/Lib/Webcam/IWebcam.cs | 2 + Vocaluxe/Menu/CMenu.cs | 143 +++--- Vocaluxe/Menu/IMenu.cs | 309 +++++++++++++ Vocaluxe/Screens/CPopupScreenPlayerControl.cs | 1 - Vocaluxe/Screens/CPopupScreenVolumeControl.cs | 1 - Vocaluxe/Screens/CScreenCredits.cs | 1 - Vocaluxe/Screens/CScreenHighscore.cs | 1 - Vocaluxe/Screens/CScreenLoad.cs | 1 - Vocaluxe/Screens/CScreenMain.cs | 1 - Vocaluxe/Screens/CScreenNames.cs | 1 - Vocaluxe/Screens/CScreenOptions.cs | 1 - Vocaluxe/Screens/CScreenOptionsGame.cs | 1 - Vocaluxe/Screens/CScreenOptionsLyrics.cs | 1 - Vocaluxe/Screens/CScreenOptionsRecord.cs | 1 - Vocaluxe/Screens/CScreenOptionsSound.cs | 1 - Vocaluxe/Screens/CScreenOptionsTheme.cs | 1 - Vocaluxe/Screens/CScreenOptionsVideo.cs | 3 +- Vocaluxe/Screens/CScreenParty.cs | 1 - Vocaluxe/Screens/CScreenPartyDummy.cs | 1 - Vocaluxe/Screens/CScreenProfiles.cs | 3 +- Vocaluxe/Screens/CScreenScore.cs | 3 +- Vocaluxe/Screens/CScreenSing.cs | 1 - Vocaluxe/Screens/CScreenSong.cs | 2 - Vocaluxe/Screens/CScreenTest.cs | 1 - Vocaluxe/Screens/PartyScreens/CMenuParty.cs | 9 +- Vocaluxe/Vocaluxe.csproj | 2 + 47 files changed, 426 insertions(+), 627 deletions(-) diff --git a/Vocaluxe/Base/CConfig.cs b/Vocaluxe/Base/CConfig.cs index 14ecf859..4e3d96d6 100644 --- a/Vocaluxe/Base/CConfig.cs +++ b/Vocaluxe/Base/CConfig.cs @@ -12,6 +12,7 @@ using OpenTK.Platform; using Vocaluxe.Lib.Sound; using Vocaluxe.Lib.Webcam; +using Vocaluxe.Menu; namespace Vocaluxe.Base { @@ -1098,8 +1099,5 @@ namespace Vocaluxe.Base } } } - - - } } diff --git a/Vocaluxe/Base/CCover.cs b/Vocaluxe/Base/CCover.cs index 22b699d9..c63082f8 100644 --- a/Vocaluxe/Base/CCover.cs +++ b/Vocaluxe/Base/CCover.cs @@ -6,6 +6,7 @@ using System.Xml; using System.Xml.XPath; using Vocaluxe.Lib.Draw; +using Vocaluxe.Menu; namespace Vocaluxe.Base { diff --git a/Vocaluxe/Base/CDataBase.cs b/Vocaluxe/Base/CDataBase.cs index cadb499f..591dca1a 100644 --- a/Vocaluxe/Base/CDataBase.cs +++ b/Vocaluxe/Base/CDataBase.cs @@ -21,6 +21,7 @@ using Community.CsharpSqlite; using Vocaluxe.Lib.Draw; using Vocaluxe.Lib.Song; +using Vocaluxe.Menu; namespace Vocaluxe.Base { diff --git a/Vocaluxe/Base/CGraphics.cs b/Vocaluxe/Base/CGraphics.cs index 4b314ae3..964f0398 100644 --- a/Vocaluxe/Base/CGraphics.cs +++ b/Vocaluxe/Base/CGraphics.cs @@ -280,12 +280,14 @@ namespace Vocaluxe.Menu for (int i = 0; i < _Screens.Count; i++) { CLog.StartBenchmark(1, "Load Theme " + Enum.GetNames(typeof(EScreens))[i]); + _Screens[i].Initialize(CMain.Config, CMain.Settings, CMain.Theme, CMain.Helper, CMain.Log, CMain.BackgroundMusic, CMain.Draw, CMain.Graphics); _Screens[i].LoadTheme(); CLog.StopBenchmark(1, "Load Theme " + Enum.GetNames(typeof(EScreens))[i]); } for (int i = 0; i < _PopupScreens.Count; i++) { + _PopupScreens[i].Initialize(CMain.Config, CMain.Settings, CMain.Theme, CMain.Helper, CMain.Log, CMain.BackgroundMusic, CMain.Draw, CMain.Graphics); _PopupScreens[i].LoadTheme(); } } diff --git a/Vocaluxe/Base/CInput.cs b/Vocaluxe/Base/CInput.cs index 28af9bf8..e6465d31 100644 --- a/Vocaluxe/Base/CInput.cs +++ b/Vocaluxe/Base/CInput.cs @@ -4,6 +4,7 @@ using System.Text; using Vocaluxe.Lib.Input; using Vocaluxe.Lib.Input.WiiMote; +using Vocaluxe.Menu; namespace Vocaluxe.Base { diff --git a/Vocaluxe/Base/CLanguage.cs b/Vocaluxe/Base/CLanguage.cs index 9e8474ed..40ca03a6 100644 --- a/Vocaluxe/Base/CLanguage.cs +++ b/Vocaluxe/Base/CLanguage.cs @@ -6,6 +6,8 @@ using System.Text; using System.Xml; using System.Xml.XPath; +using Vocaluxe.Menu; + namespace Vocaluxe.Base { struct SLanguage diff --git a/Vocaluxe/Base/CPlaylists.cs b/Vocaluxe/Base/CPlaylists.cs index c509f4f6..0c2daa0e 100644 --- a/Vocaluxe/Base/CPlaylists.cs +++ b/Vocaluxe/Base/CPlaylists.cs @@ -7,6 +7,7 @@ using System.Xml.XPath; using Vocaluxe.Lib.Song; using Vocaluxe.Lib.Playlist; +using Vocaluxe.Menu; namespace Vocaluxe.Base { diff --git a/Vocaluxe/Base/CProfiles.cs b/Vocaluxe/Base/CProfiles.cs index ed73ed31..6f282051 100644 --- a/Vocaluxe/Base/CProfiles.cs +++ b/Vocaluxe/Base/CProfiles.cs @@ -6,6 +6,7 @@ using System.Xml; using System.Xml.XPath; using Vocaluxe.Lib.Draw; +using Vocaluxe.Menu; namespace Vocaluxe.Base { diff --git a/Vocaluxe/Base/CSettings.cs b/Vocaluxe/Base/CSettings.cs index 16fb0475..3cf5209b 100644 --- a/Vocaluxe/Base/CSettings.cs +++ b/Vocaluxe/Base/CSettings.cs @@ -3,15 +3,10 @@ using System.Collections.Generic; using System.IO; using System.Text; +using Vocaluxe.Menu; + namespace Vocaluxe.Base { - public enum EGameState - { - Start, - Normal, - EditTheme - } - enum ERevision { Alpha, diff --git a/Vocaluxe/Base/CUtility.cs b/Vocaluxe/Base/CUtility.cs index 4f98fbc4..d3f97704 100644 --- a/Vocaluxe/Base/CUtility.cs +++ b/Vocaluxe/Base/CUtility.cs @@ -10,130 +10,10 @@ using System.Xml; using System.Xml.XPath; using Vocaluxe.Lib.Draw; +using Vocaluxe.Menu; namespace Vocaluxe.Base { - [Flags] - public enum EModifier - { - None, - Shift, - Alt, - Ctrl - } - - public enum ESender - { - Mouse, - Keyboard, - WiiMote, - Gamepad - } - - public struct KeyEvent - { - public ESender Sender; - public bool ModALT; - public bool ModSHIFT; - public bool ModCTRL; - public bool KeyPressed; - public bool Handled; - public Keys Key; - public Char Unicode; - public EModifier Mod; - - public KeyEvent(ESender sender, bool alt, bool shift, bool ctrl, bool pressed, char unicode, Keys key) - { - Sender = sender; - ModALT = alt; - ModSHIFT = shift; - ModCTRL = ctrl; - KeyPressed = pressed; - Unicode = unicode; - Key = key; - Handled = false; - - EModifier mALT = EModifier.None; - EModifier mSHIFT = EModifier.None; - EModifier mCTRL = EModifier.None; - - if (alt) - mALT = EModifier.Alt; - - if (shift) - mSHIFT = EModifier.Shift; - - if (ctrl) - mCTRL = EModifier.Ctrl; - - if (!alt && !shift && !ctrl) - Mod = EModifier.None; - else - Mod = mALT | mSHIFT | mCTRL; - } - } - - public struct MouseEvent - { - public ESender Sender; - public int X; - public int Y; - public bool LB; //left button click - public bool LD; //left button double click - public bool RB; //right button click - public bool MB; //middle button click - - public bool LBH; //left button hold (when moving) - public bool RBH; //right button hold (when moving) - public bool MBH; //middle button hold (when moving) - - public bool ModALT; - public bool ModSHIFT; - public bool ModCTRL; - - public EModifier Mod; - public int Wheel; - - public MouseEvent(ESender sender, bool alt, bool shift, bool ctrl, int x, int y, bool lb, bool ld, bool rb, int wheel, bool lbh, bool rbh, bool mb, bool mbh) - { - Sender = sender; - X = x; - Y = y; - LB = lb; - LD = ld; - RB = rb; - MB = mb; - - LBH = lbh; - RBH = rbh; - MBH = mbh; - - ModALT = alt; - ModSHIFT = shift; - ModCTRL = ctrl; - - EModifier mALT = EModifier.None; - EModifier mSHIFT = EModifier.None; - EModifier mCTRL = EModifier.None; - - if (alt) - mALT = EModifier.Alt; - - if (shift) - mSHIFT = EModifier.Shift; - - if (ctrl) - mCTRL = EModifier.Ctrl; - - if (!alt && !shift && !ctrl) - Mod = EModifier.None; - else - Mod = mALT | mSHIFT | mCTRL; - - Wheel = wheel; - } - } - static class CTime { private static Stopwatch _Stopwatch = new Stopwatch(); @@ -469,290 +349,6 @@ namespace Vocaluxe.Base } - class CHelper - { - public static int TryReadInt(StreamReader sr) - { - char chr = '0'; - string value = String.Empty; - - try - { - chr = (char)sr.Peek(); - while ((chr.CompareTo(' ') != 0) && ((int)chr != 19) && ((int)chr != 16) && ((int)chr != 13)) - { - chr = (char)sr.Read(); - value += chr.ToString(); - chr = (char)sr.Peek(); - } - } - catch (Exception) - { - return 0; - } - int result = 0; - int.TryParse(value, out result); - return result; - } - - public static void SetRect(RectangleF Bounds, ref RectangleF Rect, float RectAspect, EAspect Aspect) - { - float rW = Bounds.Right - Bounds.Left; - float rH = Bounds.Bottom - Bounds.Top; - float rA = rW / rH; - - float ScaledWidth = rW; - float ScaledHeight = rH; - - switch (Aspect) - { - case EAspect.Crop: - if (rA >= RectAspect) - { - ScaledWidth = rW; - ScaledHeight = rH * rA / RectAspect; - } - else - { - ScaledHeight = rH; - ScaledWidth = rW * RectAspect / rA; - } - break; - case EAspect.LetterBox: - if (RectAspect >= 1) - { - ScaledWidth = rW; - ScaledHeight = rH * rA / RectAspect; - } - else - { - ScaledHeight = rH; - ScaledWidth = rW * RectAspect / rA; - } - break; - default: - ScaledWidth = rW; - ScaledHeight = rH; - break; - } - - float Left = (rW - ScaledWidth) / 2 + Bounds.Left; - float Rigth = Left + ScaledWidth; - - float Upper = (rH - ScaledHeight) / 2 + Bounds.Top; - float Lower = Upper + ScaledHeight; - - Rect = new RectangleF(Left, Upper, Rigth - Left, Lower - Upper); - } - - public static bool TryGetEnumValueFromXML(string Cast, XPathNavigator Navigator, ref T value) - where T : struct - { - string val = String.Empty; - if (GetValueFromXML(Cast, Navigator, ref val, Enum.GetName(typeof(T), value))) - { - TryParse(val, out value, true); - return true; - } - return false; - } - - public static bool TryGetIntValueFromXML(string Cast, XPathNavigator Navigator, ref int value) - { - string val = String.Empty; - if (GetValueFromXML(Cast, Navigator, ref val, value.ToString())) - { - int res = 0; - if (int.TryParse(val, out res)) - { - value = res; - return true; - } - } - return false; - } - - public static bool TryGetFloatValueFromXML(string Cast, XPathNavigator Navigator, ref float value) - { - string val = String.Empty; - if (GetValueFromXML(Cast, Navigator, ref val, value.ToString())) - { - float res = 0; - if (TryParse(val, out res)) - { - value = res; - return true; - } - } - return false; - } - - public static bool GetValueFromXML(string Cast, XPathNavigator Navigator, ref string Value, string DefaultValue) - { - XPathNodeIterator iterator; - int results = 0; - string val = string.Empty; - - try - { - Navigator.MoveToFirstChild(); - iterator = Navigator.Select(Cast); - - while (iterator.MoveNext()) - { - val = iterator.Current.Value; - results++; - } - } - catch (Exception) - { - results = 0; - } - - if ((results == 0) || (results > 1)) - { - Value = DefaultValue; - return false; - } - else - { - Value = val; - return true; - } - - } - - public static List GetValuesFromXML(string Cast, XPathNavigator Navigator) - { - List values = new List(); - - try - { - Navigator.MoveToRoot(); - Navigator.MoveToFirstChild(); - Navigator.MoveToFirstChild(); - - while (Navigator.Name != Cast) - Navigator.MoveToNext(); - - Navigator.MoveToFirstChild(); - - values.Add(Navigator.LocalName); - while(Navigator.MoveToNext()) - values.Add(Navigator.LocalName); - - } - catch (Exception) - { - - } - - return values; - } - - public static bool ItemExistsInXML(string Cast, XPathNavigator Navigator) - { - XPathNodeIterator iterator; - int results = 0; - - try - { - Navigator.MoveToFirstChild(); - iterator = Navigator.Select(Cast); - - while (iterator.MoveNext()) - results++; - } - catch (Exception) - { - results = 0; - } - - if (results == 0) - return false; - - return true; - } - - public List ListFiles(string path, string cast) - { - return ListFiles(path, cast, false, false); - } - - public List ListFiles(string path, string cast, bool recursive) - { - return ListFiles(path, cast, recursive, false); - } - - public List ListFiles(string path, string cast, bool recursive, bool fullpath) - { - List files = new List(); - DirectoryInfo dir = new DirectoryInfo(path); - - try - { - - foreach (FileInfo file in dir.GetFiles(cast)) - { - if (!fullpath) - files.Add(file.Name); - else - //files.Add(Path.Combine(file.DirectoryName, file.Name)); - files.Add(file.FullName); - } - - if (recursive) - { - foreach (DirectoryInfo di in dir.GetDirectories()) - { - files.AddRange(ListFiles(di.FullName, cast, recursive, fullpath)); - } - } - } catch (Exception) - { - - } - - return files; - } - - public static bool TryParse(string value, out T result) - where T : struct - { - return TryParse(value, out result, false); - } - - public static bool TryParse(string value, out T result, bool ignoreCase) - where T : struct - { - result = default(T); - try - { - result = (T)Enum.Parse(typeof(T), value, ignoreCase); - return true; - } - catch { } - - return false; - } - - public static bool TryParse(string value, out float result) - { - value = value.Replace(',', '.'); - return float.TryParse(value, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, NumberFormatInfo.InvariantInfo, out result); - } - - public static bool IsInBounds(SRectF bounds, MouseEvent MouseEvent) - { - return IsInBounds(bounds, MouseEvent.X, MouseEvent.Y); - } - - public static bool IsInBounds(SRectF bounds, int x, int y) - { - return ((bounds.X <= x) && (bounds.X + bounds.W >= x) && (bounds.Y <= y) && (bounds.Y + bounds.H >= y)); - } - } - static class CEncoding { public static Encoding GetEncoding(string EncodingName) diff --git a/Vocaluxe/Base/CVideo.cs b/Vocaluxe/Base/CVideo.cs index 718222b4..04dad94b 100644 --- a/Vocaluxe/Base/CVideo.cs +++ b/Vocaluxe/Base/CVideo.cs @@ -4,7 +4,7 @@ using System.Diagnostics; using System.Drawing; using System.Text; -using Vocaluxe.Lib.Draw; +using Vocaluxe.Menu; using Vocaluxe.Lib.Video; namespace Vocaluxe.Base diff --git a/Vocaluxe/Base/CWebcam.cs b/Vocaluxe/Base/CWebcam.cs index cb735d77..5b8c4a64 100644 --- a/Vocaluxe/Base/CWebcam.cs +++ b/Vocaluxe/Base/CWebcam.cs @@ -1,10 +1,12 @@ using System; using System.Collections.Generic; +using System.Drawing; using System.Text; using Vocaluxe.Lib.Webcam; using Vocaluxe.Lib.Draw; -using System.Drawing; +using Vocaluxe.Menu; + namespace Vocaluxe.Base { diff --git a/Vocaluxe/Lib/Draw/IDraw.cs b/Vocaluxe/Lib/Draw/IDraw.cs index 7f39b5b0..fe6fcf42 100644 --- a/Vocaluxe/Lib/Draw/IDraw.cs +++ b/Vocaluxe/Lib/Draw/IDraw.cs @@ -8,122 +8,6 @@ using Vocaluxe.Menu; namespace Vocaluxe.Lib.Draw { - #region Structs - public struct SColorF - { - public float R; - public float G; - public float B; - public float A; - - public SColorF(float r, float g, float b, float a) - { - R = r; - G = g; - B = b; - A = a; - } - - public SColorF(SColorF Color) - { - R = Color.R; - G = Color.G; - B = Color.B; - A = Color.A; - } - } - - public struct SRectF - { - public float X; - public float Y; - public float W; - public float H; - public float Z; - public float Rotation; //0..360° - - public SRectF(float x, float y, float w, float h, float z) - { - X = x; - Y = y; - W = w; - H = h; - Z = z; - Rotation = 0f; - } - - public SRectF(SRectF rect) - { - X = rect.X; - Y = rect.Y; - W = rect.W; - H = rect.H; - Z = rect.Z; - Rotation = 0f; - } - } - - public struct SPoint3f - { - public float X; - public float Y; - public float Z; - } - - public struct SPoint3 - { - public int X; - public int Y; - public int Z; - } - - public struct STexture - { - public int index; - public int PBO; - public int ID; - - public string TexturePath; - - public float width; - public float height; - public SRectF rect; - - public float w2; //power of 2 width - public float h2; //power of 2 height - public float width_ratio; - public float height_ratio; - - public SColorF color; - - public STexture(int Index) - { - index = Index; - PBO = 0; - ID = -1; - TexturePath = String.Empty; - - width = 1f; - height = 1f; - rect = new SRectF(0f, 0f, 1f, 1f, 0f); - - w2 = 2f; - h2 = 2f; - width_ratio = 0.5f; - height_ratio = 0.5f; - - color = new SColorF(1f, 1f, 1f, 1f); - } - } - #endregion Structs - - enum EAspect - { - Crop, - LetterBox, - Stretch - } - interface IDraw { bool Init(); diff --git a/Vocaluxe/Lib/Input/IInput.cs b/Vocaluxe/Lib/Input/IInput.cs index 86dcde04..9ccfa247 100644 --- a/Vocaluxe/Lib/Input/IInput.cs +++ b/Vocaluxe/Lib/Input/IInput.cs @@ -5,6 +5,7 @@ using System.Drawing; using System.Text; using Vocaluxe.Base; +using Vocaluxe.Menu; namespace Vocaluxe.Lib.Input { diff --git a/Vocaluxe/Lib/Input/WiiMote/CWiiMote.cs b/Vocaluxe/Lib/Input/WiiMote/CWiiMote.cs index 4578723c..8af2e202 100644 --- a/Vocaluxe/Lib/Input/WiiMote/CWiiMote.cs +++ b/Vocaluxe/Lib/Input/WiiMote/CWiiMote.cs @@ -7,6 +7,7 @@ using System.Text; using System.Threading; using Vocaluxe.Base; +using Vocaluxe.Menu; namespace Vocaluxe.Lib.Input.WiiMote { diff --git a/Vocaluxe/Lib/Input/WiiMote/WiiMoteLib.cs b/Vocaluxe/Lib/Input/WiiMote/WiiMoteLib.cs index 71322681..9d15f5b0 100644 --- a/Vocaluxe/Lib/Input/WiiMote/WiiMoteLib.cs +++ b/Vocaluxe/Lib/Input/WiiMote/WiiMoteLib.cs @@ -10,6 +10,7 @@ using System.Windows.Forms; using Vocaluxe.Base; using Vocaluxe.Lib.Draw; using Vocaluxe.Lib.Input; +using Vocaluxe.Menu; namespace Vocaluxe.Lib.Input.WiiMote { diff --git a/Vocaluxe/Lib/Playlist/CPlaylistFile.cs b/Vocaluxe/Lib/Playlist/CPlaylistFile.cs index 57e9fb55..c22cb99e 100644 --- a/Vocaluxe/Lib/Playlist/CPlaylistFile.cs +++ b/Vocaluxe/Lib/Playlist/CPlaylistFile.cs @@ -8,6 +8,7 @@ using System.Xml.XPath; using Vocaluxe.Base; using Vocaluxe.GameModes; using Vocaluxe.Lib.Song; +using Vocaluxe.Menu; namespace Vocaluxe.Lib.Playlist diff --git a/Vocaluxe/Lib/Video/CVideoDecoder.cs b/Vocaluxe/Lib/Video/CVideoDecoder.cs index 1c6d673c..da4150db 100644 --- a/Vocaluxe/Lib/Video/CVideoDecoder.cs +++ b/Vocaluxe/Lib/Video/CVideoDecoder.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; -using Vocaluxe.Lib.Draw; +using Vocaluxe.Menu; namespace Vocaluxe.Lib.Video { diff --git a/Vocaluxe/Lib/Video/CVideoDecoderFFmpeg.cs b/Vocaluxe/Lib/Video/CVideoDecoderFFmpeg.cs index a9cacb6d..9b0f7828 100644 --- a/Vocaluxe/Lib/Video/CVideoDecoderFFmpeg.cs +++ b/Vocaluxe/Lib/Video/CVideoDecoderFFmpeg.cs @@ -9,6 +9,7 @@ using System.Threading; using Vocaluxe.Base; using Vocaluxe.Lib.Draw; using Vocaluxe.Lib.Video.Acinerella; +using Vocaluxe.Menu; namespace Vocaluxe.Lib.Video { diff --git a/Vocaluxe/Lib/Video/IVideoDecoder.cs b/Vocaluxe/Lib/Video/IVideoDecoder.cs index 374964e0..2f12f2b3 100644 --- a/Vocaluxe/Lib/Video/IVideoDecoder.cs +++ b/Vocaluxe/Lib/Video/IVideoDecoder.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Text; using Vocaluxe.Lib.Draw; +using Vocaluxe.Menu; namespace Vocaluxe.Lib.Video { diff --git a/Vocaluxe/Lib/Webcam/CAForgeNet.cs b/Vocaluxe/Lib/Webcam/CAForgeNet.cs index 0d520e1a..cbddcedc 100644 --- a/Vocaluxe/Lib/Webcam/CAForgeNet.cs +++ b/Vocaluxe/Lib/Webcam/CAForgeNet.cs @@ -10,6 +10,8 @@ using System.Runtime.InteropServices; using Vocaluxe.Lib.Draw; using System.Threading; +using Vocaluxe.Menu; + namespace Vocaluxe.Lib.Webcam { class CAForgeNet : IWebcam diff --git a/Vocaluxe/Lib/Webcam/IWebcam.cs b/Vocaluxe/Lib/Webcam/IWebcam.cs index 5b0ed223..066b83c3 100644 --- a/Vocaluxe/Lib/Webcam/IWebcam.cs +++ b/Vocaluxe/Lib/Webcam/IWebcam.cs @@ -4,6 +4,8 @@ using System.Text; using Vocaluxe.Lib.Draw; using System.Drawing; +using Vocaluxe.Menu; + namespace Vocaluxe.Lib.Webcam { struct SWebcamDevice diff --git a/Vocaluxe/Menu/CMenu.cs b/Vocaluxe/Menu/CMenu.cs index 91fc6bf4..eaa8a4b3 100644 --- a/Vocaluxe/Menu/CMenu.cs +++ b/Vocaluxe/Menu/CMenu.cs @@ -8,7 +8,7 @@ using System.Windows.Forms; using System.Xml; using System.Xml.XPath; -using Vocaluxe.Base; +//using Vocaluxe.Base; using Vocaluxe.Lib.Draw; using Vocaluxe.Menu; using Vocaluxe.Menu.SingNotes; @@ -76,6 +76,15 @@ namespace Vocaluxe.Menu protected SRectF _ScreenArea; + private IConfig _Config; + private ISettings _Settings; + private ITheme _Theme; + private IHelper _Helper; + private ILog _Log; + private IBackgroundMusic _BackgroundMusic; + private IDrawing _Draw; + private IGraphics _Graphics; + public SRectF ScreenArea { get { return _ScreenArea; } @@ -92,7 +101,20 @@ namespace Vocaluxe.Menu } public CMenu() + { + } + + public void Initialize(IConfig Config, ISettings Settings, ITheme Theme, IHelper Helper, ILog Log, IBackgroundMusic BackgroundMusic, IDrawing Draw, IGraphics Graphics) { + _Config = Config; + _Settings = Settings; + _Theme = Theme; + _Helper = Helper; + _Log = Log; + _BackgroundMusic = BackgroundMusic; + _Draw = Draw; + _Graphics = Graphics; + Init(); } @@ -132,8 +154,8 @@ namespace Vocaluxe.Menu _MouseDY = 0; _Active = false; - _ScreenArea = new SRectF(0f, 0f, CSettings.iRenderW, CSettings.iRenderH, 0f); - + _ScreenArea = new SRectF(0f, 0f, _Settings.GetRenderW(), _Settings.GetRenderH(), 0f); + _ThemeName = String.Empty; _ThemeBackgrounds = null; _ThemeStatics = null; @@ -146,12 +168,11 @@ namespace Vocaluxe.Menu _ThemeNameSelections = null; _ThemeEqualizers = null; _ThemePlaylists = null; - } #region ThemeHandler public virtual void LoadTheme() { - string file = Path.Combine(CTheme.GetThemeScreensPath(), _ThemeName + ".xml"); + string file = Path.Combine(_Theme.GetThemeScreensPath(), _ThemeName + ".xml"); XPathDocument xPathDoc = null; XPathNavigator navigator = null; @@ -172,14 +193,14 @@ namespace Vocaluxe.Menu if (xPathDoc != null) xPathDoc = null; - CLog.LogError("Error loading theme file " + file + ": " + e.Message); + _Log.LogError("Error loading theme file " + file + ": " + e.Message); } bool VersionCheck = false; if (loaded) VersionCheck = CheckVersion(_ScreenVersion, navigator); - int SkinIndex = CTheme.GetSkinIndex(); + int SkinIndex = _Theme.GetSkinIndex(); if (loaded && VersionCheck && SkinIndex != -1) { @@ -196,7 +217,7 @@ namespace Vocaluxe.Menu } else { - CLog.LogError("Can't load Background \"" + _ThemeBackgrounds[i] + "\" in screen " + _ThemeName); + _Log.LogError("Can't load Background \"" + _ThemeBackgrounds[i] + "\" in screen " + _ThemeName); } } } @@ -212,7 +233,7 @@ namespace Vocaluxe.Menu } else { - CLog.LogError("Can't load Static \"" + _ThemeStatics[i] + "\" in screen " + _ThemeName); + _Log.LogError("Can't load Static \"" + _ThemeStatics[i] + "\" in screen " + _ThemeName); } } } @@ -228,7 +249,7 @@ namespace Vocaluxe.Menu } else { - CLog.LogError("Can't load Text \"" + _ThemeTexts[i] + "\" in screen " + _ThemeName); + _Log.LogError("Can't load Text \"" + _ThemeTexts[i] + "\" in screen " + _ThemeName); } } } @@ -244,7 +265,7 @@ namespace Vocaluxe.Menu } else { - CLog.LogError("Can't load Button \"" + _ThemeButtons[i] + "\" in screen " + _ThemeName); + _Log.LogError("Can't load Button \"" + _ThemeButtons[i] + "\" in screen " + _ThemeName); } } } @@ -260,7 +281,7 @@ namespace Vocaluxe.Menu } else { - CLog.LogError("Can't load SelectSlide \"" + _ThemeSelectSlides[i] + "\" in screen " + _ThemeName); + _Log.LogError("Can't load SelectSlide \"" + _ThemeSelectSlides[i] + "\" in screen " + _ThemeName); } } } @@ -276,7 +297,7 @@ namespace Vocaluxe.Menu } else { - CLog.LogError("Can't load SongMenu \"" + _ThemeSongMenus[i] + "\" in screen " + _ThemeName); + _Log.LogError("Can't load SongMenu \"" + _ThemeSongMenus[i] + "\" in screen " + _ThemeName); } } } @@ -292,7 +313,7 @@ namespace Vocaluxe.Menu } else { - CLog.LogError("Can't load Lyric \"" + _ThemeLyrics[i] + "\" in screen " + _ThemeName); + _Log.LogError("Can't load Lyric \"" + _ThemeLyrics[i] + "\" in screen " + _ThemeName); } } } @@ -308,7 +329,7 @@ namespace Vocaluxe.Menu } else { - CLog.LogError("Can't load SingBar \"" + _ThemeSingNotes[i] + "\" in screen " + _ThemeName); + _Log.LogError("Can't load SingBar \"" + _ThemeSingNotes[i] + "\" in screen " + _ThemeName); } } } @@ -324,7 +345,7 @@ namespace Vocaluxe.Menu } else { - CLog.LogError("Can't load NameSelection \"" + _ThemeNameSelections[i] + "\" in screen " + _ThemeName); + _Log.LogError("Can't load NameSelection \"" + _ThemeNameSelections[i] + "\" in screen " + _ThemeName); } } } @@ -340,7 +361,7 @@ namespace Vocaluxe.Menu } else { - CLog.LogError("Can't load equalizer \"" + _ThemeEqualizers[i] + "\" in screen " + _ThemeName); + _Log.LogError("Can't load equalizer \"" + _ThemeEqualizers[i] + "\" in screen " + _ThemeName); } } } @@ -356,7 +377,7 @@ namespace Vocaluxe.Menu } else { - CLog.LogError("Can't load Playlist \"" + _ThemePlaylists[i] + "\" in screen " + _ThemeName); + _Log.LogError("Can't load Playlist \"" + _ThemePlaylists[i] + "\" in screen " + _ThemeName); } } } @@ -374,7 +395,7 @@ namespace Vocaluxe.Menu settings.Encoding = Encoding.UTF8; settings.ConformanceLevel = ConformanceLevel.Document; - string file = Path.Combine(CTheme.GetThemeScreensPath(), _ThemeName + ".xml"); + string file = Path.Combine(_Theme.GetThemeScreensPath(), _ThemeName + ".xml"); XmlWriter writer = XmlWriter.Create(file, settings); writer.WriteStartDocument(); @@ -738,7 +759,7 @@ namespace Vocaluxe.Menu } catch (Exception) { - CLog.LogError("Can't find Background Element \"" + key + "\" in Screen " + _ThemeName); + _Log.LogError("Can't find Background Element \"" + key + "\" in Screen " + _ThemeName); throw; } } @@ -751,7 +772,7 @@ namespace Vocaluxe.Menu } catch (Exception) { - CLog.LogError("Can't find Statics Element \"" + key + "\" in Screen " + _ThemeName); + _Log.LogError("Can't find Statics Element \"" + key + "\" in Screen " + _ThemeName); throw; } } @@ -764,7 +785,7 @@ namespace Vocaluxe.Menu } catch (Exception) { - CLog.LogError("Can't find Text Element \"" + key + "\" in Screen " + _ThemeName); + _Log.LogError("Can't find Text Element \"" + key + "\" in Screen " + _ThemeName); throw; } } @@ -777,7 +798,7 @@ namespace Vocaluxe.Menu } catch (Exception) { - CLog.LogError("Can't find Button Element \"" + key + "\" in Screen " + _ThemeName); + _Log.LogError("Can't find Button Element \"" + key + "\" in Screen " + _ThemeName); throw; } } @@ -790,7 +811,7 @@ namespace Vocaluxe.Menu } catch (Exception) { - CLog.LogError("Can't find SongMenu Element \"" + key + "\" in Screen " + _ThemeName); + _Log.LogError("Can't find SongMenu Element \"" + key + "\" in Screen " + _ThemeName); throw; } } @@ -803,7 +824,7 @@ namespace Vocaluxe.Menu } catch (Exception) { - CLog.LogError("Can't find Lyric Element \"" + key + "\" in Screen " + _ThemeName); + _Log.LogError("Can't find Lyric Element \"" + key + "\" in Screen " + _ThemeName); throw; } } @@ -816,7 +837,7 @@ namespace Vocaluxe.Menu } catch (Exception) { - CLog.LogError("Can't find SelectSlide Element \"" + key + "\" in Screen " + _ThemeName); + _Log.LogError("Can't find SelectSlide Element \"" + key + "\" in Screen " + _ThemeName); throw; } } @@ -829,7 +850,7 @@ namespace Vocaluxe.Menu } catch (Exception) { - CLog.LogError("Can't find SingBar Element \"" + key + "\" in Screen " + _ThemeName); + _Log.LogError("Can't find SingBar Element \"" + key + "\" in Screen " + _ThemeName); throw; } } @@ -842,7 +863,7 @@ namespace Vocaluxe.Menu } catch (Exception) { - CLog.LogError("Can't find NameSelection Element \"" + key + "\" in Screen " + _ThemeName); + _Log.LogError("Can't find NameSelection Element \"" + key + "\" in Screen " + _ThemeName); throw; } } @@ -855,7 +876,7 @@ namespace Vocaluxe.Menu } catch (Exception) { - CLog.LogError("Can't find Equalizer Element \"" + key + "\" in Screen " + _ThemeName); + _Log.LogError("Can't find Equalizer Element \"" + key + "\" in Screen " + _ThemeName); throw; } } @@ -868,7 +889,7 @@ namespace Vocaluxe.Menu } catch (Exception) { - CLog.LogError("Can't find Playlist Element \"" + key + "\" in Screen " + _ThemeName); + _Log.LogError("Can't find Playlist Element \"" + key + "\" in Screen " + _ThemeName); throw; } } @@ -878,7 +899,7 @@ namespace Vocaluxe.Menu #region MenuHandler public virtual bool HandleInput(KeyEvent KeyEvent) { - if (!CSettings.TabNavigation) + if (!_Settings.IsTabNavigation()) { if (KeyEvent.Key == Keys.Left) { @@ -917,35 +938,25 @@ namespace Vocaluxe.Menu if (KeyEvent.Key == Keys.Right) NextElement(); } - if (!CBackgroundMusic.Disabled) + if (_BackgroundMusic.IsDisabled()) { if (KeyEvent.ModSHIFT && (KeyEvent.Key == Keys.Add || KeyEvent.Key == Keys.PageUp)) - { - CConfig.BackgroundMusicVolume = CConfig.BackgroundMusicVolume + 5; - if (CConfig.BackgroundMusicVolume > 100) - CConfig.BackgroundMusicVolume = 100; - CConfig.SaveConfig(); - } + _Config.SetBackgroundMusicVolume(_Config.GetBackgroundMusicVolume() + 5); else if (KeyEvent.ModSHIFT && (KeyEvent.Key == Keys.Subtract || KeyEvent.Key == Keys.PageDown)) - { - CConfig.BackgroundMusicVolume = CConfig.BackgroundMusicVolume - 5; - if (CConfig.BackgroundMusicVolume < 0) - CConfig.BackgroundMusicVolume = 0; - CConfig.SaveConfig(); - } + _Config.SetBackgroundMusicVolume(_Config.GetBackgroundMusicVolume() - 5); else if (KeyEvent.Key == Keys.MediaNextTrack) - CBackgroundMusic.Next(); + _BackgroundMusic.Next(); else if (KeyEvent.Key == Keys.MediaPreviousTrack) - CBackgroundMusic.Previous(); + _BackgroundMusic.Previous(); else if (KeyEvent.Key == Keys.MediaPlayPause) { - if (CBackgroundMusic.Playing) - CBackgroundMusic.Pause(); + if (_BackgroundMusic.IsPlaying()) + _BackgroundMusic.Pause(); else - CBackgroundMusic.Play(); + _BackgroundMusic.Play(); } - - CBackgroundMusic.ApplyVolume(); + + _BackgroundMusic.ApplyVolume(); } return true; @@ -1356,10 +1367,10 @@ namespace Vocaluxe.Menu public void SelectByMouse(int x, int y) { - float z = CSettings.zFar; + float z = _Settings.GetZFar(); for (int i = 0; i < _Interactions.Count; i++) { - if ((CSettings.GameState == EGameState.EditTheme) || (!_Interactions[i].ThemeEditorOnly && _IsVisible(i))) + if ((_Settings.GetGameState() == EGameState.EditTheme) || (!_Interactions[i].ThemeEditorOnly && _IsVisible(i))) { if (_IsMouseOver(x, y, _Interactions[i])) { @@ -1410,7 +1421,7 @@ namespace Vocaluxe.Menu return true; break; case EType.TText: - RectangleF bounds = CDraw.GetTextBounds(_Texts[interact.Num]); + RectangleF bounds = _Draw.GetTextBounds(_Texts[interact.Num]); if (CHelper.IsInBounds(new SRectF(_Texts[interact.Num].X, _Texts[interact.Num].Y, bounds.Width, bounds.Height, _Texts[interact.Num].Z), x, y)) return true; break; @@ -1461,7 +1472,7 @@ namespace Vocaluxe.Menu case EType.TPlaylist: return _Playlists[interact.Num].Rect.Z; } - return CSettings.zFar; + return _Settings.GetZFar(); } private float _GetZValue(int interaction) @@ -1496,13 +1507,13 @@ namespace Vocaluxe.Menu return _Playlists[_Interactions[interaction].Num].Rect.Z; } - return CSettings.zFar; + return _Settings.GetZFar(); } private void _NextInteraction() { _UnsetSelected(); - if (CSettings.GameState != EGameState.EditTheme) + if (_Settings.GetGameState() != EGameState.EditTheme) { bool found = false; int start = _Selection; @@ -1529,7 +1540,7 @@ namespace Vocaluxe.Menu private void _PrevInteraction() { _UnsetSelected(); - if (CSettings.GameState != EGameState.EditTheme) + if (_Settings.GetGameState() != EGameState.EditTheme) { bool found = false; int start = _Selection; @@ -1676,13 +1687,13 @@ namespace Vocaluxe.Menu switch (Key.Key) { case Keys.Up: - actualRect = new SRectF(actualRect.X, CSettings.iRenderH, 1, 1, actualRect.Z); + actualRect = new SRectF(actualRect.X, _Settings.GetRenderH(), 1, 1, actualRect.Z); break; case Keys.Down: actualRect = new SRectF(actualRect.X, 0, 1, 1, actualRect.Z); break; case Keys.Left: - actualRect = new SRectF(CSettings.iRenderW, actualRect.Y, 1, 1, actualRect.Z); + actualRect = new SRectF(_Settings.GetRenderW(), actualRect.Y, 1, 1, actualRect.Z); break; case Keys.Right: actualRect = new SRectF(0, actualRect.Y, 1, 1, actualRect.Z); @@ -2200,7 +2211,7 @@ namespace Vocaluxe.Menu msg += "the file is for newer program versions! "; msg += "Current screen version is " + Version.ToString(); - CLog.LogError(msg); + _Log.LogError(msg); } return false; } @@ -2242,11 +2253,11 @@ namespace Vocaluxe.Menu private void ReloadThemeEditMode() { - CTheme.UnloadSkins(); - CTheme.ListSkins(); - CTheme.LoadSkins(); - CTheme.LoadTheme(); - CGraphics.ReloadTheme(); + _Theme.UnloadSkins(); + _Theme.ListSkins(); + _Theme.LoadSkins(); + _Theme.LoadTheme(); + _Graphics.ReloadTheme(); OnShow(); OnShowFinish(); diff --git a/Vocaluxe/Menu/IMenu.cs b/Vocaluxe/Menu/IMenu.cs index cc65ede5..192a12b5 100644 --- a/Vocaluxe/Menu/IMenu.cs +++ b/Vocaluxe/Menu/IMenu.cs @@ -1,6 +1,8 @@ using System; using System.Collections.Generic; +using System.Drawing; using System.Text; +using System.Windows.Forms; using Vocaluxe.Base; using Vocaluxe.Lib.Draw; @@ -9,6 +11,8 @@ namespace Vocaluxe.Menu { interface IMenu { + void Initialize(IConfig Config, ISettings Settings, ITheme Theme, IHelper Helper, ILog Log, IBackgroundMusic BackgroundMusic, IDrawing Draw, IGraphics Graphics); + void LoadTheme(); void SaveTheme(); void ReloadTextures(); @@ -38,4 +42,309 @@ namespace Vocaluxe.Menu void ProcessMouseClick(int x, int y); void ProcessMouseMove(int x, int y); } + + interface IConfig + { + void SetBackgroundMusicVolume(int NewVolume); + int GetBackgroundMusicVolume(); + } + + interface ISettings + { + int GetRenderW(); + int GetRenderH(); + bool IsTabNavigation(); + + float GetZFar(); + float GetZNear(); + + EGameState GetGameState(); + } + + interface ITheme + { + string GetThemeScreensPath(); + int GetSkinIndex(); + + void UnloadSkins(); + void ListSkins(); + void LoadSkins(); + void LoadTheme(); + } + + interface IHelper + { + } + + interface IBackgroundMusic + { + bool IsDisabled(); + bool IsPlaying(); + + void Next(); + void Previous(); + void Pause(); + void Play(); + + void ApplyVolume(); + } + + interface IDrawing + { + RectangleF GetTextBounds(CText text); + } + + interface IGraphics + { + void ReloadTheme(); + } + + interface ILog + { + void LogError(string ErrorText); + } + + [Flags] + public enum EModifier + { + None, + Shift, + Alt, + Ctrl + } + + public enum ESender + { + Mouse, + Keyboard, + WiiMote, + Gamepad + } + + public struct KeyEvent + { + public ESender Sender; + public bool ModALT; + public bool ModSHIFT; + public bool ModCTRL; + public bool KeyPressed; + public bool Handled; + public Keys Key; + public Char Unicode; + public EModifier Mod; + + public KeyEvent(ESender sender, bool alt, bool shift, bool ctrl, bool pressed, char unicode, Keys key) + { + Sender = sender; + ModALT = alt; + ModSHIFT = shift; + ModCTRL = ctrl; + KeyPressed = pressed; + Unicode = unicode; + Key = key; + Handled = false; + + EModifier mALT = EModifier.None; + EModifier mSHIFT = EModifier.None; + EModifier mCTRL = EModifier.None; + + if (alt) + mALT = EModifier.Alt; + + if (shift) + mSHIFT = EModifier.Shift; + + if (ctrl) + mCTRL = EModifier.Ctrl; + + if (!alt && !shift && !ctrl) + Mod = EModifier.None; + else + Mod = mALT | mSHIFT | mCTRL; + } + } + + public struct MouseEvent + { + public ESender Sender; + public int X; + public int Y; + public bool LB; //left button click + public bool LD; //left button double click + public bool RB; //right button click + public bool MB; //middle button click + + public bool LBH; //left button hold (when moving) + public bool RBH; //right button hold (when moving) + public bool MBH; //middle button hold (when moving) + + public bool ModALT; + public bool ModSHIFT; + public bool ModCTRL; + + public EModifier Mod; + public int Wheel; + + public MouseEvent(ESender sender, bool alt, bool shift, bool ctrl, int x, int y, bool lb, bool ld, bool rb, int wheel, bool lbh, bool rbh, bool mb, bool mbh) + { + Sender = sender; + X = x; + Y = y; + LB = lb; + LD = ld; + RB = rb; + MB = mb; + + LBH = lbh; + RBH = rbh; + MBH = mbh; + + ModALT = alt; + ModSHIFT = shift; + ModCTRL = ctrl; + + EModifier mALT = EModifier.None; + EModifier mSHIFT = EModifier.None; + EModifier mCTRL = EModifier.None; + + if (alt) + mALT = EModifier.Alt; + + if (shift) + mSHIFT = EModifier.Shift; + + if (ctrl) + mCTRL = EModifier.Ctrl; + + if (!alt && !shift && !ctrl) + Mod = EModifier.None; + else + Mod = mALT | mSHIFT | mCTRL; + + Wheel = wheel; + } + } + + public enum EGameState + { + Start, + Normal, + EditTheme + } + + enum EAspect + { + Crop, + LetterBox, + Stretch + } + + #region Structs + public struct SColorF + { + public float R; + public float G; + public float B; + public float A; + + public SColorF(float r, float g, float b, float a) + { + R = r; + G = g; + B = b; + A = a; + } + + public SColorF(SColorF Color) + { + R = Color.R; + G = Color.G; + B = Color.B; + A = Color.A; + } + } + + public struct SRectF + { + public float X; + public float Y; + public float W; + public float H; + public float Z; + public float Rotation; //0..360° + + public SRectF(float x, float y, float w, float h, float z) + { + X = x; + Y = y; + W = w; + H = h; + Z = z; + Rotation = 0f; + } + + public SRectF(SRectF rect) + { + X = rect.X; + Y = rect.Y; + W = rect.W; + H = rect.H; + Z = rect.Z; + Rotation = 0f; + } + } + + public struct SPoint3f + { + public float X; + public float Y; + public float Z; + } + + public struct SPoint3 + { + public int X; + public int Y; + public int Z; + } + + public struct STexture + { + public int index; + public int PBO; + public int ID; + + public string TexturePath; + + public float width; + public float height; + public SRectF rect; + + public float w2; //power of 2 width + public float h2; //power of 2 height + public float width_ratio; + public float height_ratio; + + public SColorF color; + + public STexture(int Index) + { + index = Index; + PBO = 0; + ID = -1; + TexturePath = String.Empty; + + width = 1f; + height = 1f; + rect = new SRectF(0f, 0f, 1f, 1f, 0f); + + w2 = 2f; + h2 = 2f; + width_ratio = 0.5f; + height_ratio = 0.5f; + + color = new SColorF(1f, 1f, 1f, 1f); + } + } + #endregion Structs } diff --git a/Vocaluxe/Screens/CPopupScreenPlayerControl.cs b/Vocaluxe/Screens/CPopupScreenPlayerControl.cs index f1b206b2..16d0d3bd 100644 --- a/Vocaluxe/Screens/CPopupScreenPlayerControl.cs +++ b/Vocaluxe/Screens/CPopupScreenPlayerControl.cs @@ -76,7 +76,6 @@ namespace Vocaluxe.Screens public CPopupScreenPlayerControl() { - Init(); } protected override void Init() diff --git a/Vocaluxe/Screens/CPopupScreenVolumeControl.cs b/Vocaluxe/Screens/CPopupScreenVolumeControl.cs index a3c0f4aa..76624af1 100644 --- a/Vocaluxe/Screens/CPopupScreenVolumeControl.cs +++ b/Vocaluxe/Screens/CPopupScreenVolumeControl.cs @@ -24,7 +24,6 @@ namespace Vocaluxe.Screens public CPopupScreenVolumeControl() { - Init(); } protected override void Init() diff --git a/Vocaluxe/Screens/CScreenCredits.cs b/Vocaluxe/Screens/CScreenCredits.cs index 0327b38c..582a26bc 100644 --- a/Vocaluxe/Screens/CScreenCredits.cs +++ b/Vocaluxe/Screens/CScreenCredits.cs @@ -59,7 +59,6 @@ namespace Vocaluxe.Screens public CScreenCredits() { - Init(); } protected override void Init() diff --git a/Vocaluxe/Screens/CScreenHighscore.cs b/Vocaluxe/Screens/CScreenHighscore.cs index 5704ce63..06cb2c6d 100644 --- a/Vocaluxe/Screens/CScreenHighscore.cs +++ b/Vocaluxe/Screens/CScreenHighscore.cs @@ -31,7 +31,6 @@ namespace Vocaluxe.Screens public CScreenHighscore() { - Init(); } protected override void Init() diff --git a/Vocaluxe/Screens/CScreenLoad.cs b/Vocaluxe/Screens/CScreenLoad.cs index 41f373b2..77f3cab4 100644 --- a/Vocaluxe/Screens/CScreenLoad.cs +++ b/Vocaluxe/Screens/CScreenLoad.cs @@ -36,7 +36,6 @@ namespace Vocaluxe.Screens public CScreenLoad() { - Init(); } protected override void Init() diff --git a/Vocaluxe/Screens/CScreenMain.cs b/Vocaluxe/Screens/CScreenMain.cs index 4dea3cfb..a9dc6cc0 100644 --- a/Vocaluxe/Screens/CScreenMain.cs +++ b/Vocaluxe/Screens/CScreenMain.cs @@ -28,7 +28,6 @@ namespace Vocaluxe.Screens public CScreenMain() { - Init(); } protected override void Init() diff --git a/Vocaluxe/Screens/CScreenNames.cs b/Vocaluxe/Screens/CScreenNames.cs index 4e838086..5099dc36 100644 --- a/Vocaluxe/Screens/CScreenNames.cs +++ b/Vocaluxe/Screens/CScreenNames.cs @@ -43,7 +43,6 @@ namespace Vocaluxe.Screens public CScreenNames() { - Init(); } protected override void Init() diff --git a/Vocaluxe/Screens/CScreenOptions.cs b/Vocaluxe/Screens/CScreenOptions.cs index e3353ee2..755a03c3 100644 --- a/Vocaluxe/Screens/CScreenOptions.cs +++ b/Vocaluxe/Screens/CScreenOptions.cs @@ -23,7 +23,6 @@ namespace Vocaluxe.Screens public CScreenOptions() { - Init(); } protected override void Init() diff --git a/Vocaluxe/Screens/CScreenOptionsGame.cs b/Vocaluxe/Screens/CScreenOptionsGame.cs index 96acb672..72d335ba 100644 --- a/Vocaluxe/Screens/CScreenOptionsGame.cs +++ b/Vocaluxe/Screens/CScreenOptionsGame.cs @@ -32,7 +32,6 @@ namespace Vocaluxe.Screens public CScreenOptionsGame() { - Init(); } protected override void Init() diff --git a/Vocaluxe/Screens/CScreenOptionsLyrics.cs b/Vocaluxe/Screens/CScreenOptionsLyrics.cs index c6574c31..eef18019 100644 --- a/Vocaluxe/Screens/CScreenOptionsLyrics.cs +++ b/Vocaluxe/Screens/CScreenOptionsLyrics.cs @@ -20,7 +20,6 @@ namespace Vocaluxe.Screens public CScreenOptionsLyrics() { - Init(); } protected override void Init() diff --git a/Vocaluxe/Screens/CScreenOptionsRecord.cs b/Vocaluxe/Screens/CScreenOptionsRecord.cs index 7c0dae2d..2964d0f8 100644 --- a/Vocaluxe/Screens/CScreenOptionsRecord.cs +++ b/Vocaluxe/Screens/CScreenOptionsRecord.cs @@ -56,7 +56,6 @@ namespace Vocaluxe.Screens public CScreenOptionsRecord() { - Init(); } protected override void Init() diff --git a/Vocaluxe/Screens/CScreenOptionsSound.cs b/Vocaluxe/Screens/CScreenOptionsSound.cs index ca4a7a86..c6c91042 100644 --- a/Vocaluxe/Screens/CScreenOptionsSound.cs +++ b/Vocaluxe/Screens/CScreenOptionsSound.cs @@ -27,7 +27,6 @@ namespace Vocaluxe.Screens public CScreenOptionsSound() { - Init(); } protected override void Init() diff --git a/Vocaluxe/Screens/CScreenOptionsTheme.cs b/Vocaluxe/Screens/CScreenOptionsTheme.cs index a8862dd7..8f868bc3 100644 --- a/Vocaluxe/Screens/CScreenOptionsTheme.cs +++ b/Vocaluxe/Screens/CScreenOptionsTheme.cs @@ -33,7 +33,6 @@ namespace Vocaluxe.Screens public CScreenOptionsTheme() { - Init(); } protected override void Init() diff --git a/Vocaluxe/Screens/CScreenOptionsVideo.cs b/Vocaluxe/Screens/CScreenOptionsVideo.cs index fa5f5f1f..3221bdf0 100644 --- a/Vocaluxe/Screens/CScreenOptionsVideo.cs +++ b/Vocaluxe/Screens/CScreenOptionsVideo.cs @@ -27,13 +27,12 @@ namespace Vocaluxe.Screens private const string ButtonExit = "ButtonExit"; private SWebcamConfig _Config; - Lib.Draw.STexture _WebcamTexture = new Lib.Draw.STexture(-1); + STexture _WebcamTexture = new STexture(-1); private int _DeviceNr; private int _CapabilityNr; public CScreenOptionsVideo() { - Init(); } protected override void Init() diff --git a/Vocaluxe/Screens/CScreenParty.cs b/Vocaluxe/Screens/CScreenParty.cs index 0d0a6d38..aa003b4a 100644 --- a/Vocaluxe/Screens/CScreenParty.cs +++ b/Vocaluxe/Screens/CScreenParty.cs @@ -16,7 +16,6 @@ namespace Vocaluxe.Screens public CScreenParty() { - Init(); } protected override void Init() diff --git a/Vocaluxe/Screens/CScreenPartyDummy.cs b/Vocaluxe/Screens/CScreenPartyDummy.cs index a414c419..a506e5cd 100644 --- a/Vocaluxe/Screens/CScreenPartyDummy.cs +++ b/Vocaluxe/Screens/CScreenPartyDummy.cs @@ -14,7 +14,6 @@ namespace Vocaluxe.Screens public CScreenPartyDummy() { - Init(); } protected override void Init() diff --git a/Vocaluxe/Screens/CScreenProfiles.cs b/Vocaluxe/Screens/CScreenProfiles.cs index ec94f1e5..456cd8fd 100644 --- a/Vocaluxe/Screens/CScreenProfiles.cs +++ b/Vocaluxe/Screens/CScreenProfiles.cs @@ -41,12 +41,11 @@ namespace Vocaluxe.Screens private EEditMode _EditMode; - private Lib.Draw.STexture _WebcamTexture = new Lib.Draw.STexture(-1); + private STexture _WebcamTexture = new STexture(-1); private Bitmap _Snapshot = null; public CScreenProfiles() { - Init(); } protected override void Init() diff --git a/Vocaluxe/Screens/CScreenScore.cs b/Vocaluxe/Screens/CScreenScore.cs index 5f652325..7f0701fc 100644 --- a/Vocaluxe/Screens/CScreenScore.cs +++ b/Vocaluxe/Screens/CScreenScore.cs @@ -33,7 +33,6 @@ namespace Vocaluxe.Screens public CScreenScore() { - Init(); } protected override void Init() @@ -366,7 +365,7 @@ namespace Vocaluxe.Screens Statics[htStatics(StaticPointsBarBG[player, numplayer])].Visible = (numplayer + 1 == CGame.NumPlayer); Statics[htStatics(StaticAvatar[player, numplayer])].Visible = (numplayer + 1 == CGame.NumPlayer); - Statics[htStatics(StaticAvatar[player, numplayer])].Texture = new Lib.Draw.STexture(-1); + Statics[htStatics(StaticAvatar[player, numplayer])].Texture = new STexture(-1); } } } diff --git a/Vocaluxe/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs index 11c57146..2e001911 100644 --- a/Vocaluxe/Screens/CScreenSing.cs +++ b/Vocaluxe/Screens/CScreenSing.cs @@ -97,7 +97,6 @@ namespace Vocaluxe.Screens public CScreenSing() { - Init(); } protected override void Init() diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 9325e95c..2cee62d6 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -68,8 +68,6 @@ namespace Vocaluxe.Screens public CScreenSong() { - Init(); - _AvailableGameModes = new List(); } diff --git a/Vocaluxe/Screens/CScreenTest.cs b/Vocaluxe/Screens/CScreenTest.cs index 9f387043..a203518e 100644 --- a/Vocaluxe/Screens/CScreenTest.cs +++ b/Vocaluxe/Screens/CScreenTest.cs @@ -19,7 +19,6 @@ namespace Vocaluxe.Screens public CScreenTest() { - Init(); } protected override void Init() diff --git a/Vocaluxe/Screens/PartyScreens/CMenuParty.cs b/Vocaluxe/Screens/PartyScreens/CMenuParty.cs index 332f93e9..94f90323 100644 --- a/Vocaluxe/Screens/PartyScreens/CMenuParty.cs +++ b/Vocaluxe/Screens/PartyScreens/CMenuParty.cs @@ -6,8 +6,13 @@ using Vocaluxe.Menu; namespace Vocaluxe.Screens.PartyScreens { - abstract class CMenuParty : CMenu + abstract class CMenuParty { + public CMenuParty() + { + } + + /* public sealed override void LoadTheme() { } @@ -23,7 +28,7 @@ namespace Vocaluxe.Screens.PartyScreens public override void UnloadTextures() { } - + */ } } diff --git a/Vocaluxe/Vocaluxe.csproj b/Vocaluxe/Vocaluxe.csproj index 42c754cc..7a88a37f 100644 --- a/Vocaluxe/Vocaluxe.csproj +++ b/Vocaluxe/Vocaluxe.csproj @@ -180,6 +180,7 @@ + @@ -230,6 +231,7 @@ +