//
// Created by sasha on 04.12.2025.
//

#ifndef RU_DANSOFT_PUZZLE15_AUDIO_MANAGER_H
#define RU_DANSOFT_PUZZLE15_AUDIO_MANAGER_H

#include <string>
#include <map>

#include "SDL3_mixer/SDL_mixer.h"

class AudioManager {
private:
    MIX_Mixer *gMixer;
    MIX_Track *globalTrack;
    std::map<std::string,MIX_Audio*> listAudio;

    static AudioManager* instance;

    AudioManager();

    // Удаляем копирование и присваивание
    AudioManager(const AudioManager&) = delete;
    AudioManager& operator=(const AudioManager&) = delete;

public:
    static AudioManager* getInstance() {
        if (!instance) {
            instance = new AudioManager();
        }
        return instance;
    }

    void stop();

    bool init();
    void playSound(const std::string &name);

};


#endif //RU_DANSOFT_PUZZLE15_AUDIO_MANAGER_H
