JSAPI2_MediaCore.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #pragma once
  2. #include <ocidl.h>
  3. #include <vector>
  4. #include <string>
  5. #include "../nu/AutoLock.h"
  6. #include "JSAPI_Info.h"
  7. namespace JSAPI2
  8. {
  9. class MediaCoreAPI : public IDispatch
  10. {
  11. public:
  12. MediaCoreAPI(const wchar_t *_key, JSAPI::ifc_info *info);
  13. ~MediaCoreAPI();
  14. STDMETHOD(QueryInterface)(REFIID riid, PVOID *ppvObject);
  15. STDMETHOD_(ULONG, AddRef)(void);
  16. STDMETHOD_(ULONG, Release)(void);
  17. // *** IDispatch Methods ***
  18. STDMETHOD (GetIDsOfNames)(REFIID riid, OLECHAR FAR* FAR* rgszNames, unsigned int cNames, LCID lcid, DISPID FAR* rgdispid);
  19. STDMETHOD (GetTypeInfo)(unsigned int itinfo, LCID lcid, ITypeInfo FAR* FAR* pptinfo);
  20. STDMETHOD (GetTypeInfoCount)(unsigned int FAR * pctinfo);
  21. STDMETHOD (Invoke)(DISPID dispid, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS FAR *pdispparams, VARIANT FAR *pvarResult, EXCEPINFO FAR * pexecinfo, unsigned int FAR *puArgErr);
  22. /* For CallbackManager */
  23. bool OverrideMetadata(const wchar_t *filename, const wchar_t *tag, wchar_t *out, size_t outCch);
  24. private:
  25. const wchar_t *key;
  26. volatile LONG refCount;
  27. JSAPI::ifc_info *info;
  28. struct metadata_info
  29. {
  30. std::wstring url;
  31. std::wstring tag;
  32. std::wstring metadata;
  33. };
  34. typedef std::vector<metadata_info> MetadataMap;
  35. MetadataMap metadataMap;
  36. Nullsoft::Utility::LockGuard metadataGuard;
  37. STDMETHOD (IsRegisteredExtension)(WORD wFlags, DISPPARAMS FAR *pdispparams, VARIANT FAR *pvarResult, unsigned int FAR *puArgErr);
  38. STDMETHOD (GetMetadata)(WORD wFlags, DISPPARAMS FAR *pdispparams, VARIANT FAR *pvarResult, unsigned int FAR *puArgErr);
  39. STDMETHOD (AddMetadataHook)(WORD wFlags, DISPPARAMS FAR *pdispparams, VARIANT FAR *pvarResult, unsigned int FAR *puArgErr);
  40. STDMETHOD (RemoveMetadataHook)(WORD wFlags, DISPPARAMS FAR *pdispparams, VARIANT FAR *pvarResult, unsigned int FAR *puArgErr);
  41. void RemoveMetadataHook(const wchar_t *filename);
  42. void RemoveMetadataHook(const wchar_t *filename, const wchar_t *tag);
  43. };
  44. }