Added option to config.xml for switching bg-music start-tag behavior.
This commit is contained in:
1 parent
4420a11b08
commit
e20bd7093f
2 files changed
+13
-8
No files matched your search
@@ -247,12 +247,12 @@ namespace Vocaluxe.Base
|
||||
if (_RepeatSong)
|
||||
{
|
||||
//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);
|
||||
else
|
||||
CSound.SetPosition(_CurrentMusicStream, 0);
|
||||
if (_VideoEnabled && _Video != -1)
|
||||
if (_CurrentPlaylistElement.Start != 0f)
|
||||
if (_CurrentPlaylistElement.Start != 0f && CConfig.BackgroundMusicUseStart == EOffOn.TR_CONFIG_ON)
|
||||
CVideo.VdSkip(_Video, _CurrentPlaylistElement.Start, _CurrentPlaylistElement.VideoGap);
|
||||
else
|
||||
CVideo.VdSkip(_Video, 0f, _CurrentPlaylistElement.VideoGap);
|
||||
@@ -290,7 +290,7 @@ namespace Vocaluxe.Base
|
||||
CSound.SetStreamVolumeMax(_CurrentMusicStream, CConfig.BackgroundMusicVolume);
|
||||
|
||||
//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);
|
||||
|
||||
if (_VideoEnabled)
|
||||
@@ -310,12 +310,12 @@ namespace Vocaluxe.Base
|
||||
if (CSound.GetPosition(_CurrentMusicStream) >= 1.5f)
|
||||
{
|
||||
//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);
|
||||
else
|
||||
CSound.SetPosition(_CurrentMusicStream, 0);
|
||||
if (_VideoEnabled && _Video != -1)
|
||||
if(_CurrentPlaylistElement.Start != 0f)
|
||||
if (_CurrentPlaylistElement.Start != 0f && CConfig.BackgroundMusicUseStart == EOffOn.TR_CONFIG_ON)
|
||||
CVideo.VdSkip(_Video, _CurrentPlaylistElement.Start, _CurrentPlaylistElement.VideoGap);
|
||||
else
|
||||
CVideo.VdSkip(_Video, 0f, _CurrentPlaylistElement.VideoGap);
|
||||
@@ -340,12 +340,12 @@ namespace Vocaluxe.Base
|
||||
else if (_CurrentMusicStream != -1)
|
||||
{
|
||||
//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);
|
||||
else
|
||||
CSound.SetPosition(_CurrentMusicStream, 0);
|
||||
if (_VideoEnabled && _Video != -1)
|
||||
if (_CurrentPlaylistElement.Start != 0f)
|
||||
if (_CurrentPlaylistElement.Start != 0f && CConfig.BackgroundMusicUseStart == EOffOn.TR_CONFIG_ON)
|
||||
CVideo.VdSkip(_Video, _CurrentPlaylistElement.Start, _CurrentPlaylistElement.VideoGap);
|
||||
else
|
||||
CVideo.VdSkip(_Video, 0f, _CurrentPlaylistElement.VideoGap);
|
||||
@@ -519,7 +519,7 @@ namespace Vocaluxe.Base
|
||||
if (_Video == -1)
|
||||
{
|
||||
_Video = CVideo.VdLoad(_CurrentPlaylistElement.VideoFilePath);
|
||||
if (_CurrentPlaylistElement.Start != 0f)
|
||||
if (_CurrentPlaylistElement.Start != 0f && CConfig.BackgroundMusicUseStart == EOffOn.TR_CONFIG_ON)
|
||||
CVideo.VdSkip(_Video, _CurrentPlaylistElement.Start, _CurrentPlaylistElement.VideoGap);
|
||||
else
|
||||
CVideo.VdSkip(_Video, 0f, _CurrentPlaylistElement.VideoGap);
|
||||
|
||||
@@ -64,6 +64,7 @@ namespace Vocaluxe.Base
|
||||
public static int BackgroundMusicVolume = 30;
|
||||
public static EOffOn BackgroundMusic = EOffOn.TR_CONFIG_ON;
|
||||
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 GameMusicVolume = 80;
|
||||
|
||||
@@ -179,6 +180,7 @@ namespace Vocaluxe.Base
|
||||
xmlReader.TryGetEnumValue("//root/Sound/BackgroundMusic", ref BackgroundMusic);
|
||||
xmlReader.TryGetIntValueRange("//root/Sound/BackgroundMusicVolume", ref BackgroundMusicVolume);
|
||||
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/GameMusicVolume", ref GameMusicVolume);
|
||||
#endregion Sound
|
||||
@@ -411,6 +413,9 @@ namespace Vocaluxe.Base
|
||||
writer.WriteComment("Background Music Source");
|
||||
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.WriteElementString("PreviewMusicVolume", PreviewMusicVolume.ToString());
|
||||
|
||||
|
||||
Reference in new issue
Block a user