Btk
mixer.hpp
1 #if !defined(_BTK_MIXER_HPP_)
2 #define _BTK_MIXER_HPP_
3 #include <string_view>
4 #include <stdexcept>
5 #include "defs.hpp"
6 
7 struct _Mix_Music;
8 struct _Mix_Chunk;
9 
10 namespace Btk{
11  class BTKAPI MixerError:public std::runtime_error{
12  public:
13  MixerError(const char *msg);
14  MixerError(const MixerError &) = default;
15  ~MixerError();
16 
17  };
18  namespace Mixer{
19  class BTKAPI Music{
20  public:
21  ~Music();
22  static Music FromFile();
23  private:
24  _Mix_Music *music;
25  };
26  class BTKAPI Channal{
27  public:
28  static Channal Alloc();
29  };
30  class BTKAPI Chunk{
31  public:
32  ~Chunk();
33  private:
34  _Mix_Chunk *chunk;
35  };
36  BTKAPI void Init();
37  BTKAPI void Quit();
38  BTKAPI bool WasInit();
39  }
40  using MixerMusic = Mixer::Music;
41  using MixerAudio = Mixer::Music;
42  using MixerChunk = Mixer::Chunk;
44 
45  [[noreturn]] void BTKAPI throwMixerError(const char *msg);
46  [[noreturn]] void BTKAPI throwMixerError();
47 }
48 
49 #endif // _BTK_MIXER_HPP_
This header include many useful containers.
Definition: async.hpp:7
Definition: mixer.hpp:11
Definition: mixer.hpp:26
Definition: mixer.hpp:30
Definition: mixer.hpp:19