1
0

features.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #pragma once
  2. #include "foundation/types.h"
  3. #include "foundation/mkncc.h"
  4. #ifdef __cplusplus
  5. #include "syscb/ifc_syscallback.h"
  6. #endif
  7. /*
  8. This is a listing of features that can be added to Application::SetPermission and api_application::SetFeature
  9. or queried with api_application::GetPermission or api_application::GetFeature
  10. if you are linking from a C file, prepend application_feature_ before each of these guids
  11. if you are linking from a C++ file, these are in the Features namespace
  12. */
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #define FEATURE(x) x
  16. #define PERMISSION(x) x
  17. namespace Features {
  18. #else
  19. #define FEATURE(x) application_feature_ ## x
  20. #define PERMISSION(x) x application_feature_ ## x
  21. #endif
  22. /* these gets sent via api_sysb when permissions change */
  23. // {33C86C8A-281E-4CA7-88B0-9AF9A06C486D}
  24. static const GUID FEATURE(event_type) =
  25. { 0x33c86c8a, 0x281e, 0x4ca7, { 0x88, 0xb0, 0x9a, 0xf9, 0xa0, 0x6c, 0x48, 0x6d } };
  26. static const int FEATURE(permissions_changed) = 0;
  27. static const int FEATURE(features_changed) = 1;
  28. #ifdef __cplusplus
  29. class SystemCallback : public ifc_sysCallback
  30. {
  31. protected:
  32. GUID WASABICALL SysCallback_GetEventType() { return event_type; }
  33. int WASABICALL SysCallback_Notify(int msg, intptr_t param1, intptr_t param2)
  34. {
  35. switch(msg)
  36. {
  37. case permissions_changed:
  38. return FeaturesSystemCallback_OnPermissionsChanged();
  39. case features_changed:
  40. return FeaturesSystemCallback_OnFeaturesChanged();
  41. default:
  42. return NErr_Success;
  43. }
  44. }
  45. virtual int WASABICALL FeaturesSystemCallback_OnPermissionsChanged() { return NErr_Success; }
  46. virtual int WASABICALL FeaturesSystemCallback_OnFeaturesChanged() { return NErr_Success; }
  47. };
  48. #endif
  49. #if 0
  50. // {2E9CE2F8-E26D-4629-A3FF-5DF619136B2C}
  51. static const GUID PERMISSION(crossfade) =
  52. { 0x2e9ce2f8, 0xe26d, 0x4629, { 0xa3, 0xff, 0x5d, 0xf6, 0x19, 0x13, 0x6b, 0x2c } };
  53. // {F7CCB4E1-CD8B-4D0A-973A-0C1F15FDDAE2}
  54. static const GUID PERMISSION(replaygain) =
  55. { 0xf7ccb4e1, 0xcd8b, 0x4d0a, { 0x97, 0x3a, 0xc, 0x1f, 0x15, 0xfd, 0xda, 0xe2 } };
  56. // {9A52404E-764D-416D-9EC9-33AA84FBA13F}
  57. static const GUID PERMISSION(equalizer) =
  58. { 0x9a52404e, 0x764d, 0x416d, { 0x9e, 0xc9, 0x33, 0xaa, 0x84, 0xfb, 0xa1, 0x3f } };
  59. #endif
  60. // {69663D62-5EC5-4B25-B91C-65E388C85E09}
  61. static const GUID FEATURE(aac_playback) =
  62. { 0x69663d62, 0x5ec5, 0x4b25, { 0xb9, 0x1c, 0x65, 0xe3, 0x88, 0xc8, 0x5e, 0x9 } };
  63. // {281E7D5B-3A46-4F60-9026-D3FCBFCDD2BB}
  64. static const GUID PERMISSION(gapless) =
  65. { 0x281e7d5b, 0x3a46, 0x4f60, { 0x90, 0x26, 0xd3, 0xfc, 0xbf, 0xcd, 0xd2, 0xbb } };
  66. // {4D6A0C67-D2FF-4F81-BA4F-369AF90BE680}
  67. static const GUID PERMISSION(flac_playback) =
  68. { 0x4d6a0c67, 0xd2ff, 0x4f81, { 0xba, 0x4f, 0x36, 0x9a, 0xf9, 0xb, 0xe6, 0x80 } };
  69. // {5599E564-400B-40EC-8393-A58D4A6BEBD9}
  70. static const GUID PERMISSION(gracenote_autotag) =
  71. { 0x5599e564, 0x400b, 0x40ec, { 0x83, 0x93, 0xa5, 0x8d, 0x4a, 0x6b, 0xeb, 0xd9 } };
  72. // {1A9106D7-C226-4B72-9A30-E4977A519234}
  73. static const GUID PERMISSION(alac_playback) =
  74. { 0x1a9106d7, 0xc226, 0x4b72, { 0x9a, 0x30, 0xe4, 0x97, 0x7a, 0x51, 0x92, 0x34 } };
  75. #ifdef __cplusplus
  76. }
  77. }
  78. #endif