Merge pull request #13 from Vocaluxe/release-0.1
merge Release 0.1 branch changes into develop branch
This commit is contained in:
commit
678eda5e91
4 files changed
+39
-21
No files matched your search
@@ -85,9 +85,9 @@
|
|||||||
<TR_CONFIG_TIMERLOOK_NORMAL>Normal</TR_CONFIG_TIMERLOOK_NORMAL>
|
<TR_CONFIG_TIMERLOOK_NORMAL>Normal</TR_CONFIG_TIMERLOOK_NORMAL>
|
||||||
<TR_CONFIG_TIMERLOOK_EXPANDED>Développé</TR_CONFIG_TIMERLOOK_EXPANDED>
|
<TR_CONFIG_TIMERLOOK_EXPANDED>Développé</TR_CONFIG_TIMERLOOK_EXPANDED>
|
||||||
<!--Config: Background-Music-Source-->
|
<!--Config: Background-Music-Source-->
|
||||||
<TR_CONFIG_OWN_MUSIC>TODO: Own Music and Background Music</TR_CONFIG_OWN_MUSIC>
|
<TR_CONFIG_OWN_MUSIC>Musique personnelle et Musique de fond</TR_CONFIG_OWN_MUSIC>
|
||||||
<TR_CONFIG_NO_OWN_MUSIC>TODO: No own Music</TR_CONFIG_NO_OWN_MUSIC>
|
<TR_CONFIG_NO_OWN_MUSIC>Pas de Musique personnelle</TR_CONFIG_NO_OWN_MUSIC>
|
||||||
<TR_CONFIG_ONLY_OWN_MUSIC>TODO: Only own Music</TR_CONFIG_ONLY_OWN_MUSIC>
|
<TR_CONFIG_ONLY_OWN_MUSIC>Seulement la Musique personnelle</TR_CONFIG_ONLY_OWN_MUSIC>
|
||||||
<!--Screens-->
|
<!--Screens-->
|
||||||
<!--ScreenLoad-->
|
<!--ScreenLoad-->
|
||||||
<TR_SCREENLOAD_LOADING>Chargement</TR_SCREENLOAD_LOADING>
|
<TR_SCREENLOAD_LOADING>Chargement</TR_SCREENLOAD_LOADING>
|
||||||
@@ -163,9 +163,9 @@
|
|||||||
<TR_SCREENORECORD_BUTTON_DELAYTEST>Test du Retard</TR_SCREENORECORD_BUTTON_DELAYTEST>
|
<TR_SCREENORECORD_BUTTON_DELAYTEST>Test du Retard</TR_SCREENORECORD_BUTTON_DELAYTEST>
|
||||||
<!--ScreenOptionsSound-->
|
<!--ScreenOptionsSound-->
|
||||||
<TR_SCREENOSOUND_OPTIONS>Options du Son</TR_SCREENOSOUND_OPTIONS>
|
<TR_SCREENOSOUND_OPTIONS>Options du Son</TR_SCREENOSOUND_OPTIONS>
|
||||||
<TR_SCREENOSOUND_BACKGROUNDMUSIC>TODO: Background Music</TR_SCREENOSOUND_BACKGROUNDMUSIC>
|
<TR_SCREENOSOUND_BACKGROUNDMUSIC>Musique de fond</TR_SCREENOSOUND_BACKGROUNDMUSIC>
|
||||||
<TR_SCREENOSOUND_BACKGROUNDMUSICVOLUME>TODO: Background Music Volume</TR_SCREENOSOUND_BACKGROUNDMUSICVOLUME>
|
<TR_SCREENOSOUND_BACKGROUNDMUSICVOLUME>Volume de la Musique de fond</TR_SCREENOSOUND_BACKGROUNDMUSICVOLUME>
|
||||||
<TR_SCREENOSOUND_BACKGROUNDMUSICSOURCE>TODO: Background Music Source</TR_SCREENOSOUND_BACKGROUNDMUSICSOURCE>
|
<TR_SCREENOSOUND_BACKGROUNDMUSICSOURCE>Source de la Musique de fond</TR_SCREENOSOUND_BACKGROUNDMUSICSOURCE>
|
||||||
<!--ScreenOptionsTheme-->
|
<!--ScreenOptionsTheme-->
|
||||||
<TR_SCREENOTHEME_OPTIONS>Options du Thème</TR_SCREENOTHEME_OPTIONS>
|
<TR_SCREENOTHEME_OPTIONS>Options du Thème</TR_SCREENOTHEME_OPTIONS>
|
||||||
<TR_SCREENOTHEME_THEME>Thème</TR_SCREENOTHEME_THEME>
|
<TR_SCREENOTHEME_THEME>Thème</TR_SCREENOTHEME_THEME>
|
||||||
|
|||||||
@@ -16,10 +16,12 @@ namespace Vocaluxe.Base
|
|||||||
private static string _CurrentMusicFilePath = String.Empty;
|
private static string _CurrentMusicFilePath = String.Empty;
|
||||||
|
|
||||||
private static List<string> _AllFileNames = new List<string>();
|
private static List<string> _AllFileNames = new List<string>();
|
||||||
|
private static List<string> _NotPlayedFileNames = new List<string>();
|
||||||
private static List<string> _BGMusicFileNames = new List<string>();
|
private static List<string> _BGMusicFileNames = new List<string>();
|
||||||
|
|
||||||
private static bool _OwnMusicAdded;
|
private static bool _OwnMusicAdded;
|
||||||
private static bool _BackgroundMusicAdded;
|
private static bool _BackgroundMusicAdded;
|
||||||
|
private static bool _Playing;
|
||||||
|
|
||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
@@ -30,6 +32,8 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
if(CConfig.BackgroundMusicSource != EBackgroundMusicSource.TR_CONFIG_ONLY_OWN_MUSIC)
|
if(CConfig.BackgroundMusicSource != EBackgroundMusicSource.TR_CONFIG_ONLY_OWN_MUSIC)
|
||||||
AddBackgroundMusic();
|
AddBackgroundMusic();
|
||||||
|
|
||||||
|
_Playing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Play()
|
public static void Play()
|
||||||
@@ -42,6 +46,7 @@ namespace Vocaluxe.Base
|
|||||||
{
|
{
|
||||||
CSound.Fade(_CurrentMusicStream, CConfig.BackgroundMusicVolume, CSettings.BackgroundMusicFadeTime);
|
CSound.Fade(_CurrentMusicStream, CConfig.BackgroundMusicVolume, CSettings.BackgroundMusicFadeTime);
|
||||||
CSound.Play(_CurrentMusicStream);
|
CSound.Play(_CurrentMusicStream);
|
||||||
|
_Playing = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Next();
|
Next();
|
||||||
@@ -54,11 +59,13 @@ namespace Vocaluxe.Base
|
|||||||
CSound.FadeAndStop(_CurrentMusicStream, 0f, CSettings.BackgroundMusicFadeTime);
|
CSound.FadeAndStop(_CurrentMusicStream, 0f, CSettings.BackgroundMusicFadeTime);
|
||||||
|
|
||||||
_CurrentMusicFilePath = String.Empty;
|
_CurrentMusicFilePath = String.Empty;
|
||||||
|
_Playing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Pause()
|
public static void Pause()
|
||||||
{
|
{
|
||||||
CSound.FadeAndPause(_CurrentMusicStream, 0f, CSettings.BackgroundMusicFadeTime);
|
CSound.FadeAndPause(_CurrentMusicStream, 0f, CSettings.BackgroundMusicFadeTime);
|
||||||
|
_Playing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Update()
|
public static void Update()
|
||||||
@@ -66,8 +73,8 @@ namespace Vocaluxe.Base
|
|||||||
if (_AllFileNames.Count > 0 && _CurrentMusicStream != -1)
|
if (_AllFileNames.Count > 0 && _CurrentMusicStream != -1)
|
||||||
{
|
{
|
||||||
float timeToPlay = CSound.GetLength(_CurrentMusicStream) - CSound.GetPosition(_CurrentMusicStream);
|
float timeToPlay = CSound.GetLength(_CurrentMusicStream) - CSound.GetPosition(_CurrentMusicStream);
|
||||||
|
bool finished = CSound.IsFinished(_CurrentMusicStream);
|
||||||
if (timeToPlay <= CSettings.BackgroundMusicFadeTime)
|
if (_Playing && (timeToPlay <= CSettings.BackgroundMusicFadeTime || finished))
|
||||||
Next();
|
Next();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -78,7 +85,12 @@ namespace Vocaluxe.Base
|
|||||||
{
|
{
|
||||||
Stop();
|
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);
|
_CurrentMusicStream = CSound.Load(_CurrentMusicFilePath);
|
||||||
CSound.SetStreamVolume(_CurrentMusicStream, 0f);
|
CSound.SetStreamVolume(_CurrentMusicStream, 0f);
|
||||||
Play();
|
Play();
|
||||||
@@ -99,6 +111,7 @@ namespace Vocaluxe.Base
|
|||||||
foreach (CSong song in CSongs.AllSongs)
|
foreach (CSong song in CSongs.AllSongs)
|
||||||
{
|
{
|
||||||
_AllFileNames.Add(song.GetMP3());
|
_AllFileNames.Add(song.GetMP3());
|
||||||
|
_NotPlayedFileNames.Add(song.GetMP3());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_OwnMusicAdded = true;
|
_OwnMusicAdded = true;
|
||||||
@@ -107,9 +120,13 @@ namespace Vocaluxe.Base
|
|||||||
public static void RemoveOwnMusic()
|
public static void RemoveOwnMusic()
|
||||||
{
|
{
|
||||||
_AllFileNames.Clear();
|
_AllFileNames.Clear();
|
||||||
|
_NotPlayedFileNames.Clear();
|
||||||
|
|
||||||
if (_BackgroundMusicAdded)
|
if (_BackgroundMusicAdded)
|
||||||
|
{
|
||||||
_AllFileNames.AddRange(_BGMusicFileNames);
|
_AllFileNames.AddRange(_BGMusicFileNames);
|
||||||
|
_NotPlayedFileNames.AddRange(_BGMusicFileNames);
|
||||||
|
}
|
||||||
|
|
||||||
if (IsPlaying() && !IsBackgroundFile(_CurrentMusicFilePath) || _AllFileNames.Count == 0)
|
if (IsPlaying() && !IsBackgroundFile(_CurrentMusicFilePath) || _AllFileNames.Count == 0)
|
||||||
Next();
|
Next();
|
||||||
@@ -122,6 +139,7 @@ namespace Vocaluxe.Base
|
|||||||
if (!_BackgroundMusicAdded)
|
if (!_BackgroundMusicAdded)
|
||||||
{
|
{
|
||||||
_AllFileNames.AddRange(_BGMusicFileNames);
|
_AllFileNames.AddRange(_BGMusicFileNames);
|
||||||
|
_NotPlayedFileNames.AddRange(_BGMusicFileNames);
|
||||||
_BackgroundMusicAdded = true;
|
_BackgroundMusicAdded = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,10 +87,10 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
public enum ESongMenu
|
public enum ESongMenu
|
||||||
{
|
{
|
||||||
TR_CONFIG_LIST, //a simple list
|
//TR_CONFIG_LIST, //a simple list
|
||||||
TR_CONFIG_DREIDEL, //as in ultrastar deluxe
|
//TR_CONFIG_DREIDEL, //as in ultrastar deluxe
|
||||||
TR_CONFIG_TILE_BOARD, //chessboard like
|
TR_CONFIG_TILE_BOARD, //chessboard like
|
||||||
TR_CONFIG_BOOK //for playlists
|
//TR_CONFIG_BOOK //for playlists
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ESongSorting
|
public enum ESongSorting
|
||||||
|
|||||||
@@ -166,21 +166,21 @@ namespace Vocaluxe.Menu.SongMenu
|
|||||||
|
|
||||||
switch (CConfig.SongMenu)
|
switch (CConfig.SongMenu)
|
||||||
{
|
{
|
||||||
case ESongMenu.TR_CONFIG_LIST:
|
//case ESongMenu.TR_CONFIG_LIST:
|
||||||
_SongMenu = new CSongMenuList();
|
// _SongMenu = new CSongMenuList();
|
||||||
break;
|
// break;
|
||||||
|
|
||||||
case ESongMenu.TR_CONFIG_DREIDEL:
|
//case ESongMenu.TR_CONFIG_DREIDEL:
|
||||||
_SongMenu = new CSongMenuDreidel();
|
// _SongMenu = new CSongMenuDreidel();
|
||||||
break;
|
// break;
|
||||||
|
|
||||||
case ESongMenu.TR_CONFIG_TILE_BOARD:
|
case ESongMenu.TR_CONFIG_TILE_BOARD:
|
||||||
_SongMenu = new CSongMenuTileBoard();
|
_SongMenu = new CSongMenuTileBoard();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ESongMenu.TR_CONFIG_BOOK:
|
//case ESongMenu.TR_CONFIG_BOOK:
|
||||||
_SongMenu = new CSongMenuBook();
|
// _SongMenu = new CSongMenuBook();
|
||||||
break;
|
// break;
|
||||||
}
|
}
|
||||||
|
|
||||||
_Type = CConfig.SongMenu;
|
_Type = CConfig.SongMenu;
|
||||||
|
|||||||
Reference in new issue
Block a user