/*Copyright (C) 2010-2020 Duncan Deveaux

This file is part of Hikou no mizu.

Hikou no mizu is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Hikou no mizu is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Hikou no mizu.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef DEF_MUSIC_PLAYER
#define DEF_MUSIC_PLAYER

#include <pthread.h>
#include <iostream>
#include <map>
#include <vector>

#include "Audio/Music.hpp"
#include "Tools/Timer.hpp"

namespace MusicPlayer
{
    //Data used by threads
    struct MusicData
    {
        MusicData() : volume(100), loop(false), close_fade(false), close_force(false)
        {
            
        }
        
        MusicData(const std::string &dataPath, float dataVolume, bool dataLoop) :
        path(dataPath), volume(dataVolume), loop(dataLoop), close_fade(false), close_force(false)
        {
            
        }
        
        std::string path;
        float volume;
        bool loop;
        
        bool close_fade, close_force;
    };
    
    void playMusic(const std::string &path, float volume, bool loop);
    void stopMusic(const std::string &path);
    
    bool isPlaying(const std::string &path);
    void destroy();
}

#endif
