1
0

ifc_devicemanagerevent.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #ifndef _NULLSOFT_WINAMP_DEVICES_DEVICE_MANAGER_EVENT_INTERFACE_HEADER
  2. #define _NULLSOFT_WINAMP_DEVICES_DEVICE_MANAGER_EVENT_INTERFACE_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <bfc/platform/guid.h>
  7. // {3D58B8B4-74C8-4fa2-B28D-86E96ABC7200}
  8. static const GUID IFC_DeviceManagerEvent =
  9. { 0x3d58b8b4, 0x74c8, 0x4fa2, { 0xb2, 0x8d, 0x86, 0xe9, 0x6a, 0xbc, 0x72, 0x0 } };
  10. #include <bfc/dispatch.h>
  11. class api_devicemanager;
  12. // supports AddRef(), Release(), QueryInterface()
  13. class __declspec(novtable) ifc_devicemanagerevent : public Dispatchable
  14. {
  15. protected:
  16. ifc_devicemanagerevent() {}
  17. ~ifc_devicemanagerevent() {}
  18. public:
  19. void TypeAdded(api_devicemanager *manager, ifc_devicetype *type);
  20. void TypeRemoved(api_devicemanager *manager, ifc_devicetype *type);
  21. void ConnectionAdded(api_devicemanager *manager, ifc_deviceconnection *connection);
  22. void ConnectionRemoved(api_devicemanager *manager, ifc_deviceconnection *connection);
  23. void CommandAdded(api_devicemanager *manager, ifc_devicecommand *command);
  24. void CommandRemoved(api_devicemanager *manager, ifc_devicecommand *command);
  25. void DeviceAdded(api_devicemanager *manager, ifc_device *device);
  26. void DeviceRemoved(api_devicemanager *manager, ifc_device *device);
  27. void DiscoveryStarted(api_devicemanager *manager);
  28. void DiscoveryFinished(api_devicemanager *manager);
  29. public:
  30. DISPATCH_CODES
  31. {
  32. API_TYPEADDED = 10,
  33. API_TYPEREMOVED = 20,
  34. API_CONNECTIONADDED = 30,
  35. API_CONNECTIONREMOVED = 40,
  36. API_COMMANDADDED = 50,
  37. API_COMMANDREMOVED = 60,
  38. API_DEVICEADDED = 70,
  39. API_DEVICEREMOVED = 80,
  40. API_DISCOVERYSTARTED = 90,
  41. API_DISCOVERYFINISHED = 100,
  42. };
  43. };
  44. inline void ifc_devicemanagerevent::TypeAdded(api_devicemanager *manager, ifc_devicetype *type)
  45. {
  46. _voidcall(API_TYPEADDED, manager, type);
  47. }
  48. inline void ifc_devicemanagerevent::TypeRemoved(api_devicemanager *manager, ifc_devicetype *type)
  49. {
  50. _voidcall(API_TYPEREMOVED, manager, type);
  51. }
  52. inline void ifc_devicemanagerevent::ConnectionAdded(api_devicemanager *manager, ifc_deviceconnection *connection)
  53. {
  54. _voidcall(API_CONNECTIONADDED, manager, connection);
  55. }
  56. inline void ifc_devicemanagerevent::ConnectionRemoved(api_devicemanager *manager, ifc_deviceconnection *connection)
  57. {
  58. _voidcall(API_CONNECTIONREMOVED, manager, connection);
  59. }
  60. inline void ifc_devicemanagerevent::CommandAdded(api_devicemanager *manager, ifc_devicecommand *command)
  61. {
  62. _voidcall(API_COMMANDADDED, manager, command);
  63. }
  64. inline void ifc_devicemanagerevent::CommandRemoved(api_devicemanager *manager, ifc_devicecommand *command)
  65. {
  66. _voidcall(API_COMMANDREMOVED, manager, command);
  67. }
  68. inline void ifc_devicemanagerevent::DeviceAdded(api_devicemanager *manager, ifc_device *device)
  69. {
  70. _voidcall(API_DEVICEADDED, manager, device);
  71. }
  72. inline void ifc_devicemanagerevent::DeviceRemoved(api_devicemanager *manager, ifc_device *device)
  73. {
  74. _voidcall(API_DEVICEREMOVED, manager, device);
  75. }
  76. inline void ifc_devicemanagerevent::DiscoveryStarted(api_devicemanager *manager)
  77. {
  78. _voidcall(API_DISCOVERYSTARTED, manager);
  79. }
  80. inline void ifc_devicemanagerevent::DiscoveryFinished(api_devicemanager *manager)
  81. {
  82. _voidcall(API_DISCOVERYFINISHED, manager);
  83. }
  84. #endif //_NULLSOFT_WINAMP_DEVICES_DEVICE_MANAGER_EVENT_INTERFACE_HEADER