diff --git a/src/MusicWheel.cpp b/src/MusicWheel.cpp index a286add578..6ef5313334 100644 --- a/src/MusicWheel.cpp +++ b/src/MusicWheel.cpp @@ -542,7 +542,6 @@ void MusicWheel::BuildWheelItemDatas( std::vector &arrayWh split( MODE_MENU_CHOICE_NAMES, ",", vsNames ); for( unsigned i=0; iTrace( "Adding mode menu item %s", vsNames[i].c_str() ); MusicWheelItemData wid( WheelItemDataType_Sort, nullptr, "", nullptr, nullptr, SORT_MENU_COLOR, 0 ); wid.m_pAction = HiddenPtr( new GameCommand ); wid.m_pAction->m_sName = vsNames[i]; @@ -756,13 +755,12 @@ void MusicWheel::BuildWheelItemDatas( std::vector &arrayWh for( unsigned i=0; i< arraySongs.size(); i++ ) { Song* pSong = arraySongs[i]; - Pack* pPack = pSong->GetPack(); + Group* pGroup = pSong->GetGroup(); if( bUseSections ) { - RString sThisSection = pSong->GetPack()->m_sSortTitle; - if (pPack->m_bHasPackIni) { - LOG->Trace("HE GOT DA INI"); - sThisSection = pPack->m_sGroupName; + RString sThisSection = pSong->GetGroup()->m_sSortTitle; + if (pGroup->m_bHasGroupIni) { + sThisSection = pGroup->m_sGroupName; } if( sThisSection != sLastSection ) { @@ -780,11 +778,11 @@ void MusicWheel::BuildWheelItemDatas( std::vector &arrayWh // todo: preferred sort section color handling? -aj RageColor colorSection = (so==SORT_GROUP) ? SONGMAN->GetSongGroupColor(sThisSection) : SECTION_COLORS.GetValue(iSectionColorIndex); iSectionColorIndex = (iSectionColorIndex+1) % NUM_SECTION_COLORS; - arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Section, nullptr, sThisSection, nullptr, pPack, colorSection, iSectionCount) ); + arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Section, nullptr, sThisSection, nullptr, pGroup, colorSection, iSectionCount) ); sLastSection = sThisSection; } } - arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Song, pSong, sLastSection, nullptr, pPack, SONGMAN->GetSongColor(pSong), 0) ); + arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Song, pSong, sLastSection, nullptr, pGroup, SONGMAN->GetSongColor(pSong), 0) ); } break; @@ -816,7 +814,7 @@ void MusicWheel::BuildWheelItemDatas( std::vector &arrayWh sLastSection = sThisSection; } } - arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Song, pSong, sLastSection, nullptr, pSong->GetPack(), SONGMAN->GetSongColor(pSong), 0) ); + arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Song, pSong, sLastSection, nullptr, pSong->GetGroup(), SONGMAN->GetSongColor(pSong), 0) ); } break; } diff --git a/src/MusicWheelItem.cpp b/src/MusicWheelItem.cpp index 20de79ef1e..7df82fc483 100644 --- a/src/MusicWheelItem.cpp +++ b/src/MusicWheelItem.cpp @@ -34,10 +34,10 @@ static const char *MusicWheelItemTypeNames[] = { XToString( MusicWheelItemType ); MusicWheelItemData::MusicWheelItemData( WheelItemDataType type, Song* pSong, - RString sSectionName, Course* pCourse, Pack* pPack, + RString sSectionName, Course* pCourse, Group* pGroup, RageColor color, int iSectionCount ): WheelItemBaseData(type, sSectionName, color), - m_pCourse(pCourse), m_pSong(pSong), m_pPack(pPack), m_Flags(WheelNotifyIcon::Flags()), + m_pCourse(pCourse), m_pSong(pSong), m_pGroup(pGroup), m_Flags(WheelNotifyIcon::Flags()), m_iSectionCount(iSectionCount), m_sLabel(""), m_pAction() {} MusicWheelItem::MusicWheelItem( RString sType ): @@ -222,14 +222,14 @@ void MusicWheelItem::LoadFromWheelItemData( const WheelItemBaseData *pData, int break; case WheelItemDataType_Section: { - if ( pWID->m_pPack == nullptr ) { + if ( pWID->m_pGroup == nullptr ) { sDisplayName = SONGMAN->ShortenGroupName(pWID->m_sText); } else { - if ( pWID->m_pPack->m_sSeries.empty() ) + if ( pWID->m_pGroup->m_sSeries.empty() ) sDisplayName = SONGMAN->ShortenGroupName(pWID->m_sText); else - sDisplayName = SONGMAN->ShortenGroupName("["+pWID->m_pPack->m_sSeries+"] "+pWID->m_pPack->m_sDisplayTitle); + sDisplayName = SONGMAN->ShortenGroupName("[" + pWID->m_pGroup->m_sSeries +"] " + pWID->m_pGroup->m_sDisplayTitle); } if( GAMESTATE->sExpandedSectionName == pWID->m_sText ) type = MusicWheelItemType_SectionExpanded; diff --git a/src/MusicWheelItem.h b/src/MusicWheelItem.h index b2f33cc6a9..1758cd8ecb 100644 --- a/src/MusicWheelItem.h +++ b/src/MusicWheelItem.h @@ -14,7 +14,7 @@ class Course; class Song; -struct Pack; +struct Group; struct MusicWheelItemData; @@ -64,15 +64,15 @@ private: struct MusicWheelItemData : public WheelItemBaseData { - MusicWheelItemData() : m_pCourse(nullptr), m_pSong(nullptr), m_pPack(nullptr), m_Flags(), + MusicWheelItemData() : m_pCourse(nullptr), m_pSong(nullptr), m_pGroup(nullptr), m_Flags(), m_iSectionCount(0), m_sLabel(""), m_pAction() { } MusicWheelItemData( WheelItemDataType type, Song* pSong, - RString sSectionName, Course* pCourse, Pack* pPack, + RString sSectionName, Course* pCourse, Group* pGroup, RageColor color, int iSectionCount ); Course* m_pCourse; Song* m_pSong; - Pack* m_pPack; + Group* m_pGroup; WheelNotifyIcon::Flags m_Flags; // for TYPE_SECTION diff --git a/src/Profile.cpp b/src/Profile.cpp index 26582cb01f..6c10efe8ff 100644 --- a/src/Profile.cpp +++ b/src/Profile.cpp @@ -1195,14 +1195,14 @@ void Profile::LoadSongsFromDir(RString const& dir, ProfileSlot prof_slot) RageTimer song_load_start_time; song_load_start_time.Touch(); FILEMAN->GetDirListing(songs_folder + "/*", song_folders, true, true); - Pack pack; - pack.m_sDisplayTitle = m_sDisplayName; - pack.m_sSortTitle = m_sDisplayName; - pack.m_sTranslitTitle = m_sDisplayName; - pack.m_sSeries = ""; - pack.m_iSyncOffset = 0; - pack.m_sPath = songs_folder; - pack.m_sGroupName = m_sDisplayName; + Group group; + group.m_sDisplayTitle = m_sDisplayName; + group.m_sSortTitle = m_sDisplayName; + group.m_sTranslitTitle = m_sDisplayName; + group.m_sSeries = ""; + group.m_iSyncOffset = 0; + group.m_sPath = songs_folder; + group.m_sGroupName = m_sDisplayName; StripCvsAndSvn(song_folders); StripMacResourceForks(song_folders); diff --git a/src/Song.cpp b/src/Song.cpp index 6bf953ee6b..638d722618 100644 --- a/src/Song.cpp +++ b/src/Song.cpp @@ -276,9 +276,9 @@ const RString &Song::GetSongFilePath() const * into Song.h, which is heavily used. */ static std::set BlacklistedImages; -Pack* Song::GetPack() const +Group* Song::GetGroup() const { - return SONGMAN->GetPackFromGroupName(m_sGroupName); + return SONGMAN->GetGroupFromName(m_sGroupName); } /* If PREFSMAN->m_bFastLoad is true, always load from cache if possible. @@ -462,14 +462,11 @@ bool Song::LoadFromSongDir(RString sDir, bool load_autosave, ProfileSlot from_pr return true; // do load this song } - - /* This function feels EXTREMELY hacky - copying things on top of pointers so * they don't break elsewhere. Maybe it could be rewritten to politely ask the * Song/Steps objects to reload themselves. -- djpohly */ bool Song::ReloadFromSongDir( RString sDir ) { - LOG->Trace("Reload From Song Dir Pack Test: %s", GetPack()->m_sGroupName.c_str()); // Remove the cache file to force the song to reload from its dir instead // of loading from the cache. -Kyz FILEMAN->Remove(GetCacheFilePath()); @@ -2565,4 +2562,4 @@ LUA_REGISTER_CLASS( Song ) * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. - */ + */ \ No newline at end of file diff --git a/src/Song.h b/src/Song.h index fcc8a9ce9a..bacbb7d7fd 100644 --- a/src/Song.h +++ b/src/Song.h @@ -65,7 +65,7 @@ struct LyricSegment }; -struct Pack +struct Group { RString m_sDisplayTitle; RString m_sSortTitle; @@ -74,7 +74,7 @@ struct Pack RString m_sTranslitTitle; RString m_sSeries; float m_iSyncOffset; - bool m_bHasPackIni; + bool m_bHasGroupIni; int iTotalSongs; RString m_sBannerPath; }; @@ -222,7 +222,7 @@ public: RString GetDisplayArtist() const; RString GetMainTitle() const; - Pack* GetPack() const; + Group* GetGroup() const; /** * @brief Retrieve the transliterated title, or the main title if there is no translit. diff --git a/src/SongManager.cpp b/src/SongManager.cpp index 0d3faff9f5..a7cef72047 100644 --- a/src/SongManager.cpp +++ b/src/SongManager.cpp @@ -267,7 +267,7 @@ void SongManager::SanityCheckGroupDir( RString sDir ) const } } -void SongManager::AddGroup( RString sDir, RString sGroupDirName, Pack pack ) +void SongManager::AddGroup( RString sDir, RString sGroupDirName, Group group ) { unsigned j; for(j = 0; j < m_sSongGroupNames.size(); ++j) @@ -281,10 +281,10 @@ void SongManager::AddGroup( RString sDir, RString sGroupDirName, Pack pack ) // Look for a group banner in this group folder std::vector arrayGroupBanners; - // First check if there is a banner provided in pack.ini - if( pack.m_sBannerPath != "" ) + // First check if there is a banner provided in group.ini + if( group.m_sBannerPath != "" ) { - GetDirListing( sDir+sGroupDirName+"/"+pack.m_sBannerPath, arrayGroupBanners ); + GetDirListing( sDir+sGroupDirName+"/"+group.m_sBannerPath, arrayGroupBanners ); } GetDirListing( sDir+sGroupDirName+"/*.png", arrayGroupBanners ); GetDirListing( sDir+sGroupDirName+"/*.jpg", arrayGroupBanners ); @@ -342,21 +342,21 @@ void SongManager::AddGroup( RString sDir, RString sGroupDirName, Pack pack ) m_sSongGroupNames.push_back( sGroupDirName ); m_sSongGroupBannerPaths.push_back( sBannerPath ); - if (m_mapGroupToPack.find(sGroupDirName) == m_mapGroupToPack.end()) + if (m_mapGroupsByName.find(sGroupDirName) == m_mapGroupsByName.end()) { - m_mapGroupToPack[sGroupDirName] = pack; + m_mapGroupsByName[sGroupDirName] = group; } else { - LOG->Trace("SongManager::AddGroup: Group %s already has a pack. Ignoring pack %s.", sGroupDirName.c_str(), pack.m_sDisplayTitle.c_str()); + LOG->Trace("SongManager::AddGroup: Group %s already has a group. Ignoring group %s.", sGroupDirName.c_str(), group.m_sDisplayTitle.c_str()); } - // Add the pack to its series if the pack has one and if the series exists - if( pack.m_sSeries != "" ) + // Add the group to its series if the group has one and if the series exists + if( group.m_sSeries != "" ) { - std::vector& series = m_mapSeries[pack.m_sSeries]; - if( std::find(series.begin(), series.end(), &pack) == series.end() ) - series.push_back(&pack); + std::vector& series = m_mapSeries[group.m_sSeries]; + if( std::find(series.begin(), series.end(), &group) == series.end() ) + series.push_back(&group); } //m_sSongGroupBackgroundPaths.push_back( sBackgroundPath ); } @@ -440,7 +440,7 @@ void SongManager::LoadSongDir( RString sDir, LoadingWindow *ld, bool onlyAdditio SongPointerVector& index_entry = m_mapSongGroupIndex[sGroupDirName]; RString group_base_name= Basename(sGroupDirName); - RString sGroupIniPath = sDir + sGroupDirName + "/pack.ini"; + RString sGroupIniPath = sDir + sGroupDirName + "/Group.ini"; RString sDisplayTitle = sGroupDirName; RString SortTitle = sGroupDirName; RString TranslitTitle = sGroupDirName; @@ -448,48 +448,49 @@ void SongManager::LoadSongDir( RString sDir, LoadingWindow *ld, bool onlyAdditio RString bannerPath = ""; float fOffset = 0; - Pack pack; + Group group; if( FILEMAN->DoesFileExist( sGroupIniPath ) && arraySongDirs.size() > 0 ) { - LOG->Trace("Loading pack.ini for \"%s\"", (sDir+sGroupDirName).c_str() ); IniFile ini; ini.ReadFile( sGroupIniPath ); ini.GetValue( "Group", "DisplayTitle", sDisplayTitle ); - if (sDisplayTitle.empty()) + if (sDisplayTitle.empty()) { sDisplayTitle = group_base_name; + } ini.GetValue( "Group", "Banner", bannerPath ); ini.GetValue( "Group", "SortTitle", SortTitle ); - if (SortTitle.empty()) + if (SortTitle.empty()) { SortTitle = sDisplayTitle; + } ini.GetValue( "Group", "TranslitTitle", TranslitTitle ); - if (TranslitTitle.empty()) + if (TranslitTitle.empty()) { TranslitTitle = sDisplayTitle; + } ini.GetValue( "Group", "Series", Series ); RString sValue = ""; + ini.GetValue( "Group", "SyncOffset", sValue ); - if( sValue.CompareNoCase("null")==0 ) + if( sValue.CompareNoCase("null")==0 ) { fOffset = 0; - else if ( sValue.CompareNoCase("itg")==0 ) + } else if ( sValue.CompareNoCase("itg")==0 ) { fOffset = 0.009f; - else + } else { fOffset = StringToFloat( sValue ); + } + LOG->Trace("Loaded group.ini for \"%s\"", (sDir+sGroupDirName).c_str() ); - LOG->Trace("Loaded pack.ini for \"%s\"", (sDir+sGroupDirName).c_str() ); - // LOG THE RECEIVED INFO - LOG->Trace("DisplayTitle: %s", sDisplayTitle.c_str()); - LOG->Trace("SortTitle: %s", SortTitle.c_str()); - pack.m_bHasPackIni = true; + group.m_bHasGroupIni = true; } else { - pack.m_bHasPackIni = false; + group.m_bHasGroupIni = false; } - pack.m_sDisplayTitle = sDisplayTitle; - pack.m_sSortTitle = SortTitle; - pack.m_sTranslitTitle = TranslitTitle; - pack.m_sSeries = Series; - pack.m_iSyncOffset = fOffset; - pack.m_sBannerPath = bannerPath; - pack.m_sPath = sDir + sGroupDirName; - pack.m_sGroupName = group_base_name; + group.m_sDisplayTitle = sDisplayTitle; + group.m_sSortTitle = SortTitle; + group.m_sTranslitTitle = TranslitTitle; + group.m_sSeries = Series; + group.m_iSyncOffset = fOffset; + group.m_sBannerPath = bannerPath; + group.m_sPath = sDir + sGroupDirName; + group.m_sGroupName = group_base_name; for( unsigned j=0; j< arraySongDirs.size(); ++j ) // for each song dir @@ -525,19 +526,19 @@ void SongManager::LoadSongDir( RString sDir, LoadingWindow *ld, bool onlyAdditio delete pNewSong; continue; } - // Apply Pack Offset if applicable - if( pack.m_iSyncOffset != 0 ) + // Apply Group Offset if applicable + if( group.m_iSyncOffset != 0 ) { - LOG->Trace("Applying pack offset of %i ms to \"%s\"", pack.m_iSyncOffset, pNewSong->GetSongDir().c_str() ); - pNewSong->m_SongTiming.m_fBeat0PackOffsetInSeconds = pack.m_iSyncOffset; + LOG->Trace("Applying group offset of %i ms to \"%s\"", group.m_iSyncOffset, pNewSong->GetSongDir().c_str() ); + pNewSong->m_SongTiming.m_fBeat0GroupOffsetInSeconds = group.m_iSyncOffset; const std::vector& vpSteps = pNewSong->GetAllSteps(); - for (Steps *s : vpSteps) + for (Steps* s : vpSteps) { // Empty TimingData means it's inherited // from the song and is already changed. if( s->m_Timing.empty() ) continue; - s->m_Timing.m_fBeat0PackOffsetInSeconds = pack.m_iSyncOffset; + s->m_Timing.m_fBeat0GroupOffsetInSeconds = group.m_iSyncOffset; } } @@ -554,10 +555,10 @@ void SongManager::LoadSongDir( RString sDir, LoadingWindow *ld, bool onlyAdditio // Don't add the group name if we didn't load any songs in this group. if(!loaded) continue; // Save amount of songs - pack.iTotalSongs = loaded; + group.iTotalSongs = loaded; // Add this group to the group array. - AddGroup(sDir, sGroupDirName, pack); + AddGroup(sDir, sGroupDirName, group); // Cache and load the group banner. (and background if it has one -aj) @@ -958,11 +959,11 @@ std::vector SongManager::GetPreferredSortSongsBySectionName( const RStrin return AddTo; } -Pack* SongManager::GetPackFromGroupName( const RString &sGroupName ) const +Group* SongManager::GetGroupFromName( const RString& sGroupName ) const { - std::map::const_iterator iter = m_mapGroupToPack.find( sGroupName ); - if( iter != m_mapGroupToPack.end() ) - return const_cast(&iter->second); + auto iter = m_mapGroupsByName.find( sGroupName ); + if( iter != m_mapGroupsByName.end() ) + return const_cast(&iter->second); return nullptr; } diff --git a/src/SongManager.h b/src/SongManager.h index bcf316a1e5..dbc1f6ce06 100644 --- a/src/SongManager.h +++ b/src/SongManager.h @@ -146,9 +146,9 @@ public: void GetPreferredSortSongs( std::vector &AddTo ) const; std::map> GetPreferredSortSongsMap() const { return m_mapPreferredSectionToSongs;}; RString SongToPreferredSortSectionName( const Song *pSong ) const; - std::map GetGroupPackMap() const { return m_mapGroupToPack;}; - std::map> GetSeriesPackMap() const { return m_mapSeries;}; - Pack* GetPackFromGroupName( const RString &sGroupName ) const; + std::map GetGroupGroupMap() const { return m_mapGroupsByName;}; + std::map> GetSeriesGroupMap() const { return m_mapSeries;}; + Group* GetGroupFromName( const RString &sGroupName ) const; std::vector GetPreferredSortSectionNames() const; std::vector GetPreferredSortSongsBySectionName( const RString &sSectionName ) const; void GetPreferredSortSongsBySectionName( const RString &sSectionName, std::vector &AddTo ) const; @@ -215,7 +215,7 @@ protected: void LoadSongDir( RString sDir, LoadingWindow *ld, bool onlyAdditions ); bool GetExtraStageInfoFromCourse( bool bExtra2, RString sPreferredGroup, Song*& pSongOut, Steps*& pStepsOut, StepsType stype ); void SanityCheckGroupDir( RString sDir ) const; - void AddGroup( RString sDir, RString sGroupDirName, Pack pack ); + void AddGroup( RString sDir, RString sGroupDirName, Group group ); int GetNumEditsLoadedFromProfile( ProfileSlot slot ) const; void AddSongToList(Song* new_song); @@ -247,8 +247,8 @@ protected: std::vector m_sSongGroupBannerPaths; // each song group may have a banner associated with it //vector m_sSongGroupBackgroundPaths; // each song group may have a background associated with it (very rarely) - std::map m_mapGroupToPack; - std::map> m_mapSeries; + std::map m_mapGroupsByName; + std::map> m_mapSeries; struct Comp { bool operator()(const RString& s, const RString &t) const { return CompareRStringsAsc(s,t); } }; typedef std::vector SongPointerVector; diff --git a/src/SongUtil.cpp b/src/SongUtil.cpp index 51dd983b66..32eaf3c595 100644 --- a/src/SongUtil.cpp +++ b/src/SongUtil.cpp @@ -596,12 +596,12 @@ void SongUtil::SortSongPointerArrayByGenre( std::vector &vpSongsInOut ) int SongUtil::CompareSongPointersByGroup(const Song *pSong1, const Song *pSong2) { // Check if the sort title exists - if( pSong1->GetPack()->m_sSortTitle.empty() || pSong2->GetPack()->m_sSortTitle.empty() ) { + if( pSong1->GetGroup()->m_sSortTitle.empty() || pSong2->GetGroup()->m_sSortTitle.empty() ) { // LOG the DEETS LOG->Warn("SongUtil::CompareSongPointersByGroup: Song %s or %s has an empty group name. Using group name instead.", pSong1->m_sSongName.c_str(), pSong2->m_sSongName.c_str()); return pSong1->m_sGroupName < pSong2->m_sGroupName; } else { - return pSong1->GetPack()->m_sSortTitle < pSong2->GetPack()->m_sSortTitle; + return pSong1->GetGroup()->m_sSortTitle < pSong2->GetGroup()->m_sSortTitle; } } @@ -609,8 +609,8 @@ static int CompareSongPointersByGroupAndTitle( const Song *pSong1, const Song *p { // Check if the sort title exists - const RString &sGroup1 = pSong1->GetPack()->m_sSortTitle; - const RString &sGroup2 = pSong2->GetPack()->m_sSortTitle; + const RString &sGroup1 = pSong1->GetGroup()->m_sSortTitle; + const RString &sGroup2 = pSong2->GetGroup()->m_sSortTitle; if( sGroup1 < sGroup2 ) return true; @@ -655,7 +655,7 @@ RString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so return SONGMAN->SongToPreferredSortSectionName( pSong ); case SORT_GROUP: // guaranteed not empty - return pSong->GetPack()->m_sSortTitle; + return pSong->GetGroup()->m_sSortTitle; case SORT_TITLE: case SORT_ARTIST: { diff --git a/src/TimingData.cpp b/src/TimingData.cpp index d432e825ac..f33b694f77 100644 --- a/src/TimingData.cpp +++ b/src/TimingData.cpp @@ -18,7 +18,7 @@ static const int INVALID_INDEX = -1; TimingSegment* GetSegmentAtRow( int iNoteRow, TimingSegmentType tst ); -TimingData::TimingData(float fOffset) : m_fBeat0OffsetInSeconds(fOffset), m_fBeat0PackOffsetInSeconds(0.0f) +TimingData::TimingData(float fOffset) : m_fBeat0OffsetInSeconds(fOffset), m_fBeat0GroupOffsetInSeconds(0.0f) { } @@ -28,7 +28,7 @@ void TimingData::Copy( const TimingData& cpy ) Clear(); m_fBeat0OffsetInSeconds = cpy.m_fBeat0OffsetInSeconds; - m_fBeat0PackOffsetInSeconds = cpy.m_fBeat0PackOffsetInSeconds; + m_fBeat0GroupOffsetInSeconds = cpy.m_fBeat0GroupOffsetInSeconds; m_sFile = cpy.m_sFile; FOREACH_TimingSegmentType( tst ) @@ -103,14 +103,14 @@ void TimingData::PrepareLookup() curr_segment < total_segments; curr_segment+= segments_per_lookup) { GetBeatStarts beat_start; - beat_start.last_time= -m_fBeat0OffsetInSeconds - m_fBeat0PackOffsetInSeconds; + beat_start.last_time= -m_fBeat0OffsetInSeconds - m_fBeat0GroupOffsetInSeconds; GetBeatArgs args; args.elapsed_time= FLT_MAX; GetBeatInternal(beat_start, args, curr_segment); m_beat_start_lookup.push_back(lookup_item_t(args.elapsed_time, beat_start)); GetBeatStarts time_start; - time_start.last_time= -m_fBeat0OffsetInSeconds - m_fBeat0PackOffsetInSeconds; + time_start.last_time= -m_fBeat0OffsetInSeconds - m_fBeat0GroupOffsetInSeconds; m_time_start_lookup.push_back(lookup_item_t(NoteRowToBeat(time_start.last_row), time_start)); } // If there are less than two entries, then FindEntryInLookup in lookup @@ -917,7 +917,7 @@ void TimingData::GetBeatInternal(GetBeatStarts& start, GetBeatArgs& args, void TimingData::GetBeatAndBPSFromElapsedTimeNoOffset(GetBeatArgs& args) const { GetBeatStarts start; - start.last_time= -m_fBeat0OffsetInSeconds - m_fBeat0PackOffsetInSeconds; + start.last_time= -m_fBeat0OffsetInSeconds - m_fBeat0GroupOffsetInSeconds; beat_start_lookup_t::const_iterator looked_up_start= FindEntryInLookup(m_beat_start_lookup, args.elapsed_time); if(looked_up_start != m_beat_start_lookup.end()) @@ -1002,7 +1002,7 @@ float TimingData::GetElapsedTimeFromBeat( float fBeat ) const float TimingData::GetElapsedTimeFromBeatNoOffset( float fBeat ) const { GetBeatStarts start; - start.last_time= -m_fBeat0OffsetInSeconds - m_fBeat0PackOffsetInSeconds; + start.last_time= -m_fBeat0OffsetInSeconds - m_fBeat0GroupOffsetInSeconds; beat_start_lookup_t::const_iterator looked_up_start= FindEntryInLookup(m_time_start_lookup, fBeat); if(looked_up_start != m_time_start_lookup.end()) diff --git a/src/TimingData.h b/src/TimingData.h index fc3ec33869..f009df8cc4 100644 --- a/src/TimingData.h +++ b/src/TimingData.h @@ -460,8 +460,8 @@ public: /** @brief The initial offset of a song. */ float m_fBeat0OffsetInSeconds; - /** @brief The offset applied to the song's entire pack */ - float m_fBeat0PackOffsetInSeconds; + /** @brief The offset applied to the song's entire group */ + float m_fBeat0GroupOffsetInSeconds; // XXX: this breaks encapsulation. get rid of it ASAP std::vector ToVectorString(TimingSegmentType tst, int dec = 6) const;