diff options
author | Jean-Francois Mauguit <jfmauguit@mac.com> | 2024-09-24 09:03:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-24 09:03:25 -0400 |
commit | bab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Wasabi/api/service/svccache.cpp | |
parent | 4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff) | |
parent | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff) | |
download | winamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz |
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/Wasabi/api/service/svccache.cpp')
-rw-r--r-- | Src/Wasabi/api/service/svccache.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Src/Wasabi/api/service/svccache.cpp b/Src/Wasabi/api/service/svccache.cpp new file mode 100644 index 00000000..af3e47cf --- /dev/null +++ b/Src/Wasabi/api/service/svccache.cpp @@ -0,0 +1,35 @@ +#include <precomp.h> +#include "svccache.h" +#include <bfc/string/bfcstring.h> + +#if !defined(WASABI_API_SVC) +#error no no +#endif + +SvcCache::SvcCache(FOURCC type) { + int p = 0; + list.setAutoSort(FALSE); + for (;;) { + waServiceFactory *svc = WASABI_API_SVC->service_enumService(type, p++); + if (svc == NULL) break; + const wchar_t *teststr = svc->getTestString(); + if (teststr == NULL || *teststr == '\0') continue; +//CUT DebugString("cachin %s\n", teststr); + list.addItem(svc); + } + list.setAutoSort(TRUE); +} + +waServiceFactory *SvcCache::findServiceFactory(const wchar_t *searchval) { + return list.findItem(searchval); +} + +int SvcCache::waServiceFactoryCompare::compareItem(waServiceFactory *p1, waServiceFactory* p2) { + int r = WCSICMP(p1->getTestString(), p2->getTestString()); + if (r == 0) return CMP3(p1, p2); + return r; +} + +int SvcCache::waServiceFactoryCompare::compareAttrib(const wchar_t *attrib, waServiceFactory *item) { + return WCSICMP(attrib, item->getTestString()); +} |