aboutsummaryrefslogtreecommitdiff
path: root/Src/Winamp/asx.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/Winamp/asx.cpp
parent537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff)
downloadwinamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz
Initial community commit
Diffstat (limited to 'Src/Winamp/asx.cpp')
-rw-r--r--Src/Winamp/asx.cpp63
1 files changed, 63 insertions, 0 deletions
diff --git a/Src/Winamp/asx.cpp b/Src/Winamp/asx.cpp
new file mode 100644
index 00000000..70ef4d17
--- /dev/null
+++ b/Src/Winamp/asx.cpp
@@ -0,0 +1,63 @@
+/** (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 "asx.h"
+#include "../jnetlib/api_httpget.h"
+#include "../nu/AutoChar.h"
+#include "WinampPlaylist.h"
+#include "../nu/AutoWide.h"
+#include "api.h"
+
+#if 0 // keep around for reference
+void ASXLoader::LoadFile(const char *filename)
+{
+ HANDLE file = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, NULL, NULL);
+
+ if (file == INVALID_HANDLE_VALUE)
+ return ;
+
+ char data[1024];
+ DWORD bytesRead;
+
+ // check for ASXv2
+ if (ReadFile(file, data, 11, &bytesRead, NULL) && bytesRead)
+ {
+ if (bytesRead == 11 && !_strnicmp((char *)data, "[Reference]", 11))
+ {
+ loadasxv2fn(filename, 1); // can pass 0 since loadasxfn() already took care of this
+ CloseHandle(file);
+ return ;
+ }
+ }
+ else
+ {
+ CloseHandle(file);
+ return ;
+ }
+ if (!parser)
+ {
+ CloseHandle(file);
+ return ;
+ }
+
+ GayASX_to_XML_converter(parser, data, bytesRead); // read the small amount we read when sniffing for asxv2
+
+ while (true)
+ {
+
+ if (ReadFile(file, data, 1024, &bytesRead, NULL) && bytesRead)
+ GayASX_to_XML_converter(parser, data, bytesRead);
+ else
+ break;
+ }
+
+ CloseHandle(file);
+ parser->xmlreader_feed(0, 0);
+}
+#endif
+