diff --git a/Themes/_fallback/Languages/en.ini b/Themes/_fallback/Languages/en.ini index cf0de8bf02..58ebe40005 100644 --- a/Themes/_fallback/Languages/en.ini +++ b/Themes/_fallback/Languages/en.ini @@ -1516,7 +1516,7 @@ Enter the new track mapping.=Enter the new track mapping. Entry %d, '%d', is out of range 1 to %d.=Entry %d, '%d', is out of range 1 to %d. More than %d notes per measure is not allowed. This change has been reverted.=More than %d notes per measure is not allowed. This change has been reverted. No backgrounds available=No backgrounds available -EditHelpText=Up/Down:\n change beat\nLeft/Right:\n change snap\nNumber keys:\n add/remove\n tap note\nN and M keys:\n swap tap notes\nCtrl + N/M:\n swap cycled segment\nCtrl + ,/.:\n cycle segments\nCreate hold note:\n Hold a number\n while moving\n Up or Down\nCreate roll note:\n Hold Shift,\n then create a\n hold note.\nSpace bar: Set area\n marker\nT key: Switch Timing\nEnter: Area Menu\nA Key: Alter Menu\nEscape: Main Menu\nF4: Timing Menu\nF1: Show help\n +EditHelpText=Up/Down:\n change beat\nLeft/Right:\n change snap\nNumber keys:\n add/remove\n tap note\nN and M keys:\n swap tap notes\nCtrl + N/M:\n swap cycled segment\nCtrl + ,/.:\n cycle segments\nCreate hold note:\n Hold a number\n while moving\n Up or Down\nCreate roll note:\n Hold Shift,\n then create a\n hold note.\nSpace bar: Set area\n marker\nT key: Switch Timing\nEnter: Area Menu\nA Key: Alter Menu\nEscape: Main Menu\nF4: Timing Menu\nF1: Show help\nQ/M: Change record hold time.\nE/R: Toggle record holds PlayRecordHelpText=Press START to end Save successful.=Save successful. Saved as SM and DWI.=Saved as SM and DWI. @@ -1558,6 +1558,7 @@ Song Timing=Song Timing Beat 0 offset=Beat 0 offset Preview Start=Preview Start Preview Length=Preview Length +Record Hold Time=Record Hold Time Help=Help Info=Info Routine Player=Player diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index 9d961f7f39..96b18197ee 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -4034,10 +4034,10 @@ TimerSeconds=-1 EditModifiers="no reverse" EditHelpX=SCREEN_LEFT+4 EditHelpY=SCREEN_TOP+16 -EditHelpOnCommand=halign,0;valign,0;zoom,0.5;shadowlength,1 +EditHelpOnCommand=halign,0;valign,0;zoom,0.5;shadowlength,1;maxheight,(SCREEN_HEIGHT-32)*2 InfoX=SCREEN_RIGHT-128 InfoY=SCREEN_TOP+16 -InfoOnCommand=halign,0;valign,0;zoom,0.5;shadowlength,1 +InfoOnCommand=halign,0;valign,0;zoom,0.5;shadowlength,1;maxheight,(SCREEN_HEIGHT-32)*2 PlayRecordHelpX=SCREEN_LEFT+20 PlayRecordHelpY=SCREEN_BOTTOM-20 PlayRecordHelpOnCommand=halign,0;valign,0;shadowlength,1 @@ -4083,6 +4083,7 @@ TimingModeFormat="%s:\n %s\n" Beat0OffsetFormat="%s:\n %.3f secs\n" PreviewStartFormat="%s:\n %.3f secs\n" PreviewLengthFormat="%s:\n %.3f secs\n" +RecordHoldTimeFormat="%s:\n %.2f secs\n" FadeInPreview=0 FadeOutPreview=1.5 diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index f9d17bc839..506ace23cc 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -43,7 +43,8 @@ static Preference g_iDefaultRecordLength( "DefaultRecordLength", 4 ); static Preference g_bEditorShowBGChangesPlay( "EditorShowBGChangesPlay", true ); /** @brief How long must the button be held to generate a hold in record mode? */ -const float RECORD_HOLD_SECONDS = 0.3f; +const float record_hold_default= 0.3f; +float record_hold_seconds = record_hold_default; #define PLAYER_X (SCREEN_CENTER_X) #define PLAYER_Y (SCREEN_CENTER_Y) @@ -195,6 +196,11 @@ void ScreenEdit::InitEditMappings() name_to_edit_button["RECORD_FROM_CURSOR"]= EDIT_BUTTON_RECORD_FROM_CURSOR; name_to_edit_button["RECORD_SELECTION"]= EDIT_BUTTON_RECORD_SELECTION; + name_to_edit_button["RECORD_HOLD_RESET"]= EDIT_BUTTON_RECORD_HOLD_RESET; + name_to_edit_button["RECORD_HOLD_OFF"]= EDIT_BUTTON_RECORD_HOLD_OFF; + name_to_edit_button["RECORD_HOLD_MORE"]= EDIT_BUTTON_RECORD_HOLD_MORE; + name_to_edit_button["RECORD_HOLD_LESS"]= EDIT_BUTTON_RECORD_HOLD_LESS; + name_to_edit_button["RETURN_TO_EDIT"]= EDIT_BUTTON_RETURN_TO_EDIT; name_to_edit_button["INSERT"]= EDIT_BUTTON_INSERT; @@ -386,6 +392,11 @@ void ScreenEdit::InitEditMappings() m_EditMappingsDeviceInput.button[EDIT_BUTTON_DELETE_SHIFT_PAUSES][0] = DeviceInput(DEVICE_KEYBOARD, KEY_DEL); m_EditMappingsDeviceInput.hold[EDIT_BUTTON_DELETE_SHIFT_PAUSES][0] = DeviceInput(DEVICE_KEYBOARD, KEY_LCTRL); m_EditMappingsDeviceInput.hold[EDIT_BUTTON_DELETE_SHIFT_PAUSES][1] = DeviceInput(DEVICE_KEYBOARD, KEY_RCTRL); + + m_EditMappingsDeviceInput.button[EDIT_BUTTON_RECORD_HOLD_LESS][0]= DeviceInput(DEVICE_KEYBOARD, KEY_Cq); + m_EditMappingsDeviceInput.button[EDIT_BUTTON_RECORD_HOLD_MORE][0]= DeviceInput(DEVICE_KEYBOARD, KEY_Cw); + m_EditMappingsDeviceInput.button[EDIT_BUTTON_RECORD_HOLD_RESET][0]= DeviceInput(DEVICE_KEYBOARD, KEY_Ce); + m_EditMappingsDeviceInput.button[EDIT_BUTTON_RECORD_HOLD_OFF][0]= DeviceInput(DEVICE_KEYBOARD, KEY_Cr); break; default: break; } @@ -1548,7 +1559,7 @@ void ScreenEdit::Update( float fDeltaTime ) { m_NoteDataRecord.ClearRangeForTrack( BeatToNoteRow(fStartBeat), BeatToNoteRow(fEndBeat), t ); } - else if( fSecsHeld > RECORD_HOLD_SECONDS ) + else if( fSecsHeld > record_hold_seconds ) { // create or extend a hold or roll note TapNote tn = EditIsBeingPressed(EDIT_BUTTON_LAY_ROLL) ? TAP_ORIGINAL_ROLL_HEAD: TAP_ORIGINAL_HOLD_HEAD; @@ -1663,6 +1674,7 @@ static LocalizedString SONG_TIMING("ScreenEdit", "Song Timing"); static LocalizedString BEAT_0_OFFSET("ScreenEdit", "Beat 0 offset"); static LocalizedString PREVIEW_START("ScreenEdit", "Preview Start"); static LocalizedString PREVIEW_LENGTH("ScreenEdit", "Preview Length"); +static LocalizedString RECORD_HOLD_TIME("ScreenEdit", "Record Hold Time"); static ThemeMetric CURRENT_BEAT_FORMAT("ScreenEdit", "CurrentBeatFormat"); static ThemeMetric CURRENT_SECOND_FORMAT("ScreenEdit", "CurrentSecondFormat"); @@ -1700,6 +1712,7 @@ static ThemeMetric TIMING_MODE_FORMAT("ScreenEdit", "TimingModeFormat") static ThemeMetric BEAT_0_OFFSET_FORMAT("ScreenEdit", "Beat0OffsetFormat"); static ThemeMetric PREVIEW_START_FORMAT("ScreenEdit", "PreviewStartFormat"); static ThemeMetric PREVIEW_LENGTH_FORMAT("ScreenEdit", "PreviewLengthFormat"); +static ThemeMetric RECORD_HOLD_TIME_FORMAT("ScreenEdit", "RecordHoldTimeFormat"); void ScreenEdit::UpdateTextInfo() { if( m_pSteps == NULL ) @@ -1829,6 +1842,11 @@ void ScreenEdit::UpdateTextInfo() GetAppropriateTiming().m_fBeat0OffsetInSeconds ); sText += ssprintf( PREVIEW_START_FORMAT.GetValue(), PREVIEW_START.GetValue().c_str(), m_pSong->m_fMusicSampleStartSeconds ); sText += ssprintf( PREVIEW_LENGTH_FORMAT.GetValue(), PREVIEW_LENGTH.GetValue().c_str(), m_pSong->m_fMusicSampleLengthSeconds ); + if(record_hold_seconds < record_hold_default - .001f || + record_hold_seconds > record_hold_default + .001f) + { + sText += ssprintf(RECORD_HOLD_TIME_FORMAT.GetValue(), RECORD_HOLD_TIME.GetValue().c_str(), record_hold_seconds); + } break; } @@ -2870,6 +2888,26 @@ bool ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) SCREENMAN->PlayInvalidSound(); return true; + case EDIT_BUTTON_RECORD_HOLD_LESS: + record_hold_seconds-= .01f; + if(record_hold_seconds <= 0.0f) + { + record_hold_seconds= 0.0f; + } + return true; + + case EDIT_BUTTON_RECORD_HOLD_MORE: + record_hold_seconds+= .01f; + return true; + + case EDIT_BUTTON_RECORD_HOLD_RESET: + record_hold_seconds= record_hold_default; + return true; + + case EDIT_BUTTON_RECORD_HOLD_OFF: + record_hold_seconds= 120.0f; + return true; + case EDIT_BUTTON_SAVE: HandleMainMenuChoice( ScreenEdit::save ); return true; diff --git a/src/ScreenEdit.h b/src/ScreenEdit.h index d9de73739d..73958de654 100644 --- a/src/ScreenEdit.h +++ b/src/ScreenEdit.h @@ -114,6 +114,11 @@ enum EditButton EDIT_BUTTON_RECORD_FROM_CURSOR, EDIT_BUTTON_RECORD_SELECTION, + EDIT_BUTTON_RECORD_HOLD_RESET, + EDIT_BUTTON_RECORD_HOLD_OFF, + EDIT_BUTTON_RECORD_HOLD_MORE, + EDIT_BUTTON_RECORD_HOLD_LESS, + EDIT_BUTTON_RETURN_TO_EDIT, EDIT_BUTTON_INSERT,