Added equalizers to ScreenNames to show mic-input. Should be useful with more than 2 mics...
This commit is contained in:
1 parent
aacc842d80
commit
df8f2c10d2
4 files changed
+218
-48
No files matched your search
+25
-43
@@ -127,6 +127,10 @@ namespace Vocaluxe.Menu
|
||||
{
|
||||
_Theme.Name = ElementName;
|
||||
_Bars = new float[_Theme.NumBars];
|
||||
for (int i = 0; i < _Bars.Length; i++)
|
||||
{
|
||||
_Bars[i] = 0f;
|
||||
}
|
||||
LoadTextures();
|
||||
}
|
||||
return _ThemeLoaded;
|
||||
@@ -170,18 +174,18 @@ namespace Vocaluxe.Menu
|
||||
writer.WriteElementString("B", Color.B.ToString("#0.00"));
|
||||
writer.WriteElementString("A", Color.A.ToString("#0.00"));
|
||||
}
|
||||
writer.WriteComment("<Color>: Equalizer color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
writer.WriteComment("<MaxColor>: Equalizer color for maximal volume from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <MaxR>, <MaxG>, <MaxB>, <MaxA> (lower priority)");
|
||||
if (_Theme.ColorName != String.Empty)
|
||||
{
|
||||
writer.WriteElementString("Color", _Theme.ColorName);
|
||||
writer.WriteElementString("MaxColor", _Theme.ColorName);
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.WriteElementString("R", Color.R.ToString("#0.00"));
|
||||
writer.WriteElementString("G", Color.G.ToString("#0.00"));
|
||||
writer.WriteElementString("B", Color.B.ToString("#0.00"));
|
||||
writer.WriteElementString("A", Color.A.ToString("#0.00"));
|
||||
writer.WriteElementString("MaxR", Color.R.ToString("#0.00"));
|
||||
writer.WriteElementString("MaxG", Color.G.ToString("#0.00"));
|
||||
writer.WriteElementString("MaxB", Color.B.ToString("#0.00"));
|
||||
writer.WriteElementString("MaxA", Color.A.ToString("#0.00"));
|
||||
}
|
||||
|
||||
writer.WriteComment("<Reflection> If exists:");
|
||||
@@ -207,11 +211,10 @@ namespace Vocaluxe.Menu
|
||||
return;
|
||||
for (int i = 0; i < _Bars.Length; i++)
|
||||
{
|
||||
|
||||
if (weights.Length > i){
|
||||
_Bars[i] = weights[i];
|
||||
_Bars[i] = 1f - weights[i];
|
||||
if (_Theme.DrawNegative == EOffOn.TR_CONFIG_OFF && weights[i] < 0)
|
||||
_Bars[i] = 0f;
|
||||
_Bars[i] = (1f + weights[i]);
|
||||
}
|
||||
else
|
||||
_Bars[i] = 0f;
|
||||
@@ -234,7 +237,7 @@ namespace Vocaluxe.Menu
|
||||
if (_Bars == null)
|
||||
return;
|
||||
|
||||
float dx = Rect.W / _Bars.Length + Space;
|
||||
float dx = (Rect.W ) / _Bars.Length;
|
||||
int max = _Bars.Length - 1;
|
||||
float maxB = _Bars[max];
|
||||
for (int i = 0; i < _Bars.Length - 1; i++)
|
||||
@@ -246,40 +249,19 @@ namespace Vocaluxe.Menu
|
||||
}
|
||||
}
|
||||
|
||||
switch (_Theme.Style){
|
||||
case EEqualizerStyle.Collums:
|
||||
for (int i = 0; i < _Bars.Length; i++)
|
||||
{
|
||||
SRectF bar = new SRectF(Rect.X + dx * i, Rect.Y + Rect.H - _Bars[i] * Rect.H, dx - Space, _Bars[i] * Rect.H, Rect.Z);
|
||||
SColorF color = Color;
|
||||
if (i == max)
|
||||
{
|
||||
color = MaxColor;
|
||||
}
|
||||
for (int i = 0; i < _Bars.Length; i++)
|
||||
{
|
||||
SRectF bar = new SRectF(Rect.X + dx * i, Rect.Y + Rect.H - _Bars[i] * Rect.H, dx - Space, _Bars[i] * Rect.H, Rect.Z);
|
||||
SColorF color = Color;
|
||||
if (i == max)
|
||||
{
|
||||
color = MaxColor;
|
||||
}
|
||||
|
||||
CDraw.DrawColor(color, bar);
|
||||
CDraw.DrawColor(color, bar);
|
||||
|
||||
if (Reflection)
|
||||
CDraw.DrawColorReflection(color, bar, ReflectionSpace, ReflectionHeight);
|
||||
}
|
||||
break;
|
||||
|
||||
case EEqualizerStyle.Bars:
|
||||
for (int i = 0; i < _Bars.Length; i++)
|
||||
{
|
||||
SRectF bar = new SRectF(Rect.X + dx * i, Rect.Y + Rect.H - _Bars[i] * Rect.H, dx - Space, _Bars[i] * Rect.H, Rect.Z);
|
||||
SColorF color = Color;
|
||||
if (i == max)
|
||||
{
|
||||
color = MaxColor;
|
||||
}
|
||||
|
||||
CDraw.DrawColor(color, bar);
|
||||
|
||||
if (Reflection)
|
||||
CDraw.DrawColorReflection(color, bar, ReflectionSpace, ReflectionHeight);
|
||||
}
|
||||
break;
|
||||
if (Reflection)
|
||||
CDraw.DrawColorReflection(color, bar, ReflectionSpace, ReflectionHeight);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Vocaluxe.Screens
|
||||
class CScreenNames : CMenu
|
||||
{
|
||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||
const int ScreenVersion = 2;
|
||||
const int ScreenVersion = 3;
|
||||
|
||||
private CStatic chooseAvatarStatic;
|
||||
private int OldMouseX;
|
||||
@@ -29,6 +29,7 @@ namespace Vocaluxe.Screens
|
||||
private readonly string[] StaticPlayer = new string[] { "StaticPlayer1", "StaticPlayer2", "StaticPlayer3", "StaticPlayer4", "StaticPlayer5", "StaticPlayer6" };
|
||||
private readonly string[] StaticPlayerAvatar = new string[] { "StaticPlayerAvatar1", "StaticPlayerAvatar2", "StaticPlayerAvatar3", "StaticPlayerAvatar4", "StaticPlayerAvatar5", "StaticPlayerAvatar6" };
|
||||
private readonly string[] TextPlayer = new string[] { "TextPlayer1", "TextPlayer2", "TextPlayer3", "TextPlayer4", "TextPlayer5", "TextPlayer6" };
|
||||
private readonly string[] EqualizerPlayer = new string[] { "EqualizerPlayer1", "EqualizerPlayer2", "EqualizerPlayer3", "EqualizerPlayer4", "EqualizerPlayer5", "EqualizerPlayer6" };
|
||||
private STexture[] OriginalPlayerAvatarTextures = new STexture[CSettings.MaxNumPlayer];
|
||||
|
||||
private bool selectingMouseActive = false;
|
||||
@@ -84,6 +85,10 @@ namespace Vocaluxe.Screens
|
||||
texts.Add(NameSelection);
|
||||
_ThemeNameSelections = texts.ToArray();
|
||||
|
||||
texts.Clear();
|
||||
texts.AddRange(EqualizerPlayer);
|
||||
_ThemeEqualizers = texts.ToArray();
|
||||
|
||||
chooseAvatarStatic = new CStatic();
|
||||
chooseAvatarStatic.Visible = false;
|
||||
}
|
||||
@@ -503,13 +508,18 @@ namespace Vocaluxe.Screens
|
||||
|
||||
public override bool UpdateGame()
|
||||
{
|
||||
|
||||
for (int i = 1; i <= CGame.NumPlayer; i++)
|
||||
{
|
||||
CSound.AnalyzeBuffer((i-1));
|
||||
Equalizers[htEqualizer("EqualizerPlayer" + i)].Update(CSound.ToneWeigth((i-1)));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnShow()
|
||||
{
|
||||
base.OnShow();
|
||||
CSound.RecordStart();
|
||||
|
||||
NameSelections[htNameSelections(NameSelection)].Init();
|
||||
|
||||
@@ -531,6 +541,12 @@ namespace Vocaluxe.Screens
|
||||
SetInteractionToButton(Buttons[htButtons(ButtonStart)]);
|
||||
}
|
||||
|
||||
public override void OnClose()
|
||||
{
|
||||
base.OnClose();
|
||||
CSound.RecordStop();
|
||||
}
|
||||
|
||||
public override bool Draw()
|
||||
{
|
||||
base.Draw();
|
||||
@@ -539,7 +555,10 @@ namespace Vocaluxe.Screens
|
||||
{
|
||||
chooseAvatarStatic.Draw();
|
||||
}
|
||||
|
||||
for (int i = 1; i <= CGame.NumPlayer; i++)
|
||||
{
|
||||
Equalizers[htEqualizer("EqualizerPlayer" + i)].Draw();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -591,12 +610,14 @@ namespace Vocaluxe.Screens
|
||||
{
|
||||
Texts[htTexts("TextPlayer" + i)].Text = CLanguage.Translate("TR_SCREENNAMES_PLAYER") + " " + i.ToString();
|
||||
}
|
||||
Equalizers[htEqualizer("EqualizerPlayer" + i)].Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Statics[htStatics("StaticPlayer" + i)].Visible = false;
|
||||
Statics[htStatics("StaticPlayerAvatar" + i)].Visible = false;
|
||||
Texts[htTexts("TextPlayer" + i)].Visible = false;
|
||||
Equalizers[htEqualizer("EqualizerPlayer" + i)].Visible = false;
|
||||
}
|
||||
}
|
||||
CConfig.SaveConfig();
|
||||
|
||||
Reference in new issue
Block a user