diff --git a/Docs/Changelog_SSCformat.txt b/Docs/Changelog_SSCformat.txt index b21c8c8ce1..643f4b60a0 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.82] - cerbo +* add #PREVIEWVID tag. (to load the preview video, like #PREVIEW tag in .sma) + [v0.81] - freem * add #JACKET, #CDIMAGE, and #DISCIMAGE tags. (similar to #BANNER, etc.) diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index 2c356f59a2..3e46d9e4a3 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -8,6 +8,10 @@ ________________________________________________________________________________ StepMania 5.0 alpha 1 | 20120108 -------------------------------------------------------------------------------- +2012/01/08 +---------- +* [Song] Add HasPreviewVid and GetPreviewVidPath lua binding [cerbo] + 2012/01/08 ---------- * [ScreenManager] Made AddScreenToTop take a second (optional) parameter for diff --git a/src/NotesLoaderSMA.cpp b/src/NotesLoaderSMA.cpp index 18450805c4..0921924afc 100644 --- a/src/NotesLoaderSMA.cpp +++ b/src/NotesLoaderSMA.cpp @@ -209,7 +209,7 @@ bool SMALoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCach out.m_sBackgroundFile = sParams[1]; else if( sValueName=="PREVIEW" ) - out.m_sPreviewBGFile = sParams[1]; + out.m_sPreviewVidFile = sParams[1]; // Save "#LYRICS" for later, so we can add an internal lyrics tag. else if( sValueName=="LYRICSPATH" ) diff --git a/src/NotesLoaderSSC.cpp b/src/NotesLoaderSSC.cpp index 2ec8c9dbe7..c55d556137 100644 --- a/src/NotesLoaderSSC.cpp +++ b/src/NotesLoaderSSC.cpp @@ -325,9 +325,9 @@ bool SSCLoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCach out.m_sBackgroundFile = sParams[1]; } - else if( sValueName=="PREVIEWBG" ) + else if( sValueName=="PREVIEWVID" ) { - out.m_sPreviewBGFile = sParams[1]; + out.m_sPreviewVidFile = sParams[1]; } else if( sValueName=="JACKET" ) diff --git a/src/NotesWriterSSC.cpp b/src/NotesWriterSSC.cpp index 646291fd08..476588536d 100644 --- a/src/NotesWriterSSC.cpp +++ b/src/NotesWriterSSC.cpp @@ -222,7 +222,7 @@ static void WriteGlobalTags( RageFile &f, const Song &out ) f.PutLine( ssprintf( "#CREDIT:%s;", SmEscape(out.m_sCredit).c_str() ) ); f.PutLine( ssprintf( "#BANNER:%s;", SmEscape(out.m_sBannerFile).c_str() ) ); f.PutLine( ssprintf( "#BACKGROUND:%s;", SmEscape(out.m_sBackgroundFile).c_str() ) ); - f.PutLine( ssprintf( "#PREVIEWBG:%s;", SmEscape(out.m_sPreviewBGFile).c_str() ) ); + f.PutLine( ssprintf( "#PREVIEWVID:%s;", SmEscape(out.m_sPreviewVidFile).c_str() ) ); f.PutLine( ssprintf( "#JACKET:%s;", SmEscape(out.m_sJacketFile).c_str() ) ); f.PutLine( ssprintf( "#CDIMAGE:%s;", SmEscape(out.m_sCDFile).c_str() ) ); f.PutLine( ssprintf( "#DISCIMAGE:%s;", SmEscape(out.m_sDiscFile).c_str() ) ); diff --git a/src/Song.cpp b/src/Song.cpp index 8c72817f67..527bc156bc 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 = 207; +const int FILE_CACHE_VERSION = 208; /** @brief How long does a song sample last by default? */ const float DEFAULT_MUSIC_SAMPLE_LENGTH = 12.f; @@ -1273,9 +1273,9 @@ bool Song::HasCDImage() const { return m_sCDFile != "" && IsAFile(GetCDImagePath()); } -bool Song::HasPreviewBG() const +bool Song::HasPreviewVid() const { - return m_sPreviewBGFile != "" && IsAFile(GetPreviewBGPath()); + return m_sPreviewVidFile != "" && IsAFile(GetPreviewVidPath()); } const vector &Song::GetBackgroundChanges( BackgroundLayer bl ) const @@ -1410,9 +1410,9 @@ RString Song::GetCDImagePath() const return GetSongAssetPath( m_sCDFile, m_sSongDir ); } -RString Song::GetPreviewBGPath() const +RString Song::GetPreviewVidPath() const { - return GetSongAssetPath( m_sPreviewBGFile, m_sSongDir ); + return GetSongAssetPath( m_sPreviewVidFile, m_sSongDir ); } RString Song::GetDisplayMainTitle() const @@ -1707,9 +1707,9 @@ public: lua_pushnil(L); return 1; } - static int GetPreviewBGPath( T* p, lua_State *L ) + static int GetPreviewVidPath( T* p, lua_State *L ) { - RString s = p->GetPreviewBGPath(); + RString s = p->GetPreviewVidPath(); if( !s.empty() ) lua_pushstring(L, s); else @@ -1837,7 +1837,7 @@ public: static int HasMusic( T* p, lua_State *L ) { lua_pushboolean(L, p->HasMusic()); return 1; } static int HasBanner( T* p, lua_State *L ) { lua_pushboolean(L, p->HasBanner()); return 1; } static int HasBackground( T* p, lua_State *L ) { lua_pushboolean(L, p->HasBackground()); return 1; } - static int HasPreviewBG( T* p, lua_State *L ) { lua_pushboolean(L, p->HasPreviewBG()); return 1; } + static int HasPreviewVid( T* p, lua_State *L ) { lua_pushboolean(L, p->HasPreviewVid()); return 1; } static int HasJacket( T* p, lua_State *L ) { lua_pushboolean(L, p->HasJacket()); return 1; } static int HasDisc( T* p, lua_State *L ) { lua_pushboolean(L, p->HasDisc()); return 1; } static int HasCDImage( T* p, lua_State *L ) { lua_pushboolean(L, p->HasCDImage()); return 1; } @@ -1994,8 +1994,8 @@ public: ADD_METHOD( IsDisplayBpmConstant ); ADD_METHOD( IsDisplayBpmRandom ); ADD_METHOD( ShowInDemonstrationAndRanking ); - ADD_METHOD( HasPreviewBG ); - ADD_METHOD( GetPreviewBGPath ); + ADD_METHOD( HasPreviewVid ); + ADD_METHOD( GetPreviewVidPath ); } }; diff --git a/src/Song.h b/src/Song.h index 0fe682262b..57f62bf8df 100644 --- a/src/Song.h +++ b/src/Song.h @@ -238,7 +238,7 @@ public: RString m_sLyricsFile; RString m_sBackgroundFile; RString m_sCDTitleFile; - RString m_sPreviewBGFile; + RString m_sPreviewVidFile; AttackArray m_Attacks; vector m_sAttackString; @@ -252,7 +252,7 @@ public: RString GetLyricsPath() const; RString GetBackgroundPath() const; RString GetCDTitlePath() const; - RString GetPreviewBGPath() const; + RString GetPreviewVidPath() const; // For loading only: bool m_bHasMusic, m_bHasBanner, m_bHasBackground; @@ -275,7 +275,7 @@ public: bool HasBGChanges() const; bool HasLyrics() const; bool HasAttacks() const; - bool HasPreviewBG() const; + bool HasPreviewVid() const; bool Matches(RString sGroup, RString sSong) const;