loop playback and record
This commit is contained in:
@@ -920,8 +920,12 @@ void ScreenEdit::Update( float fDeltaTime )
|
|||||||
fLastBeat = m_pSong->m_Timing.GetBeatFromElapsedTime( fSeconds + 0.5f );
|
fLastBeat = m_pSong->m_Timing.GetBeatFromElapsedTime( fSeconds + 0.5f );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( GAMESTATE->m_fSongBeat > fLastBeat )
|
float fStopAtSeconds = m_pSong->m_Timing.GetElapsedTimeFromBeat( NoteRowToBeat(m_iStopPlayingAt) ) + 1;
|
||||||
TransitionEditState( STATE_EDITING );
|
if( GAMESTATE->m_fMusicSeconds > fStopAtSeconds )
|
||||||
|
{
|
||||||
|
// loop
|
||||||
|
TransitionEditState( STATE_PLAYING );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1831,7 +1835,6 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
|||||||
case EDIT_BUTTON_RECORD_FROM_CURSOR:
|
case EDIT_BUTTON_RECORD_FROM_CURSOR:
|
||||||
m_iStartPlayingAt = BeatToNoteRow(GAMESTATE->m_fSongBeat);
|
m_iStartPlayingAt = BeatToNoteRow(GAMESTATE->m_fSongBeat);
|
||||||
m_iStopPlayingAt = m_NoteDataEdit.GetLastRow();
|
m_iStopPlayingAt = m_NoteDataEdit.GetLastRow();
|
||||||
m_iStopPlayingAt += BeatToNoteRow(4); // give a one measure lead out
|
|
||||||
TransitionEditState( STATE_RECORDING );
|
TransitionEditState( STATE_RECORDING );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -2039,6 +2042,8 @@ void ScreenEdit::TransitionEditState( EditState em )
|
|||||||
if( old == STATE_RECORDING_PAUSED && em == STATE_PLAYING )
|
if( old == STATE_RECORDING_PAUSED && em == STATE_PLAYING )
|
||||||
m_bReturnToRecordMenuAfterPlay = true;
|
m_bReturnToRecordMenuAfterPlay = true;
|
||||||
|
|
||||||
|
const bool bStateChanging = em != old;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
//
|
//
|
||||||
// If switching out of record, open the menu.
|
// If switching out of record, open the menu.
|
||||||
@@ -2062,6 +2067,8 @@ void ScreenEdit::TransitionEditState( EditState em )
|
|||||||
m_soundAssistTick.StopPlaying();
|
m_soundAssistTick.StopPlaying();
|
||||||
GAMESTATE->m_bGameplayLeadIn.Set( true );
|
GAMESTATE->m_bGameplayLeadIn.Set( true );
|
||||||
|
|
||||||
|
if( bStateChanging )
|
||||||
|
{
|
||||||
switch( old )
|
switch( old )
|
||||||
{
|
{
|
||||||
case STATE_EDITING:
|
case STATE_EDITING:
|
||||||
@@ -2085,6 +2092,7 @@ void ScreenEdit::TransitionEditState( EditState em )
|
|||||||
CheckNumberOfNotesAndUndo();
|
CheckNumberOfNotesAndUndo();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Set up player options for this mode. (EDITING uses m_PlayerStateEdit, which we
|
// Set up player options for this mode. (EDITING uses m_PlayerStateEdit, which we
|
||||||
@@ -2131,6 +2139,7 @@ void ScreenEdit::TransitionEditState( EditState em )
|
|||||||
case STATE_PLAYING:
|
case STATE_PLAYING:
|
||||||
case STATE_RECORDING:
|
case STATE_RECORDING:
|
||||||
{
|
{
|
||||||
|
if( bStateChanging )
|
||||||
AdjustSync::ResetOriginalSyncData();
|
AdjustSync::ResetOriginalSyncData();
|
||||||
|
|
||||||
/* Give a 1 second lead-in. If we're loading Player, this must be done first. */
|
/* Give a 1 second lead-in. If we're loading Player, this must be done first. */
|
||||||
@@ -2642,7 +2651,6 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector<int> &iAns
|
|||||||
{
|
{
|
||||||
m_iStartPlayingAt = 0;
|
m_iStartPlayingAt = 0;
|
||||||
m_iStopPlayingAt = m_NoteDataEdit.GetLastRow();
|
m_iStopPlayingAt = m_NoteDataEdit.GetLastRow();
|
||||||
m_iStopPlayingAt += BeatToNoteRow(4); // give a one measure lead out
|
|
||||||
TransitionEditState( STATE_PLAYING );
|
TransitionEditState( STATE_PLAYING );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -2650,7 +2658,6 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector<int> &iAns
|
|||||||
{
|
{
|
||||||
m_iStartPlayingAt = m_NoteFieldEdit.m_iBeginMarker;
|
m_iStartPlayingAt = m_NoteFieldEdit.m_iBeginMarker;
|
||||||
m_iStopPlayingAt = m_NoteDataEdit.GetLastRow();
|
m_iStopPlayingAt = m_NoteDataEdit.GetLastRow();
|
||||||
m_iStopPlayingAt += BeatToNoteRow(4); // give a one measure lead out
|
|
||||||
TransitionEditState( STATE_PLAYING );
|
TransitionEditState( STATE_PLAYING );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -2658,7 +2665,6 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector<int> &iAns
|
|||||||
{
|
{
|
||||||
m_iStartPlayingAt = BeatToNoteRow(GAMESTATE->m_fSongBeat);
|
m_iStartPlayingAt = BeatToNoteRow(GAMESTATE->m_fSongBeat);
|
||||||
m_iStopPlayingAt = m_NoteDataEdit.GetLastRow();
|
m_iStopPlayingAt = m_NoteDataEdit.GetLastRow();
|
||||||
m_iStopPlayingAt += BeatToNoteRow(4); // give a one measure lead out
|
|
||||||
TransitionEditState( STATE_PLAYING );
|
TransitionEditState( STATE_PLAYING );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user