Added Mic delay in calculation of line breaks
Added config entry for minimal time before text is show
This commit is contained in:
1 parent
75451a0a17
commit
1a644ab22c
4 files changed
+61
-25
No files matched your search
+30
@@ -0,0 +1,30 @@
|
|||||||
|
obj
|
||||||
|
Output/Songs
|
||||||
|
*.mp4
|
||||||
|
*.pdb
|
||||||
|
/Output/Benchmark.log
|
||||||
|
|
||||||
|
/Output/CoverDB.sqlite
|
||||||
|
|
||||||
|
/Output/HighscoreDB.sqlite
|
||||||
|
|
||||||
|
/Output/PartyModes/*/Code/*
|
||||||
|
|
||||||
|
/Output/Vocaluxe.exe*
|
||||||
|
|
||||||
|
/Output/Vocaluxe.vshost.exe*
|
||||||
|
|
||||||
|
/Output/VocaluxeLib.dll
|
||||||
|
|
||||||
|
*.psess
|
||||||
|
|
||||||
|
/*.vsp
|
||||||
|
|
||||||
|
/*.ctl
|
||||||
|
|
||||||
|
/Output/Registration.xml
|
||||||
|
|
||||||
|
/Vocaluxe.suo
|
||||||
|
/Vocaluxe/Vocaluxe.csproj.user
|
||||||
|
|
||||||
|
/Output/Config.xml
|
||||||
@@ -81,6 +81,8 @@ namespace Vocaluxe.Base
|
|||||||
public static EOffOn LyricsOnTop = EOffOn.TR_CONFIG_OFF;
|
public static EOffOn LyricsOnTop = EOffOn.TR_CONFIG_OFF;
|
||||||
public static string[] Players = new string[CSettings.MaxNumPlayer];
|
public static string[] Players = new string[CSettings.MaxNumPlayer];
|
||||||
|
|
||||||
|
public static float MinLineBreakTime = 0.1f; //Minimum time to show the text before it is (to be) sung (if possible)
|
||||||
|
|
||||||
// Video
|
// Video
|
||||||
public static EVideoDecoder VideoDecoder = EVideoDecoder.FFmpeg;
|
public static EVideoDecoder VideoDecoder = EVideoDecoder.FFmpeg;
|
||||||
public static EOffOn VideoBackgrounds = EOffOn.TR_CONFIG_ON;
|
public static EOffOn VideoBackgrounds = EOffOn.TR_CONFIG_ON;
|
||||||
|
|||||||
@@ -738,6 +738,30 @@ namespace Vocaluxe.Screens
|
|||||||
CWebcam.Close();
|
CWebcam.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int FindCurrentLine(CLine[] line, CSong song)
|
||||||
|
{
|
||||||
|
float CurrentTime = _CurrentTime - song.Gap;
|
||||||
|
//We are only interested in the last matching line, so either do not check further after line[j].StartBeat > _CurrentBeat or go backwards!
|
||||||
|
for (int j = line.Length - 1; j >= 0; j--)
|
||||||
|
{
|
||||||
|
if (line[j].StartBeat <= _CurrentBeat)
|
||||||
|
{
|
||||||
|
float FirstNoteTime = CGame.GetTimeFromBeats(line[j].FirstNoteBeat, song.BPM);
|
||||||
|
//Earlist possible line break is 10s before first note
|
||||||
|
if (FirstNoteTime <= CurrentTime + 10f)
|
||||||
|
{
|
||||||
|
//First line has no predecessor or line has to be shown
|
||||||
|
if(j == 0 || FirstNoteTime - CConfig.MinLineBreakTime <= CurrentTime) return j;
|
||||||
|
float LastNoteTime = CGame.GetTimeFromBeats(line[j-1].LastNoteBeat, song.BPM);
|
||||||
|
//No line break if last line is not fully evaluated (with 50% tolerance -> tested so notes are drawn)
|
||||||
|
if(LastNoteTime + CConfig.MicDelay/1000f * 1.5f >= CurrentTime) return j-1;
|
||||||
|
return j;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
private void UpdateLyrics()
|
private void UpdateLyrics()
|
||||||
{
|
{
|
||||||
if (_FadeOut)
|
if (_FadeOut)
|
||||||
@@ -759,18 +783,8 @@ namespace Vocaluxe.Screens
|
|||||||
lines[i] = song.Notes.GetLines(i);
|
lines[i] = song.Notes.GetLines(i);
|
||||||
CLine[] line = lines[i].Line;
|
CLine[] line = lines[i].Line;
|
||||||
|
|
||||||
// find current line (it must be the same as in CalcFadingAlpha)
|
// find current line
|
||||||
int nr = -1;
|
int nr = FindCurrentLine(line, song);
|
||||||
for (int j = 0; j < line.Length; j++)
|
|
||||||
{
|
|
||||||
if (line[j].StartBeat <= _CurrentBeat)
|
|
||||||
{
|
|
||||||
if (CGame.GetTimeFromBeats(line[j].FirstNoteBeat, song.BPM) <= _CurrentTime - song.Gap + 10f)
|
|
||||||
{
|
|
||||||
nr = j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nr != -1)
|
if (nr != -1)
|
||||||
{
|
{
|
||||||
@@ -1048,18 +1062,8 @@ namespace Vocaluxe.Screens
|
|||||||
lines[i] = Song.Notes.GetLines(i);
|
lines[i] = Song.Notes.GetLines(i);
|
||||||
CLine[] line = lines[i].Line;
|
CLine[] line = lines[i].Line;
|
||||||
|
|
||||||
// find current line for lyric sub fading (it must be the same as in UpdateLyrics)
|
// find current line for lyric sub fading
|
||||||
int CurrentLineSub = 0;
|
int CurrentLineSub = FindCurrentLine(line, Song);
|
||||||
for (int j = 0; j < line.Length; j++)
|
|
||||||
{
|
|
||||||
if (line[j].StartBeat <= _CurrentBeat)
|
|
||||||
{
|
|
||||||
if (CGame.GetTimeFromBeats(line[j].FirstNoteBeat, Song.BPM) <= _CurrentTime - Song.Gap + 10f)
|
|
||||||
{
|
|
||||||
CurrentLineSub = j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// find current line for lyric main fading
|
// find current line for lyric main fading
|
||||||
int CurrentLine = 0;
|
int CurrentLine = 0;
|
||||||
|
|||||||
@@ -636,7 +636,7 @@ namespace Vocaluxe.Menu.SingNotes
|
|||||||
#region Methods
|
#region Methods
|
||||||
public void AddLine(CLine Line)
|
public void AddLine(CLine Line)
|
||||||
{
|
{
|
||||||
AddLine(Line, true);
|
AddLine(Line, false);
|
||||||
}
|
}
|
||||||
public void AddLine(CLine Line, bool updateTimings)
|
public void AddLine(CLine Line, bool updateTimings)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user