本文整理汇总了C++中NoteData::GetLastRow方法的典型用法代码示例。如果您正苦于以下问题:C++ NoteData::GetLastRow方法的具体用法?C++ NoteData::GetLastRow怎么用?C++ NoteData::GetLastRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NoteData
的用法示例。
在下文中一共展示了NoteData::GetLastRow方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RemoveHoles
void KSFLoader::RemoveHoles( NoteData &out, const Song &song )
{
/* Start at the second BPM segment; the first one is already aligned. */
for( unsigned seg = 1; seg < song.m_Timing.m_BPMSegments.size(); ++seg )
{
// const float FromBeat = song.m_Timing.m_BPMSegments[seg].m_fStartBeat;
const float FromBeat = song.m_Timing.m_BPMSegments[seg].m_fStartBeat * song.m_BPMSegments[seg].m_fBPM / song.m_BPMSegments[0].m_fBPM;
const int FromRow = (int) BeatToNoteRow(FromBeat);
const int ToRow = (int) BeatToNoteRow(song.m_Timing.m_BPMSegments[seg].m_fStartBeat);
LOG->Trace("from %f (%i) to (%i)", FromBeat, FromRow, ToRow);
// const int ToRow = (int) roundf(FromRow * song.m_Timing.m_BPMSegments[0].m_fBPM / song.m_BPMSegments[seg].m_fBPM);
// const int Rows = out.GetLastRow() - FromRow + 1;
// int LastRow;
// if(seg+1 < song.m_Timing.m_BPMSegments().size())
// LastRow = (int) NoteRowToBeat( song.m_Timing.m_BPMSegments[seg+1].m_fStartBeat ) - 1;
// else
// LastRow = out.GetLastRow();
NoteData tmp;
tmp.SetNumTracks(out.GetNumTracks());
tmp.CopyRange( &out, FromRow, out.GetLastRow() );
out.ClearRange( FromRow, out.GetLastRow() );
out.CopyRange( &tmp, 0, tmp.GetLastRow(), ToRow );
}
/*
out.ConvertHoldNotesTo2sAnd3s();
for( t = 0; t < notedata.GetNumTracks(); ++t )
{
const float CurBPM = song.GetBPMAtBeat( NoteRowToBeat(row) );
song.m_Timing.m_BPMSegments.size()
for( int row = 0; row <= notedata.GetLastRow(); ++row )
{
TapNote tn = notedata.GetTapNote(t, row);
if( tn == TAP_EMPTY )
continue;
const int RealRow = (int) roundf(row * OrigBPM / CurBPM);
if( RealRow == row )
continue;
LOG->Trace("from %i to %i", row, RealRow);
notedata.SetTapNote( t, RealRow, tn );
notedata.SetTapNote( t, row, TAP_EMPTY );
}
}
out.Convert2sAnd3sToHoldNotes();
*/
}
示例2: DetermineStepsType
static StepsType DetermineStepsType( int iPlayer, const NoteData &nd, const RString &sPath )
{
ASSERT( NUM_PMS_TRACKS == nd.GetNumTracks() );
bool bTrackHasNote[NUM_NON_AUTO_KEYSOUND_TRACKS];
ZERO( bTrackHasNote );
int iLastRow = nd.GetLastRow();
for( int t=0; t<NUM_NON_AUTO_KEYSOUND_TRACKS; t++ )
{
for( int r=0; r<=iLastRow; r++ )
{
if( nd.GetTapNote(t, r).type != TapNote::empty )
{
bTrackHasNote[t] = true;
break;
}
}
}
int iNumNonEmptyTracks = 0;
for( int t=0; t<NUM_NON_AUTO_KEYSOUND_TRACKS; t++ )
if( bTrackHasNote[t] )
iNumNonEmptyTracks++;
switch( iPlayer )
{
case 1:
switch( iNumNonEmptyTracks )
{
case 5: return StepsType_popn_five;
case 9: return StepsType_popn_nine;
default: return StepsType_Invalid;
}
default:
LOG->UserLog( "Song file", sPath, "has an invalid #PLAYER value %d.", iPlayer );
return StepsType_Invalid;
}
}
示例3: DetermineStepsType
static StepsType DetermineStepsType( int iPlayer, const NoteData &nd, const RString &sPath )
{
ASSERT( NUM_BMS_TRACKS == nd.GetNumTracks() );
bool bTrackHasNote[NUM_NON_AUTO_KEYSOUND_TRACKS];
ZERO( bTrackHasNote );
int iLastRow = nd.GetLastRow();
for( int t=0; t<NUM_NON_AUTO_KEYSOUND_TRACKS; t++ )
{
for( int r=0; r<=iLastRow; r++ )
{
if( nd.GetTapNote(t, r).type != TapNote::empty )
{
bTrackHasNote[t] = true;
break;
}
}
}
int iNumNonEmptyTracks = 0;
for( int t=0; t<NUM_NON_AUTO_KEYSOUND_TRACKS; t++ )
if( bTrackHasNote[t] )
iNumNonEmptyTracks++;
switch( iPlayer )
{
case 1: // "1 player"
/* Track counts:
* 4 - dance 4-panel
* 5 - pop 5-key
* 6 - dance 6-panel, beat 5-key
* 8 - beat 7-key
* 9 - popn 9-key */
switch( iNumNonEmptyTracks )
{
case 4: return StepsType_dance_single;
case 5: return StepsType_popn_five;
case 6:
// FIXME: There's no way to distinguish between these types.
// They use the same tracks. Assume it's a Beat type since they
// are more common.
//return StepsType_dance_solo;
return StepsType_beat_single5;
case 8: return StepsType_beat_single7;
case 9: return StepsType_popn_nine;
default: return StepsType_Invalid;
}
case 2: // couple/battle
return StepsType_dance_couple;
case 3: // double
/* Track counts:
* 8 - dance Double
* 12 - beat Double 5-key
* 16 - beat Double 7-key */
switch( iNumNonEmptyTracks )
{
case 8: return StepsType_beat_single7;
case 12: return StepsType_beat_double5;
case 16: return StepsType_beat_double7;
default: return StepsType_Invalid;
}
default:
LOG->UserLog( "Song file", sPath, "has an invalid #PLAYER value %d.", iPlayer );
return StepsType_Invalid;
}
}