TagProvider.cpp 936 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /** (c) Nullsoft, Inc. C O N F I D E N T I A L
  2. ** Filename:
  3. ** Project:
  4. ** Description:
  5. ** Author: Ben Allison [email protected]
  6. ** Created:
  7. **/
  8. #include "main.h"
  9. #include "TagProvider.h"
  10. #include "tagz.h"
  11. /* --- TagProvider --- */
  12. wchar_t *TagProvider::GetTag(const wchar_t *name, ifc_tagparams *parameters)
  13. {
  14. const wchar_t *filename = (const wchar_t *)parameters->GetParameter(&filenameParameterID);
  15. if (!filename)
  16. return 0;
  17. wchar_t *tag = Winamp::GetTag(name, filename);
  18. if (tag == reinterpret_cast<wchar_t *>(-1))
  19. return 0;
  20. if (!tag)
  21. tag = Winamp::GetExtendedTag(name, filename);
  22. if (tag == reinterpret_cast<wchar_t *>(-1))
  23. return 0;
  24. return tag;
  25. }
  26. void TagProvider::FreeTag(wchar_t *tag)
  27. {
  28. free(tag);
  29. }
  30. #ifdef CBCLASS
  31. #undef CBCLASS
  32. #endif
  33. #define CBCLASS TagProvider
  34. START_DISPATCH;
  35. CB(IFC_TAGPROVIDER_GET_TAG, GetTag);
  36. VCB(IFC_TAGPROVIDER_FREE_TAG, FreeTag);
  37. END_DISPATCH;
  38. #undef CBCLASS