Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

129 lines
4.2 KiB

  1. //============ Copyright (c) Valve Corporation, All rights reserved. ============
  2. #ifndef ISTEAMMUSICREMOTE_H
  3. #define ISTEAMMUSICREMOTE_H
  4. #ifdef _WIN32
  5. #pragma once
  6. #endif
  7. #include "isteamclient.h"
  8. #include "isteammusic.h"
  9. #define k_SteamMusicNameMaxLength 255
  10. #define k_SteamMusicPNGMaxLength 65535
  11. class ISteamMusicRemote
  12. {
  13. public:
  14. // Service Definition
  15. virtual bool RegisterSteamMusicRemote( const char *pchName ) = 0;
  16. virtual bool DeregisterSteamMusicRemote() = 0;
  17. virtual bool BIsCurrentMusicRemote() = 0;
  18. virtual bool BActivationSuccess( bool bValue ) = 0;
  19. virtual bool SetDisplayName( const char *pchDisplayName ) = 0;
  20. virtual bool SetPNGIcon_64x64( void *pvBuffer, uint32 cbBufferLength ) = 0;
  21. // Abilities for the user interface
  22. virtual bool EnablePlayPrevious(bool bValue) = 0;
  23. virtual bool EnablePlayNext( bool bValue ) = 0;
  24. virtual bool EnableShuffled( bool bValue ) = 0;
  25. virtual bool EnableLooped( bool bValue ) = 0;
  26. virtual bool EnableQueue( bool bValue ) = 0;
  27. virtual bool EnablePlaylists( bool bValue ) = 0;
  28. // Status
  29. virtual bool UpdatePlaybackStatus( AudioPlayback_Status nStatus ) = 0;
  30. virtual bool UpdateShuffled( bool bValue ) = 0;
  31. virtual bool UpdateLooped( bool bValue ) = 0;
  32. virtual bool UpdateVolume( float flValue ) = 0; // volume is between 0.0 and 1.0
  33. // Current Entry
  34. virtual bool CurrentEntryWillChange() = 0;
  35. virtual bool CurrentEntryIsAvailable( bool bAvailable ) = 0;
  36. virtual bool UpdateCurrentEntryText( const char *pchText ) = 0;
  37. virtual bool UpdateCurrentEntryElapsedSeconds( int nValue ) = 0;
  38. virtual bool UpdateCurrentEntryCoverArt( void *pvBuffer, uint32 cbBufferLength ) = 0;
  39. virtual bool CurrentEntryDidChange() = 0;
  40. // Queue
  41. virtual bool QueueWillChange() = 0;
  42. virtual bool ResetQueueEntries() = 0;
  43. virtual bool SetQueueEntry( int nID, int nPosition, const char *pchEntryText ) = 0;
  44. virtual bool SetCurrentQueueEntry( int nID ) = 0;
  45. virtual bool QueueDidChange() = 0;
  46. // Playlist
  47. virtual bool PlaylistWillChange() = 0;
  48. virtual bool ResetPlaylistEntries() = 0;
  49. virtual bool SetPlaylistEntry( int nID, int nPosition, const char *pchEntryText ) = 0;
  50. virtual bool SetCurrentPlaylistEntry( int nID ) = 0;
  51. virtual bool PlaylistDidChange() = 0;
  52. };
  53. #define STEAMMUSICREMOTE_INTERFACE_VERSION "STEAMMUSICREMOTE_INTERFACE_VERSION001"
  54. // callbacks
  55. #if defined( VALVE_CALLBACK_PACK_SMALL )
  56. #pragma pack( push, 4 )
  57. #elif defined( VALVE_CALLBACK_PACK_LARGE )
  58. #pragma pack( push, 8 )
  59. #else
  60. #error isteamclient.h must be included
  61. #endif
  62. DEFINE_CALLBACK( MusicPlayerRemoteWillActivate_t, k_iSteamMusicRemoteCallbacks + 1)
  63. END_DEFINE_CALLBACK_0()
  64. DEFINE_CALLBACK( MusicPlayerRemoteWillDeactivate_t, k_iSteamMusicRemoteCallbacks + 2 )
  65. END_DEFINE_CALLBACK_0()
  66. DEFINE_CALLBACK( MusicPlayerRemoteToFront_t, k_iSteamMusicRemoteCallbacks + 3 )
  67. END_DEFINE_CALLBACK_0()
  68. DEFINE_CALLBACK( MusicPlayerWillQuit_t, k_iSteamMusicRemoteCallbacks + 4 )
  69. END_DEFINE_CALLBACK_0()
  70. DEFINE_CALLBACK( MusicPlayerWantsPlay_t, k_iSteamMusicRemoteCallbacks + 5 )
  71. END_DEFINE_CALLBACK_0()
  72. DEFINE_CALLBACK( MusicPlayerWantsPause_t, k_iSteamMusicRemoteCallbacks + 6 )
  73. END_DEFINE_CALLBACK_0()
  74. DEFINE_CALLBACK( MusicPlayerWantsPlayPrevious_t, k_iSteamMusicRemoteCallbacks + 7 )
  75. END_DEFINE_CALLBACK_0()
  76. DEFINE_CALLBACK( MusicPlayerWantsPlayNext_t, k_iSteamMusicRemoteCallbacks + 8 )
  77. END_DEFINE_CALLBACK_0()
  78. DEFINE_CALLBACK( MusicPlayerWantsShuffled_t, k_iSteamMusicRemoteCallbacks + 9 )
  79. CALLBACK_MEMBER( 0, bool, m_bShuffled )
  80. END_DEFINE_CALLBACK_1()
  81. DEFINE_CALLBACK( MusicPlayerWantsLooped_t, k_iSteamMusicRemoteCallbacks + 10 )
  82. CALLBACK_MEMBER(0, bool, m_bLooped )
  83. END_DEFINE_CALLBACK_1()
  84. DEFINE_CALLBACK( MusicPlayerWantsVolume_t, k_iSteamMusicCallbacks + 11 )
  85. CALLBACK_MEMBER(0, float, m_flNewVolume)
  86. END_DEFINE_CALLBACK_1()
  87. DEFINE_CALLBACK( MusicPlayerSelectsQueueEntry_t, k_iSteamMusicCallbacks + 12 )
  88. CALLBACK_MEMBER(0, int, nID )
  89. END_DEFINE_CALLBACK_1()
  90. DEFINE_CALLBACK( MusicPlayerSelectsPlaylistEntry_t, k_iSteamMusicCallbacks + 13 )
  91. CALLBACK_MEMBER(0, int, nID )
  92. END_DEFINE_CALLBACK_1()
  93. DEFINE_CALLBACK( MusicPlayerWantsPlayingRepeatStatus_t, k_iSteamMusicRemoteCallbacks + 14 )
  94. CALLBACK_MEMBER(0, int, m_nPlayingRepeatStatus )
  95. END_DEFINE_CALLBACK_1()
  96. #pragma pack( pop )
  97. #endif // #define ISTEAMMUSICREMOTE_H