From af6491320a9aae9ec201831559d3654790d347cb Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Tue, 24 Apr 2007 03:15:00 +0000 Subject: [PATCH] add experimental lead track music file This should be generalized to allow named music tracks --- stepmania/src/Song.cpp | 17 ++++++++++++----- stepmania/src/song.h | 3 +++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index 8aa1e7948e..f99c05713b 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -33,7 +33,7 @@ #include #include -const int FILE_CACHE_VERSION = 151; // increment this to invalidate cache +const int FILE_CACHE_VERSION = 154; // increment this to invalidate cache const float DEFAULT_MUSIC_SAMPLE_LENGTH = 12.f; @@ -360,6 +360,7 @@ void Song::TidyUpData() ASSERT_M( m_sSongDir.Left(3) != "../", m_sSongDir ); /* meaningless */ FixupPath( m_sSongDir, "" ); FixupPath( m_sMusicFile, m_sSongDir ); + FixupPath( m_sLeadTrackFile, m_sSongDir ); FixupPath( m_sBannerFile, m_sSongDir ); FixupPath( m_sLyricsFile, m_sSongDir ); FixupPath( m_sBackgroundFile, m_sSongDir ); @@ -1039,10 +1040,11 @@ bool Song::HasMusic() const return m_sMusicFile != "" && IsAFile(GetMusicPath()); } -bool Song::HasBanner() const {return m_sBannerFile != "" && IsAFile(GetBannerPath()); } -bool Song::HasLyrics() const {return m_sLyricsFile != "" && IsAFile(GetLyricsPath()); } -bool Song::HasBackground() const {return m_sBackgroundFile != "" && IsAFile(GetBackgroundPath()); } -bool Song::HasCDTitle() const {return m_sCDTitleFile != "" && IsAFile(GetCDTitlePath()); } +bool Song::HasBanner() const {return m_sBannerFile != "" && IsAFile(GetBannerPath()); } +bool Song::HasLeadTrack() const {return m_sLeadTrackFile != "" && IsAFile(GetLeadTrackPath()); } +bool Song::HasLyrics() const {return m_sLyricsFile != "" && IsAFile(GetLyricsPath()); } +bool Song::HasBackground() const {return m_sBackgroundFile != "" && IsAFile(GetBackgroundPath()); } +bool Song::HasCDTitle() const {return m_sCDTitleFile != "" && IsAFile(GetCDTitlePath()); } bool Song::HasBGChanges() const { FOREACH_BackgroundLayer( i ) @@ -1107,6 +1109,11 @@ RString Song::GetMusicPath() const return GetSongAssetPath( m_sMusicFile, m_sSongDir ); } +RString Song::GetLeadTrackPath() const +{ + return GetSongAssetPath( m_sLeadTrackFile, m_sSongDir ); +} + RString Song::GetBannerPath() const { return GetSongAssetPath( m_sBannerFile, m_sSongDir ); diff --git a/stepmania/src/song.h b/stepmania/src/song.h index 5c767053a8..62ed410bad 100644 --- a/stepmania/src/song.h +++ b/stepmania/src/song.h @@ -113,6 +113,7 @@ public: RString m_sCredit; RString m_sMusicFile; + RString m_sLeadTrackFile; float m_fMusicLengthSeconds; float m_fFirstBeat; // beat of first note float m_fLastBeat; // beat of last note @@ -129,6 +130,7 @@ public: RString m_sCDTitleFile; RString GetMusicPath() const; + RString GetLeadTrackPath() const; RString GetBannerPath() const; RString GetLyricsPath() const; RString GetBackgroundPath() const; @@ -138,6 +140,7 @@ public: bool m_bHasMusic, m_bHasBanner; bool HasMusic() const; + bool HasLeadTrack() const; bool HasBanner() const; bool HasBackground() const; bool HasCDTitle() const;