From a828ac3542c8ce3b9ab947731dac80b6d82c7e8c Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Tue, 27 Jul 2010 21:53:40 -0500 Subject: [PATCH] Allow editing of a Song's #GENRE tag within the editor. --- src/ScreenEdit.cpp | 12 ++++++++++++ src/ScreenEdit.h | 25 +++++++++++++++---------- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 850619dd8b..4a8be38124 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -567,6 +567,7 @@ static MenuDef g_SongInformation( MenuRowDef( ScreenEdit::main_title, "Main title", true, EditMode_Practice, true, true, 0, NULL ), MenuRowDef( ScreenEdit::sub_title, "Sub title", true, EditMode_Practice, true, true, 0, NULL ), MenuRowDef( ScreenEdit::artist, "Artist", true, EditMode_Practice, true, true, 0, NULL ), + MenuRowDef( ScreenEdit::genre, "Genre", true, EditMode_Practice, true, true, 0, NULL ), MenuRowDef( ScreenEdit::credit, "Credit", true, EditMode_Practice, true, true, 0, NULL ), 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 ), @@ -2869,6 +2870,12 @@ static void ChangeArtist( const RString &sNew ) pSong->m_sArtist = sNew; } +static void ChangeGenre( const RString &sNew ) +{ + Song* pSong = GAMESTATE->m_pCurSong; + pSong->m_sGenre = sNew; +} + static void ChangeCredit( const RString &sNew ) { Song* pSong = GAMESTATE->m_pCurSong; @@ -3081,6 +3088,7 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector &iAns g_SongInformation.rows[main_title].SetOneUnthemedChoice( pSong->m_sMainTitle ); g_SongInformation.rows[sub_title].SetOneUnthemedChoice( pSong->m_sSubTitle ); g_SongInformation.rows[artist].SetOneUnthemedChoice( pSong->m_sArtist ); + g_SongInformation.rows[genre].SetOneUnthemedChoice( pSong->m_sGenre ); g_SongInformation.rows[credit].SetOneUnthemedChoice( pSong->m_sCredit ); g_SongInformation.rows[main_title_transliteration].SetOneUnthemedChoice( pSong->m_sMainTitleTranslit ); g_SongInformation.rows[sub_title_transliteration].SetOneUnthemedChoice( pSong->m_sSubTitleTranslit ); @@ -3490,6 +3498,7 @@ void ScreenEdit::HandleStepsInformationChoice( StepsInformationChoice c, const v static LocalizedString ENTER_MAIN_TITLE ("ScreenEdit","Enter a new main title."); static LocalizedString ENTER_SUB_TITLE ("ScreenEdit","Enter a new sub title."); static LocalizedString ENTER_ARTIST ("ScreenEdit","Enter a new artist."); +static LocalizedString ENTER_GENRE ("ScreenEdit","Enter a new genre."); 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."); @@ -3513,6 +3522,9 @@ void ScreenEdit::HandleSongInformationChoice( SongInformationChoice c, const vec case artist: ScreenTextEntry::TextEntry( SM_None, ENTER_ARTIST, pSong->m_sArtist, 100, NULL, ChangeArtist, NULL ); break; + case genre: + ScreenTextEntry::TextEntry( SM_None, ENTER_GENRE, pSong->m_sGenre, 100, NULL, ChangeGenre, NULL ); + break; case credit: ScreenTextEntry::TextEntry( SM_None, ENTER_CREDIT, pSong->m_sCredit, 100, NULL, ChangeCredit, NULL ); break; diff --git a/src/ScreenEdit.h b/src/ScreenEdit.h index b403f4b2ad..a49c811ace 100644 --- a/src/ScreenEdit.h +++ b/src/ScreenEdit.h @@ -111,6 +111,10 @@ enum EditButton EDIT_BUTTON_BPM_DOWN, EDIT_BUTTON_STOP_UP, EDIT_BUTTON_STOP_DOWN, + /* + EDIT_BUTTON_DELAY_UP, + EDIT_BUTTON_DELAY_DOWN, + */ EDIT_BUTTON_OFFSET_UP, EDIT_BUTTON_OFFSET_DOWN, EDIT_BUTTON_SAMPLE_START_UP, @@ -185,8 +189,8 @@ public: virtual void HandleMessage( const Message &msg ); virtual void HandleScreenMessage( const ScreenMessage SM ); - void SetDirty( bool bDirty ) { m_bDirty = bDirty; } - bool IsDirty() const { return m_bDirty; } + void SetDirty( bool bDirty ) { m_bDirty = bDirty; } + bool IsDirty() const { return m_bDirty; } protected: virtual ScreenType GetScreenType() const { return m_EditState==STATE_PLAYING ? gameplay : ScreenWithMenuElements::GetScreenType(); } @@ -217,7 +221,7 @@ protected: Song* m_pSong; Steps* m_pSteps; - PlayerNumber m_InputPlayerNumber; + PlayerNumber m_InputPlayerNumber; PlayerState m_PlayerStateEdit; NoteField m_NoteFieldEdit; NoteData m_NoteDataEdit; @@ -226,21 +230,21 @@ protected: BitmapText m_textInputTips; void UpdateTextInfo(); - BitmapText m_textInfo; // status information that changes + BitmapText m_textInfo; // status information that changes bool m_bTextInfoNeedsUpdate; BitmapText m_textPlayRecordHelp; // keep track of where we are and what we're doing - float m_fTrailingBeat; // this approaches GAMESTATE->m_fSongBeat, which is the actual beat - /* The location we were at when shift was pressed, or - * -1 when shift isn't pressed: */ + float m_fTrailingBeat; // this approaches GAMESTATE->m_fSongBeat, which is the actual beat + // The location we were at when shift was pressed, or -1 when shift isn't pressed: int m_iShiftAnchor; NoteData m_Clipboard; bool m_bHasUndo; // TODO: convert this into a stack of NoteData objs for multi-state undo -aj NoteData m_Undo; + // TODO: also maybe have a redo stack/option -aj bool m_bDirty; @@ -277,12 +281,12 @@ protected: bool m_bReturnToRecordMenuAfterPlay; // for MODE_RECORD and MODE_PLAY - int m_iStartPlayingAt, m_iStopPlayingAt; + int m_iStartPlayingAt, m_iStopPlayingAt; float m_fBeatToReturnTo; - AutoKeysounds m_AutoKeysounds; + AutoKeysounds m_AutoKeysounds; RageSound *m_pSoundMusic; - GameplayAssist m_GameplayAssist; + GameplayAssist m_GameplayAssist; ThemeMetric EDIT_MODE; @@ -421,6 +425,7 @@ public: main_title, sub_title, artist, + genre, credit, main_title_transliteration, sub_title_transliteration,