metacb.h 1010 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #pragma once
  2. #include <api/syscb/callbacks/syscbi.h>
  3. namespace MetadataCallback {
  4. enum {
  5. FILE_UPDATED = 10,
  6. ART_UPDATED = 20,
  7. FILE_MAY_UPDATE = 30,
  8. };
  9. };
  10. #define METADATACALLBACK_PARENT SysCallbackI
  11. class MetadataCallbackI : public METADATACALLBACK_PARENT
  12. {
  13. protected:
  14. MetadataCallbackI() { }
  15. public:
  16. virtual void metacb_FileUpdated(const wchar_t *filename) { }
  17. virtual void metacb_ArtUpdated(const wchar_t *filename) { }
  18. virtual void metacb_FileMayUpdate(const wchar_t *filename) { }
  19. private:
  20. virtual FOURCC syscb_getEventType() { return SysCallback::META; }
  21. virtual int syscb_notify(int msg, intptr_t param1, intptr_t param2) {
  22. switch (msg) {
  23. case MetadataCallback::FILE_UPDATED:
  24. metacb_FileUpdated((const wchar_t *)param1);
  25. break;
  26. case MetadataCallback::ART_UPDATED:
  27. metacb_ArtUpdated((const wchar_t *)param1);
  28. break;
  29. case MetadataCallback::FILE_MAY_UPDATE:
  30. metacb_FileMayUpdate((const wchar_t *)param1);
  31. break;
  32. default: return 0;
  33. }
  34. return 1;
  35. }
  36. };