Tinman  1.0
sound.h
Go to the documentation of this file.
1 #ifndef _SOUND_H
2 #define _SOUND_H
3 
4 #include <SDL/SDL.h>
5 #include <SDL/SDL_mixer.h>
6 #include <string>
7 #include <iostream>
8 #include <memory>
9 #include <unistd.h>
10 
11 class Sound {
12  public:
13  typedef std::shared_ptr<Sound> shared;
14  Sound();
15  ~Sound();
16 
17  void play(const std::string& fileName) const;
18  void pause();
19  void stop();
20 
21  private:
22  void init_audio_device();
23 
24  bool is_paused() const;
25  bool is_stopped() const;
26  bool is_playing() const;
27  bool in_error_state() const;
28 };
29 
30 #endif
void stop()
Definition: sound.cpp:41
Sound()
Definition: sound.cpp:20
void play(const std::string &fileName) const
Definition: sound.cpp:46
bool in_error_state() const
bool is_stopped() const
Definition: sound.cpp:65
std::shared_ptr< Sound > shared
Definition: sound.h:13
bool is_paused() const
Definition: sound.cpp:60
Definition: sound.h:11
void init_audio_device()
Definition: sound.cpp:53
~Sound()
Definition: sound.cpp:24
void pause()
Definition: sound.cpp:29
bool is_playing() const
Definition: sound.cpp:70