#include "sound.h"

Music::Music(const char* path)
{
    music = Mix_LoadMUS(path);
}

void Music::play(int loops)
{
    Mix_PlayMusic(music, loops);
}

void Music::pause()
{
    Mix_PauseMusic();
}

void Music::stop()
{
    Mix_HaltMusic();
}

void Music::resume()
{
    Mix_ResumeMusic();
}

void Music::setVolume(int volume)
{
    Mix_VolumeMusic(volume);
}

Music::~Music()
{
    Mix_FreeMusic(music);
}

Effect::Effect(const char* path)
{
    effect = Mix_LoadWAV(path);
}

void Effect::play(int loops, int channel)
{
    Mix_PlayChannel(channel, effect, loops);
}

void Effect::setVolume(int volume)
{
    Mix_VolumeChunk(effect, volume);
}

Effect::~Effect()
{
    Mix_FreeChunk(effect);
}