redbooksound.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // redbooksound.h
  3. //
  4. // SoundEngine support for redbook audio
  5. //
  6. namespace SoundEngine {
  7. //
  8. // A generic disk player wrapper
  9. //
  10. class IDiskPlayer : public ISoundObject
  11. {
  12. public:
  13. // plays one track
  14. virtual HRESULT Play(int nTrack) = 0;
  15. // stops the CD player
  16. virtual HRESULT Stop() = 0;
  17. // returns S_OK if the CD player is playing, S_FALSE otherwise
  18. virtual HRESULT IsPlaying() = 0;
  19. // returns the current track of the CD player
  20. virtual HRESULT GetCurrentTrack(int& nTrack) = 0;
  21. // sets the gain on the CD player, from 0 to -100 dB
  22. virtual HRESULT SetGain(float fGain) = 0;
  23. };
  24. //
  25. // Helper functions
  26. //
  27. // Creates a new disk player object (CD, minidisk, etc.). strDevice can be
  28. // empty (choose any device), a path ("E:\"), or a volume label.
  29. HRESULT CreateDiskPlayer(TRef<IDiskPlayer>& pdiskplayer, const ZString& strDevice = "");
  30. // Creates a new disk player object that only has stubs for each of the calls
  31. HRESULT CreateDummyDiskPlayer(TRef<IDiskPlayer>& pdiskplayer);
  32. // creates a sound template representing a redbook audio track
  33. HRESULT CreateRedbookSoundTemplate(TRef<ISoundTemplate>& pstDest, TRef<IDiskPlayer> diskPlayer, int nTrack);
  34. };