1
0

Main.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #ifndef NULLSOFT_MAINH
  2. #define NULLSOFT_MAINH
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <wtypes.h>
  7. #include "../../General/gen_ml/ml.h"
  8. #include "./common.h"
  9. #include <string>
  10. #include <vector>
  11. #include "../nu/AutoLock.h"
  12. #define PLUGIN_VERSION_MAJOR 2
  13. #define PLUGIN_VERSION_MINOR 03
  14. HINSTANCE Plugin_GetInstance(void);
  15. HWND Plugin_GetWinamp(void);
  16. HWND Plugin_GetLibrary(void);
  17. class Navigation;
  18. HRESULT Plugin_GetNavigation(Navigation **instance);
  19. typedef void (CALLBACK *PLUGINUNLOADCALLBACK)(void);
  20. void Plugin_RegisterUnloadCallback(PLUGINUNLOADCALLBACK callback);
  21. extern int winampVersion;
  22. #define MUTEX_T CRITICAL_SECTION
  23. #define MUTEX_ENTER(n) EnterCriticalSection(&(n))
  24. #define MUTEX_LEAVE(n) LeaveCriticalSection(&(n))
  25. #define MUTEX_INIT(n) InitializeCriticalSection(&(n))
  26. #define MUTEX_DEL(n) DeleteCriticalSection(&(n))
  27. #define FILECACHEVERSION 0x00000001
  28. typedef struct FileCacheType {
  29. INT64 version;
  30. INT64 expires;
  31. INT64 urllen;
  32. INT64 datalen;
  33. INT64 resv1; // Future use, older versions MUST ignore
  34. INT64 resv2; // Future use, older versions MUST ignore
  35. INT64 resv3; // Future use, older versions MUST ignore
  36. INT64 resv4; // Future use, older versions MUST ignore
  37. } FileCacheType;
  38. #define FILECACHETYPE FileCacheType
  39. struct url_info
  40. {
  41. std::wstring url;
  42. size_t url_wcslen;
  43. std::wstring title;
  44. int length;
  45. } ;
  46. struct metadata_info
  47. {
  48. std::wstring url;
  49. std::wstring tag;
  50. std::wstring metadata;
  51. } ;
  52. typedef std::vector<url_info> URLMap; // just to save some typing & template code ugliness
  53. typedef std::vector<metadata_info> MetadataMap;
  54. extern URLMap urlMap;
  55. extern MetadataMap metadataMap;
  56. extern Nullsoft::Utility::LockGuard urlMapGuard;
  57. typedef void (CALLBACK *PLUGINTIMERPROC)(UINT_PTR /*eventId*/, DWORD /*elapsedMs*/, ULONG_PTR /*data*/);
  58. UINT_PTR Plugin_SetTimer(UINT elapseMs, PLUGINTIMERPROC callback, ULONG_PTR data);
  59. void Plugin_KillTimer(UINT_PTR eventId);
  60. #endif