ISoundPlayer.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * ISoundPlayer.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. #include "../lib/CSoundBase.h"
  12. #include "../lib/filesystem/ResourcePath.h"
  13. class ISoundPlayer
  14. {
  15. public:
  16. virtual ~ISoundPlayer() = default;
  17. virtual int playSound(soundBase::soundID soundID) = 0;
  18. virtual int playSound(const AudioPath & sound) = 0;
  19. virtual int playSoundLooped(const AudioPath & sound) = 0;
  20. virtual int playSound(std::pair<std::unique_ptr<ui8[]>, si64> & data) = 0;
  21. virtual int playSoundFromSet(std::vector<soundBase::soundID> & sound_vec) = 0;
  22. virtual void stopSound(int handler) = 0;
  23. virtual void pauseSound(int handler) = 0;
  24. virtual void resumeSound(int handler) = 0;
  25. virtual ui32 getVolume() const = 0;
  26. virtual void setVolume(ui32 percent) = 0;
  27. virtual uint32_t getSoundDurationMilliseconds(const AudioPath & sound) = 0;
  28. virtual void setCallback(int channel, std::function<void()> function) = 0;
  29. virtual void resetCallback(int channel) = 0;
  30. virtual void soundFinishedCallback(int channel) = 0;
  31. virtual void ambientUpdateChannels(std::map<AudioPath, int> currentSounds) = 0;
  32. virtual void ambientStopAllChannels() = 0;
  33. virtual int ambientGetRange() const = 0;
  34. };