summaryrefslogtreecommitdiff
path: root/graphics/AudioManager.h
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/AudioManager.h')
-rw-r--r--graphics/AudioManager.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/graphics/AudioManager.h b/graphics/AudioManager.h
new file mode 100644
index 0000000..f323cc7
--- /dev/null
+++ b/graphics/AudioManager.h
@@ -0,0 +1,20 @@
+#pragma once
+
+#include <unordered_map>
+#include <string>
+#include <SDL2/SDL.h>
+#include <SDL2/SDL_mixer.h>
+
+class AudioManager
+{
+ std::unordered_map<std::string, Mix_Chunk*> sounds;
+ std::unordered_map<std::string, Mix_Music*> scores;
+ bool initialized = true;
+public:
+ void playSound(std::string soundfile, float volume, bool looping = false);
+ void playMusic(std::string soundfile, float volume, bool looping = true, int fade_time = 0);
+ void stopMusic(int fade_time = 0);
+ AudioManager();
+ ~AudioManager();
+
+}; \ No newline at end of file