Add a last beat hint. The real last beat will be at least as long as the hint.
This commit is contained in:
@@ -293,6 +293,9 @@ bool SMLoader::LoadFromSMFile( const RString &sPath, Song &out )
|
||||
continue;
|
||||
out.m_fMusicLengthSeconds = StringToFloat( sParams[1] );
|
||||
}
|
||||
|
||||
else if( sValueName=="LASTBEATHINT" )
|
||||
out.m_fSpecifiedLastBeat = StringToFloat( sParams[1] );
|
||||
|
||||
else if( sValueName=="MUSICBYTES" )
|
||||
; /* ignore */
|
||||
|
||||
@@ -54,6 +54,8 @@ void NotesWriterSM::WriteGlobalTags( RageFile &f, const Song &out )
|
||||
f.PutLine( ssprintf( "#OFFSET:%.3f;", out.m_Timing.m_fBeat0OffsetInSeconds ) );
|
||||
f.PutLine( ssprintf( "#SAMPLESTART:%.3f;", out.m_fMusicSampleStartSeconds ) );
|
||||
f.PutLine( ssprintf( "#SAMPLELENGTH:%.3f;", out.m_fMusicSampleLengthSeconds ) );
|
||||
if( out.m_fSpecifiedLastBeat > 0 )
|
||||
f.PutLine( ssprintf("#LASTBEATHINT:%.3f;", out.m_fSpecifiedLastBeat) );
|
||||
|
||||
f.Write( "#SELECTABLE:" );
|
||||
switch(out.m_SelectionDisplay) {
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include <set>
|
||||
#include <float.h>
|
||||
|
||||
const int FILE_CACHE_VERSION = 150; // increment this to invalidate cache
|
||||
const int FILE_CACHE_VERSION = 151; // increment this to invalidate cache
|
||||
|
||||
const float DEFAULT_MUSIC_SAMPLE_LENGTH = 12.f;
|
||||
|
||||
@@ -53,6 +53,7 @@ Song::Song()
|
||||
m_fMusicLengthSeconds = 0;
|
||||
m_fFirstBeat = -1;
|
||||
m_fLastBeat = -1;
|
||||
m_fSpecifiedLastBeat = -1;
|
||||
m_SelectionDisplay = SHOW_ALWAYS;
|
||||
m_DisplayBPMType = DISPLAY_ACTUAL;
|
||||
m_fSpecifiedBPMMin = 0;
|
||||
@@ -657,7 +658,7 @@ void Song::TranslateTitles()
|
||||
void Song::ReCalculateRadarValuesAndLastBeat()
|
||||
{
|
||||
float fFirstBeat = FLT_MAX; /* inf */
|
||||
float fLastBeat = 0;
|
||||
float fLastBeat = m_fSpecifiedLastBeat; // Make sure we're at least as long as the specified amount.
|
||||
|
||||
for( unsigned i=0; i<m_vpSteps.size(); i++ )
|
||||
{
|
||||
|
||||
@@ -117,6 +117,7 @@ public:
|
||||
float m_fMusicLengthSeconds;
|
||||
float m_fFirstBeat; // beat of first note
|
||||
float m_fLastBeat; // beat of last note
|
||||
float m_fSpecifiedLastBeat; // specified last beat of the song
|
||||
float m_fMusicSampleStartSeconds;
|
||||
float m_fMusicSampleLengthSeconds;
|
||||
enum { DISPLAY_ACTUAL, DISPLAY_SPECIFIED, DISPLAY_RANDOM } m_DisplayBPMType;
|
||||
|
||||
Reference in New Issue
Block a user