From 176b6f55ea539937a7ef17743fba84648c9f39e4 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sat, 30 Jul 2011 15:33:00 -0400 Subject: [PATCH] Remove #INSTRUMENTTRACK. It's guitar only. --- Docs/Changelog_SSCformat.txt | 3 +++ Docs/Changelog_sm5.txt | 3 +++ Docs/SimfileFormats/ssc_msd5.txt | 1 - src/AutoKeysounds.cpp | 20 ----------------- src/NotesLoaderSM.cpp | 23 -------------------- src/NotesLoaderSMA.cpp | 5 ----- src/NotesLoaderSSC.cpp | 5 ----- src/NotesWriterSSC.cpp | 8 ------- src/Song.cpp | 37 +------------------------------- src/Song.h | 19 +--------------- 10 files changed, 8 insertions(+), 116 deletions(-) diff --git a/Docs/Changelog_SSCformat.txt b/Docs/Changelog_SSCformat.txt index 75c9fe55ec..eedde716c3 100644 --- a/Docs/Changelog_SSCformat.txt +++ b/Docs/Changelog_SSCformat.txt @@ -9,6 +9,9 @@ change to JSON, but it is unsure if this will be done. Implement .ssc at your own risk. ________________________________________________________________________________ +[v0.78] - Wolfman2000 +* Remove the #INSTRUMENTTRACK tag. + [v0.77] - Wolfman2000 * Add the cache tag #STEPFILENAME to gain access to the proper #NOTES when required. diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index 65a8160661..50b2a88c47 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -11,6 +11,9 @@ StepMania 5.0 Preview 3 | 20110??? 2011/07/30 ---------- * [ProfileManager] Fix an issue when deleting recently created profiles. [AJ] +* Start removing anything related to Guitar mode. This was rushed in, and it + is not worth us keeping at this time. This also means the #INSTRUMENTTRACK + tag is no longer valid. [Wolfman2000] 2011/07/26 ---------- diff --git a/Docs/SimfileFormats/ssc_msd5.txt b/Docs/SimfileFormats/ssc_msd5.txt index b8e5a2aea3..cb65462186 100644 --- a/Docs/SimfileFormats/ssc_msd5.txt +++ b/Docs/SimfileFormats/ssc_msd5.txt @@ -13,7 +13,6 @@ #LYRICSPATH:; #CDTITLE:; #MUSIC:; -#INSTRUMENTTRACK:; #MUSICLENGTH:; #OFFSET:; #BPMS:; diff --git a/src/AutoKeysounds.cpp b/src/AutoKeysounds.cpp index b536a3aa95..932ab930d7 100644 --- a/src/AutoKeysounds.cpp +++ b/src/AutoKeysounds.cpp @@ -132,15 +132,6 @@ void AutoKeysounds::LoadTracks( const Song *pSong, RageSoundReader *&pShared, Ra if( !sMusicPath.empty() ) vsMusicFile.push_back( sMusicPath ); - FOREACH_ENUM( InstrumentTrack, it ) - { - if( it == InstrumentTrack_Guitar ) - continue; - if( pSong->HasInstrumentTrack(it) ) - vsMusicFile.push_back( pSong->GetInstrumentTrackPath(it) ); - } - - vector vpSounds; FOREACH( RString, vsMusicFile, s ) { @@ -174,17 +165,6 @@ void AutoKeysounds::LoadTracks( const Song *pSong, RageSoundReader *&pShared, Ra pShared = pSongReader; } - - if( pSong->HasInstrumentTrack(InstrumentTrack_Guitar) ) - { - RString sError; - RageSoundReader *pGuitarTrackReader = RageSoundReader_FileReader::OpenFile( pSong->GetInstrumentTrackPath(InstrumentTrack_Guitar), sError ); - // Load the buffering filter before the effects filters, so effects aren't delayed. - pGuitarTrackReader = new RageSoundReader_Extend( pGuitarTrackReader ); - pGuitarTrackReader = new RageSoundReader_ThreadedBuffer( pGuitarTrackReader ); - pPlayer1 = pGuitarTrackReader; - } - return; //if( pSongReader->GetNumChannels() <= 2 ) diff --git a/src/NotesLoaderSM.cpp b/src/NotesLoaderSM.cpp index 889fafe2ce..80760a8c07 100644 --- a/src/NotesLoaderSM.cpp +++ b/src/NotesLoaderSM.cpp @@ -179,23 +179,6 @@ void SMLoader::ProcessAttacks( AttackArray &attacks, MsdFile::value_t params ) } } -void SMLoader::ProcessInstrumentTracks( Song &out, const RString &sParam ) -{ - vector vs1; - split( sParam, ",", vs1 ); - FOREACH_CONST( RString, vs1, s ) - { - vector vs2; - split( *s, "=", vs2 ); - if( vs2.size() >= 2 ) - { - InstrumentTrack it = StringToInstrumentTrack( vs2[0] ); - if( it != InstrumentTrack_Invalid ) - out.m_sInstrumentTrackFile[it] = vs2[1]; - } - } -} - bool SMLoader::ProcessBPMs( TimingData &out, const RString line, const int rowsPerBeat ) { vector arrayBPMChangeExpressions; @@ -783,12 +766,6 @@ bool SMLoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCache { ProcessTickcounts(out.m_SongTiming, sParams[1]); } - - - else if( sValueName=="INSTRUMENTTRACK" ) - { - ProcessInstrumentTracks( out, sParams[1] ); - } else if( sValueName=="MUSICLENGTH" ) { diff --git a/src/NotesLoaderSMA.cpp b/src/NotesLoaderSMA.cpp index 293e7bff17..6e5e689c3a 100644 --- a/src/NotesLoaderSMA.cpp +++ b/src/NotesLoaderSMA.cpp @@ -224,11 +224,6 @@ bool SMALoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCach else if( sValueName=="MUSIC" ) out.m_sMusicFile = sParams[1]; - else if( sValueName=="INSTRUMENTTRACK" ) - { - SMLoader::ProcessInstrumentTracks( out, sParams[1] ); - } - else if( sValueName=="MUSICLENGTH" ) { continue; diff --git a/src/NotesLoaderSSC.cpp b/src/NotesLoaderSSC.cpp index bcefb97fad..1ee4c0164c 100644 --- a/src/NotesLoaderSSC.cpp +++ b/src/NotesLoaderSSC.cpp @@ -341,11 +341,6 @@ bool SSCLoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCach out.m_sMusicFile = sParams[1]; } - else if( sValueName=="INSTRUMENTTRACK" ) - { - SMLoader::ProcessInstrumentTracks( out, sParams[1] ); - } - else if( sValueName=="MUSICLENGTH" ) { if( !bFromCache ) diff --git a/src/NotesWriterSSC.cpp b/src/NotesWriterSSC.cpp index e341782478..932bfa3858 100644 --- a/src/NotesWriterSSC.cpp +++ b/src/NotesWriterSSC.cpp @@ -227,14 +227,6 @@ static void WriteGlobalTags( RageFile &f, const Song &out ) f.PutLine( ssprintf( "#CDTITLE:%s;", SmEscape(out.m_sCDTitleFile).c_str() ) ); f.PutLine( ssprintf( "#MUSIC:%s;", SmEscape(out.m_sMusicFile).c_str() ) ); - { - vector vs = out.GetInstrumentTracksToVectorString(); - if( !vs.empty() ) - { - RString s = join( ",", vs ); - f.PutLine( "#INSTRUMENTTRACK:" + s + ";\n" ); - } - } f.PutLine( ssprintf( "#OFFSET:%.6f;", out.m_SongTiming.m_fBeat0OffsetInSeconds ) ); f.PutLine( ssprintf( "#SAMPLESTART:%.6f;", out.m_fMusicSampleStartSeconds ) ); f.PutLine( ssprintf( "#SAMPLELENGTH:%.6f;", out.m_fMusicSampleLengthSeconds ) ); diff --git a/src/Song.cpp b/src/Song.cpp index 0ccf1d9762..4317d23f53 100644 --- a/src/Song.cpp +++ b/src/Song.cpp @@ -41,7 +41,7 @@ * @brief The internal version of the cache for StepMania. * * Increment this value to invalidate the current cache. */ -const int FILE_CACHE_VERSION = 198; +const int FILE_CACHE_VERSION = 199; /** @brief How long does a song sample last by default? */ const float DEFAULT_MUSIC_SAMPLE_LENGTH = 12.f; @@ -50,14 +50,6 @@ static Preference g_fLongVerSongSeconds( "LongVerSongSeconds", 60*2.5f ); static Preference g_fMarathonVerSongSeconds( "MarathonVerSongSeconds", 60*5.f ); static Preference g_BackUpAllSongSaves( "BackUpAllSongSaves", false ); -static const char *InstrumentTrackNames[] = { - "Guitar", - "Rhythm", - "Bass", -}; -XToString( InstrumentTrack ); -StringToX( InstrumentTrack ); - Song::Song() { FOREACH_BackgroundLayer( i ) @@ -454,9 +446,6 @@ void Song::TidyUpData( bool fromCache, bool duringCache ) ASSERT_M( m_sSongDir.Left(3) != "../", m_sSongDir ); // meaningless FixupPath( m_sSongDir, "" ); FixupPath( m_sMusicFile, m_sSongDir ); - FOREACH_ENUM( InstrumentTrack, i ) - if( !m_sInstrumentTrackFile[i].empty() ) - FixupPath( m_sInstrumentTrackFile[i], m_sSongDir ); FixupPath( m_sBannerFile, m_sSongDir ); //FixupPath( m_sJacketFile, m_sSongDir ); //FixupPath( m_sDiscFile, m_sSongDir ); @@ -1204,10 +1193,6 @@ bool Song::HasBanner() const { return m_sBannerFile != "" && IsAFile(GetBannerPath()); } -bool Song::HasInstrumentTrack( InstrumentTrack it ) const -{ - return m_sInstrumentTrackFile[it] != "" && IsAFile(GetInstrumentTrackPath(it)); -} bool Song::HasLyrics() const { return m_sLyricsFile != "" && IsAFile(GetLyricsPath()); @@ -1275,21 +1260,6 @@ vector Song::GetFGChanges1ToVectorString() const return this->GetChangesToVectorString(this->GetForegroundChanges()); } -vector Song::GetInstrumentTracksToVectorString() const -{ - vector ret; - FOREACH_ENUM(InstrumentTrack, it) - { - if (this->HasInstrumentTrack(it)) - { - ret.push_back(InstrumentTrackToString(it) - + "=" - + this->m_sInstrumentTrackFile[it]); - } - } - return ret; -} - RString GetSongAssetPath( RString sPath, const RString &sSongPath ) { if( sPath == "" ) @@ -1324,11 +1294,6 @@ RString Song::GetMusicPath() const return GetSongAssetPath( m_sMusicFile, m_sSongDir ); } -RString Song::GetInstrumentTrackPath( InstrumentTrack it ) const -{ - return GetSongAssetPath( m_sInstrumentTrackFile[it], m_sSongDir ); -} - RString Song::GetBannerPath() const { return GetSongAssetPath( m_sBannerFile, m_sSongDir ); diff --git a/src/Song.h b/src/Song.h index 5f17ad8969..462d405ffd 100644 --- a/src/Song.h +++ b/src/Song.h @@ -20,7 +20,7 @@ void FixupPath( RString &path, const RString &sSongPath ); RString GetSongAssetPath( RString sPath, const RString &sSongPath ); /** @brief The version of the .ssc file format. */ -const static float STEPFILE_VERSION_NUMBER = 0.77f; +const static float STEPFILE_VERSION_NUMBER = 0.78f; /** @brief How many edits for this song can each profile have? */ const int MAX_EDITS_PER_SONG_PER_PROFILE = 15; @@ -42,18 +42,6 @@ enum BackgroundLayer /** @brief A custom foreach loop for the different background layers. */ #define FOREACH_BackgroundLayer( bl ) FOREACH_ENUM( BackgroundLayer, bl ) -/** @brief The different instrument tracks for band type games. */ -enum InstrumentTrack -{ - InstrumentTrack_Guitar, - InstrumentTrack_Rhythm, - InstrumentTrack_Bass, - NUM_InstrumentTrack, - InstrumentTrack_Invalid -}; -const RString& InstrumentTrackToString( InstrumentTrack it ); -InstrumentTrack StringToInstrumentTrack( const RString& s ); - /** @brief The collection of lyrics for the Song. */ struct LyricSegment { @@ -225,7 +213,6 @@ public: RString m_sOrigin; // song origin (for .ssc format) RString m_sMusicFile; - RString m_sInstrumentTrackFile[NUM_InstrumentTrack]; /** @brief The length of the music file. */ float m_fMusicLengthSeconds; @@ -248,7 +235,6 @@ public: vector m_sAttackString; RString GetMusicPath() const; - RString GetInstrumentTrackPath( InstrumentTrack it ) const; RString GetBannerPath() const; //RString GetJacketPath() const; //RString GetCDImagePath() const; @@ -261,7 +247,6 @@ public: bool m_bHasMusic, m_bHasBanner, m_bHasBackground; bool HasMusic() const; - bool HasInstrumentTrack( InstrumentTrack it ) const; /** * @brief Does this song have a banner? * @return true if it does, false otherwise. */ @@ -331,8 +316,6 @@ public: vector GetBGChanges2ToVectorString() const; vector GetFGChanges1ToVectorString() const; - vector GetInstrumentTracksToVectorString() const; - /** * @brief The list of LyricSegments. *