From dffdd5c3bf9cfa4056dd49b5dfe937efe49d5364 Mon Sep 17 00:00:00 2001 From: Stefan Date: Mon, 18 Oct 2021 00:12:34 +0200 Subject: [PATCH 01/11] Adding statics and preparing team equalizers Updated class for the new changes in the theme file for adding team player name static background and team equalizers. Equalizers not ready! The part in the UpdateGame() has still to be added to see a working equalizer. --- .../CPartyScreenTicTacToeMain.cs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/PartyModes/PartyModeTicTacToe/CPartyScreenTicTacToeMain.cs b/PartyModes/PartyModeTicTacToe/CPartyScreenTicTacToeMain.cs index a0ec0798..2466b422 100644 --- a/PartyModes/PartyModeTicTacToe/CPartyScreenTicTacToeMain.cs +++ b/PartyModes/PartyModeTicTacToe/CPartyScreenTicTacToeMain.cs @@ -38,7 +38,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe // Version number for theme files. Increment it, if you've changed something on the theme files! protected override int _ScreenVersion { - get { return 1; } + get { return 2; } } private const string _TextPopupReallyExit = "TextPopupReallyExit"; @@ -64,6 +64,11 @@ namespace VocaluxeLib.PartyModes.TicTacToe private const string _StaticPopupBG = "StaticPopupBG"; private const string _StaticAvatarT1 = "StaticAvatarT1"; private const string _StaticAvatarT2 = "StaticAvatarT2"; + private const string _StaticTeam1 = "StaticTeam1"; + private const string _StaticTeam2 = "StaticTeam2"; + + private readonly string[] _EqualizerTeam = new string[] + {"EqualizerTeam1", "EqualizerTeam2"}; private bool _ExitPopupVisible; @@ -89,7 +94,11 @@ namespace VocaluxeLib.PartyModes.TicTacToe _ButtonNextRound, _ButtonBack, _ButtonExit, _ButtonPopupYes, _ButtonPopupNo, _ButtonField, _ButtonJokerRandomT1, _ButtonJokerRandomT2, _ButtonJokerRetryT1, _ButtonJokerRetryT2 }; - _ThemeStatics = new string[] {_StaticPopupBG, _StaticAvatarT1, _StaticAvatarT2}; + _ThemeStatics = new string[] {_StaticPopupBG, _StaticAvatarT1, _StaticAvatarT2, _StaticTeam1, _StaticTeam2}; + + var texts = new List(); + texts.AddRange(_EqualizerTeam); + _ThemeEqualizers = texts.ToArray(); } public override void LoadTheme(string xmlPath) @@ -299,6 +308,8 @@ namespace VocaluxeLib.PartyModes.TicTacToe _Texts[_TextNextPlayerNameT2].Visible = false; _Statics[_StaticAvatarT1].Visible = false; _Statics[_StaticAvatarT2].Visible = false; + _Statics[_StaticTeam1].Visible = false; + _Statics[_StaticTeam2].Visible = false; _Buttons[_ButtonJokerRandomT1].Visible = false; _Buttons[_ButtonJokerRandomT2].Visible = false; _Buttons[_ButtonJokerRetryT1].Visible = false; @@ -504,6 +515,8 @@ namespace VocaluxeLib.PartyModes.TicTacToe _Statics[_StaticAvatarT2].Visible = true; _Statics[_StaticAvatarT1].Texture = CBase.Profiles.GetAvatar(_PartyMode.GameData.ProfileIDsTeam1[_PartyMode.GameData.Rounds[_PartyMode.GameData.FieldNr].SingerTeam1]); _Statics[_StaticAvatarT2].Texture = CBase.Profiles.GetAvatar(_PartyMode.GameData.ProfileIDsTeam2[_PartyMode.GameData.Rounds[_PartyMode.GameData.FieldNr].SingerTeam2]); + _Statics[_StaticTeam1].Visible = true; + _Statics[_StaticTeam2].Visible = true; } private void _UseJoker(int teamNr, int jokerNum) @@ -641,4 +654,4 @@ namespace VocaluxeLib.PartyModes.TicTacToe return 0; } } -} \ No newline at end of file +} From 98622eddbd10e1eea1ba294ba569bf34063a5ad2 Mon Sep 17 00:00:00 2001 From: Stefan Date: Mon, 18 Oct 2021 00:14:38 +0200 Subject: [PATCH 02/11] Adding statics and preparing team equalizers Updated theme file for adding team player name static background and team equalizers. --- .../Screens/PartyScreenTicTacToeMain.xml | 75 +++++++++++++++++-- 1 file changed, 69 insertions(+), 6 deletions(-) diff --git a/Output/PartyModes/TicTacToe/Themes/Default/Screens/PartyScreenTicTacToeMain.xml b/Output/PartyModes/TicTacToe/Themes/Default/Screens/PartyScreenTicTacToeMain.xml index 471a2294..5827c451 100644 --- a/Output/PartyModes/TicTacToe/Themes/Default/Screens/PartyScreenTicTacToeMain.xml +++ b/Output/PartyModes/TicTacToe/Themes/Default/Screens/PartyScreenTicTacToeMain.xml @@ -2,7 +2,7 @@ PartyScreenTicTacToeMain - 1 + 2 @@ -44,7 +44,7 @@ 200 100 100 - -1 + -3 @@ -55,7 +55,29 @@ 200 100 100 - -1 + -3 + + + + PlayerSelBG + + + 5 + 195 + 325 + 110 + -2 + + + + PlayerSelBG + + + 950 + 195 + 325 + 110 + -2 @@ -146,7 +168,7 @@ 120 - 230 + 200 0 35 0 @@ -160,7 +182,7 @@ 1160 - 230 + 200 0 40 0 @@ -490,7 +512,48 @@ - + + + + + 120 + 230 + 205 + 37 + -3 + + 16 + 2 + + TR_CONFIG_OFF + + 0.2 + + + 0.4 + + + + + + 955 + 230 + 205 + 37 + -3 + + 16 + 2 + + TR_CONFIG_OFF + + 0.2 + + + 0.4 + + + From 392bfaceae86d07e566b460fca7ad43fb3389665 Mon Sep 17 00:00:00 2001 From: Stefan Date: Mon, 18 Oct 2021 21:47:00 +0200 Subject: [PATCH 03/11] Final implementation of the team mic equalizers --- .../CPartyScreenTicTacToeMain.cs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/PartyModes/PartyModeTicTacToe/CPartyScreenTicTacToeMain.cs b/PartyModes/PartyModeTicTacToe/CPartyScreenTicTacToeMain.cs index 2466b422..a2722ed4 100644 --- a/PartyModes/PartyModeTicTacToe/CPartyScreenTicTacToeMain.cs +++ b/PartyModes/PartyModeTicTacToe/CPartyScreenTicTacToeMain.cs @@ -274,9 +274,16 @@ namespace VocaluxeLib.PartyModes.TicTacToe return true; } + public override void OnClose() + { + base.OnClose(); + CBase.Record.Stop(); + } + public override void OnShow() { base.OnShow(); + CBase.Record.Start(); if (_PartyMode.GameData.CurrentRoundNr == 1) { @@ -310,6 +317,8 @@ namespace VocaluxeLib.PartyModes.TicTacToe _Statics[_StaticAvatarT2].Visible = false; _Statics[_StaticTeam1].Visible = false; _Statics[_StaticTeam2].Visible = false; + _Equalizers[_EqualizerTeam[0]].Visible = false; + _Equalizers[_EqualizerTeam[1]].Visible = false; _Buttons[_ButtonJokerRandomT1].Visible = false; _Buttons[_ButtonJokerRandomT2].Visible = false; _Buttons[_ButtonJokerRetryT1].Visible = false; @@ -342,6 +351,15 @@ namespace VocaluxeLib.PartyModes.TicTacToe public override bool UpdateGame() { + if (!_Equalizers[_EqualizerTeam[0]].Visible) + return true; + + for (int i = 0; i < 2; i++) + { + CBase.Record.AnalyzeBuffer(i); + _Equalizers["EqualizerTeam" + (i+1)].Update(CBase.Record.ToneWeigth(i), CBase.Record.GetMaxVolume(i)); + } + return true; } @@ -517,6 +535,8 @@ namespace VocaluxeLib.PartyModes.TicTacToe _Statics[_StaticAvatarT2].Texture = CBase.Profiles.GetAvatar(_PartyMode.GameData.ProfileIDsTeam2[_PartyMode.GameData.Rounds[_PartyMode.GameData.FieldNr].SingerTeam2]); _Statics[_StaticTeam1].Visible = true; _Statics[_StaticTeam2].Visible = true; + _Equalizers[_EqualizerTeam[0]].Visible = true; + _Equalizers[_EqualizerTeam[1]].Visible = true; } private void _UseJoker(int teamNr, int jokerNum) From 819ce3bb57fe5a720bb13b2c30341b241143a809 Mon Sep 17 00:00:00 2001 From: Stefan Date: Mon, 18 Oct 2021 21:50:03 +0200 Subject: [PATCH 04/11] Implementing more CRecord stuff Needed for equalizers in the VocaluxeLib namespace. --- VocaluxeLib/IBasic.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/VocaluxeLib/IBasic.cs b/VocaluxeLib/IBasic.cs index ad09e6a2..de8162a8 100644 --- a/VocaluxeLib/IBasic.cs +++ b/VocaluxeLib/IBasic.cs @@ -208,6 +208,11 @@ namespace VocaluxeLib public interface IRecording { int GetToneAbs(int player); + void AnalyzeBuffer(int player); + float GetMaxVolume(int player); + float[] ToneWeigth(int player); + bool Start(); + bool Stop(); } public interface IProfiles From 8ea88d7a49b9926762daeb2e89124331fc304a16 Mon Sep 17 00:00:00 2001 From: Stefan Date: Mon, 18 Oct 2021 21:52:40 +0200 Subject: [PATCH 05/11] Implementing more CRecord stuff Needed for equalizers in the VocaluxeLib namespace. --- Vocaluxe/Base/CMain.cs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Vocaluxe/Base/CMain.cs b/Vocaluxe/Base/CMain.cs index 89824b8b..9ab1d835 100644 --- a/Vocaluxe/Base/CMain.cs +++ b/Vocaluxe/Base/CMain.cs @@ -686,6 +686,31 @@ namespace Vocaluxe.Base { return CRecord.GetToneAbs(player); } + + public void AnalyzeBuffer(int player) + { + CRecord.AnalyzeBuffer(player); + } + + public bool Start() + { + return CRecord.Start(); + } + + public bool Stop() + { + return CRecord.Stop(); + } + + public float GetMaxVolume(int player) + { + return CRecord.GetMaxVolume(player); + } + + public float[] ToneWeigth(int player) + { + return CRecord.ToneWeigth(player); + } } class CBsongs : ISongs From d1a602deb1e3c3cd0e8826922174028f9873253f Mon Sep 17 00:00:00 2001 From: Stefan Date: Mon, 18 Oct 2021 22:00:30 +0200 Subject: [PATCH 06/11] Updated position of equalizers --- .../Themes/Default/Screens/PartyScreenTicTacToeMain.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Output/PartyModes/TicTacToe/Themes/Default/Screens/PartyScreenTicTacToeMain.xml b/Output/PartyModes/TicTacToe/Themes/Default/Screens/PartyScreenTicTacToeMain.xml index 5827c451..983a6b34 100644 --- a/Output/PartyModes/TicTacToe/Themes/Default/Screens/PartyScreenTicTacToeMain.xml +++ b/Output/PartyModes/TicTacToe/Themes/Default/Screens/PartyScreenTicTacToeMain.xml @@ -517,7 +517,7 @@ 120 - 230 + 250 205 37 -3 @@ -537,7 +537,7 @@ 955 - 230 + 250 205 37 -3 From 524c8e94ad0a0fbdb7696aa65f4c8de26ca83ccc Mon Sep 17 00:00:00 2001 From: Stefan Date: Mon, 18 Oct 2021 23:28:56 +0200 Subject: [PATCH 07/11] Added two text elements Added TextSelPlayersTitle and TextHelpBar. --- .../Screens/PartyScreenTicTacToeNames.xml | 46 +++++++++++++++---- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/Output/PartyModes/TicTacToe/Themes/Default/Screens/PartyScreenTicTacToeNames.xml b/Output/PartyModes/TicTacToe/Themes/Default/Screens/PartyScreenTicTacToeNames.xml index 4c798de0..46ba9c19 100644 --- a/Output/PartyModes/TicTacToe/Themes/Default/Screens/PartyScreenTicTacToeNames.xml +++ b/Output/PartyModes/TicTacToe/Themes/Default/Screens/PartyScreenTicTacToeNames.xml @@ -41,6 +41,34 @@ Outline TR_SCREENNAMES_TITLE + + 640 + 155 + 0 + 20 + 0 + + + Center + Center + + Outline + TR_SCREENNAMES_SELPLAYERSTITLE + + + 640 + 703 + 0 + 16 + 1200 + + + Center + Center + + Outline + TR_SCREENNAMES_HELPMESSAGE +