Merge remote-tracking branch 'remotes/flokuep/develop' into develop

This commit is contained in:
Alexander Eckart committed 2013-02-24 20:05:42 +01:00
commit ce46c75415
3 files changed
+63 -25

No files matched your search

+42 -18
View File
@@ -246,9 +246,16 @@ namespace Vocaluxe.Base
{ {
if (_RepeatSong) if (_RepeatSong)
{ {
CSound.SetPosition(_CurrentMusicStream, 0); //Seek to #Start-Tag, if found
if (_CurrentPlaylistElement.Start != 0f && CConfig.BackgroundMusicUseStart == EOffOn.TR_CONFIG_ON)
CSound.SetPosition(_CurrentMusicStream, _CurrentPlaylistElement.Start);
else
CSound.SetPosition(_CurrentMusicStream, 0);
if (_VideoEnabled && _Video != -1) if (_VideoEnabled && _Video != -1)
CVideo.VdSkip(_Video, 0f, _CurrentPlaylistElement.VideoGap); if (_CurrentPlaylistElement.Start != 0f && CConfig.BackgroundMusicUseStart == EOffOn.TR_CONFIG_ON)
CVideo.VdSkip(_Video, _CurrentPlaylistElement.Start, _CurrentPlaylistElement.VideoGap);
else
CVideo.VdSkip(_Video, 0f, _CurrentPlaylistElement.VideoGap);
} }
else else
Next(); Next();
@@ -283,7 +290,7 @@ namespace Vocaluxe.Base
CSound.SetStreamVolumeMax(_CurrentMusicStream, CConfig.BackgroundMusicVolume); CSound.SetStreamVolumeMax(_CurrentMusicStream, CConfig.BackgroundMusicVolume);
//Seek to #Start-Tag, if found //Seek to #Start-Tag, if found
if (_CurrentPlaylistElement.Start != 0f) if (_CurrentPlaylistElement.Start != 0f && CConfig.BackgroundMusicUseStart == EOffOn.TR_CONFIG_ON)
CSound.SetPosition(_CurrentMusicStream, _CurrentPlaylistElement.Start); CSound.SetPosition(_CurrentMusicStream, _CurrentPlaylistElement.Start);
if (_VideoEnabled) if (_VideoEnabled)
@@ -302,9 +309,16 @@ namespace Vocaluxe.Base
float pos = CSound.GetPosition(_CurrentMusicStream); float pos = CSound.GetPosition(_CurrentMusicStream);
if (CSound.GetPosition(_CurrentMusicStream) >= 1.5f) if (CSound.GetPosition(_CurrentMusicStream) >= 1.5f)
{ {
CSound.SetPosition(_CurrentMusicStream, 0); //Seek to #Start-Tag, if found
if (_CurrentPlaylistElement.Start != 0f && CConfig.BackgroundMusicUseStart == EOffOn.TR_CONFIG_ON)
CSound.SetPosition(_CurrentMusicStream, _CurrentPlaylistElement.Start);
else
CSound.SetPosition(_CurrentMusicStream, 0);
if (_VideoEnabled && _Video != -1) if (_VideoEnabled && _Video != -1)
CVideo.VdSkip(_Video, 0f, _CurrentPlaylistElement.VideoGap); if (_CurrentPlaylistElement.Start != 0f && CConfig.BackgroundMusicUseStart == EOffOn.TR_CONFIG_ON)
CVideo.VdSkip(_Video, _CurrentPlaylistElement.Start, _CurrentPlaylistElement.VideoGap);
else
CVideo.VdSkip(_Video, 0f, _CurrentPlaylistElement.VideoGap);
} }
else else
{ {
@@ -325,9 +339,16 @@ namespace Vocaluxe.Base
} }
else if (_CurrentMusicStream != -1) else if (_CurrentMusicStream != -1)
{ {
CSound.SetPosition(_CurrentMusicStream, 0); //Seek to #Start-Tag, if found
if (_CurrentPlaylistElement.Start != 0f && CConfig.BackgroundMusicUseStart == EOffOn.TR_CONFIG_ON)
CSound.SetPosition(_CurrentMusicStream, _CurrentPlaylistElement.Start);
else
CSound.SetPosition(_CurrentMusicStream, 0);
if (_VideoEnabled && _Video != -1) if (_VideoEnabled && _Video != -1)
CVideo.VdSkip(_Video, 0f, _CurrentPlaylistElement.VideoGap); if (_CurrentPlaylistElement.Start != 0f && CConfig.BackgroundMusicUseStart == EOffOn.TR_CONFIG_ON)
CVideo.VdSkip(_Video, _CurrentPlaylistElement.Start, _CurrentPlaylistElement.VideoGap);
else
CVideo.VdSkip(_Video, 0f, _CurrentPlaylistElement.VideoGap);
} }
} }
@@ -392,16 +413,7 @@ namespace Vocaluxe.Base
public static void CheckAndApplyConfig(EOffOn NewOnOff, EBackgroundMusicSource NewSource, float NewVolume) public static void CheckAndApplyConfig(EOffOn NewOnOff, EBackgroundMusicSource NewSource, float NewVolume)
{ {
if (CConfig.BackgroundMusic != NewOnOff) if (CConfig.BackgroundMusicSource != NewSource || (NewOnOff == EOffOn.TR_CONFIG_ON && !_OwnMusicAdded && !_BackgroundMusicAdded))
{
CConfig.BackgroundMusic = NewOnOff;
if (NewOnOff == EOffOn.TR_CONFIG_ON)
Play();
else
Pause();
}
if (CConfig.BackgroundMusicSource != NewSource)
{ {
CConfig.BackgroundMusicSource = NewSource; CConfig.BackgroundMusicSource = NewSource;
@@ -430,6 +442,15 @@ namespace Vocaluxe.Base
} }
} }
if (CConfig.BackgroundMusic != NewOnOff)
{
CConfig.BackgroundMusic = NewOnOff;
if (NewOnOff == EOffOn.TR_CONFIG_ON)
Play();
else
Pause();
}
if (CConfig.BackgroundMusicVolume != NewVolume) if (CConfig.BackgroundMusicVolume != NewVolume)
{ {
CConfig.BackgroundMusicVolume = (int)NewVolume; CConfig.BackgroundMusicVolume = (int)NewVolume;
@@ -498,7 +519,10 @@ namespace Vocaluxe.Base
if (_Video == -1) if (_Video == -1)
{ {
_Video = CVideo.VdLoad(_CurrentPlaylistElement.VideoFilePath); _Video = CVideo.VdLoad(_CurrentPlaylistElement.VideoFilePath);
CVideo.VdSkip(_Video, 0f, _CurrentPlaylistElement.VideoGap); if (_CurrentPlaylistElement.Start != 0f && CConfig.BackgroundMusicUseStart == EOffOn.TR_CONFIG_ON)
CVideo.VdSkip(_Video, _CurrentPlaylistElement.Start, _CurrentPlaylistElement.VideoGap);
else
CVideo.VdSkip(_Video, 0f, _CurrentPlaylistElement.VideoGap);
_VideoEnabled = true; _VideoEnabled = true;
_FadeTimer.Reset(); _FadeTimer.Reset();
_FadeTimer.Start(); _FadeTimer.Start();
+5
View File
@@ -64,6 +64,7 @@ namespace Vocaluxe.Base
public static int BackgroundMusicVolume = 30; public static int BackgroundMusicVolume = 30;
public static EOffOn BackgroundMusic = EOffOn.TR_CONFIG_ON; public static EOffOn BackgroundMusic = EOffOn.TR_CONFIG_ON;
public static EBackgroundMusicSource BackgroundMusicSource = EBackgroundMusicSource.TR_CONFIG_NO_OWN_MUSIC; public static EBackgroundMusicSource BackgroundMusicSource = EBackgroundMusicSource.TR_CONFIG_NO_OWN_MUSIC;
public static EOffOn BackgroundMusicUseStart = EOffOn.TR_CONFIG_ON;
public static int PreviewMusicVolume = 50; public static int PreviewMusicVolume = 50;
public static int GameMusicVolume = 80; public static int GameMusicVolume = 80;
@@ -179,6 +180,7 @@ namespace Vocaluxe.Base
xmlReader.TryGetEnumValue("//root/Sound/BackgroundMusic", ref BackgroundMusic); xmlReader.TryGetEnumValue("//root/Sound/BackgroundMusic", ref BackgroundMusic);
xmlReader.TryGetIntValueRange("//root/Sound/BackgroundMusicVolume", ref BackgroundMusicVolume); xmlReader.TryGetIntValueRange("//root/Sound/BackgroundMusicVolume", ref BackgroundMusicVolume);
xmlReader.TryGetEnumValue("//root/Sound/BackgroundMusicSource", ref BackgroundMusicSource); xmlReader.TryGetEnumValue("//root/Sound/BackgroundMusicSource", ref BackgroundMusicSource);
xmlReader.TryGetEnumValue<EOffOn>("//root/Sound/BackgroundMusicUseStart", ref BackgroundMusicUseStart);
xmlReader.TryGetIntValueRange("//root/Sound/PreviewMusicVolume", ref PreviewMusicVolume); xmlReader.TryGetIntValueRange("//root/Sound/PreviewMusicVolume", ref PreviewMusicVolume);
xmlReader.TryGetIntValueRange("//root/Sound/GameMusicVolume", ref GameMusicVolume); xmlReader.TryGetIntValueRange("//root/Sound/GameMusicVolume", ref GameMusicVolume);
#endregion Sound #endregion Sound
@@ -411,6 +413,9 @@ namespace Vocaluxe.Base
writer.WriteComment("Background Music Source"); writer.WriteComment("Background Music Source");
writer.WriteElementString("BackgroundMusicSource", Enum.GetName(typeof(EBackgroundMusicSource), BackgroundMusicSource)); writer.WriteElementString("BackgroundMusicSource", Enum.GetName(typeof(EBackgroundMusicSource), BackgroundMusicSource));
writer.WriteComment("Background Music use start-tag of songs");
writer.WriteElementString("BackgroundMusicUseStart", Enum.GetName(typeof(EOffOn), BackgroundMusicUseStart));
writer.WriteComment("Preview Volume from 0 to 100"); writer.WriteComment("Preview Volume from 0 to 100");
writer.WriteElementString("PreviewMusicVolume", PreviewMusicVolume.ToString()); writer.WriteElementString("PreviewMusicVolume", PreviewMusicVolume.ToString());
+16 -7
View File
@@ -508,6 +508,11 @@ namespace Vocaluxe.Base
&& _CurrentScreen != EScreens.ScreenCredits && !CBackgroundMusic.Disabled; && _CurrentScreen != EScreens.ScreenCredits && !CBackgroundMusic.Disabled;
bool PopupVolumeControlAllowed = _CurrentScreen != EScreens.ScreenCredits && _CurrentScreen != EScreens.ScreenOptionsRecord; bool PopupVolumeControlAllowed = _CurrentScreen != EScreens.ScreenCredits && _CurrentScreen != EScreens.ScreenOptionsRecord;
//Hide volume control for bg-music if bg-music is disabled
if (PopupVolumeControlAllowed && (_CurrentScreen != EScreens.ScreenSong || (_CurrentScreen == EScreens.ScreenSong && CSongs.Category == -1))
&& _CurrentScreen != EScreens.ScreenSing && CConfig.BackgroundMusic == EOffOn.TR_CONFIG_OFF)
PopupVolumeControlAllowed = false;
bool Resume = true; bool Resume = true;
bool EventsAvailable = false; bool EventsAvailable = false;
@@ -532,14 +537,9 @@ namespace Vocaluxe.Base
HidePopup(EPopupScreens.PopupPlayerControl); HidePopup(EPopupScreens.PopupPlayerControl);
} }
if (PopupVolumeControlAllowed && CConfig.BackgroundMusic == EOffOn.TR_CONFIG_ON) if (PopupPlayerControlAllowed && CConfig.BackgroundMusic == EOffOn.TR_CONFIG_ON)
{ {
int Diff = 0; if (KeyEvent.Key == Keys.MediaNextTrack)
if ((KeyEvent.ModSHIFT && (KeyEvent.Key == Keys.Add || KeyEvent.Key == Keys.PageUp)) || (KeyEvent.Sender == ESender.WiiMote && KeyEvent.Key == Keys.Add))
Diff = 5;
else if ((KeyEvent.ModSHIFT && (KeyEvent.Key == Keys.Subtract || KeyEvent.Key == Keys.PageDown)) || (KeyEvent.Sender == ESender.WiiMote && KeyEvent.Key == Keys.Subtract))
Diff = -5;
else if (KeyEvent.Key == Keys.MediaNextTrack)
CMain.BackgroundMusic.Next(); CMain.BackgroundMusic.Next();
else if (KeyEvent.Key == Keys.MediaPreviousTrack) else if (KeyEvent.Key == Keys.MediaPreviousTrack)
CMain.BackgroundMusic.Previous(); CMain.BackgroundMusic.Previous();
@@ -550,6 +550,15 @@ namespace Vocaluxe.Base
else else
CMain.BackgroundMusic.Play(); CMain.BackgroundMusic.Play();
} }
}
if (PopupVolumeControlAllowed)
{
int Diff = 0;
if ((KeyEvent.ModSHIFT && (KeyEvent.Key == Keys.Add || KeyEvent.Key == Keys.PageUp)) || (KeyEvent.Sender == ESender.WiiMote && KeyEvent.Key == Keys.Add))
Diff = 5;
else if ((KeyEvent.ModSHIFT && (KeyEvent.Key == Keys.Subtract || KeyEvent.Key == Keys.PageDown)) || (KeyEvent.Sender == ESender.WiiMote && KeyEvent.Key == Keys.Subtract))
Diff = -5;
if (Diff != 0) if (Diff != 0)
{ {