From 1336a6fa3658ea64f416f36b62b56705afb6813c Mon Sep 17 00:00:00 2001 From: Flamefire Date: Mon, 15 Apr 2013 12:58:29 +0200 Subject: [PATCH] Renamed ambiguous variable names --- .../PartyScreenChallengeMain.cs | 24 ++++---- .../PartyScreenChallengeMedleyMain.cs | 24 ++++---- Vocaluxe/Base/CGraphics.cs | 50 ++++++++-------- Vocaluxe/Base/CMain.cs | 4 +- Vocaluxe/Base/CSettings.cs | 8 +-- Vocaluxe/Base/CVideo.cs | 2 +- Vocaluxe/Lib/Draw/CDirect3D.cs | 2 +- Vocaluxe/Lib/Draw/COpenGL.cs | 4 +- Vocaluxe/Lib/Sound/COpenALPlay.cs | 1 - Vocaluxe/Lib/Sound/CPortAudioPlay.cs | 5 +- .../Lib/Sound/Decoder/CAudioDecoderFFmpeg.cs | 20 +++---- Vocaluxe/Screens/CScreenNames.cs | 2 +- Vocaluxe/Screens/CScreenSong.cs | 2 +- VocaluxeLib/Menu/CPoints.cs | 26 ++++----- VocaluxeLib/Menu/CScreenSetting.cs | 12 ++-- VocaluxeLib/Menu/SongMenu/CSong.cs | 16 +++--- .../Menu/SongMenu/CSongMenuFramework.cs | 57 +++++++++---------- 17 files changed, 126 insertions(+), 133 deletions(-) diff --git a/PartyModes/PartyModeChallenge/PartyScreenChallengeMain.cs b/PartyModes/PartyModeChallenge/PartyScreenChallengeMain.cs index f6fa899f..d54173cf 100644 --- a/PartyModes/PartyModeChallenge/PartyScreenChallengeMain.cs +++ b/PartyModes/PartyModeChallenge/PartyScreenChallengeMain.cs @@ -425,11 +425,11 @@ namespace VocaluxeLib.PartyModes.Challenge if (NumRoundsVisible > GameState.Combs.Count) NumRoundsVisible = GameState.Combs.Count; - float x = Texts[TextRoundNumber].X; - float y = Texts[TextRoundNumber].Y; + float numberX = Texts[TextRoundNumber].X; + float numberY = Texts[TextRoundNumber].Y; - RoundsTableScrollArea.X = x; - RoundsTableScrollArea.Y = y; + RoundsTableScrollArea.X = numberX; + RoundsTableScrollArea.Y = numberY; RoundsTableScrollArea.W = CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20; float delta = Texts[TextRoundNumber].Height; @@ -438,8 +438,8 @@ namespace VocaluxeLib.PartyModes.Challenge for (int round = 0; round < RoundsTable.Count; round++) { //Round-number - RoundsTable[round].Number.X = x; - RoundsTable[round].Number.Y = y; + RoundsTable[round].Number.X = numberX; + RoundsTable[round].Number.Y = numberY; int NumInnerRows = (int)Math.Ceiling(GameState.NumPlayerAtOnce / ((double)NumPlayerInOneRow)); for (int row = 0; row < NumInnerRows; row++) { @@ -453,23 +453,23 @@ namespace VocaluxeLib.PartyModes.Challenge for (int column = row * NumPlayerInOneRow; column < num; column++) { //Player - float _x = x + 15 + (CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20) / NumPlayerInThisRow * (column - row * NumPlayerInOneRow) + + float _x = numberX + 15 + (CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20) / NumPlayerInThisRow * (column - row * NumPlayerInOneRow) + ((CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20) / NumPlayerInThisRow) / 2; float maxw = ((CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20) / NumPlayerInThisRow) / 2 - 5; RoundsTable[round].TextPlayer[column].X = _x; - RoundsTable[round].TextPlayer[column].Y = y; + RoundsTable[round].TextPlayer[column].Y = numberY; RoundsTable[round].TextPlayer[column].MaxWidth = maxw; //Score RoundsTable[round].TextScores[column] = RoundsTable[round].TextScores[column]; RoundsTable[round].TextScores[column].X = _x; - RoundsTable[round].TextScores[column].Y = y + delta; + RoundsTable[round].TextScores[column].Y = numberY + delta; RoundsTable[round].TextScores[column].MaxWidth = maxw; } - y = y + delta + delta; + numberY = numberY + delta + delta; } - y = y + delta / 2; + numberY = numberY + delta / 2; } - RoundsTableScrollArea.H = y - RoundsTableScrollArea.Y; + RoundsTableScrollArea.H = numberY - RoundsTableScrollArea.Y; } private void UpdateRoundsTable() diff --git a/PartyModes/PartyModeChallengeMedley/PartyScreenChallengeMedleyMain.cs b/PartyModes/PartyModeChallengeMedley/PartyScreenChallengeMedleyMain.cs index fcd47460..0e377470 100644 --- a/PartyModes/PartyModeChallengeMedley/PartyScreenChallengeMedleyMain.cs +++ b/PartyModes/PartyModeChallengeMedley/PartyScreenChallengeMedleyMain.cs @@ -425,11 +425,11 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley if (NumRoundsVisible > GameState.Combs.Count) NumRoundsVisible = GameState.Combs.Count; - float x = Texts[TextRoundNumber].X; - float y = Texts[TextRoundNumber].Y; + float numberX = Texts[TextRoundNumber].X; + float numberY = Texts[TextRoundNumber].Y; - RoundsTableScrollArea.X = x; - RoundsTableScrollArea.Y = y; + RoundsTableScrollArea.X = numberX; + RoundsTableScrollArea.Y = numberY; RoundsTableScrollArea.W = CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20; float delta = Texts[TextRoundNumber].Height; @@ -438,8 +438,8 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley for (int round = 0; round < RoundsTable.Count; round++) { //Round-number - RoundsTable[round].Number.X = x; - RoundsTable[round].Number.Y = y; + RoundsTable[round].Number.X = numberX; + RoundsTable[round].Number.Y = numberY; int NumInnerRows = (int)Math.Ceiling(GameState.NumPlayerAtOnce / ((double)NumPlayerInOneRow)); for (int row = 0; row < NumInnerRows; row++) { @@ -453,23 +453,23 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley for (int column = row * NumPlayerInOneRow; column < num; column++) { //Player - float _x = x + 15 + (CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20) / NumPlayerInThisRow * (column - row * NumPlayerInOneRow) + + float _x = numberX + 15 + (CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20) / NumPlayerInThisRow * (column - row * NumPlayerInOneRow) + ((CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20) / NumPlayerInThisRow) / 2; float maxw = ((CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20) / NumPlayerInThisRow) / 2 - 5; RoundsTable[round].TextPlayer[column].X = _x; - RoundsTable[round].TextPlayer[column].Y = y; + RoundsTable[round].TextPlayer[column].Y = numberY; RoundsTable[round].TextPlayer[column].MaxWidth = maxw; //Score RoundsTable[round].TextScores[column] = RoundsTable[round].TextScores[column]; RoundsTable[round].TextScores[column].X = _x; - RoundsTable[round].TextScores[column].Y = y + delta; + RoundsTable[round].TextScores[column].Y = numberY + delta; RoundsTable[round].TextScores[column].MaxWidth = maxw; } - y = y + delta + delta; + numberY = numberY + delta + delta; } - y = y + delta / 2; + numberY = numberY + delta / 2; } - RoundsTableScrollArea.H = y - RoundsTableScrollArea.Y; + RoundsTableScrollArea.H = numberY - RoundsTableScrollArea.Y; } private void UpdateRoundsTable() diff --git a/Vocaluxe/Base/CGraphics.cs b/Vocaluxe/Base/CGraphics.cs index 36d2cd9b..bfe8e245 100644 --- a/Vocaluxe/Base/CGraphics.cs +++ b/Vocaluxe/Base/CGraphics.cs @@ -244,7 +244,7 @@ namespace Vocaluxe.Base new SColorF(CTheme.Cursor.r, CTheme.Cursor.g, CTheme.Cursor.b, CTheme.Cursor.a), CTheme.Cursor.w, CTheme.Cursor.h, - CSettings.zNear); + CSettings.ZNear); for (int i = 0; i < _Screens.Count; i++) { @@ -361,7 +361,7 @@ namespace Vocaluxe.Base float factor = (float)ms / FadeTime; _GlobalAlpha = 1f; // -factor / 100f; - _ZOffset = CSettings.zFar / 2; + _ZOffset = CSettings.ZFar / 2; if (_CurrentScreen == EScreens.ScreenPartyDummy) { @@ -739,8 +739,8 @@ namespace Vocaluxe.Base CFonts.Height = 30f; RectangleF rect = new RectangleF(CSettings.iRenderW - CFonts.GetTextWidth(txt), dy, CFonts.GetTextWidth(txt), CFonts.GetTextHeight(txt)); - CDraw.DrawColor(Gray, new SRectF(rect.X, rect.Top, rect.Width, rect.Height, CSettings.zNear)); - CFonts.DrawText(txt, rect.X, rect.Y, CSettings.zNear); + CDraw.DrawColor(Gray, new SRectF(rect.X, rect.Top, rect.Width, rect.Height, CSettings.ZNear)); + CFonts.DrawText(txt, rect.X, rect.Y, CSettings.ZNear); dy += rect.Height; } @@ -750,8 +750,8 @@ namespace Vocaluxe.Base RectangleF rect = new RectangleF(CSettings.iRenderW - CFonts.GetTextWidth(txt), dy, CFonts.GetTextWidth(txt), CFonts.GetTextHeight(txt)); - CDraw.DrawColor(Gray, new SRectF(rect.X, rect.Top, rect.Width, rect.Height, CSettings.zNear)); - CFonts.DrawText(txt, rect.X, rect.Y, CSettings.zNear); + CDraw.DrawColor(Gray, new SRectF(rect.X, rect.Top, rect.Width, rect.Height, CSettings.ZNear)); + CFonts.DrawText(txt, rect.X, rect.Y, CSettings.ZNear); dy += rect.Height; } @@ -761,8 +761,8 @@ namespace Vocaluxe.Base RectangleF rect = new RectangleF(CSettings.iRenderW - CFonts.GetTextWidth(txt), dy, CFonts.GetTextWidth(txt), CFonts.GetTextHeight(txt)); - CDraw.DrawColor(Gray, new SRectF(rect.X, rect.Top, rect.Width, rect.Height, CSettings.zNear)); - CFonts.DrawText(txt, rect.X, rect.Y, CSettings.zNear); + CDraw.DrawColor(Gray, new SRectF(rect.X, rect.Top, rect.Width, rect.Height, CSettings.ZNear)); + CFonts.DrawText(txt, rect.X, rect.Y, CSettings.ZNear); dy += rect.Height; } @@ -772,8 +772,8 @@ namespace Vocaluxe.Base RectangleF rect = new RectangleF(CSettings.iRenderW - CFonts.GetTextWidth(txt), dy, CFonts.GetTextWidth(txt), CFonts.GetTextHeight(txt)); - CDraw.DrawColor(Gray, new SRectF(rect.X, rect.Top, rect.Width, rect.Height, CSettings.zNear)); - CFonts.DrawText(txt, rect.X, rect.Y, CSettings.zNear); + CDraw.DrawColor(Gray, new SRectF(rect.X, rect.Top, rect.Width, rect.Height, CSettings.ZNear)); + CFonts.DrawText(txt, rect.X, rect.Y, CSettings.ZNear); dy += rect.Height; } @@ -784,8 +784,8 @@ namespace Vocaluxe.Base RectangleF rect = new RectangleF(CSettings.iRenderW - CFonts.GetTextWidth(txt), dy, CFonts.GetTextWidth(txt), CFonts.GetTextHeight(txt)); - CDraw.DrawColor(Gray, new SRectF(rect.X, rect.Top, rect.Width, rect.Height, CSettings.zNear)); - CFonts.DrawText(txt, rect.X, rect.Y, CSettings.zNear); + CDraw.DrawColor(Gray, new SRectF(rect.X, rect.Top, rect.Width, rect.Height, CSettings.ZNear)); + CFonts.DrawText(txt, rect.X, rect.Y, CSettings.ZNear); dy += rect.Height; } @@ -795,8 +795,8 @@ namespace Vocaluxe.Base RectangleF rect = new RectangleF(CSettings.iRenderW - CFonts.GetTextWidth(txt), dy, CFonts.GetTextWidth(txt), CFonts.GetTextHeight(txt)); - CDraw.DrawColor(Gray, new SRectF(rect.X, rect.Top, rect.Width, rect.Height, CSettings.zNear)); - CFonts.DrawText(txt, rect.X, rect.Y, CSettings.zNear); + CDraw.DrawColor(Gray, new SRectF(rect.X, rect.Top, rect.Width, rect.Height, CSettings.ZNear)); + CFonts.DrawText(txt, rect.X, rect.Y, CSettings.ZNear); dy += rect.Height; @@ -804,16 +804,16 @@ namespace Vocaluxe.Base rect = new RectangleF(CSettings.iRenderW - CFonts.GetTextWidth(txt), dy, CFonts.GetTextWidth(txt), CFonts.GetTextHeight(txt)); - CDraw.DrawColor(Gray, new SRectF(rect.X, rect.Top, rect.Width, rect.Height, CSettings.zNear)); - CFonts.DrawText(txt, rect.X, rect.Y, CSettings.zNear); + CDraw.DrawColor(Gray, new SRectF(rect.X, rect.Top, rect.Width, rect.Height, CSettings.ZNear)); + CFonts.DrawText(txt, rect.X, rect.Y, CSettings.ZNear); dy += rect.Height; txt = CSound.RecordGetToneAbs(1).ToString(CLanguage.Translate("TR_DEBUG_TONE_ABS") + " P2: 00"); rect = new RectangleF(CSettings.iRenderW - CFonts.GetTextWidth(txt), dy, CFonts.GetTextWidth(txt), CFonts.GetTextHeight(txt)); - CDraw.DrawColor(Gray, new SRectF(rect.X, rect.Top, rect.Width, rect.Height, CSettings.zNear)); - CFonts.DrawText(txt, rect.X, rect.Y, CSettings.zNear); + CDraw.DrawColor(Gray, new SRectF(rect.X, rect.Top, rect.Width, rect.Height, CSettings.ZNear)); + CFonts.DrawText(txt, rect.X, rect.Y, CSettings.ZNear); dy += rect.Height; @@ -821,8 +821,8 @@ namespace Vocaluxe.Base rect = new RectangleF(CSettings.iRenderW - CFonts.GetTextWidth(txt), dy, CFonts.GetTextWidth(txt), CFonts.GetTextHeight(txt)); - CDraw.DrawColor(Gray, new SRectF(rect.X, rect.Top, rect.Width, rect.Height, CSettings.zNear)); - CFonts.DrawText(txt, rect.X, rect.Y, CSettings.zNear); + CDraw.DrawColor(Gray, new SRectF(rect.X, rect.Top, rect.Width, rect.Height, CSettings.ZNear)); + CFonts.DrawText(txt, rect.X, rect.Y, CSettings.ZNear); dy += rect.Height; } @@ -832,8 +832,8 @@ namespace Vocaluxe.Base RectangleF rect = new RectangleF(CSettings.iRenderW - CFonts.GetTextWidth(txt), dy, CFonts.GetTextWidth(txt), CFonts.GetTextHeight(txt)); - CDraw.DrawColor(Gray, new SRectF(rect.X, rect.Top, rect.Width, rect.Height, CSettings.zNear)); - CFonts.DrawText(txt, rect.X, rect.Y, CSettings.zNear); + CDraw.DrawColor(Gray, new SRectF(rect.X, rect.Top, rect.Width, rect.Height, CSettings.ZNear)); + CFonts.DrawText(txt, rect.X, rect.Y, CSettings.ZNear); dy += rect.Height; } @@ -843,8 +843,8 @@ namespace Vocaluxe.Base RectangleF rect = new RectangleF(CSettings.iRenderW - CFonts.GetTextWidth(txt), dy, CFonts.GetTextWidth(txt), CFonts.GetTextHeight(txt)); - CDraw.DrawColor(Gray, new SRectF(rect.X, rect.Top, rect.Width, rect.Height, CSettings.zNear)); - CFonts.DrawText(txt, rect.X, rect.Y, CSettings.zNear); + CDraw.DrawColor(Gray, new SRectF(rect.X, rect.Top, rect.Width, rect.Height, CSettings.ZNear)); + CFonts.DrawText(txt, rect.X, rect.Y, CSettings.ZNear); dy += rect.Height; } } @@ -868,7 +868,7 @@ namespace Vocaluxe.Base new SColorF(CTheme.Cursor.r, CTheme.Cursor.g, CTheme.Cursor.b, CTheme.Cursor.a), CTheme.Cursor.w, CTheme.Cursor.h, - CSettings.zNear); + CSettings.ZNear); } #endregion private stuff } diff --git a/Vocaluxe/Base/CMain.cs b/Vocaluxe/Base/CMain.cs index 6f4b41b9..ed6ac6ff 100644 --- a/Vocaluxe/Base/CMain.cs +++ b/Vocaluxe/Base/CMain.cs @@ -153,12 +153,12 @@ namespace Vocaluxe.Base public float GetZFar() { - return CSettings.zFar; + return CSettings.ZFar; } public float GetZNear() { - return CSettings.zNear; + return CSettings.ZNear; } public EGameState GetGameState() diff --git a/Vocaluxe/Base/CSettings.cs b/Vocaluxe/Base/CSettings.cs index 4a1f7b13..e14e704c 100644 --- a/Vocaluxe/Base/CSettings.cs +++ b/Vocaluxe/Base/CSettings.cs @@ -48,8 +48,8 @@ namespace Vocaluxe.Base public static int iRenderW = 1280; public static int iRenderH = 720; - public static int zNear = -100; - public static int zFar = 100; + public const int ZNear = -100; + public const int ZFar = 100; public static bool IsFullScreen = false; public static int iVertexBufferElements = 10000; @@ -57,7 +57,7 @@ namespace Vocaluxe.Base public const string sIcon = "Vocaluxe.ico"; public const string sLogo = "Logo.png"; public const string FallbackLanguage = "English"; - public static string sBassRegistration = "Registration.xml"; + public const string sBassRegistration = "Registration.xml"; public static string sFileConfig = "Config.xml"; public const string sFileCover = "Cover.xml"; public const string sFileFonts = "Fonts.xml"; @@ -87,7 +87,7 @@ namespace Vocaluxe.Base public const string sFolderBackgroundMusic = "BackgroundMusic"; public static string sFolderPlaylists = "Playlists"; - public static string sFolderPartyModes = "PartyModes"; + public const string sFolderPartyModes = "PartyModes"; public const string sFolderPartyModeCode = "Code"; public const string sFolderPartyModeScreens = "Screens"; public const string sFolderPartyModeLanguages = "Languages"; diff --git a/Vocaluxe/Base/CVideo.cs b/Vocaluxe/Base/CVideo.cs index d3167b0b..be09eb05 100644 --- a/Vocaluxe/Base/CVideo.cs +++ b/Vocaluxe/Base/CVideo.cs @@ -171,7 +171,7 @@ namespace Vocaluxe.Base RectangleF rect = new RectangleF(0f, 0f, _VideoTexture.width, _VideoTexture.height); CHelper.SetRect(bounds, ref rect, rect.Width / rect.Height, EAspect.Crop); - CDraw.DrawTexture(_VideoTexture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, CSettings.zFar / 4)); + CDraw.DrawTexture(_VideoTexture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, CSettings.ZFar / 4)); } public void PreLoad() diff --git a/Vocaluxe/Lib/Draw/CDirect3D.cs b/Vocaluxe/Lib/Draw/CDirect3D.cs index 400ece84..c86d4715 100644 --- a/Vocaluxe/Lib/Draw/CDirect3D.cs +++ b/Vocaluxe/Lib/Draw/CDirect3D.cs @@ -402,7 +402,7 @@ namespace Vocaluxe.Lib.Draw Text = CSettings.GetFullVersionText(); SlimDX.Matrix translate = SlimDX.Matrix.Translation(new Vector3(-CSettings.iRenderW / 2, CSettings.iRenderH / 2, 0)); SlimDX.Matrix projection = SlimDX.Matrix.OrthoOffCenterLH(-CSettings.iRenderW / 2, CSettings.iRenderW / 2, -CSettings.iRenderH / 2, CSettings.iRenderH / 2, - CSettings.zNear, CSettings.zFar); + CSettings.ZNear, CSettings.ZFar); _VertexBuffer = new VertexBuffer(_Device, CSettings.iVertexBufferElements * (4 * Marshal.SizeOf(typeof(TexturedColoredVertex))), Usage.WriteOnly | Usage.Dynamic, VertexFormat.Position | VertexFormat.Texture1 | VertexFormat.Diffuse, Pool.Default); diff --git a/Vocaluxe/Lib/Draw/COpenGL.cs b/Vocaluxe/Lib/Draw/COpenGL.cs index b977064e..534a77a8 100644 --- a/Vocaluxe/Lib/Draw/COpenGL.cs +++ b/Vocaluxe/Lib/Draw/COpenGL.cs @@ -420,7 +420,7 @@ namespace Vocaluxe.Lib.Draw OpenTK.Graphics.OpenGL.GL.MatrixMode(OpenTK.Graphics.OpenGL.MatrixMode.Projection); OpenTK.Graphics.OpenGL.GL.LoadIdentity(); - OpenTK.Graphics.OpenGL.GL.Ortho(0, CSettings.iRenderW, CSettings.iRenderH, 0, CSettings.zNear, CSettings.zFar); + OpenTK.Graphics.OpenGL.GL.Ortho(0, CSettings.iRenderW, CSettings.iRenderH, 0, CSettings.ZNear, CSettings.ZFar); OpenTK.Graphics.OpenGL.GL.Viewport(x, y, w, h); } @@ -437,7 +437,7 @@ namespace Vocaluxe.Lib.Draw OpenTK.Graphics.OpenGL.GL.BlendFunc(OpenTK.Graphics.OpenGL.BlendingFactorSrc.SrcAlpha, OpenTK.Graphics.OpenGL.BlendingFactorDest.OneMinusSrcAlpha); OpenTK.Graphics.OpenGL.GL.PixelStore(OpenTK.Graphics.OpenGL.PixelStoreParameter.UnpackAlignment, 1); - OpenTK.Graphics.OpenGL.GL.DepthRange(CSettings.zFar, CSettings.zNear); + OpenTK.Graphics.OpenGL.GL.DepthRange(CSettings.ZFar, CSettings.ZNear); OpenTK.Graphics.OpenGL.GL.DepthFunc(OpenTK.Graphics.OpenGL.DepthFunction.Lequal); OpenTK.Graphics.OpenGL.GL.Enable(OpenTK.Graphics.OpenGL.EnableCap.DepthTest); diff --git a/Vocaluxe/Lib/Sound/COpenALPlay.cs b/Vocaluxe/Lib/Sound/COpenALPlay.cs index 4d8587b8..2885ab34 100644 --- a/Vocaluxe/Lib/Sound/COpenALPlay.cs +++ b/Vocaluxe/Lib/Sound/COpenALPlay.cs @@ -376,7 +376,6 @@ namespace Vocaluxe.Lib.Sound private bool _pauseStreamAfterFade; private bool _fading; - private Stopwatch _FadeTimer = new Stopwatch(); private readonly Stopwatch _Timer = new Stopwatch(); private CLOSEPROC _Closeproc; diff --git a/Vocaluxe/Lib/Sound/CPortAudioPlay.cs b/Vocaluxe/Lib/Sound/CPortAudioPlay.cs index f502f557..ebb587e7 100644 --- a/Vocaluxe/Lib/Sound/CPortAudioPlay.cs +++ b/Vocaluxe/Lib/Sound/CPortAudioPlay.cs @@ -354,7 +354,6 @@ namespace Vocaluxe.Lib.Sound private static PortAudio.PaDeviceInfo _outputDeviceInfo; private IntPtr _Ptr = new IntPtr(0); - private Stopwatch _FadeTimer = new Stopwatch(); private CLOSEPROC _Closeproc; private PortAudio.PaStreamCallbackDelegate _paStreamCallback; @@ -581,7 +580,7 @@ namespace Vocaluxe.Lib.Sound } } - _paStreamCallback = _PaStreamCallback; + _paStreamCallback = _ProcessNewData; } catch (Exception) { @@ -790,7 +789,7 @@ namespace Vocaluxe.Lib.Sound #endregion Threading #region Callbacks - private PortAudio.PaStreamCallbackResult _PaStreamCallback( + private PortAudio.PaStreamCallbackResult _ProcessNewData( IntPtr input, IntPtr output, uint frameCount, diff --git a/Vocaluxe/Lib/Sound/Decoder/CAudioDecoderFFmpeg.cs b/Vocaluxe/Lib/Sound/Decoder/CAudioDecoderFFmpeg.cs index c49e0320..6c3bc15b 100644 --- a/Vocaluxe/Lib/Sound/Decoder/CAudioDecoderFFmpeg.cs +++ b/Vocaluxe/Lib/Sound/Decoder/CAudioDecoderFFmpeg.cs @@ -8,7 +8,7 @@ namespace Vocaluxe.Lib.Sound.Decoder { class CAudioDecoderFFmpeg : CAudioDecoder, IDisposable { - private IntPtr _instance = IntPtr.Zero; + private IntPtr _InstancePtr = IntPtr.Zero; private IntPtr _audiodecoder = IntPtr.Zero; private AC_instance _Instance; @@ -33,9 +33,9 @@ namespace Vocaluxe.Lib.Sound.Decoder try { - _instance = CAcinerella.ac_init(); - CAcinerella.ac_open2(_instance, _FileName); - _Instance = (AC_instance)Marshal.PtrToStructure(_instance, typeof(AC_instance)); + _InstancePtr = CAcinerella.ac_init(); + CAcinerella.ac_open2(_InstancePtr, _FileName); + _Instance = (AC_instance)Marshal.PtrToStructure(_InstancePtr, typeof(AC_instance)); } catch (Exception) { @@ -54,7 +54,7 @@ namespace Vocaluxe.Lib.Sound.Decoder AC_decoder Audiodecoder; try { - _audiodecoder = CAcinerella.ac_create_audio_decoder(_instance); + _audiodecoder = CAcinerella.ac_create_audio_decoder(_InstancePtr); Audiodecoder = (AC_decoder)Marshal.PtrToStructure(_audiodecoder, typeof(AC_decoder)); AudioStreamIndex = Audiodecoder.stream_index; } @@ -99,11 +99,11 @@ namespace Vocaluxe.Lib.Sound.Decoder if (_audiodecoder != IntPtr.Zero) CAcinerella.ac_free_decoder(_audiodecoder); - if (_instance != IntPtr.Zero) - CAcinerella.ac_close(_instance); + if (_InstancePtr != IntPtr.Zero) + CAcinerella.ac_close(_InstancePtr); - if (_instance != IntPtr.Zero) - CAcinerella.ac_free(_instance); + if (_InstancePtr != IntPtr.Zero) + CAcinerella.ac_free(_InstancePtr); _FileOpened = false; } @@ -160,7 +160,7 @@ namespace Vocaluxe.Lib.Sound.Decoder int FrameFinished = 0; try { - FrameFinished = CAcinerella.ac_get_audio_frame(_instance, _audiodecoder); + FrameFinished = CAcinerella.ac_get_audio_frame(_InstancePtr, _audiodecoder); } catch (Exception) { diff --git a/Vocaluxe/Screens/CScreenNames.cs b/Vocaluxe/Screens/CScreenNames.cs index 32ec3c6c..ef72207d 100644 --- a/Vocaluxe/Screens/CScreenNames.cs +++ b/Vocaluxe/Screens/CScreenNames.cs @@ -434,7 +434,7 @@ namespace Vocaluxe.Screens CStatic SelectedPlayer = NameSelections[NameSelection].TilePlayerAvatar(mouseEvent); chooseAvatarStatic.Visible = true; chooseAvatarStatic.Rect = SelectedPlayer.Rect; - chooseAvatarStatic.Rect.Z = CSettings.zNear; + chooseAvatarStatic.Rect.Z = CSettings.ZNear; chooseAvatarStatic.Color = new SColorF(1, 1, 1, 1); chooseAvatarStatic.Texture = SelectedPlayer.Texture; } diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 184f6f42..3ef9c575 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -552,7 +552,7 @@ namespace Vocaluxe.Screens if (!DragAndDropActive && Playlists[Playlist].Visible && CSongs.NumVisibleSongs > 0 && SongMenus[SongMenu].GetActualSelection() != -1) { DragAndDropCover = SongMenus[SongMenu].GetSelectedSongCover(); - DragAndDropCover.Rect.Z = CSettings.zNear; + DragAndDropCover.Rect.Z = CSettings.ZNear; Playlists[Playlist].DragAndDropSongID = CSongs.VisibleSongs[SongMenus[SongMenu].GetActualSelection()].ID; DragAndDropActive = true; return true; diff --git a/VocaluxeLib/Menu/CPoints.cs b/VocaluxeLib/Menu/CPoints.cs index 15dc154a..5b3d3b11 100644 --- a/VocaluxeLib/Menu/CPoints.cs +++ b/VocaluxeLib/Menu/CPoints.cs @@ -8,17 +8,17 @@ namespace VocaluxeLib.Menu { private readonly SPlayer[,] _Rounds; - public CPoints(int NumRounds, SPlayer[] Player) + public CPoints(int NumRounds, SPlayer[] Players) { - _Rounds = new SPlayer[NumRounds, Player.Length]; + _Rounds = new SPlayer[NumRounds, Players.Length]; for (int round = 0; round < NumRounds; round++) { - for (int player = 0; player < Player.Length; player++) + for (int player = 0; player < Players.Length; player++) { - _Rounds[round, player].ProfileID = Player[player].ProfileID; - _Rounds[round, player].Name = Player[player].Name; - _Rounds[round, player].Difficulty = Player[player].Difficulty; + _Rounds[round, player].ProfileID = Players[player].ProfileID; + _Rounds[round, player].Name = Players[player].Name; + _Rounds[round, player].Difficulty = Players[player].Difficulty; _Rounds[round, player].Points = 0f; _Rounds[round, player].PointsGoldenNotes = 0f; _Rounds[round, player].PointsLineBonus = 0f; @@ -30,21 +30,21 @@ namespace VocaluxeLib.Menu } } - public void SetPoints(int Round, int SongID, SPlayer[] Player, bool Medley, bool Duet, bool ShortSong) + public void SetPoints(int Round, int SongID, SPlayer[] Players, bool Medley, bool Duet, bool ShortSong) { long DateTicks = DateTime.Now.Ticks; - for (int player = 0; player < Player.Length; player++) + for (int player = 0; player < Players.Length; player++) { _Rounds[Round, player].SongID = SongID; - _Rounds[Round, player].LineNr = Player[player].LineNr; - _Rounds[Round, player].Points = Player[player].Points; - _Rounds[Round, player].PointsGoldenNotes = Player[player].PointsGoldenNotes; - _Rounds[Round, player].PointsLineBonus = Player[player].PointsLineBonus; + _Rounds[Round, player].LineNr = Players[player].LineNr; + _Rounds[Round, player].Points = Players[player].Points; + _Rounds[Round, player].PointsGoldenNotes = Players[player].PointsGoldenNotes; + _Rounds[Round, player].PointsLineBonus = Players[player].PointsLineBonus; _Rounds[Round, player].Medley = Medley; _Rounds[Round, player].Duet = Duet; _Rounds[Round, player].ShortSong = ShortSong; _Rounds[Round, player].DateTicks = DateTicks; - _Rounds[Round, player].SongFinished = Player[player].SongFinished; + _Rounds[Round, player].SongFinished = Players[player].SongFinished; } } diff --git a/VocaluxeLib/Menu/CScreenSetting.cs b/VocaluxeLib/Menu/CScreenSetting.cs index 45a7f651..49bcd712 100644 --- a/VocaluxeLib/Menu/CScreenSetting.cs +++ b/VocaluxeLib/Menu/CScreenSetting.cs @@ -100,11 +100,11 @@ namespace VocaluxeLib.Menu public void ReloadTextures() {} #region Private - private int GetIntValue(string _string) + private int GetIntValue(string value) { try { - return Convert.ToInt32(_string); + return Convert.ToInt32(value); } catch (Exception) { @@ -112,14 +112,14 @@ namespace VocaluxeLib.Menu } } - private STexture GetTextureValue(string _string) + private STexture GetTextureValue(string value) { - return CBase.Theme.GetSkinTexture(_string, _PartyModeID); + return CBase.Theme.GetSkinTexture(value, _PartyModeID); } - private SColorF GetColorValue(string _string) + private SColorF GetColorValue(string value) { - return CBase.Theme.GetColor(_string, _PartyModeID); + return CBase.Theme.GetColor(value, _PartyModeID); } #endregion Private diff --git a/VocaluxeLib/Menu/SongMenu/CSong.cs b/VocaluxeLib/Menu/SongMenu/CSong.cs index e03d8434..4864601c 100644 --- a/VocaluxeLib/Menu/SongMenu/CSong.cs +++ b/VocaluxeLib/Menu/SongMenu/CSong.cs @@ -866,7 +866,7 @@ namespace VocaluxeLib.Menu.SongMenu private struct Series { - public int start; + public int Start; public int end; public int length; } @@ -897,7 +897,7 @@ namespace VocaluxeLib.Menu.SongMenu if (sentences[i] == sentences[j] && sentences[i].Length > 0) { Series tempSeries = new Series(); - tempSeries.start = i; + tempSeries.Start = i; tempSeries.end = i; int max = 0; @@ -914,7 +914,7 @@ namespace VocaluxeLib.Menu.SongMenu break; } - tempSeries.length = tempSeries.end - tempSeries.start + 1; + tempSeries.length = tempSeries.end - tempSeries.Start + 1; series.Add(tempSeries); } } @@ -953,7 +953,7 @@ namespace VocaluxeLib.Menu.SongMenu // set medley vars if (series.Count > 0 && series[longest].length > CBase.Settings.GetMedleyMinSeriesLength()) { - Medley.StartBeat = lines.Line[series[longest].start].FirstNoteBeat; + Medley.StartBeat = lines.Line[series[longest].Start].FirstNoteBeat; Medley.EndBeat = lines.Line[series[longest].end].LastNoteBeat; bool foundEnd = false; @@ -965,7 +965,7 @@ namespace VocaluxeLib.Menu.SongMenu if (!foundEnd) { - for (int i = series[longest].start + 1; i < lines.LineCount - 1; i++) + for (int i = series[longest].Start + 1; i < lines.LineCount - 1; i++) { if (CBase.Game.GetTimeFromBeats(Medley.StartBeat, BPM) + CBase.Settings.GetMedleyMinDuration() > CBase.Game.GetTimeFromBeats(lines.Line[i].LastNoteBeat, BPM)) @@ -1005,11 +1005,11 @@ namespace VocaluxeLib.Menu.SongMenu //Check if stop is in series for (int i = 0; i < series.Count; i++) { - if (lines.Line[series[i].start].FirstNoteBeat < stop && lines.Line[series[i].end].LastNoteBeat > stop) + if (lines.Line[series[i].Start].FirstNoteBeat < stop && lines.Line[series[i].end].LastNoteBeat > stop) { - if (stop < (lines.Line[series[i].start].FirstNoteBeat + ((lines.Line[series[i].end].LastNoteBeat - lines.Line[series[i].start].FirstNoteBeat) / 2))) + if (stop < (lines.Line[series[i].Start].FirstNoteBeat + ((lines.Line[series[i].end].LastNoteBeat - lines.Line[series[i].Start].FirstNoteBeat) / 2))) { - ShortEnd = lines.Line[series[i].start - 1].LastNote.EndBeat; + ShortEnd = lines.Line[series[i].Start - 1].LastNote.EndBeat; return; } else diff --git a/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs b/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs index 12f0f348..5781304d 100644 --- a/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs +++ b/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs @@ -89,7 +89,6 @@ namespace VocaluxeLib.Menu.SongMenu private readonly Stopwatch _timer = new Stopwatch(); private readonly Stopwatch _VideoFadeTimer = new Stopwatch(); private readonly List _streams = new List(); - private int _video = -1; private int _actsong = -1; private int _actsongstream = -1; protected STexture _vidtex = new STexture(-1); @@ -171,10 +170,7 @@ namespace VocaluxeLib.Menu.SongMenu get { return _actsongstream; } } - protected int _Video - { - get { return _video; } - } + protected int _Video { get; private set; } protected int _ActSong { @@ -427,19 +423,19 @@ namespace VocaluxeLib.Menu.SongMenu if (_actsong != _PreviewSelected) SelectSong(_PreviewSelected); - if (_streams.Count > 0 && _video != -1) + if (_streams.Count > 0 && _Video != -1) { - if (CBase.Video.IsFinished(_video) || CBase.Sound.IsFinished(_actsongstream)) + if (CBase.Video.IsFinished(_Video) || CBase.Sound.IsFinished(_actsongstream)) { - CBase.Video.Close(_video); - _video = -1; + CBase.Video.Close(_Video); + _Video = -1; return; } float time = CBase.Sound.GetPosition(_actsongstream); float vtime = 0f; - CBase.Video.GetFrame(_video, ref _vidtex, time, ref vtime); + CBase.Video.GetFrame(_Video, ref _vidtex, time, ref vtime); if (_VideoFadeTimer.ElapsedMilliseconds <= 3000L) _vidtex.color.A = _VideoFadeTimer.ElapsedMilliseconds / 3000f; else @@ -462,8 +458,8 @@ namespace VocaluxeLib.Menu.SongMenu CBase.Sound.FadeAndStop(stream, 0f, 0.75f); _streams.Clear(); - CBase.Video.Close(_video); - _video = -1; + CBase.Video.Close(_Video); + _Video = -1; CBase.Drawing.RemoveTexture(ref _vidtex); @@ -489,7 +485,7 @@ namespace VocaluxeLib.Menu.SongMenu if (!_Initialized || !_Visible) return; - if (_video != -1) + if (_Video != -1) CBase.Drawing.DrawTexture(_vidtex, new SRectF(0, 0, 1280, 720, 0)); } @@ -608,12 +604,11 @@ namespace VocaluxeLib.Menu.SongMenu { if (CBase.Songs.GetCurrentCategoryIndex() >= 0 && (CBase.Songs.GetNumVisibleSongs() > 0) && (nr >= 0) && ((_actsong != nr) || (_streams.Count == 0))) { - foreach (int stream in _streams) - CBase.Sound.FadeAndStop(stream, 0f, 1f); + _streams.ForEach(soundStream => CBase.Sound.FadeAndStop(soundStream, 0f, 1f)); _streams.Clear(); - CBase.Video.Close(_video); - _video = -1; + CBase.Video.Close(_Video); + _Video = -1; CBase.Drawing.RemoveTexture(ref _vidtex); @@ -622,27 +617,27 @@ namespace VocaluxeLib.Menu.SongMenu _actsong = 0; - int _stream = CBase.Sound.Load(Path.Combine(CBase.Songs.GetVisibleSong(_actsong).Folder, CBase.Songs.GetVisibleSong(_actsong).MP3FileName), true); - CBase.Sound.SetStreamVolumeMax(_stream, _MaxVolume); - CBase.Sound.SetStreamVolume(_stream, 0f); + int stream = CBase.Sound.Load(Path.Combine(CBase.Songs.GetVisibleSong(_actsong).Folder, CBase.Songs.GetVisibleSong(_actsong).MP3FileName), true); + CBase.Sound.SetStreamVolumeMax(stream, _MaxVolume); + CBase.Sound.SetStreamVolume(stream, 0f); float startposition = CBase.Songs.GetVisibleSong(_actsong).PreviewStart; if (startposition == 0f) - startposition = CBase.Sound.GetLength(_stream) / 4f; + startposition = CBase.Sound.GetLength(stream) / 4f; - CBase.Sound.SetPosition(_stream, startposition); - CBase.Sound.Play(_stream); - CBase.Sound.Fade(_stream, 100f, 3f); - _streams.Add(_stream); - _actsongstream = _stream; + CBase.Sound.SetPosition(stream, startposition); + CBase.Sound.Play(stream); + CBase.Sound.Fade(stream, 100f, 3f); + _streams.Add(stream); + _actsongstream = stream; if (CBase.Songs.GetVisibleSong(_actsong).VideoFileName.Length > 0 && CBase.Config.GetVideoPreview() == EOffOn.TR_CONFIG_ON) { - _video = CBase.Video.Load(Path.Combine(CBase.Songs.GetVisibleSong(_actsong).Folder, CBase.Songs.GetVisibleSong(_actsong).VideoFileName)); - if (_video == -1) + _Video = CBase.Video.Load(Path.Combine(CBase.Songs.GetVisibleSong(_actsong).Folder, CBase.Songs.GetVisibleSong(_actsong).VideoFileName)); + if (_Video == -1) return; - CBase.Video.Skip(_video, startposition, CBase.Songs.GetVisibleSong(_actsong).VideoGap); + CBase.Video.Skip(_Video, startposition, CBase.Songs.GetVisibleSong(_actsong).VideoGap); _VideoFadeTimer.Stop(); _VideoFadeTimer.Reset(); _VideoFadeTimer.Start(); @@ -656,8 +651,8 @@ namespace VocaluxeLib.Menu.SongMenu CBase.Sound.FadeAndStop(stream, 0f, 0.75f); _streams.Clear(); - CBase.Video.Close(_video); - _video = -1; + CBase.Video.Close(_Video); + _Video = -1; CBase.Drawing.RemoveTexture(ref _vidtex);