1
0

api_metadata.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #pragma once
  2. #include "foundation/dispatch.h"
  3. #include "foundation/error.h"
  4. #include "service/types.h"
  5. #include "nx/nxuri.h"
  6. #include "metadata/ifc_metadata.h"
  7. #include "metadata/ifc_metadata_editor.h"
  8. #include "metadata/MetadataKeys.h"
  9. // {63149C84-08DC-4EA0-9351-2B0CB263FE55}
  10. static const GUID metadataApiServiceGuid =
  11. { 0x63149c84, 0x8dc, 0x4ea0, { 0x93, 0x51, 0x2b, 0xc, 0xb2, 0x63, 0xfe, 0x55 } };
  12. // ----------------------------------------------------------------------------
  13. class NOVTABLE api_metadata: public Wasabi2::Dispatchable
  14. {
  15. protected:
  16. api_metadata() : Dispatchable(DISPATCHABLE_VERSION) {}
  17. ~api_metadata() {}
  18. public:
  19. static GUID GetServiceType() { return SVC_TYPE_UNIQUE; }
  20. static GUID GetServiceGUID() { return metadataApiServiceGuid; }
  21. ns_error_t RegisterField(nx_string_t field_name, int *field) { return Metadata_RegisterField(field_name, field); } // Register for a non standard metadata field name
  22. ns_error_t GetFieldKey(nx_string_t field_name, int *field) { return Metadata_GetFieldKey(field_name, field); } // Return the integer key of the current field
  23. ns_error_t GetFieldName(int field_key, nx_string_t *name) { return Metadata_GetFieldName(field_key, name); } // Return the field name when provided with the key
  24. ns_error_t GetGenre(uint8_t genre_id, nx_string_t *genre) { return Metadata_GetGenre(genre_id, genre); }
  25. ns_error_t GetGenreID(nx_string_t genre, uint8_t *genre_id) { return Metadata_GetGenreID(genre, genre_id); }
  26. ns_error_t SupportedFilename(nx_uri_t filename) { return Metadata_SupportedFilename(filename); }
  27. ns_error_t CreateMetadata(ifc_metadata **out_metadata, nx_uri_t filename) { return Metadata_CreateMetadata(out_metadata, filename); }
  28. ns_error_t CreateMetadataEditor(ifc_metadata_editor **out_metadata, nx_uri_t filename) { return Metadata_CreateMetadataEditor(out_metadata, filename); }
  29. enum
  30. {
  31. DISPATCHABLE_VERSION, // ToDo: Does this need to be set here?
  32. };
  33. protected:
  34. virtual ns_error_t WASABICALL Metadata_RegisterField(nx_string_t field_name, int *field)=0;
  35. virtual ns_error_t WASABICALL Metadata_GetFieldKey(nx_string_t field_name, int *field)=0;
  36. virtual ns_error_t WASABICALL Metadata_GetFieldName(int field_key, nx_string_t *name)=0;
  37. virtual ns_error_t WASABICALL Metadata_GetGenre(uint8_t genre_id, nx_string_t *genre)=0;
  38. virtual ns_error_t WASABICALL Metadata_GetGenreID(nx_string_t genre, uint8_t *genre_id)=0;
  39. virtual ns_error_t WASABICALL Metadata_SupportedFilename(nx_uri_t filename)=0;
  40. virtual ns_error_t WASABICALL Metadata_CreateMetadata(ifc_metadata **out_metadata, nx_uri_t filename)=0;
  41. virtual ns_error_t WASABICALL Metadata_CreateMetadataEditor(ifc_metadata_editor **out_metadata, nx_uri_t filename)=0;
  42. };