xbmc
AESound.h
1 /*
2  * Copyright (C) 2010-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "cores/AudioEngine/Utils/AEAudioFormat.h"
12 
13 #include <string>
14 
15 class IAESound
16 {
17 protected:
18  friend class IAE;
19  explicit IAESound(const std::string &filename) {}
20  virtual ~IAESound() = default;
21 
22 public:
23  /* play the sound this object represents */
24  virtual void Play() = 0;
25 
26  /* stop playing the sound this object represents */
27  virtual void Stop() = 0;
28 
29  /* return true if the sound is currently playing */
30  virtual bool IsPlaying() = 0;
31 
32  /* set the playback channel of this sound, AE_CH_NULL for all */
33  virtual void SetChannel(AEChannel channel) = 0;
34 
35  /* get the current playback channel of this sound, AE_CH_NULL for all */
36  virtual AEChannel GetChannel() = 0;
37 
38  /* set the playback volume of this sound */
39  virtual void SetVolume(float volume) = 0;
40 
41  /* get the current playback volume of this sound */
42  virtual float GetVolume() = 0;
43 };
44 
virtual void SetVolume(const float volume)=0
Sets the master volume level of the AudioEngine.
virtual float GetVolume()=0
Returns the current master volume level of the AudioEngine.
Definition: AESound.h:15
IAE Interface.
Definition: AE.h:81