diff options
author | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
---|---|---|
committer | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
commit | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Plugins/Input/in_swf/ExtendedFileInfo.cpp | |
parent | 537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff) | |
download | winamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz |
Initial community commit
Diffstat (limited to 'Src/Plugins/Input/in_swf/ExtendedFileInfo.cpp')
-rw-r--r-- | Src/Plugins/Input/in_swf/ExtendedFileInfo.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Src/Plugins/Input/in_swf/ExtendedFileInfo.cpp b/Src/Plugins/Input/in_swf/ExtendedFileInfo.cpp new file mode 100644 index 00000000..be0efd14 --- /dev/null +++ b/Src/Plugins/Input/in_swf/ExtendedFileInfo.cpp @@ -0,0 +1,41 @@ +#include "main.h" +#include "resource.h" +#include <shlwapi.h> +#include <strsafe.h> +#include "api.h" + +#define TESTKEYWORD(__keyword, __string)\ + (CSTR_EQUAL == CompareStringA(MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT),\ + NORM_IGNORECASE, (__keyword), -1, (__string), -1)) + +extern "C" __declspec( dllexport ) int winampGetExtendedFileInfoW(const wchar_t *fn, const char *data, wchar_t *dest, int destlen) +{ + if (TESTKEYWORD("type", data)) + { + if (NULL != dest) + { + int index = 0; + if (destlen > 1) + dest[index++] = L'1'; + dest[index] = L'\0'; + } + return 1; + } + else if (TESTKEYWORD("family", data)) + { + LPCWSTR e, p(NULL); + e = PathFindExtensionW(fn); + if (L'.' != *e) return 0; + e++; + + if (CSTR_EQUAL == CompareStringW(MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT), + NORM_IGNORECASE, e, -1, L"SWF", -1)) + { + if (S_OK == StringCchCopyW(dest, destlen, WASABI_API_LNGSTRINGW(IDS_FAMILY_STRING))) return 1; + //p = L"Shockwave Flash"; + } + //if (p && S_OK == StringCchCopyW(dest, destlen, p)) return 1; + return 0; + } + return 0; +}
\ No newline at end of file |