From 78133d42e4bb39476f6e817bb52f99ab8a7b05bb Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Thu, 23 Feb 2012 18:20:44 +0100 Subject: [PATCH 1/4] =?UTF-8?q?update=20of=20french=20translation=20(by=20?= =?UTF-8?q?Fr=C3=A9d=C3=A9ric)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Output/Languages/French.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Output/Languages/French.xml b/Output/Languages/French.xml index 0e877864..2c2f7944 100644 --- a/Output/Languages/French.xml +++ b/Output/Languages/French.xml @@ -85,9 +85,9 @@ Normal Développé - TODO: Own Music and Background Music - TODO: No own Music - TODO: Only own Music + Musique personnelle et Musique de fond + Pas de Musique personnelle + Seulement la Musique personnelle Chargement @@ -163,9 +163,9 @@ Test du Retard Options du Son - TODO: Background Music - TODO: Background Music Volume - TODO: Background Music Source + Musique de fond + Volume de la Musique de fond + Source de la Musique de fond Options du Thème Thème From 2015613b2d6f9680a72edfa0c8859f76fc7acb58 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Thu, 23 Feb 2012 18:22:14 +0100 Subject: [PATCH 2/4] deactivated invalid songmenus --- Vocaluxe/Base/CConfig.cs | 6 +++--- Vocaluxe/Menu/SongMenu/CSongMenu.cs | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Vocaluxe/Base/CConfig.cs b/Vocaluxe/Base/CConfig.cs index 45ec4a5e..6f172561 100644 --- a/Vocaluxe/Base/CConfig.cs +++ b/Vocaluxe/Base/CConfig.cs @@ -87,10 +87,10 @@ namespace Vocaluxe.Base public enum ESongMenu { - TR_CONFIG_LIST, //a simple list - TR_CONFIG_DREIDEL, //as in ultrastar deluxe + //TR_CONFIG_LIST, //a simple list + //TR_CONFIG_DREIDEL, //as in ultrastar deluxe TR_CONFIG_TILE_BOARD, //chessboard like - TR_CONFIG_BOOK //for playlists + //TR_CONFIG_BOOK //for playlists } public enum ESongSorting diff --git a/Vocaluxe/Menu/SongMenu/CSongMenu.cs b/Vocaluxe/Menu/SongMenu/CSongMenu.cs index 3ab202a5..24dd94d1 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenu.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenu.cs @@ -166,21 +166,21 @@ namespace Vocaluxe.Menu.SongMenu switch (CConfig.SongMenu) { - case ESongMenu.TR_CONFIG_LIST: - _SongMenu = new CSongMenuList(); - break; + //case ESongMenu.TR_CONFIG_LIST: + // _SongMenu = new CSongMenuList(); + // break; - case ESongMenu.TR_CONFIG_DREIDEL: - _SongMenu = new CSongMenuDreidel(); - break; + //case ESongMenu.TR_CONFIG_DREIDEL: + // _SongMenu = new CSongMenuDreidel(); + // break; case ESongMenu.TR_CONFIG_TILE_BOARD: _SongMenu = new CSongMenuTileBoard(); break; - case ESongMenu.TR_CONFIG_BOOK: - _SongMenu = new CSongMenuBook(); - break; + //case ESongMenu.TR_CONFIG_BOOK: + // _SongMenu = new CSongMenuBook(); + // break; } _Type = CConfig.SongMenu; From 351aa6e799480c1ffb59e61901f9c46f56ef58d6 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Thu, 23 Feb 2012 19:46:37 +0100 Subject: [PATCH 3/4] fixed next bg music loading, FFmpeg does not always report properly stream lengths --- Vocaluxe/Base/CBackgroundMusic.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Vocaluxe/Base/CBackgroundMusic.cs b/Vocaluxe/Base/CBackgroundMusic.cs index 77163853..c5a9e6ff 100644 --- a/Vocaluxe/Base/CBackgroundMusic.cs +++ b/Vocaluxe/Base/CBackgroundMusic.cs @@ -20,6 +20,7 @@ namespace Vocaluxe.Base private static bool _OwnMusicAdded; private static bool _BackgroundMusicAdded; + private static bool _Playing; public static void Init() { @@ -30,6 +31,8 @@ namespace Vocaluxe.Base if(CConfig.BackgroundMusicSource != EBackgroundMusicSource.TR_CONFIG_ONLY_OWN_MUSIC) AddBackgroundMusic(); + + _Playing = false; } public static void Play() @@ -42,6 +45,7 @@ namespace Vocaluxe.Base { CSound.Fade(_CurrentMusicStream, CConfig.BackgroundMusicVolume, CSettings.BackgroundMusicFadeTime); CSound.Play(_CurrentMusicStream); + _Playing = true; } else Next(); @@ -54,11 +58,13 @@ namespace Vocaluxe.Base CSound.FadeAndStop(_CurrentMusicStream, 0f, CSettings.BackgroundMusicFadeTime); _CurrentMusicFilePath = String.Empty; + _Playing = false; } public static void Pause() { CSound.FadeAndPause(_CurrentMusicStream, 0f, CSettings.BackgroundMusicFadeTime); + _Playing = false; } public static void Update() @@ -66,8 +72,8 @@ namespace Vocaluxe.Base if (_AllFileNames.Count > 0 && _CurrentMusicStream != -1) { float timeToPlay = CSound.GetLength(_CurrentMusicStream) - CSound.GetPosition(_CurrentMusicStream); - - if (timeToPlay <= CSettings.BackgroundMusicFadeTime) + bool finished = CSound.IsFinished(_CurrentMusicStream); + if (_Playing && (timeToPlay <= CSettings.BackgroundMusicFadeTime || finished)) Next(); } } From 0e73a77c0b3f0be0831cf597b150ed0e7460dcaa Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Thu, 23 Feb 2012 20:19:19 +0100 Subject: [PATCH 4/4] do not play bg music files twice until all files are played --- Vocaluxe/Base/CBackgroundMusic.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Vocaluxe/Base/CBackgroundMusic.cs b/Vocaluxe/Base/CBackgroundMusic.cs index c5a9e6ff..403a64f9 100644 --- a/Vocaluxe/Base/CBackgroundMusic.cs +++ b/Vocaluxe/Base/CBackgroundMusic.cs @@ -16,6 +16,7 @@ namespace Vocaluxe.Base private static string _CurrentMusicFilePath = String.Empty; private static List _AllFileNames = new List(); + private static List _NotPlayedFileNames = new List(); private static List _BGMusicFileNames = new List(); private static bool _OwnMusicAdded; @@ -84,7 +85,12 @@ namespace Vocaluxe.Base { Stop(); - _CurrentMusicFilePath = _AllFileNames[CGame.Rand.Next(_AllFileNames.Count)]; + if (_NotPlayedFileNames.Count == 0) + _NotPlayedFileNames.AddRange(_AllFileNames); + + _CurrentMusicFilePath = _NotPlayedFileNames[CGame.Rand.Next(_NotPlayedFileNames.Count)]; + _NotPlayedFileNames.Remove(_CurrentMusicFilePath); + _CurrentMusicStream = CSound.Load(_CurrentMusicFilePath); CSound.SetStreamVolume(_CurrentMusicStream, 0f); Play(); @@ -105,6 +111,7 @@ namespace Vocaluxe.Base foreach (CSong song in CSongs.AllSongs) { _AllFileNames.Add(song.GetMP3()); + _NotPlayedFileNames.Add(song.GetMP3()); } } _OwnMusicAdded = true; @@ -113,9 +120,13 @@ namespace Vocaluxe.Base public static void RemoveOwnMusic() { _AllFileNames.Clear(); + _NotPlayedFileNames.Clear(); if (_BackgroundMusicAdded) + { _AllFileNames.AddRange(_BGMusicFileNames); + _NotPlayedFileNames.AddRange(_BGMusicFileNames); + } if (IsPlaying() && !IsBackgroundFile(_CurrentMusicFilePath) || _AllFileNames.Count == 0) Next(); @@ -128,6 +139,7 @@ namespace Vocaluxe.Base if (!_BackgroundMusicAdded) { _AllFileNames.AddRange(_BGMusicFileNames); + _NotPlayedFileNames.AddRange(_BGMusicFileNames); _BackgroundMusicAdded = true; } }