readd 'm' shortcut

This commit is contained in:
Glenn Maynard
2003-03-05 02:38:17 +00:00
parent 7a4934980a
commit a448d15bd8
2 changed files with 18 additions and 5 deletions
+17 -5
View File
@@ -109,8 +109,12 @@ MiniMenuDefinition g_KeyboardShortcuts =
{ "F7/F8: Decrease/increase BPM at cur beat", false, 1, 0, {""} }, { "F7/F8: Decrease/increase BPM at cur beat", false, 1, 0, {""} },
{ "F9/F10: Decrease/increase stop at cur beat", false, 1, 0, {""} }, { "F9/F10: Decrease/increase stop at cur beat", false, 1, 0, {""} },
{ "F11/F12: Decrease/increase music offset", false, 1, 0, {""} }, { "F11/F12: Decrease/increase music offset", false, 1, 0, {""} },
/* XXX: This would be better as a single submenu, to let people tweak
* and play the sample several times (without having to re-enter the
* menu each time), so it doesn't use a whole bunch of hotkeys. */
{ "[ and ]: Decrease/increase sample music start", false, 1, 0, {""} }, { "[ and ]: Decrease/increase sample music start", false, 1, 0, {""} },
{ "{ and }: Decrease/increase sample music length", false, 1, 0, {""} }, { "{ and }: Decrease/increase sample music length", false, 1, 0, {""} },
{ "M: Play sample music", false, 1, 0, {""} },
} }
}; };
@@ -328,6 +332,15 @@ bool ScreenEdit::PlayTicks() const
return bAnyoneHasANote; return bAnyoneHasANote;
} }
void ScreenEdit::PlayPreviewMusic()
{
SOUNDMAN->PlayMusic("");
SOUNDMAN->PlayMusic( m_pSong->GetMusicPath(), false,
m_pSong->m_fMusicSampleStartSeconds,
m_pSong->m_fMusicSampleLengthSeconds,
1.5f );
}
void ScreenEdit::Update( float fDeltaTime ) void ScreenEdit::Update( float fDeltaTime )
{ {
if(m_soundMusic.IsPlaying()) if(m_soundMusic.IsPlaying())
@@ -889,6 +902,9 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
} }
} }
break; break;
case SDLK_m:
PlayPreviewMusic();
break;
case SDLK_p: case SDLK_p:
{ {
if( INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD,SDLK_LCTRL)) || if( INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD,SDLK_LCTRL)) ||
@@ -1208,11 +1224,7 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, int* iAnswers )
} }
break; break;
case play_preview_music: case play_preview_music:
SOUNDMAN->PlayMusic(""); PlayPreviewMusic();
SOUNDMAN->PlayMusic( m_pSong->GetMusicPath(), false,
m_pSong->m_fMusicSampleStartSeconds,
m_pSong->m_fMusicSampleLengthSeconds,
1.5f );
break; break;
case exit: case exit:
SCREENMAN->SetNewScreen( "ScreenEditMenu" ); SCREENMAN->SetNewScreen( "ScreenEditMenu" );
+1
View File
@@ -44,6 +44,7 @@ protected:
void TransitionFromRecordToEdit(); void TransitionFromRecordToEdit();
void TransitionToEdit(); void TransitionToEdit();
bool PlayTicks() const; bool PlayTicks() const;
void PlayPreviewMusic();
void OnSnapModeChange(); void OnSnapModeChange();
void MenuItemGainFocus( BitmapText* menuitem ); void MenuItemGainFocus( BitmapText* menuitem );