aboutsummaryrefslogtreecommitdiffstats
path: root/src/base
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/base/UPathUtils.pas5
-rw-r--r--src/base/UPlatform.pas1
-rw-r--r--src/base/UPlatformMacOSX.pas26
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;