ID3v2Metadata.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. #pragma once
  2. #include "metadata/metadata.h"
  3. #include "nsid3v2/nsid3v2.h"
  4. /* this class mimics ifc_metadata and ifc_metadata_editor, but doesn't inherit (because it's not given out directly) */
  5. class ID3v2Metadata
  6. {
  7. public:
  8. ID3v2Metadata();
  9. ~ID3v2Metadata();
  10. static int Initialize(api_metadata *metadata_api);
  11. int Initialize(nsid3v2_tag_t tag);
  12. /* ifc_metadata implementation */
  13. int WASABICALL Metadata_GetField(int field, unsigned int index, nx_string_t *value);
  14. int WASABICALL Metadata_GetInteger(int field, unsigned int index, int64_t *value);
  15. int WASABICALL Metadata_GetReal(int field, unsigned int index, double *value);
  16. int WASABICALL Metadata_GetArtwork(int field, unsigned int index, artwork_t *artwork, data_flags_t flags);
  17. /* ifc_metadata_editor implementation */
  18. int WASABICALL MetadataEditor_SetField(int field, unsigned int index, nx_string_t value);
  19. int WASABICALL MetadataEditor_SetArtwork(int field, unsigned int index, artwork_t *data, data_flags_t flags);
  20. private:
  21. nsid3v2_tag_t id3v2_tag;
  22. int GetGenre(int index, nx_string_t *value);
  23. static api_metadata *metadata_api;
  24. #ifdef __APPLE__
  25. CFNumberFormatterRef number_formatter;
  26. #endif
  27. };