Audio Mode for Instrumental & Karaoke (#749)

* Add AudioMode

* Update Theme System Version

* Update Theme System Version

* Version 11

* Version 8

* Update Theme System Version

* Add AudioMode

* Update Theme System Version

* Add AudioMode

* Add AudioMode

* Add AudioMode

* Add AudioMode

* Add AudioMode

* No effect for Instrumental

* Instrumental Check

* Add HasInstrumental Check

---------

Co-authored-by: Florian Ostertag <flokuep@users.noreply.github.com>
This commit is contained in:
Edi316andFlorian Ostertag authored and GitHub committed 2025-01-09 06:10:07 +01:00
1 parent cccca5ab83
commit 18d6dba40e
14 files changed
+166 -28

No files matched your search

+1 -1
View File
@@ -29,7 +29,7 @@ namespace Vocaluxe.Base.ThemeSystem
abstract class CTheme
{
// Version number for theme files. Increment it, if you've changed something on the theme files!
private const int _ThemeSystemVersion = 7;
private const int _ThemeSystemVersion = 8;
protected STheme _Data;
public String Name
+4
View File
@@ -240,6 +240,10 @@ namespace Vocaluxe.Screens
if (points == null)
return;
// No points in Karaoke Mode
if (CScreenSong.GetAudioMode() == EAudioMode.TR_AUDIOMODE_KARAOKE)
return;
for (int round = 0; round < points.NumRounds; round++)
{
SPlayer[] players = points.GetPlayer(round, CGame.NumPlayers);
+19 -7
View File
@@ -169,7 +169,9 @@ namespace Vocaluxe.Screens
{
string rating;
if (points >= 9800)
if (CScreenSong.GetAudioMode() == EAudioMode.TR_AUDIOMODE_KARAOKE)
rating = "TR_RATING_KARAOKE";
else if (points >= 9800)
rating = "TR_RATING_VOCAL_HERO";
else if (points >= 8400)
rating = "TR_RATING_SUPERSTAR";
@@ -257,6 +259,12 @@ namespace Vocaluxe.Screens
private void _PlayApplauseSound(int maxPoints)
{
// Play no applause sound based on Karaoke Mode
if (CScreenSong.GetAudioMode() == EAudioMode.TR_AUDIOMODE_KARAOKE)
{
return;
}
// Play the appropriate applause sound based on maxPoints
if (maxPoints >= 8000)
{
@@ -356,19 +364,23 @@ namespace Vocaluxe.Screens
private void _SetVisibility()
{
bool isKaraokeMode = CScreenSong.GetAudioMode() == EAudioMode.TR_AUDIOMODE_KARAOKE;
for (int numplayer = 0; numplayer < CSettings.MaxNumPlayer; numplayer++)
{
for (int player = 0; player < CSettings.MaxNumPlayer; player++)
{
if (player <= numplayer)
{
_Texts[_TextNames[player, numplayer]].Visible = numplayer + 1 == CGame.NumPlayers;
_Texts[_TextScores[player, numplayer]].Visible = numplayer + 1 == CGame.NumPlayers;
_Texts[_TextRatings[player, numplayer]].Visible = numplayer + 1 == CGame.NumPlayers;
_Texts[_TextDifficulty[player, numplayer]].Visible = numplayer + 1 == CGame.NumPlayers;
_ProgressBars[_ProgressBarPoints[player, numplayer]].Visible = numplayer + 1 == CGame.NumPlayers;
bool isVisible = numplayer + 1 == CGame.NumPlayers;
_Texts[_TextNames[player, numplayer]].Visible = isVisible;
_Texts[_TextScores[player, numplayer]].Visible = isVisible && !isKaraokeMode;
_Texts[_TextRatings[player, numplayer]].Visible = isVisible;
_Texts[_TextDifficulty[player, numplayer]].Visible = isVisible;
_ProgressBars[_ProgressBarPoints[player, numplayer]].Visible = isVisible && !isKaraokeMode;
_ProgressBars[_ProgressBarPoints[player, numplayer]].Reset(true);
_Statics[_StaticAvatar[player, numplayer]].Visible = numplayer + 1 == CGame.NumPlayers;
_Statics[_StaticAvatar[player, numplayer]].Visible = isVisible;
_Statics[_StaticAvatar[player, numplayer]].Texture = null;
}
+25 -4
View File
@@ -1159,7 +1159,15 @@ namespace Vocaluxe.Screens
_Texts[_TextSongName].Text = songname;
_Texts[_TextPauseSongName].Text = songname;
_CurrentStream = CSound.Load(song.GetMP3(), false, true, CConfig.Config.Sound.KaraokeEffect == EOffOn.TR_CONFIG_ON ? EAudioEffect.Karaoke : EAudioEffect.None);
if (CScreenSong.GetAudioMode() == EAudioMode.TR_AUDIOMODE_INSTRUMENTAL || CScreenSong.GetAudioMode() == EAudioMode.TR_AUDIOMODE_KARAOKE)
{
_CurrentStream = CSound.Load(song.GetInstrumental(), false, true, EAudioEffect.None);
}
else
{
_CurrentStream = CSound.Load(song.GetMP3(), false, true, CConfig.Config.Sound.KaraokeEffect == EOffOn.TR_CONFIG_ON ? EAudioEffect.Karaoke : EAudioEffect.None);
}
CSound.SetStreamVolume(_CurrentStream, 100);
CSound.SetPosition(_CurrentStream, song.Start);
_CurrentTime = song.Start;
@@ -1399,13 +1407,26 @@ namespace Vocaluxe.Screens
for (int player = 0; player < CGame.NumPlayers; player++)
{
_Texts[_PlayerTextScore[player]].Visible = true;
if (CScreenSong.GetAudioMode() == EAudioMode.TR_AUDIOMODE_KARAOKE)
{
_Texts[_PlayerTextScore[player]].Visible = false;
_Statics[_PlayerStaticScore[player]].Visible = false;
_ProgressBars[_PlayerProgressBarRating[player]].Visible = false;
_SingNotes[_SingBars].Visible = false;
}
else
{
_Texts[_PlayerTextScore[player]].Visible = true;
_Statics[_PlayerStaticScore[player]].Visible = true;
_ProgressBars[_PlayerProgressBarRating[player]].Visible = true;
_SingNotes[_SingBars].Visible = true;
}
_Texts[_PlayerTextName[player]].Visible = (CConfig.Config.Theme.PlayerInfo == EPlayerInfo.TR_CONFIG_PLAYERINFO_BOTH ||
CConfig.Config.Theme.PlayerInfo == EPlayerInfo.TR_CONFIG_PLAYERINFO_NAME);
_Statics[_PlayerStaticScore[player]].Visible = true;
_Statics[_PlayerStaticAvatar[player]].Visible = (CConfig.Config.Theme.PlayerInfo == EPlayerInfo.TR_CONFIG_PLAYERINFO_BOTH ||
CConfig.Config.Theme.PlayerInfo == EPlayerInfo.TR_CONFIG_PLAYERINFO_AVATAR);
_ProgressBars[_PlayerProgressBarRating[player]].Visible = true;
}
_Lyrics[_LyricMain].Alpha = 0f;
+29 -1
View File
@@ -71,6 +71,7 @@ namespace Vocaluxe.Screens
private const string _ButtonOptionsHighscore = "ButtonOptionsHighscore";
private const string _SelectSlideOptionsMode = "SelectSlideOptionsMode";
private const string _SelectSlideOptionsAudioMode = "SelectSlideOptionsAudioMode";
private const string _SelectSlideOptionsPlaylistAdd = "SelectSlideOptionsPlaylistAdd";
private const string _SelectSlideOptionsPlaylistOpen = "SelectSlideOptionsPlaylistOpen";
private const string _SelectSlideOptionsNumMedleySongs = "SelectSlideOptionsNumMedleySongs";
@@ -105,6 +106,13 @@ namespace Vocaluxe.Screens
private System.Timers.Timer _TimerShortInfoText;
private static EAudioMode _AudioMode = EAudioMode.TR_AUDIOMODE_NORMAL;
public static EAudioMode GetAudioMode()
{
return _AudioMode;
}
private static int _StaticSelectedSongID;
private static void setStaticSelectedSongID(int songID)
@@ -168,7 +176,7 @@ namespace Vocaluxe.Screens
_ThemeStatics = new string[] {_StaticSearchBar, _StaticOptionsBG, _StaticShortInfoTop};
_ThemeTexts = tlist.ToArray();
_ThemeButtons = blist.ToArray();
_ThemeSelectSlides = new string[] {_SelectSlideOptionsMode, _SelectSlideOptionsPlaylistAdd, _SelectSlideOptionsPlaylistOpen, _SelectSlideOptionsNumMedleySongs};
_ThemeSelectSlides = new string[] {_SelectSlideOptionsMode, _SelectSlideOptionsAudioMode, _SelectSlideOptionsPlaylistAdd, _SelectSlideOptionsPlaylistOpen, _SelectSlideOptionsNumMedleySongs};
_ThemeSongMenus = new string[] {_SongMenuName};
_ThemePlaylists = new string[] {_PlaylistName};
@@ -1014,6 +1022,8 @@ namespace Vocaluxe.Screens
else
gm = CSongs.VisibleSongs[songNr].IsDuet ? EGameMode.TR_GAMEMODE_DUET : EGameMode.TR_GAMEMODE_NORMAL;
_AudioMode = (EAudioMode)_SelectSlides[_SelectSlideOptionsAudioMode].Selection;
CGame.Reset();
CGame.ClearSongs();
@@ -1331,6 +1341,7 @@ namespace Vocaluxe.Screens
private void _ToggleSongOptions(ESongOptionsView view)
{
_SelectSlides[_SelectSlideOptionsMode].Visible = false;
_SelectSlides[_SelectSlideOptionsAudioMode].Visible = false;
_SelectSlides[_SelectSlideOptionsPlaylistAdd].Visible = false;
_SelectSlides[_SelectSlideOptionsPlaylistOpen].Visible = false;
_SelectSlides[_SelectSlideOptionsNumMedleySongs].Visible = false;
@@ -1397,6 +1408,22 @@ namespace Vocaluxe.Screens
//Set SelectSlide-Selection to last selected game-mode if possible
_SelectSlides[_SelectSlideOptionsMode].SelectedTag = (int)lastMode;
_SelectSlides[_SelectSlideOptionsAudioMode].Clear();
CSong currentSong = CSongs.VisibleSongs[_SongMenu.GetPreviewSongNr()];
if (currentSong.HasInstrumental())
{
_SelectSlides[_SelectSlideOptionsAudioMode].AddValue("TR_AUDIOMODE_NORMAL");
_SelectSlides[_SelectSlideOptionsAudioMode].AddValue("TR_AUDIOMODE_INSTRUMENTAL");
_SelectSlides[_SelectSlideOptionsAudioMode].AddValue("TR_AUDIOMODE_KARAOKE");
_SelectSlides[_SelectSlideOptionsAudioMode].Visible = true;
}
else
{
_SelectSlides[_SelectSlideOptionsAudioMode].Visible = false;
}
_SelectSlides[_SelectSlideOptionsAudioMode].Selection = (int)_AudioMode;
_SelectSlides[_SelectSlideOptionsMode].Visible = true;
_SelectSlides[_SelectSlideOptionsPlaylistAdd].Visible = true;
_Buttons[_ButtonOptionsSing].Visible = true;
@@ -1404,6 +1431,7 @@ namespace Vocaluxe.Screens
_Buttons[_ButtonOptionsHighscore].Visible = true;
_SelectElement(_Buttons[_ButtonOptionsSing]);
_SetSelectSlidePlaylistToCurrentPlaylist();
}
private void _ShowSongOptionsGeneral()