aboutsummaryrefslogtreecommitdiff
path: root/Src/Winamp/PathsINI.cpp
diff options
context:
space:
mode:
authorJean-Francois Mauguit <jfmauguit@mac.com>2024-09-24 09:03:25 -0400
committerGitHub <noreply@github.com>2024-09-24 09:03:25 -0400
commitbab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Winamp/PathsINI.cpp
parent4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff)
parent20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff)
downloadwinamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/Winamp/PathsINI.cpp')
-rw-r--r--Src/Winamp/PathsINI.cpp64
1 files changed, 64 insertions, 0 deletions
diff --git a/Src/Winamp/PathsINI.cpp b/Src/Winamp/PathsINI.cpp
new file mode 100644
index 00000000..e0c59f0e
--- /dev/null
+++ b/Src/Winamp/PathsINI.cpp
@@ -0,0 +1,64 @@
+/** (c) Nullsoft, Inc. C O N F I D E N T I A L
+ ** Filename:
+ ** Project:
+ ** Description:
+ ** Author: Ben Allison benski@nullsoft.com
+ ** Created:
+ **/
+
+
+#include "main.h"
+#include "../nu/AutoWide.h"
+#include "../nu/AutoChar.h"
+#include "../nu/ns_wc.h"
+
+void LoadPathsIni()
+{
+ wchar_t pathsini[MAX_PATH] = {0};
+ wchar_t dir[1024] = {0};
+
+ PathCombineW(pathsini, PROGDIR, L"paths.ini");
+
+ GetPrivateProfileStringW(L"Winamp", L"inidir", L"", dir, 1024, pathsini);
+ if (dir[0])
+ {
+ ResolveEnvironmentVariables(dir, 1024);
+ config_setinidir(dir);
+ }
+
+ GetPrivateProfileStringW(L"Winamp", L"m3udir", L"", dir, 1024, pathsini);
+ if (dir[0])
+ {
+ ResolveEnvironmentVariables(dir, 1024);
+ config_setm3udir(dir);
+ }
+
+ GetPrivateProfileStringW(L"Winamp", L"m3ubase", L"", dir, 1024, pathsini);
+ if (dir[0])
+ {
+ ResolveEnvironmentVariables(dir, 1024);
+ config_setm3ubase(dir);
+ }
+
+ GetPrivateProfileStringW(L"Winamp", L"inifile", L"", dir, 1024, pathsini);
+ if (dir[0])
+ {
+ ResolveEnvironmentVariables(dir, 1024);
+ config_setinifile(dir);
+ }
+
+ GetPrivateProfileStringW(L"Winamp", L"class", L"", dir, 1024, pathsini);
+ if (dir[0])
+ {
+ ResolveEnvironmentVariables(dir, 1024);
+ StringCchCopyW(szAppName, 64, dir);
+ }
+
+ GetPrivateProfileStringW(L"Winamp", L"cwd", L"", dir, 1024, pathsini);
+ if (dir[0])
+ {
+ ResolveEnvironmentVariables(dir, 1024);
+ StringCchCopyW(config_cwd, MAX_PATH, dir);
+ //MultiByteToWideCharSZ(CP_ACP, 0, dir, -1, config_cwd, MAX_PATH);
+ }
+} \ No newline at end of file