From 630168d64b21dcb336e1e3690dccba3ea60717f7 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Tue, 3 May 2011 09:18:31 -0400 Subject: [PATCH] [sm130futures] Allow editing more Song Info in menus. In this case, Beat 0 Offset, Music Sample Start, and Music Sample Length can be edited via Edit Song Info. --- Docs/Changelog_sm5.txt | 4 ++++ Themes/_fallback/Languages/en.ini | 6 +++++ src/ScreenEdit.cpp | 39 +++++++++++++++++++++++++++++++ src/ScreenEdit.h | 3 +++ 4 files changed, 52 insertions(+) diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index b605e0aa1b..911c512a32 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -8,6 +8,10 @@ ________________________________________________________________________________ StepMania 5.0 $NEXT | 20110xyy -------------------------------------------------------------------------------- +2011/05/03 +* [ScreenEdit] Allow changing the Beat 0 Offset, Music Sample Start, and + Music Sample Length via Edit Song Info menu. [Wolfman2000] + 2011/05/02 ---------- * [ScreenSelectMusic] Added NullScoreString metric. [AJ] diff --git a/Themes/_fallback/Languages/en.ini b/Themes/_fallback/Languages/en.ini index da117080d7..0847beabb8 100644 --- a/Themes/_fallback/Languages/en.ini +++ b/Themes/_fallback/Languages/en.ini @@ -790,6 +790,7 @@ Background=Background BarDrain=Bar Drain BatLives=Bat Lives Base Difficulty=Base Difficulty +Beat 0 Offset=Beat 0 Offset Bookkeeping=Bookkeeping Calibrate Machine Sync=Calibrate Audio Sync CPUSkill=CPU Skill @@ -942,6 +943,8 @@ Predicted Meter=Predicted Meter Preferences=Preferences PreloadSounds=Preload Sounds Premium=Premium +Preview Length=Preview Length +Preview Start=Preview Start Export Packages=Export Packages Profile=Profile Profiles=Profiles @@ -1230,11 +1233,14 @@ Enter a new credit.=Enter a new credit. Enter a new description.=Enter a new description. Enter a new chart style.=Enter a new chart style (e.g. "Pad", "Keyboard"). Enter the author who made this step pattern.=Enter the author who made this step pattern. +Enter the offset for the song.=Enter the beat 0 offset for the song. Enter a new last beat hint.=Enter a new last beat hint. Enter a new main title transliteration.=Enter a new main title transliteration. Enter a new main title.=Enter a new main title. Enter a new sub title transliteration.=Enter a new sub title transliteration. Enter a new sub title.=Enter a new sub title. +Enter a new preview start.=Enter when the music sample starts. +Enter a new preview length.=Enter how long the music sample lasts. Enter a new min BPM.=Enter the minimum displayed BPM. Enter a new max BPM.=Enter the maximum displayed BPM. 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. diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index e0430092f0..52e9c62ea0 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -547,7 +547,10 @@ static MenuDef g_SongInformation( MenuRowDef( ScreenEdit::main_title_transliteration, "Main title transliteration", true, EditMode_Practice, true, true, 0, NULL ), MenuRowDef( ScreenEdit::sub_title_transliteration, "Sub title transliteration", true, EditMode_Practice, true, true, 0, NULL ), MenuRowDef( ScreenEdit::artist_transliteration, "Artist transliteration", true, EditMode_Practice, true, true, 0, NULL ), + MenuRowDef( ScreenEdit::beat_0_offset, "Beat 0 Offset", true, EditMode_Full, true, true, 0, NULL ), MenuRowDef( ScreenEdit::last_beat_hint, "Last beat hint", true, EditMode_Full, true, true, 0, NULL ), + MenuRowDef( ScreenEdit::preview_start, "Preview Start", true, EditMode_Full, true, true, 0, NULL ), + MenuRowDef( ScreenEdit::preview_length, "Preview Length", true, EditMode_Full, true, true, 0, NULL ), MenuRowDef( ScreenEdit::display_bpm, "Display BPM", true, EditMode_Full, true, true, 0, "Actual", "Specified", "Random" ), MenuRowDef( ScreenEdit::min_bpm, "Min BPM", true, EditMode_Full, true, true, 0, NULL ), MenuRowDef( ScreenEdit::max_bpm, "Max BPM", true, EditMode_Full, true, true, 0, NULL ) @@ -3010,11 +3013,26 @@ static void ChangeArtistTranslit( const RString &sNew ) pSong->m_sArtistTranslit = sNew; } +static void ChangeBeat0Offset( const RString &sNew ) +{ + GAMESTATE->m_pCurSong->m_Timing.m_fBeat0OffsetInSeconds = StringToFloat( sNew ); +} + static void ChangeLastBeatHint( const RString &sNew ) { GAMESTATE->m_pCurSong->m_fSpecifiedLastBeat = StringToFloat( sNew ); } +static void ChangePreviewStart( const RString &sNew ) +{ + GAMESTATE->m_pCurSong->m_fMusicSampleStartSeconds = StringToFloat( sNew ); +} + +static void ChangePreviewLength( const RString &sNew ) +{ + GAMESTATE->m_pCurSong->m_fMusicSampleLengthSeconds = StringToFloat( sNew ); +} + static void ChangeMinBPM( const RString &sNew ) { GAMESTATE->m_pCurSong->m_fSpecifiedBPMMin = StringToFloat( sNew ); @@ -3215,7 +3233,10 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector &iAns g_SongInformation.rows[main_title_transliteration].SetOneUnthemedChoice( pSong->m_sMainTitleTranslit ); g_SongInformation.rows[sub_title_transliteration].SetOneUnthemedChoice( pSong->m_sSubTitleTranslit ); g_SongInformation.rows[artist_transliteration].SetOneUnthemedChoice( pSong->m_sArtistTranslit ); + g_SongInformation.rows[beat_0_offset].SetOneUnthemedChoice( ssprintf("%.5f", pSong->m_Timing.m_fBeat0OffsetInSeconds) ); g_SongInformation.rows[last_beat_hint].SetOneUnthemedChoice( ssprintf("%.5f", pSong->m_fSpecifiedLastBeat) ); + g_SongInformation.rows[preview_start].SetOneUnthemedChoice( ssprintf("%.5f", pSong->m_fMusicSampleStartSeconds) ); + g_SongInformation.rows[preview_length].SetOneUnthemedChoice( ssprintf("%.5f", pSong->m_fMusicSampleLengthSeconds) ); g_SongInformation.rows[display_bpm].iDefaultChoice = pSong->m_DisplayBPMType; g_SongInformation.rows[min_bpm].SetOneUnthemedChoice( ssprintf("%.5f", pSong->m_fSpecifiedBPMMin) ); g_SongInformation.rows[max_bpm].SetOneUnthemedChoice( ssprintf("%.5f", pSong->m_fSpecifiedBPMMax) ); @@ -3623,7 +3644,10 @@ static LocalizedString ENTER_CREDIT ("ScreenEdit","Enter a new credit."); static LocalizedString ENTER_MAIN_TITLE_TRANSLIT ("ScreenEdit","Enter a new main title transliteration."); static LocalizedString ENTER_SUB_TITLE_TRANSLIT ("ScreenEdit","Enter a new sub title transliteration."); static LocalizedString ENTER_ARTIST_TRANSLIT ("ScreenEdit","Enter a new artist transliteration."); +static LocalizedString ENTER_BEAT_0_OFFSET ("ScreenEdit","Enter the offset for the song."); static LocalizedString ENTER_LAST_BEAT_HINT ("ScreenEdit","Enter a new last beat hint."); +static LocalizedString ENTER_PREVIEW_START ("ScreenEdit","Enter a new preview start."); +static LocalizedString ENTER_PREVIEW_LENGTH ("ScreenEdit","Enter a new preview length."); static LocalizedString ENTER_MIN_BPM ("ScreenEdit","Enter a new min BPM."); static LocalizedString ENTER_MAX_BPM ("ScreenEdit","Enter a new max BPM."); void ScreenEdit::HandleSongInformationChoice( SongInformationChoice c, const vector &iAnswers ) @@ -3657,11 +3681,26 @@ void ScreenEdit::HandleSongInformationChoice( SongInformationChoice c, const vec case artist_transliteration: ScreenTextEntry::TextEntry( SM_None, ENTER_ARTIST_TRANSLIT, pSong->m_sArtistTranslit, 100, NULL, ChangeArtistTranslit, NULL ); break; + case beat_0_offset: + ScreenTextEntry::TextEntry( SM_None, ENTER_BEAT_0_OFFSET, + ssprintf("%.5f", pSong->m_Timing.m_fBeat0OffsetInSeconds), 20, + ScreenTextEntry::FloatValidate, ChangeBeat0Offset, NULL ); + break; case last_beat_hint: ScreenTextEntry::TextEntry( SM_None, ENTER_LAST_BEAT_HINT, ssprintf("%.5f", pSong->m_fSpecifiedLastBeat), 20, ScreenTextEntry::FloatValidate, ChangeLastBeatHint, NULL ); break; + case preview_start: + ScreenTextEntry::TextEntry( SM_None, ENTER_PREVIEW_START, + ssprintf("%.5f", pSong->m_fMusicSampleStartSeconds), 20, + ScreenTextEntry::FloatValidate, ChangePreviewStart, NULL ); + break; + case preview_length: + ScreenTextEntry::TextEntry( SM_None, ENTER_PREVIEW_LENGTH, + ssprintf("%.5f", pSong->m_fMusicSampleLengthSeconds), 20, + ScreenTextEntry::FloatValidate, ChangePreviewLength, NULL ); + break; case min_bpm: ScreenTextEntry::TextEntry( SM_None, ENTER_MIN_BPM, ssprintf("%.5f", pSong->m_fSpecifiedBPMMin), 20, diff --git a/src/ScreenEdit.h b/src/ScreenEdit.h index 664162fff4..c9bf604ffb 100644 --- a/src/ScreenEdit.h +++ b/src/ScreenEdit.h @@ -450,7 +450,10 @@ public: main_title_transliteration, sub_title_transliteration, artist_transliteration, + beat_0_offset, last_beat_hint, + preview_start, + preview_length, display_bpm, min_bpm, max_bpm,