Allow converting delays to beats.
Just find a better song than Uprock to use this on.
This commit is contained in:
+22
-9
@@ -569,6 +569,8 @@ static MenuDef g_AreaMenu(
|
||||
MenuRowDef( ScreenEdit::shift_pauses_backward, "Shift all timing changes up", true, EditMode_Full, true, true, 0, NULL ),
|
||||
MenuRowDef(ScreenEdit::convert_pause_to_beat, "Convert pause to beats", true,
|
||||
EditMode_Full, true, true, 0, NULL ),
|
||||
MenuRowDef(ScreenEdit::convert_delay_to_beat, "Convert delay to beats", true,
|
||||
EditMode_Full, true, true, 0, NULL ),
|
||||
MenuRowDef( ScreenEdit::undo, "Undo", true, EditMode_Practice, true, true, 0, NULL ),
|
||||
MenuRowDef(ScreenEdit::clear_clipboard, "Clear clipboard", true,
|
||||
EditMode_Practice, true, true, 0, NULL )
|
||||
@@ -3856,18 +3858,29 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, const vector<int> &iAns
|
||||
break;
|
||||
|
||||
case convert_pause_to_beat:
|
||||
{
|
||||
// TODO: Convert both Delays and Stops at once.
|
||||
float fStopSeconds = GetAppropriateTiming().GetStopAtRow( BeatToNoteRow( GetBeat() ) );
|
||||
GetAppropriateTiming().SetStopAtBeat( GetBeat() , 0 );
|
||||
{
|
||||
float fStopSeconds = GetAppropriateTiming().GetStopAtRow(GetRow());
|
||||
GetAppropriateTiming().SetStopAtBeat( GetBeat() , 0 );
|
||||
|
||||
float fStopBeats = fStopSeconds * GetAppropriateTiming().GetBPMAtBeat( GetBeat() ) / 60;
|
||||
float fStopBeats = fStopSeconds * GetAppropriateTiming().GetBPMAtBeat( GetBeat() ) / 60;
|
||||
|
||||
// don't move the step from where it is, just move everything later
|
||||
NoteDataUtil::InsertRows( m_NoteDataEdit, BeatToNoteRow( GetBeat() ) + 1, BeatToNoteRow(fStopBeats) );
|
||||
GetAppropriateTiming().InsertRows( BeatToNoteRow( GetBeat() ) + 1, BeatToNoteRow(fStopBeats) );
|
||||
}
|
||||
// don't move the step from where it is, just move everything later
|
||||
NoteDataUtil::InsertRows( m_NoteDataEdit, GetRow() + 1, BeatToNoteRow(fStopBeats) );
|
||||
GetAppropriateTiming().InsertRows( GetRow() + 1, BeatToNoteRow(fStopBeats) );
|
||||
}
|
||||
break;
|
||||
case convert_delay_to_beat:
|
||||
{
|
||||
TimingData &timing = GetAppropriateTiming();
|
||||
float pause = timing.GetDelayAtRow(GetRow());
|
||||
timing.SetDelayAtRow(GetRow(), 0);
|
||||
|
||||
float pauseBeats = pause * timing.GetBPMAtBeat(GetBeat()) / 60;
|
||||
|
||||
NoteDataUtil::InsertRows(m_NoteDataEdit, GetRow(), BeatToNoteRow(pauseBeats));
|
||||
timing.InsertRows(GetRow(), BeatToNoteRow(pauseBeats));
|
||||
break;
|
||||
}
|
||||
case undo:
|
||||
Undo();
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user