Merge pull request #13 from Vocaluxe/release-0.1

merge Release 0.1 branch changes into develop branch
This commit is contained in:
Alexander Eckart committed 2012-02-23 11:50:13 -08:00
commit 678eda5e91
4 files changed
+39 -21

No files matched your search

+6 -6
View File
@@ -85,9 +85,9 @@
<TR_CONFIG_TIMERLOOK_NORMAL>Normal</TR_CONFIG_TIMERLOOK_NORMAL>
<TR_CONFIG_TIMERLOOK_EXPANDED>Développé</TR_CONFIG_TIMERLOOK_EXPANDED>
<!--Config: Background-Music-Source-->
<TR_CONFIG_OWN_MUSIC>TODO: Own Music and Background Music</TR_CONFIG_OWN_MUSIC>
<TR_CONFIG_NO_OWN_MUSIC>TODO: No own Music</TR_CONFIG_NO_OWN_MUSIC>
<TR_CONFIG_ONLY_OWN_MUSIC>TODO: Only own Music</TR_CONFIG_ONLY_OWN_MUSIC>
<TR_CONFIG_OWN_MUSIC>Musique personnelle et Musique de fond</TR_CONFIG_OWN_MUSIC>
<TR_CONFIG_NO_OWN_MUSIC>Pas de Musique personnelle</TR_CONFIG_NO_OWN_MUSIC>
<TR_CONFIG_ONLY_OWN_MUSIC>Seulement la Musique personnelle</TR_CONFIG_ONLY_OWN_MUSIC>
<!--Screens-->
<!--ScreenLoad-->
<TR_SCREENLOAD_LOADING>Chargement</TR_SCREENLOAD_LOADING>
@@ -163,9 +163,9 @@
<TR_SCREENORECORD_BUTTON_DELAYTEST>Test du Retard</TR_SCREENORECORD_BUTTON_DELAYTEST>
<!--ScreenOptionsSound-->
<TR_SCREENOSOUND_OPTIONS>Options du Son</TR_SCREENOSOUND_OPTIONS>
<TR_SCREENOSOUND_BACKGROUNDMUSIC>TODO: Background Music</TR_SCREENOSOUND_BACKGROUNDMUSIC>
<TR_SCREENOSOUND_BACKGROUNDMUSICVOLUME>TODO: Background Music Volume</TR_SCREENOSOUND_BACKGROUNDMUSICVOLUME>
<TR_SCREENOSOUND_BACKGROUNDMUSICSOURCE>TODO: Background Music Source</TR_SCREENOSOUND_BACKGROUNDMUSICSOURCE>
<TR_SCREENOSOUND_BACKGROUNDMUSIC>Musique de fond</TR_SCREENOSOUND_BACKGROUNDMUSIC>
<TR_SCREENOSOUND_BACKGROUNDMUSICVOLUME>Volume de la Musique de fond</TR_SCREENOSOUND_BACKGROUNDMUSICVOLUME>
<TR_SCREENOSOUND_BACKGROUNDMUSICSOURCE>Source de la Musique de fond</TR_SCREENOSOUND_BACKGROUNDMUSICSOURCE>
<!--ScreenOptionsTheme-->
<TR_SCREENOTHEME_OPTIONS>Options du Thème</TR_SCREENOTHEME_OPTIONS>
<TR_SCREENOTHEME_THEME>Thème</TR_SCREENOTHEME_THEME>
+21 -3
View File
@@ -16,10 +16,12 @@ namespace Vocaluxe.Base
private static string _CurrentMusicFilePath = String.Empty;
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 bool _OwnMusicAdded;
private static bool _BackgroundMusicAdded;
private static bool _Playing;
public static void Init()
{
@@ -30,6 +32,8 @@ namespace Vocaluxe.Base
if(CConfig.BackgroundMusicSource != EBackgroundMusicSource.TR_CONFIG_ONLY_OWN_MUSIC)
AddBackgroundMusic();
_Playing = false;
}
public static void Play()
@@ -42,6 +46,7 @@ namespace Vocaluxe.Base
{
CSound.Fade(_CurrentMusicStream, CConfig.BackgroundMusicVolume, CSettings.BackgroundMusicFadeTime);
CSound.Play(_CurrentMusicStream);
_Playing = true;
}
else
Next();
@@ -54,11 +59,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 +73,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();
}
}
@@ -78,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();
@@ -99,6 +111,7 @@ namespace Vocaluxe.Base
foreach (CSong song in CSongs.AllSongs)
{
_AllFileNames.Add(song.GetMP3());
_NotPlayedFileNames.Add(song.GetMP3());
}
}
_OwnMusicAdded = true;
@@ -107,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();
@@ -122,6 +139,7 @@ namespace Vocaluxe.Base
if (!_BackgroundMusicAdded)
{
_AllFileNames.AddRange(_BGMusicFileNames);
_NotPlayedFileNames.AddRange(_BGMusicFileNames);
_BackgroundMusicAdded = true;
}
}
+3 -3
View File
@@ -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
+9 -9
View File
@@ -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;