Merge branch 'develop' of https://github.com/Vocaluxe/Vocaluxe
This commit is contained in:
commit
c3e35932f7
13 files changed
+163
-167
No files matched your search
@@ -29,33 +29,6 @@
|
|||||||
<!-- <Space>: Reflection Space-->
|
<!-- <Space>: Reflection Space-->
|
||||||
<!-- <Height>: Reflection Height-->
|
<!-- <Height>: Reflection Height-->
|
||||||
</StaticMenuBar>
|
</StaticMenuBar>
|
||||||
<Text1>
|
|
||||||
<!--<X>, <Y>: Text position-->
|
|
||||||
<X>58</X>
|
|
||||||
<Y>41</Y>
|
|
||||||
<!--<Z>: Text position-->
|
|
||||||
<Z>0,00</Z>
|
|
||||||
<!--<H>: Text height-->
|
|
||||||
<H>32</H>
|
|
||||||
<!--<MaxW>: Maximum text width (if exists)-->
|
|
||||||
<!--<Color>: Text color from ColorScheme (high priority)-->
|
|
||||||
<!--or <R>, <G>, <B>, <A> (lower priority)-->
|
|
||||||
<Color>Invisible</Color>
|
|
||||||
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
|
|
||||||
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
|
|
||||||
<Color>Invisible</Color>
|
|
||||||
<!--<Align>: Text align: Left, Center, Right-->
|
|
||||||
<Align>Left</Align>
|
|
||||||
<!--<Style>: Text style: Normal, Italic, Bold, BoldItalic-->
|
|
||||||
<Style>Bold</Style>
|
|
||||||
<!--<Font>: Text font name-->
|
|
||||||
<Font>Normal</Font>
|
|
||||||
<!--<Text>: Text or translation tag-->
|
|
||||||
<Text>TR_SCREENMAIN_MENU</Text>
|
|
||||||
<!--<Reflection> If exists:-->
|
|
||||||
<!-- <Space>: Reflection Space-->
|
|
||||||
<!-- <Height>: Reflection Height-->
|
|
||||||
</Text1>
|
|
||||||
<ButtonSing>
|
<ButtonSing>
|
||||||
<!--<Skin>: Texture name-->
|
<!--<Skin>: Texture name-->
|
||||||
<Skin>Button</Skin>
|
<Skin>Button</Skin>
|
||||||
|
|||||||
@@ -142,8 +142,8 @@
|
|||||||
<!--<Reflection> If exists:-->
|
<!--<Reflection> If exists:-->
|
||||||
<!-- <Space>: Reflection Space-->
|
<!-- <Space>: Reflection Space-->
|
||||||
<!-- <Height>: Reflection Height-->
|
<!-- <Height>: Reflection Height-->
|
||||||
</Text4>
|
</Text4>
|
||||||
<ButtonExit>
|
<ButtonExit>
|
||||||
<!--<Skin>: Texture name-->
|
<!--<Skin>: Texture name-->
|
||||||
<Skin>Button</Skin>
|
<Skin>Button</Skin>
|
||||||
<!--<SkinSelected>: Texture name for selected button-->
|
<!--<SkinSelected>: Texture name for selected button-->
|
||||||
@@ -198,8 +198,7 @@
|
|||||||
<Height>26</Height>
|
<Height>26</Height>
|
||||||
</SReflection>
|
</SReflection>
|
||||||
</ButtonExit>
|
</ButtonExit>
|
||||||
|
<SelectSlideBackgroundMusic>
|
||||||
<SelectSlideBackgroundMusic>
|
|
||||||
<!--<Skin>: Texture name-->
|
<!--<Skin>: Texture name-->
|
||||||
<Skin>Invisible</Skin>
|
<Skin>Invisible</Skin>
|
||||||
<!--<SkinArrowLeft>: Texture name of left arrow-->
|
<!--<SkinArrowLeft>: Texture name of left arrow-->
|
||||||
@@ -264,7 +263,7 @@
|
|||||||
<!--<NumVisible>: Number of visible elements in the slide-->
|
<!--<NumVisible>: Number of visible elements in the slide-->
|
||||||
<NumVisible>3</NumVisible>
|
<NumVisible>3</NumVisible>
|
||||||
</SelectSlideBackgroundMusic>
|
</SelectSlideBackgroundMusic>
|
||||||
<SelectSlideBackgroundMusicVolume>
|
<SelectSlideBackgroundMusicVolume>
|
||||||
<!--<Skin>: Texture name-->
|
<!--<Skin>: Texture name-->
|
||||||
<Skin>Invisible</Skin>
|
<Skin>Invisible</Skin>
|
||||||
<!--<SkinArrowLeft>: Texture name of left arrow-->
|
<!--<SkinArrowLeft>: Texture name of left arrow-->
|
||||||
@@ -329,7 +328,7 @@
|
|||||||
<!--<NumVisible>: Number of visible elements in the slide-->
|
<!--<NumVisible>: Number of visible elements in the slide-->
|
||||||
<NumVisible>3</NumVisible>
|
<NumVisible>3</NumVisible>
|
||||||
</SelectSlideBackgroundMusicVolume>
|
</SelectSlideBackgroundMusicVolume>
|
||||||
<SelectSlideBackgroundMusicSource>
|
<SelectSlideBackgroundMusicSource>
|
||||||
<!--<Skin>: Texture name-->
|
<!--<Skin>: Texture name-->
|
||||||
<Skin>Invisible</Skin>
|
<Skin>Invisible</Skin>
|
||||||
<!--<SkinArrowLeft>: Texture name of left arrow-->
|
<!--<SkinArrowLeft>: Texture name of left arrow-->
|
||||||
@@ -386,13 +385,13 @@
|
|||||||
<!--<TextH>: Text height-->
|
<!--<TextH>: Text height-->
|
||||||
<TextH>32,00</TextH>
|
<TextH>32,00</TextH>
|
||||||
<!--<TextMaxW>: Maximum text width (if exists)-->
|
<!--<TextMaxW>: Maximum text width (if exists)-->
|
||||||
<TextMaxW>205,33</TextMaxW>
|
<TextMaxW>500</TextMaxW>
|
||||||
<!--<TextFont>: Text font name-->
|
<!--<TextFont>: Text font name-->
|
||||||
<TextFont>Normal</TextFont>
|
<TextFont>Normal</TextFont>
|
||||||
<!--<TextStyle>: Text style: Normal, Italic, Bold, BoldItalic-->
|
<!--<TextStyle>: Text style: Normal, Italic, Bold, BoldItalic-->
|
||||||
<TextStyle>Bold</TextStyle>
|
<TextStyle>Bold</TextStyle>
|
||||||
<!--<NumVisible>: Number of visible elements in the slide-->
|
<!--<NumVisible>: Number of visible elements in the slide-->
|
||||||
<NumVisible>3</NumVisible>
|
<NumVisible>1</NumVisible>
|
||||||
</SelectSlideBackgroundMusicSource>
|
</SelectSlideBackgroundMusicSource>
|
||||||
</ScreenOptionsSound>
|
</ScreenOptionsSound>
|
||||||
</root>
|
</root>
|
||||||
@@ -6,7 +6,9 @@
|
|||||||
<!--<Type>: Background type: None, Color, Texture, Video-->
|
<!--<Type>: Background type: None, Color, Texture, Video-->
|
||||||
<Type>None</Type>
|
<Type>None</Type>
|
||||||
<!--<Video>: Background video name-->
|
<!--<Video>: Background video name-->
|
||||||
|
<Video />
|
||||||
<!--<Skin>: Background Texture name-->
|
<!--<Skin>: Background Texture name-->
|
||||||
|
<Skin />
|
||||||
<!--<Color>: Background color for type "Color" from ColorScheme (high priority)-->
|
<!--<Color>: Background color for type "Color" from ColorScheme (high priority)-->
|
||||||
<!--or <R>, <G>, <B>, <A> (lower priority)-->
|
<!--or <R>, <G>, <B>, <A> (lower priority)-->
|
||||||
</Background1>
|
</Background1>
|
||||||
@@ -117,10 +119,10 @@
|
|||||||
<H>9</H>
|
<H>9</H>
|
||||||
<!--<Color>: Static color from ColorScheme (high priority)-->
|
<!--<Color>: Static color from ColorScheme (high priority)-->
|
||||||
<!--or <R>, <G>, <B>, <A> (lower priority)-->
|
<!--or <R>, <G>, <B>, <A> (lower priority)-->
|
||||||
<R>0,675</R>
|
<R>0,68</R>
|
||||||
<G>0,890</G>
|
<G>0,89</G>
|
||||||
<B>0,969</B>
|
<B>0,97</B>
|
||||||
<A>0,400</A>
|
<A>0,40</A>
|
||||||
<!--<Reflection> If exists:-->
|
<!--<Reflection> If exists:-->
|
||||||
<!-- <Space>: Reflection Space-->
|
<!-- <Space>: Reflection Space-->
|
||||||
<!-- <Height>: Reflection Height-->
|
<!-- <Height>: Reflection Height-->
|
||||||
|
|||||||
@@ -53,34 +53,6 @@
|
|||||||
<Height>26</Height>
|
<Height>26</Height>
|
||||||
</Reflection>
|
</Reflection>
|
||||||
</StaticSearchBar>
|
</StaticSearchBar>
|
||||||
<Text1>
|
|
||||||
<!--<X>, <Y>: Text position-->
|
|
||||||
<X>50</X>
|
|
||||||
<Y>41</Y>
|
|
||||||
<!--<Z>: Text position-->
|
|
||||||
<Z>0,00</Z>
|
|
||||||
<!--<H>: Text height-->
|
|
||||||
<H>32</H>
|
|
||||||
<!--<MaxW>: Maximum text width (if exists)-->
|
|
||||||
<MaxW>180</MaxW>
|
|
||||||
<!--<Color>: Text color from ColorScheme (high priority)-->
|
|
||||||
<!--or <R>, <G>, <B>, <A> (lower priority)-->
|
|
||||||
<Color>StaticColor</Color>
|
|
||||||
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
|
|
||||||
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
|
|
||||||
<Color>TextSColor</Color>
|
|
||||||
<!--<Align>: Text align: Left, Center, Right-->
|
|
||||||
<Align>Left</Align>
|
|
||||||
<!--<Style>: Text style: Normal, Italic, Bold, BoldItalic-->
|
|
||||||
<Style>Bold</Style>
|
|
||||||
<!--<Font>: Text font name-->
|
|
||||||
<Font>Normal</Font>
|
|
||||||
<!--<Text>: Text or translation tag-->
|
|
||||||
<Text>TR_SCREENSONG_MENU</Text>
|
|
||||||
<!--<Reflection> If exists:-->
|
|
||||||
<!-- <Space>: Reflection Space-->
|
|
||||||
<!-- <Height>: Reflection Height-->
|
|
||||||
</Text1>
|
|
||||||
<TextCategory>
|
<TextCategory>
|
||||||
<!--<X>, <Y>: Text position-->
|
<!--<X>, <Y>: Text position-->
|
||||||
<X>220</X>
|
<X>220</X>
|
||||||
|
|||||||
@@ -219,8 +219,8 @@
|
|||||||
</Skins>
|
</Skins>
|
||||||
<Videos>
|
<Videos>
|
||||||
<BG_Video>[Blue]BG_Video.mp4</BG_Video>
|
<BG_Video>[Blue]BG_Video.mp4</BG_Video>
|
||||||
<IntroIn>[Blue]IntroIn.mp4</IntroIn>
|
<IntroIn>[Blue]IntroIn.mp4</IntroIn>
|
||||||
<IntroMid>[Blue]IntroMid.mp4</IntroMid>
|
<IntroMid>[Blue]IntroMid.mp4</IntroMid>
|
||||||
<IntroOut>[Blue]IntroOut.mp4</IntroOut>
|
<IntroOut>[Blue]IntroOut.mp4</IntroOut>
|
||||||
</Videos>
|
</Videos>
|
||||||
</root>
|
</root>
|
||||||
@@ -219,8 +219,8 @@
|
|||||||
</Skins>
|
</Skins>
|
||||||
<Videos>
|
<Videos>
|
||||||
<BG_Video>[Green]BG_Video.mp4</BG_Video>
|
<BG_Video>[Green]BG_Video.mp4</BG_Video>
|
||||||
<IntroIn>[Green]IntroIn.mp4</IntroIn>
|
<IntroIn>[Green]IntroIn.mp4</IntroIn>
|
||||||
<IntroMid>[Green]IntroMid.mp4</IntroMid>
|
<IntroMid>[Green]IntroMid.mp4</IntroMid>
|
||||||
<IntroOut>[Green]IntroOut.mp4</IntroOut>
|
<IntroOut>[Green]IntroOut.mp4</IntroOut>
|
||||||
</Videos>
|
</Videos>
|
||||||
</root>
|
</root>
|
||||||
@@ -219,8 +219,8 @@
|
|||||||
</Skins>
|
</Skins>
|
||||||
<Videos>
|
<Videos>
|
||||||
<BG_Video>[Red]BG_Video.mp4</BG_Video>
|
<BG_Video>[Red]BG_Video.mp4</BG_Video>
|
||||||
<IntroIn>[Red]IntroIn.mp4</IntroIn>
|
<IntroIn>[Red]IntroIn.mp4</IntroIn>
|
||||||
<IntroMid>[Red]IntroMid.mp4</IntroMid>
|
<IntroMid>[Red]IntroMid.mp4</IntroMid>
|
||||||
<IntroOut>[Red]IntroOut.mp4</IntroOut>
|
<IntroOut>[Red]IntroOut.mp4</IntroOut>
|
||||||
</Videos>
|
</Videos>
|
||||||
</root>
|
</root>
|
||||||
@@ -219,8 +219,8 @@
|
|||||||
</Skins>
|
</Skins>
|
||||||
<Videos>
|
<Videos>
|
||||||
<BG_Video>[Yellow]BG_Video.mp4</BG_Video>
|
<BG_Video>[Yellow]BG_Video.mp4</BG_Video>
|
||||||
<IntroIn>[Yellow]IntroIn.mp4</IntroIn>
|
<IntroIn>[Yellow]IntroIn.mp4</IntroIn>
|
||||||
<IntroMid>[Yellow]IntroMid.mp4</IntroMid>
|
<IntroMid>[Yellow]IntroMid.mp4</IntroMid>
|
||||||
<IntroOut>[Yellow]IntroOut.mp4</IntroOut>
|
<IntroOut>[Yellow]IntroOut.mp4</IntroOut>
|
||||||
</Videos>
|
</Videos>
|
||||||
</root>
|
</root>
|
||||||
@@ -13,17 +13,22 @@ namespace Vocaluxe.Base
|
|||||||
{
|
{
|
||||||
private static CHelper Helper = new CHelper();
|
private static CHelper Helper = new CHelper();
|
||||||
private static int _CurrentMusicStream = -1;
|
private static int _CurrentMusicStream = -1;
|
||||||
private static bool _Fading;
|
private static string _CurrentMusicFilePath = String.Empty;
|
||||||
private static Stopwatch _FadeTimer = new Stopwatch();
|
|
||||||
private static Random _Random = new Random();
|
private static List<string> _AllFileNames = new List<string>();
|
||||||
private static List<string> _BackgroundMusicFileNames = new List<string>();
|
private static List<string> _BGMusicFileNames = new List<string>();
|
||||||
private static int _CurrentBackgroundMusicFileNameIndex;
|
|
||||||
private static bool _OwnMusicAdded;
|
private static bool _OwnMusicAdded;
|
||||||
private static bool _BackgroundMusicAdded;
|
private static bool _BackgroundMusicAdded;
|
||||||
|
|
||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
if(CConfig.BackgroundMusicSource == EBackgroundMusicSource.TR_CONFIG_NO_OWN_MUSIC || CConfig.BackgroundMusicSource == EBackgroundMusicSource.TR_CONFIG_OWN_MUSIC)
|
_BGMusicFileNames.AddRange(Helper.ListFiles(CSettings.sFolderBackgroundMusic, "*.mp3", true, true));
|
||||||
|
_BGMusicFileNames.AddRange(Helper.ListFiles(CSettings.sFolderBackgroundMusic, "*.wav", true, true));
|
||||||
|
_BGMusicFileNames.AddRange(Helper.ListFiles(CSettings.sFolderBackgroundMusic, "*.ogg", true, true));
|
||||||
|
_BGMusicFileNames.AddRange(Helper.ListFiles(CSettings.sFolderBackgroundMusic, "*.wma", true, true));
|
||||||
|
|
||||||
|
if(CConfig.BackgroundMusicSource != EBackgroundMusicSource.TR_CONFIG_ONLY_OWN_MUSIC)
|
||||||
AddBackgroundMusic();
|
AddBackgroundMusic();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,65 +36,62 @@ namespace Vocaluxe.Base
|
|||||||
{
|
{
|
||||||
if (CConfig.BackgroundMusic == EOffOn.TR_CONFIG_ON)
|
if (CConfig.BackgroundMusic == EOffOn.TR_CONFIG_ON)
|
||||||
{
|
{
|
||||||
if (_BackgroundMusicFileNames.Count > 0)
|
if (_AllFileNames.Count > 0)
|
||||||
{
|
{
|
||||||
CSound.Fade(_CurrentMusicStream, CConfig.BackgroundMusicVolume, CConfig.FadeTime);
|
if (_CurrentMusicStream != -1)
|
||||||
CSound.Play(_CurrentMusicStream);
|
{
|
||||||
|
CSound.Fade(_CurrentMusicStream, CConfig.BackgroundMusicVolume, CSettings.BackgroundMusicFadeTime);
|
||||||
|
CSound.Play(_CurrentMusicStream);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Next();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Stop()
|
public static void Stop()
|
||||||
{
|
{
|
||||||
if (_BackgroundMusicFileNames.Count > 0)
|
if (_AllFileNames.Count > 0)
|
||||||
CSound.FadeAndStop(_CurrentMusicStream, CConfig.BackgroundMusicVolume, CConfig.FadeTime);
|
CSound.FadeAndStop(_CurrentMusicStream, CConfig.BackgroundMusicVolume, CSettings.BackgroundMusicFadeTime);
|
||||||
|
|
||||||
|
_CurrentMusicFilePath = String.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Pause()
|
public static void Pause()
|
||||||
{
|
{
|
||||||
if (_BackgroundMusicFileNames.Count > 0)
|
if (_AllFileNames.Count > 0)
|
||||||
CSound.FadeAndPause(_CurrentMusicStream, 0, CConfig.FadeTime);
|
CSound.FadeAndPause(_CurrentMusicStream, 0f, CSettings.BackgroundMusicFadeTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Update()
|
public static void Update()
|
||||||
{
|
{
|
||||||
if (_BackgroundMusicFileNames.Count > 0)
|
if (_AllFileNames.Count > 0 && _CurrentMusicStream != -1)
|
||||||
{
|
{
|
||||||
float timeToPlay = CSound.GetLength(_CurrentMusicStream) - CSound.GetPosition(_CurrentMusicStream);
|
float timeToPlay = CSound.GetLength(_CurrentMusicStream) - CSound.GetPosition(_CurrentMusicStream);
|
||||||
if (_FadeTimer.ElapsedMilliseconds >= CConfig.FadeTime * 1000)
|
|
||||||
{
|
if (timeToPlay <= CSettings.BackgroundMusicFadeTime)
|
||||||
_Fading = false;
|
|
||||||
_FadeTimer.Reset();
|
|
||||||
}
|
|
||||||
if ((timeToPlay <= CConfig.FadeTime) && !_Fading)
|
|
||||||
{
|
|
||||||
_FadeTimer.Start();
|
|
||||||
Next();
|
Next();
|
||||||
_Fading = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Next()
|
public static void Next()
|
||||||
{
|
{
|
||||||
if (_BackgroundMusicFileNames.Count > 0)
|
if (_AllFileNames.Count > 0)
|
||||||
{
|
{
|
||||||
if (_CurrentMusicStream != -1)
|
Stop();
|
||||||
CSound.FadeAndStop(_CurrentMusicStream, 0, CConfig.FadeTime);
|
|
||||||
_CurrentBackgroundMusicFileNameIndex = _Random.Next(_BackgroundMusicFileNames.Count);
|
_CurrentMusicFilePath = _AllFileNames[CGame.Rand.Next(_AllFileNames.Count)];
|
||||||
_CurrentMusicStream = CSound.Load(_BackgroundMusicFileNames[_CurrentBackgroundMusicFileNameIndex]);
|
_CurrentMusicStream = CSound.Load(_CurrentMusicFilePath);
|
||||||
|
CSound.SetStreamVolume(_CurrentMusicStream, 0f);
|
||||||
Play();
|
Play();
|
||||||
}
|
}
|
||||||
else if (_BackgroundMusicAdded || _OwnMusicAdded)
|
else
|
||||||
{
|
Stop();
|
||||||
if (_CurrentMusicStream != -1)
|
|
||||||
CSound.FadeAndStop(_CurrentMusicStream, 0, CConfig.FadeTime);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ApplyVolume()
|
public static void ApplyVolume()
|
||||||
{
|
{
|
||||||
CSound.Fade(_CurrentMusicStream, CConfig.BackgroundMusicVolume, CConfig.FadeTime);
|
CSound.SetStreamVolume(_CurrentMusicStream, CConfig.BackgroundMusicVolume);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void AddOwnMusic()
|
public static void AddOwnMusic()
|
||||||
@@ -98,19 +100,22 @@ namespace Vocaluxe.Base
|
|||||||
{
|
{
|
||||||
foreach (CSong song in CSongs.AllSongs)
|
foreach (CSong song in CSongs.AllSongs)
|
||||||
{
|
{
|
||||||
_BackgroundMusicFileNames.Add(song.GetMP3());
|
_AllFileNames.Add(song.GetMP3());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_OwnMusicAdded = true;
|
_OwnMusicAdded = true;
|
||||||
Next();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void RemoveOwnMusic()
|
public static void RemoveOwnMusic()
|
||||||
{
|
{
|
||||||
foreach (CSong song in CSongs.AllSongs)
|
_AllFileNames.Clear();
|
||||||
{
|
|
||||||
_BackgroundMusicFileNames.Remove(song.GetMP3());
|
if (_BackgroundMusicAdded)
|
||||||
}
|
_AllFileNames.AddRange(_BGMusicFileNames);
|
||||||
|
|
||||||
|
if (IsPlaying() && !IsBackgroundFile(_CurrentMusicFilePath))
|
||||||
|
Next();
|
||||||
|
|
||||||
_OwnMusicAdded = false;
|
_OwnMusicAdded = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,12 +123,8 @@ namespace Vocaluxe.Base
|
|||||||
{
|
{
|
||||||
if (!_BackgroundMusicAdded)
|
if (!_BackgroundMusicAdded)
|
||||||
{
|
{
|
||||||
_BackgroundMusicFileNames.AddRange(Helper.ListFiles(CSettings.sFolderBackgroundMusic, "*.mp3", true, true));
|
_AllFileNames.AddRange(_BGMusicFileNames);
|
||||||
_BackgroundMusicFileNames.AddRange(Helper.ListFiles(CSettings.sFolderBackgroundMusic, "*.wav", true, true));
|
|
||||||
_BackgroundMusicFileNames.AddRange(Helper.ListFiles(CSettings.sFolderBackgroundMusic, "*.ogg", true, true));
|
|
||||||
_BackgroundMusicFileNames.AddRange(Helper.ListFiles(CSettings.sFolderBackgroundMusic, "*.wma", true, true));
|
|
||||||
_BackgroundMusicAdded = true;
|
_BackgroundMusicAdded = true;
|
||||||
Next();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,18 +132,78 @@ namespace Vocaluxe.Base
|
|||||||
{
|
{
|
||||||
if (_BackgroundMusicAdded)
|
if (_BackgroundMusicAdded)
|
||||||
{
|
{
|
||||||
List<string> removeList = new List<string>();
|
_AllFileNames.Clear();
|
||||||
removeList.AddRange(Helper.ListFiles(CSettings.sFolderBackgroundMusic, "*.mp3", true, true));
|
_OwnMusicAdded = false;
|
||||||
removeList.AddRange(Helper.ListFiles(CSettings.sFolderBackgroundMusic, "*.wav", true, true));
|
AddOwnMusic();
|
||||||
removeList.AddRange(Helper.ListFiles(CSettings.sFolderBackgroundMusic, "*.ogg", true, true));
|
|
||||||
removeList.AddRange(Helper.ListFiles(CSettings.sFolderBackgroundMusic, "*.wma", true, true));
|
|
||||||
|
|
||||||
foreach (string s in removeList)
|
|
||||||
{
|
|
||||||
_BackgroundMusicFileNames.Remove(s);
|
|
||||||
}
|
|
||||||
_BackgroundMusicAdded = false;
|
_BackgroundMusicAdded = false;
|
||||||
|
|
||||||
|
if (IsPlaying() && IsBackgroundFile(_CurrentMusicFilePath))
|
||||||
|
Next();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void CheckAndApplyConfig(EOffOn NewOnOff, EBackgroundMusicSource NewSource, float NewVolume)
|
||||||
|
{
|
||||||
|
if (CConfig.BackgroundMusic != NewOnOff)
|
||||||
|
{
|
||||||
|
CConfig.BackgroundMusic = NewOnOff;
|
||||||
|
if (NewOnOff == EOffOn.TR_CONFIG_ON)
|
||||||
|
Play();
|
||||||
|
else
|
||||||
|
Pause();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CConfig.BackgroundMusicSource != NewSource)
|
||||||
|
{
|
||||||
|
CConfig.BackgroundMusicSource = NewSource;
|
||||||
|
|
||||||
|
switch (NewSource)
|
||||||
|
{
|
||||||
|
case EBackgroundMusicSource.TR_CONFIG_NO_OWN_MUSIC:
|
||||||
|
if (!_BackgroundMusicAdded)
|
||||||
|
AddBackgroundMusic();
|
||||||
|
|
||||||
|
RemoveOwnMusic();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case EBackgroundMusicSource.TR_CONFIG_ONLY_OWN_MUSIC:
|
||||||
|
if (!_OwnMusicAdded)
|
||||||
|
AddOwnMusic();
|
||||||
|
|
||||||
|
RemoveBackgroundMusic();
|
||||||
|
break;
|
||||||
|
case EBackgroundMusicSource.TR_CONFIG_OWN_MUSIC:
|
||||||
|
if (!_BackgroundMusicAdded)
|
||||||
|
AddBackgroundMusic();
|
||||||
|
|
||||||
|
if (!_OwnMusicAdded)
|
||||||
|
AddOwnMusic();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CConfig.BackgroundMusicVolume != NewVolume)
|
||||||
|
{
|
||||||
|
CConfig.BackgroundMusicVolume = (int)NewVolume;
|
||||||
|
ApplyVolume();
|
||||||
|
}
|
||||||
|
|
||||||
|
CConfig.SaveConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool IsPlaying()
|
||||||
|
{
|
||||||
|
return CSound.IsPlaying(_CurrentMusicStream);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool IsBackgroundFile(string FilePath)
|
||||||
|
{
|
||||||
|
foreach (string file in _BGMusicFileNames)
|
||||||
|
{
|
||||||
|
if (file == FilePath)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -138,8 +138,8 @@ namespace Vocaluxe.Base
|
|||||||
public enum EBackgroundMusicSource
|
public enum EBackgroundMusicSource
|
||||||
{
|
{
|
||||||
TR_CONFIG_NO_OWN_MUSIC,
|
TR_CONFIG_NO_OWN_MUSIC,
|
||||||
TR_CONFIG_ONLY_OWN_MUSIC,
|
TR_CONFIG_OWN_MUSIC,
|
||||||
TR_CONFIG_OWN_MUSIC
|
TR_CONFIG_ONLY_OWN_MUSIC
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Enums
|
#endregion Enums
|
||||||
|
|||||||
@@ -91,6 +91,8 @@ namespace Vocaluxe.Base
|
|||||||
public const float LyricHelperMinTime = 0.2f;
|
public const float LyricHelperMinTime = 0.2f;
|
||||||
|
|
||||||
public const bool TabNavigation = false;
|
public const bool TabNavigation = false;
|
||||||
|
|
||||||
|
public const float BackgroundMusicFadeTime = 1.5f;
|
||||||
|
|
||||||
public static string GetVersionText()
|
public static string GetVersionText()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -132,6 +132,9 @@ namespace Vocaluxe.Screens
|
|||||||
CLog.StartBenchmark(3, "Load Cover");
|
CLog.StartBenchmark(3, "Load Cover");
|
||||||
_SongLoaderThread.Start();
|
_SongLoaderThread.Start();
|
||||||
_timer.Start();
|
_timer.Start();
|
||||||
|
|
||||||
|
if (!CBackgroundMusic.IsPlaying())
|
||||||
|
CBackgroundMusic.Next();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool UpdateGame()
|
public override bool UpdateGame()
|
||||||
@@ -163,6 +166,16 @@ namespace Vocaluxe.Screens
|
|||||||
CLanguage.Translate("TR_SCREENLOAD_TOTAL") + ": " + CSongs.NumAllSongs.ToString() + " " +
|
CLanguage.Translate("TR_SCREENLOAD_TOTAL") + ": " + CSongs.NumAllSongs.ToString() + " " +
|
||||||
CLanguage.Translate("TR_SCREENLOAD_SONGS") + " (" + CSongs.NumSongsWithCoverLoaded + " " +
|
CLanguage.Translate("TR_SCREENLOAD_SONGS") + " (" + CSongs.NumSongsWithCoverLoaded + " " +
|
||||||
CLanguage.Translate("TR_SCREENLOAD_LOADED") + ")";
|
CLanguage.Translate("TR_SCREENLOAD_LOADED") + ")";
|
||||||
|
|
||||||
|
if (CSongs.SongsLoaded && CConfig.BackgroundMusic == EOffOn.TR_CONFIG_ON &&
|
||||||
|
CConfig.BackgroundMusicSource != EBackgroundMusicSource.TR_CONFIG_NO_OWN_MUSIC)
|
||||||
|
{
|
||||||
|
CBackgroundMusic.AddOwnMusic();
|
||||||
|
|
||||||
|
if (!CBackgroundMusic.IsPlaying())
|
||||||
|
CBackgroundMusic.Next();
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,8 +203,6 @@ namespace Vocaluxe.Screens
|
|||||||
_Intros[2].Close();
|
_Intros[2].Close();
|
||||||
|
|
||||||
CLog.StopBenchmark(3, "Load Cover");
|
CLog.StopBenchmark(3, "Load Cover");
|
||||||
if(CConfig.BackgroundMusicSource == EBackgroundMusicSource.TR_CONFIG_ONLY_OWN_MUSIC || CConfig.BackgroundMusicSource == EBackgroundMusicSource.TR_CONFIG_OWN_MUSIC)
|
|
||||||
CBackgroundMusic.AddOwnMusic();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckStartIntroVideos()
|
private void CheckStartIntroVideos()
|
||||||
|
|||||||
@@ -130,35 +130,11 @@ namespace Vocaluxe.Screens
|
|||||||
}
|
}
|
||||||
private void SaveConfig()
|
private void SaveConfig()
|
||||||
{
|
{
|
||||||
CConfig.BackgroundMusic = (EOffOn)SelectSlides[htSelectSlides(SelectSlideBackgroundMusic)].Selection;
|
EOffOn NewOffOn = (EOffOn)SelectSlides[htSelectSlides(SelectSlideBackgroundMusic)].Selection;
|
||||||
|
EBackgroundMusicSource NewSource = (EBackgroundMusicSource)SelectSlides[htSelectSlides(SelectSlideBackgroundMusicSource)].Selection;
|
||||||
|
float NewVolume = SelectSlides[htSelectSlides(SelectSlideBackgroundMusicVolume)].Selection * 5;
|
||||||
|
|
||||||
if (CConfig.BackgroundMusic == EOffOn.TR_CONFIG_ON)
|
CBackgroundMusic.CheckAndApplyConfig(NewOffOn, NewSource, NewVolume);
|
||||||
CBackgroundMusic.Play();
|
|
||||||
else
|
|
||||||
CBackgroundMusic.Pause();
|
|
||||||
|
|
||||||
CConfig.BackgroundMusicVolume = SelectSlides[htSelectSlides(SelectSlideBackgroundMusicVolume)].Selection * 5;
|
|
||||||
CBackgroundMusic.ApplyVolume();
|
|
||||||
|
|
||||||
if (CConfig.BackgroundMusicSource != (EBackgroundMusicSource)SelectSlides[htSelectSlides(SelectSlideBackgroundMusicSource)].Selection)
|
|
||||||
{
|
|
||||||
CConfig.BackgroundMusicSource = (EBackgroundMusicSource)SelectSlides[htSelectSlides(SelectSlideBackgroundMusicSource)].Selection;
|
|
||||||
if (CConfig.BackgroundMusicSource == EBackgroundMusicSource.TR_CONFIG_NO_OWN_MUSIC)
|
|
||||||
{
|
|
||||||
CBackgroundMusic.RemoveOwnMusic();
|
|
||||||
CBackgroundMusic.AddBackgroundMusic();
|
|
||||||
}
|
|
||||||
if (CConfig.BackgroundMusicSource == EBackgroundMusicSource.TR_CONFIG_ONLY_OWN_MUSIC)
|
|
||||||
{
|
|
||||||
CBackgroundMusic.RemoveBackgroundMusic();
|
|
||||||
CBackgroundMusic.AddOwnMusic();
|
|
||||||
}
|
|
||||||
if (CConfig.BackgroundMusicSource == EBackgroundMusicSource.TR_CONFIG_OWN_MUSIC)
|
|
||||||
CBackgroundMusic.AddOwnMusic();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
CConfig.SaveConfig();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user