Add: option to enable KaraokeEffect with gestreamer backend (atm only for all audio globally)
This commit is contained in:
1 parent
d01ac27c5d
commit
49b971d126
4 files changed
+113
-4
No files matched your search
@@ -110,6 +110,20 @@
|
|||||||
<Style>Bold</Style>
|
<Style>Bold</Style>
|
||||||
<Font>Outline</Font>
|
<Font>Outline</Font>
|
||||||
<Text>TR_SCREENOSOUND_GAMEMUSICVOLUME</Text>
|
<Text>TR_SCREENOSOUND_GAMEMUSICVOLUME</Text>
|
||||||
|
</Text>
|
||||||
|
<Text Name="Text7">
|
||||||
|
<X>75</X>
|
||||||
|
<Y>407</Y>
|
||||||
|
<Z>0</Z>
|
||||||
|
<H>27</H>
|
||||||
|
<MaxW>0</MaxW>
|
||||||
|
<Color Name="StaticColor" />
|
||||||
|
<SelColor Name="TextSelColor" />
|
||||||
|
<Align>Left</Align>
|
||||||
|
<ResizeAlign>Center</ResizeAlign>
|
||||||
|
<Style>Bold</Style>
|
||||||
|
<Font>Outline</Font>
|
||||||
|
<Text>TR_SCREENOSOUND_KARAOKEEFFECT</Text>
|
||||||
</Text>
|
</Text>
|
||||||
</Texts>
|
</Texts>
|
||||||
<Buttons>
|
<Buttons>
|
||||||
@@ -361,6 +375,48 @@
|
|||||||
<TextFont>Outline</TextFont>
|
<TextFont>Outline</TextFont>
|
||||||
<TextStyle>Bold</TextStyle>
|
<TextStyle>Bold</TextStyle>
|
||||||
<NumVisible>3</NumVisible>
|
<NumVisible>3</NumVisible>
|
||||||
|
</SelectSlide>
|
||||||
|
<SelectSlide Name="SelectSlideKaraokeEffect">
|
||||||
|
<Skin/>
|
||||||
|
<SkinArrowLeft>SelectSlideArrowLeft</SkinArrowLeft>
|
||||||
|
<SkinArrowRight>SelectSlideArrowRight</SkinArrowRight>
|
||||||
|
<SkinSelected>SelectSlide</SkinSelected>
|
||||||
|
<SkinArrowLeftSelected>SelectSlideArrowLeft</SkinArrowLeftSelected>
|
||||||
|
<SkinArrowRightSelected>SelectSlideArrowRight</SkinArrowRightSelected>
|
||||||
|
<Rect>
|
||||||
|
<X>500</X>
|
||||||
|
<Y>400</Y>
|
||||||
|
<W>700</W>
|
||||||
|
<H>50</H>
|
||||||
|
<Z>0</Z>
|
||||||
|
</Rect>
|
||||||
|
<RectArrowLeft>
|
||||||
|
<X>505</X>
|
||||||
|
<Y>405</Y>
|
||||||
|
<W>40</W>
|
||||||
|
<H>40</H>
|
||||||
|
<Z>0</Z>
|
||||||
|
</RectArrowLeft>
|
||||||
|
<RectArrowRight>
|
||||||
|
<X>1170</X>
|
||||||
|
<Y>405</Y>
|
||||||
|
<W>40</W>
|
||||||
|
<H>40</H>
|
||||||
|
<Z>0</Z>
|
||||||
|
</RectArrowRight>
|
||||||
|
<Color Name="SelectSlideColor" />
|
||||||
|
<SelColor Name="SelectSlideSelColor" />
|
||||||
|
<ArrowColor Name="ArrowColor" />
|
||||||
|
<ArrowSelColor Name="ArrowSelColor" />
|
||||||
|
<TextColor Name="TextColor" />
|
||||||
|
<TextSelColor Name="TextSelColor" />
|
||||||
|
<TextH>27</TextH>
|
||||||
|
<TextRelativeX>50</TextRelativeX>
|
||||||
|
<TextRelativeY>0</TextRelativeY>
|
||||||
|
<TextMaxW>500</TextMaxW>
|
||||||
|
<TextFont>Outline</TextFont>
|
||||||
|
<TextStyle>Bold</TextStyle>
|
||||||
|
<NumVisible>2</NumVisible>
|
||||||
</SelectSlide>
|
</SelectSlide>
|
||||||
</SelectSlides>
|
</SelectSlides>
|
||||||
<SingNotes />
|
<SingNotes />
|
||||||
|
|||||||
@@ -120,6 +120,8 @@ namespace Vocaluxe.Base
|
|||||||
[DefaultValue(EOffOn.TR_CONFIG_ON)] public EOffOn BackgroundMusicUseStart;
|
[DefaultValue(EOffOn.TR_CONFIG_ON)] public EOffOn BackgroundMusicUseStart;
|
||||||
[XmlRanged(0, 100), DefaultValue(50)] public int PreviewMusicVolume;
|
[XmlRanged(0, 100), DefaultValue(50)] public int PreviewMusicVolume;
|
||||||
[XmlRanged(0, 100), DefaultValue(80)] public int GameMusicVolume;
|
[XmlRanged(0, 100), DefaultValue(80)] public int GameMusicVolume;
|
||||||
|
[DefaultValue(EOffOn.TR_CONFIG_OFF)] public EOffOn KaraokeEffect;
|
||||||
|
[XmlRanged(0, 1), DefaultValue(1.0f)] public float KaraokeEffectLevel;
|
||||||
// ReSharper restore MemberHidesStaticFromOuterClass
|
// ReSharper restore MemberHidesStaticFromOuterClass
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -452,6 +454,10 @@ namespace Vocaluxe.Base
|
|||||||
return "Preview Volume from 0 to 100";
|
return "Preview Volume from 0 to 100";
|
||||||
case "GameMusicVolume":
|
case "GameMusicVolume":
|
||||||
return "Game Volume from 0 to 100";
|
return "Game Volume from 0 to 100";
|
||||||
|
case "KaraokeEffect":
|
||||||
|
return "Apply a karaoke effect to song playback (EPlaybackLib.GstreamerSharp only)";
|
||||||
|
case "KaraokeEffectLevel":
|
||||||
|
return "The level of the karaoke effect [0-1] (EPlaybackLib.GstreamerSharp only)";
|
||||||
case "Language":
|
case "Language":
|
||||||
return "Game-Language";
|
return "Game-Language";
|
||||||
case "SongFolder":
|
case "SongFolder":
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ using System;
|
|||||||
using GLib;
|
using GLib;
|
||||||
using Gst;
|
using Gst;
|
||||||
using Vocaluxe.Base;
|
using Vocaluxe.Base;
|
||||||
|
using VocaluxeLib;
|
||||||
|
|
||||||
namespace Vocaluxe.Lib.Sound.Playback.GstreamerSharp
|
namespace Vocaluxe.Lib.Sound.Playback.GstreamerSharp
|
||||||
{
|
{
|
||||||
@@ -123,9 +124,29 @@ namespace Vocaluxe.Lib.Sound.Playback.GstreamerSharp
|
|||||||
}
|
}
|
||||||
|
|
||||||
var audioSinkBin = new Bin("Audiosink");
|
var audioSinkBin = new Bin("Audiosink");
|
||||||
audioSinkBin.Add(convert);
|
Element audiokaraoke = null;
|
||||||
audioSinkBin.Add(audiosink);
|
if (CConfig.Config.Sound.KaraokeEffect == EOffOn.TR_CONFIG_ON)
|
||||||
convert.Link(audiosink);
|
{
|
||||||
|
audiokaraoke = ElementFactory.Make("audiokaraoke", "karaoke");
|
||||||
|
audioSinkBin.Add(audiokaraoke);
|
||||||
|
audioSinkBin.Add(convert);
|
||||||
|
audioSinkBin.Add(audiosink);
|
||||||
|
|
||||||
|
audiokaraoke.Link(audiosink);
|
||||||
|
audiokaraoke["level"] = CConfig.Config.Sound.KaraokeEffectLevel;
|
||||||
|
audiokaraoke["mono-level"] = CConfig.Config.Sound.KaraokeEffectLevel;
|
||||||
|
|
||||||
|
convert.Link(audiokaraoke);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
audioSinkBin.Add(convert);
|
||||||
|
audioSinkBin.Add(audiosink);
|
||||||
|
convert.Link(audiosink);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Pad pad = convert.GetStaticPad("sink");
|
Pad pad = convert.GetStaticPad("sink");
|
||||||
GhostPad ghostpad = new GhostPad("sink", pad);
|
GhostPad ghostpad = new GhostPad("sink", pad);
|
||||||
|
|
||||||
@@ -135,6 +156,10 @@ namespace Vocaluxe.Lib.Sound.Playback.GstreamerSharp
|
|||||||
convert.Dispose();
|
convert.Dispose();
|
||||||
audiosink.Dispose();
|
audiosink.Dispose();
|
||||||
audioSinkBin.Dispose();
|
audioSinkBin.Dispose();
|
||||||
|
if (audiokaraoke != null)
|
||||||
|
{
|
||||||
|
audiokaraoke.Dispose();
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,6 +170,10 @@ namespace Vocaluxe.Lib.Sound.Playback.GstreamerSharp
|
|||||||
audiosink.Dispose();
|
audiosink.Dispose();
|
||||||
audioSinkBin.Dispose();
|
audioSinkBin.Dispose();
|
||||||
ghostpad.Dispose();
|
ghostpad.Dispose();
|
||||||
|
if (audiokaraoke != null)
|
||||||
|
{
|
||||||
|
audiokaraoke.Dispose();
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!audioSinkBin.AddPad(ghostpad))
|
if (!audioSinkBin.AddPad(ghostpad))
|
||||||
@@ -154,6 +183,10 @@ namespace Vocaluxe.Lib.Sound.Playback.GstreamerSharp
|
|||||||
audiosink.Dispose();
|
audiosink.Dispose();
|
||||||
audioSinkBin.Dispose();
|
audioSinkBin.Dispose();
|
||||||
ghostpad.Dispose();
|
ghostpad.Dispose();
|
||||||
|
if (audiokaraoke != null)
|
||||||
|
{
|
||||||
|
audiokaraoke.Dispose();
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,6 +198,10 @@ namespace Vocaluxe.Lib.Sound.Playback.GstreamerSharp
|
|||||||
audiosink.Dispose();
|
audiosink.Dispose();
|
||||||
audioSinkBin.Dispose();
|
audioSinkBin.Dispose();
|
||||||
ghostpad.Dispose();
|
ghostpad.Dispose();
|
||||||
|
if (audiokaraoke != null)
|
||||||
|
{
|
||||||
|
audiokaraoke.Dispose();
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
_Element["audio-sink"] = audioSinkBin;
|
_Element["audio-sink"] = audioSinkBin;
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ namespace Vocaluxe.Screens
|
|||||||
private const string _SelectSlideBackgroundMusicSource = "SelectSlideBackgroundMusicSource";
|
private const string _SelectSlideBackgroundMusicSource = "SelectSlideBackgroundMusicSource";
|
||||||
private const string _SelectSlidePreviewMusicVolume = "SelectSlidePreviewMusicVolume";
|
private const string _SelectSlidePreviewMusicVolume = "SelectSlidePreviewMusicVolume";
|
||||||
private const string _SelectSlideGameMusicVolume = "SelectSlideGameMusicVolume";
|
private const string _SelectSlideGameMusicVolume = "SelectSlideGameMusicVolume";
|
||||||
|
private const string _SelectSlideKaraokeEffect = "SelectSlideKaraokeEffect";
|
||||||
|
|
||||||
private const string _ButtonExit = "ButtonExit";
|
private const string _ButtonExit = "ButtonExit";
|
||||||
|
|
||||||
@@ -46,7 +47,7 @@ namespace Vocaluxe.Screens
|
|||||||
|
|
||||||
_ThemeButtons = new string[] {_ButtonExit};
|
_ThemeButtons = new string[] {_ButtonExit};
|
||||||
_ThemeSelectSlides = new string[]
|
_ThemeSelectSlides = new string[]
|
||||||
{_SelectSlideBackgroundMusic, _SelectSlideBackgroundMusicVolume, _SelectSlideBackgroundMusicSource, _SelectSlidePreviewMusicVolume, _SelectSlideGameMusicVolume};
|
{_SelectSlideBackgroundMusic, _SelectSlideBackgroundMusicVolume, _SelectSlideBackgroundMusicSource, _SelectSlidePreviewMusicVolume, _SelectSlideGameMusicVolume, _SelectSlideKaraokeEffect};
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void LoadTheme(string xmlPath)
|
public override void LoadTheme(string xmlPath)
|
||||||
@@ -64,6 +65,11 @@ namespace Vocaluxe.Screens
|
|||||||
_SelectSlides[_SelectSlideGameMusicVolume].AddValues(new string[]
|
_SelectSlides[_SelectSlideGameMusicVolume].AddValues(new string[]
|
||||||
{"0", "5", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55", "60", "65", "70", "75", "80", "85", "90", "95", "100"});
|
{"0", "5", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55", "60", "65", "70", "75", "80", "85", "90", "95", "100"});
|
||||||
_SelectSlides[_SelectSlideGameMusicVolume].Selection = CConfig.GameMusicVolume / 5;
|
_SelectSlides[_SelectSlideGameMusicVolume].Selection = CConfig.GameMusicVolume / 5;
|
||||||
|
if (CConfig.Config.Sound.PlayBackLib == EPlaybackLib.GstreamerSharp)
|
||||||
|
{
|
||||||
|
_SelectSlides[_SelectSlideKaraokeEffect].SetValues<EOffOn>((int)CConfig.Config.Sound.KaraokeEffect);
|
||||||
|
_SelectSlides[_SelectSlideBackgroundMusicSource].Selection = (int)CConfig.Config.Sound.KaraokeEffect;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool HandleInput(SKeyEvent keyEvent)
|
public override bool HandleInput(SKeyEvent keyEvent)
|
||||||
@@ -147,6 +153,10 @@ namespace Vocaluxe.Screens
|
|||||||
CConfig.Config.Sound.BackgroundMusic = (EBackgroundMusicOffOn)_SelectSlides[_SelectSlideBackgroundMusic].Selection;
|
CConfig.Config.Sound.BackgroundMusic = (EBackgroundMusicOffOn)_SelectSlides[_SelectSlideBackgroundMusic].Selection;
|
||||||
CConfig.Config.Sound.BackgroundMusicSource = (EBackgroundMusicSource)_SelectSlides[_SelectSlideBackgroundMusicSource].Selection;
|
CConfig.Config.Sound.BackgroundMusicSource = (EBackgroundMusicSource)_SelectSlides[_SelectSlideBackgroundMusicSource].Selection;
|
||||||
CConfig.BackgroundMusicVolume = _SelectSlides[_SelectSlideBackgroundMusicVolume].Selection * 5;
|
CConfig.BackgroundMusicVolume = _SelectSlides[_SelectSlideBackgroundMusicVolume].Selection * 5;
|
||||||
|
if (CConfig.Config.Sound.PlayBackLib == EPlaybackLib.GstreamerSharp)
|
||||||
|
{
|
||||||
|
CConfig.Config.Sound.KaraokeEffect = (EOffOn)_SelectSlides[_SelectSlideKaraokeEffect].Selection;
|
||||||
|
}
|
||||||
CConfig.SaveConfig();
|
CConfig.SaveConfig();
|
||||||
|
|
||||||
CBackgroundMusic.SetMusicSource(CConfig.Config.Sound.BackgroundMusicSource);
|
CBackgroundMusic.SetMusicSource(CConfig.Config.Sound.BackgroundMusicSource);
|
||||||
|
|||||||
Reference in new issue
Block a user