diff options
author | k-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-05-28 22:35:34 +0000 |
---|---|---|
committer | k-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-05-28 22:35:34 +0000 |
commit | cafa9b8034cbff7f7c3507f3f1b0b03a2e5455f7 (patch) | |
tree | e8ad42f57d769e1a882ee509f709a38e5a5392ec | |
parent | 88f143268a1ad7bd2af9fbb721ca9045f857ca1b (diff) | |
download | usdx-cafa9b8034cbff7f7c3507f3f1b0b03a2e5455f7.tar.gz usdx-cafa9b8034cbff7f7c3507f3f1b0b03a2e5455f7.tar.xz usdx-cafa9b8034cbff7f7c3507f3f1b0b03a2e5455f7.zip |
add Music/Ultrastar Deluxe as a song folder.
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2424 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r-- | src/base/UPathUtils.pas | 5 | ||||
-rw-r--r-- | src/base/UPlatform.pas | 1 | ||||
-rw-r--r-- | src/base/UPlatformMacOSX.pas | 26 |
3 files changed, 26 insertions, 6 deletions
diff --git a/src/base/UPathUtils.pas b/src/base/UPathUtils.pas index c2bcdd4b..eb98302e 100644 --- a/src/base/UPathUtils.pas +++ b/src/base/UPathUtils.pas @@ -154,6 +154,7 @@ end; procedure InitializePaths; var SharedPath, UserPath: IPath; + MacOSXSongPath: IPath; begin // Log directory (must be writable) if (not FindPath(LogPath, Platform.GetLogPath, true)) then @@ -185,8 +186,12 @@ begin // Add song paths AddSongPath(Params.SongPath); +{$IF Defined(DARWIN)} + AddSongPath(Platform.GetMusicPath); +{$ELSE} AddSongPath(SharedPath.Append('songs')); AddSongPath(UserPath.Append('songs')); +{$IFEND} // Add category cover paths AddCoverPath(SharedPath.Append('covers')); diff --git a/src/base/UPlatform.pas b/src/base/UPlatform.pas index 11c67fa7..6d884979 100644 --- a/src/base/UPlatform.pas +++ b/src/base/UPlatform.pas @@ -51,6 +51,7 @@ type procedure Halt; virtual; function GetLogPath: IPath; virtual; abstract; + function GetMusicPath: IPath; virtual; abstract; function GetGameSharedPath: IPath; virtual; abstract; function GetGameUserPath: IPath; virtual; abstract; end; diff --git a/src/base/UPlatformMacOSX.pas b/src/base/UPlatformMacOSX.pas index 6f718bcd..7115a6b0 100644 --- a/src/base/UPlatformMacOSX.pas +++ b/src/base/UPlatformMacOSX.pas @@ -108,7 +108,10 @@ type *} procedure CreateUserFolders(); - function GetHomeDir(): IPath; + {** + * GetHomeDir returns the path to $HOME. + *} + function GetHomeDir: IPath; public {** @@ -126,8 +129,14 @@ type function GetLogPath: IPath; override; {** + * GetMusicPath returns the path for music. Currently it is set to + * $HOME/Music/UltraStar Deluxe/. + *} + function GetMusicPath: IPath; override; + + {** * GetGameSharedPath returns the path for shared resources. Currently it - * is set to /Library/Application Support/UltraStarDeluxe. + * is also set to $HOME/Library/Application Support/UltraStarDeluxe. * However it is not used. *} function GetGameSharedPath: IPath; override; @@ -135,7 +144,7 @@ type {** * GetGameUserPath returns the path for user resources. Currently it is * set to $HOME/Library/Application Support/UltraStarDeluxe. - * This is where a user can add songs, themes, .... + * This is where a user can add themes, .... *} function GetGameUserPath: IPath; override; end; @@ -251,19 +260,24 @@ begin Result := GetExecutionDir().GetParent().GetParent(); end; -function TPlatformMacOSX.GetHomeDir(): IPath; +function TPlatformMacOSX.GetHomeDir: IPath; begin Result := Path(GetEnvironmentVariable('HOME')); end; function TPlatformMacOSX.GetApplicationSupportPath: IPath; begin - Result := GetHomeDir().Append('Library/Application Support/UltraStarDeluxe', pdAppend); + Result := GetHomeDir.Append('Library/Application Support/UltraStarDeluxe', pdAppend); end; function TPlatformMacOSX.GetLogPath: IPath; begin - Result := GetHomeDir().Append('Library/Logs/UltraStar Deluxe', pdAppend); + Result := GetHomeDir.Append('Library/Logs/UltraStar Deluxe', pdAppend); +end; + +function TPlatformMacOSX.GetMusicPath: IPath; +begin + Result := GetHomeDir.Append('Music/UltraStar Deluxe', pdAppend); end; function TPlatformMacOSX.GetGameSharedPath: IPath; |