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.

67 lines
1.6 KiB

  1. //============ Copyright (c) Valve Corporation, All rights reserved. ============
  2. #ifndef ISTEAMMUSIC_H
  3. #define ISTEAMMUSIC_H
  4. #ifdef _WIN32
  5. #pragma once
  6. #endif
  7. #include "isteamclient.h"
  8. //-----------------------------------------------------------------------------
  9. // Purpose:
  10. //-----------------------------------------------------------------------------
  11. enum AudioPlayback_Status
  12. {
  13. AudioPlayback_Undefined = 0,
  14. AudioPlayback_Playing = 1,
  15. AudioPlayback_Paused = 2,
  16. AudioPlayback_Idle = 3
  17. };
  18. //-----------------------------------------------------------------------------
  19. // Purpose: Functions to control music playback in the steam client
  20. //-----------------------------------------------------------------------------
  21. class ISteamMusic
  22. {
  23. public:
  24. virtual bool BIsEnabled() = 0;
  25. virtual bool BIsPlaying() = 0;
  26. virtual AudioPlayback_Status GetPlaybackStatus() = 0;
  27. virtual void Play() = 0;
  28. virtual void Pause() = 0;
  29. virtual void PlayPrevious() = 0;
  30. virtual void PlayNext() = 0;
  31. // volume is between 0.0 and 1.0
  32. virtual void SetVolume( float flVolume ) = 0;
  33. virtual float GetVolume() = 0;
  34. };
  35. #define STEAMMUSIC_INTERFACE_VERSION "STEAMMUSIC_INTERFACE_VERSION001"
  36. // callbacks
  37. #if defined( VALVE_CALLBACK_PACK_SMALL )
  38. #pragma pack( push, 4 )
  39. #elif defined( VALVE_CALLBACK_PACK_LARGE )
  40. #pragma pack( push, 8 )
  41. #else
  42. #error isteamclient.h must be included
  43. #endif
  44. DEFINE_CALLBACK( PlaybackStatusHasChanged_t, k_iSteamMusicCallbacks + 1 )
  45. END_DEFINE_CALLBACK_0()
  46. DEFINE_CALLBACK( VolumeHasChanged_t, k_iSteamMusicCallbacks + 2 )
  47. CALLBACK_MEMBER( 0, float, m_flNewVolume )
  48. END_DEFINE_CALLBACK_1()
  49. #pragma pack( pop )
  50. #endif // #define ISTEAMMUSIC_H