aboutsummaryrefslogtreecommitdiff
path: root/Src/Plugins/Library/ml_wire/Defaults.cpp
diff options
context:
space:
mode:
authorJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
committerJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
commit20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Plugins/Library/ml_wire/Defaults.cpp
parent537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff)
downloadwinamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz
Initial community commit
Diffstat (limited to 'Src/Plugins/Library/ml_wire/Defaults.cpp')
-rw-r--r--Src/Plugins/Library/ml_wire/Defaults.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/Src/Plugins/Library/ml_wire/Defaults.cpp b/Src/Plugins/Library/ml_wire/Defaults.cpp
new file mode 100644
index 00000000..8c8da669
--- /dev/null
+++ b/Src/Plugins/Library/ml_wire/Defaults.cpp
@@ -0,0 +1,40 @@
+#include "main.h"
+#include "Defaults.h"
+#include <shlobj.h>
+wchar_t defaultDownloadPath[MAX_PATH] = {0},
+ serviceUrl[1024] = {0};
+__time64_t updateTime = 60 /* 1 minute */ * 60 /* 1 hour */ * 24 /* 1 day */;
+int autoDownloadEpisodes = 1;
+bool autoUpdate = true;
+bool autoDownload = true;
+bool updateOnLaunch = false;
+bool needToMakePodcastsView=true;
+
+static BOOL UtilGetSpecialFolderPath( HWND hwnd, wchar_t *path, int folder )
+{
+ ITEMIDLIST *pidl; // Shell Item ID List ptr
+ IMalloc *imalloc; // Shell IMalloc interface ptr
+ BOOL result; // Return value
+
+ if ( SHGetSpecialFolderLocation( hwnd, folder, &pidl ) != NOERROR )
+ return FALSE;
+
+ result = SHGetPathFromIDList( pidl, path );
+
+ if ( SHGetMalloc( &imalloc ) == NOERROR )
+ {
+ imalloc->Free( pidl );
+ imalloc->Release();
+ }
+
+ return result;
+}
+
+void BuildDefaultDownloadPath( HWND hwnd )
+{
+ wchar_t defaultPath[ MAX_PATH ] = L"";
+ if ( !UtilGetSpecialFolderPath( hwnd, defaultPath, CSIDL_MYMUSIC ) )
+ UtilGetSpecialFolderPath( hwnd, defaultPath, CSIDL_PERSONAL );
+
+ lstrcpyn( defaultDownloadPath, defaultPath, MAX_PATH );
+} \ No newline at end of file