Basic support for symbolic song linking. Currently it duplicatly loads a song into the specified dir. The SONGNAME.include should be in whatever mix folder the link should appear in, and only have the tag of #LINK:Songs/mixfolder/songname; -- Unfortunatly since it is double-loading this song, this causes 2 scores to be saved, etc. Added m_bIsSymLink into the Song class so we can ID it as such, to exclude it from score writing/song enumeration and such. I kinda need some help makgin sure scores and all writable data are mapped back to the real song.
This commit is contained in:
@@ -101,6 +101,7 @@ Song::Song()
|
|||||||
m_DisplayBPMType = DISPLAY_ACTUAL;
|
m_DisplayBPMType = DISPLAY_ACTUAL;
|
||||||
m_fSpecifiedBPMMin = 0;
|
m_fSpecifiedBPMMin = 0;
|
||||||
m_fSpecifiedBPMMax = 0;
|
m_fSpecifiedBPMMax = 0;
|
||||||
|
m_bIsSymLink = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Song::~Song()
|
Song::~Song()
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#include "SongManager.h"
|
#include "SongManager.h"
|
||||||
#include "IniFile.h"
|
#include "IniFile.h"
|
||||||
#include "RageLog.h"
|
#include "RageLog.h"
|
||||||
|
#include "MsdFile.h"
|
||||||
#include "NotesLoaderDWI.h"
|
#include "NotesLoaderDWI.h"
|
||||||
#include "BannerCache.h"
|
#include "BannerCache.h"
|
||||||
#include "arch/arch.h"
|
#include "arch/arch.h"
|
||||||
@@ -255,6 +256,36 @@ void SongManager::LoadStepManiaSongDir( CString sDir, LoadingWindow *ld )
|
|||||||
|
|
||||||
/* Cache and load the group banner. */
|
/* Cache and load the group banner. */
|
||||||
BANNERCACHE->CacheBanner( GetGroupBannerPath(sGroupDirName) );
|
BANNERCACHE->CacheBanner( GetGroupBannerPath(sGroupDirName) );
|
||||||
|
|
||||||
|
/* Load the group sym links (if any)*/
|
||||||
|
LoadGroupSymLinks(sDir, sGroupDirName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SongManager::LoadGroupSymLinks(CString sDir, CString sGroupFolder)
|
||||||
|
{
|
||||||
|
// Find all symlink files in this folder
|
||||||
|
CStringArray arraySymLinks;
|
||||||
|
GetDirListing( sDir+sGroupFolder+SLASH+"*.include", arraySymLinks, false );
|
||||||
|
SortCStringArray( arraySymLinks );
|
||||||
|
for( unsigned s=0; s< arraySymLinks.size(); s++ ) // for each symlink in this dir, add it in as a song.
|
||||||
|
{
|
||||||
|
MsdFile msdF;
|
||||||
|
msdF.ReadFile( sDir+sGroupFolder+SLASH+arraySymLinks[s].c_str() );
|
||||||
|
CString sSymDestination = msdF.GetParam(0,1); // Should only be 1 vale¶m...period.
|
||||||
|
|
||||||
|
Song* pNewSong = new Song;
|
||||||
|
if( !pNewSong->LoadFromSongDir( sSymDestination ) )
|
||||||
|
delete pNewSong; // The song failed to load.
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pNewSong->m_apNotes.clear(); // No memory hogs..
|
||||||
|
pNewSong->m_BackgroundChanges.clear();
|
||||||
|
|
||||||
|
pNewSong->m_bIsSymLink = true; // Very important so we don't double-parse later
|
||||||
|
pNewSong->m_sGroupName = sGroupFolder;
|
||||||
|
m_pSongs.push_back( pNewSong );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ public:
|
|||||||
void InitSongsFromDisk( LoadingWindow *ld );
|
void InitSongsFromDisk( LoadingWindow *ld );
|
||||||
void FreeSongs();
|
void FreeSongs();
|
||||||
void CompressSongs();
|
void CompressSongs();
|
||||||
|
void LoadGroupSymLinks( CString sDir, CString sGroupFolder );
|
||||||
|
|
||||||
void InitCoursesFromDisk( LoadingWindow *ld );
|
void InitCoursesFromDisk( LoadingWindow *ld );
|
||||||
void InitAutogenCourses();
|
void InitAutogenCourses();
|
||||||
|
|||||||
@@ -111,6 +111,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
bool m_bChangedSinceSave;
|
bool m_bChangedSinceSave;
|
||||||
|
bool m_bIsSymLink;
|
||||||
|
|
||||||
CString m_sMainTitle, m_sSubTitle, m_sArtist;
|
CString m_sMainTitle, m_sSubTitle, m_sArtist;
|
||||||
CString m_sMainTitleTranslit, m_sSubTitleTranslit, m_sArtistTranslit;
|
CString m_sMainTitleTranslit, m_sSubTitleTranslit, m_sArtistTranslit;
|
||||||
|
|||||||
Reference in New Issue
Block a user