WiiFlow_Lite/source/music/musicplayer.h

45 lines
884 B
C
Raw Normal View History

2012-01-21 21:57:41 +01:00
#ifndef _MUSICPLAYER_H
#define _MUSICPLAYER_H
#include <string>
#include "gui_sound.h"
#include "config/config.hpp"
2012-01-21 21:57:41 +01:00
using namespace std;
2012-01-21 21:57:41 +01:00
class MusicPlayer
{
public:
void cleanup();
void Init(Config &cfg, string musicDir, string themeMusicDir);
2012-01-21 21:57:41 +01:00
void Tick(bool attenuate);
void SetVolume(u8 volume);
void SetMaxVolume(u8 volume);
u8 GetVolume() { return m_music_current_volume; };
u8 GetMaxVolume() { return m_music_volume; };
2012-01-21 21:57:41 +01:00
void Previous();
void Next();
void Play();
void Stop();
2012-01-21 21:57:41 +01:00
bool IsStopped() { return m_stopped; };
protected:
2012-01-21 21:57:41 +01:00
void LoadCurrentFile();
void ScanDirectories(const char *directory);
2012-01-21 21:57:41 +01:00
u8 m_music_volume;
u8 m_music_current_volume;
u8 m_fade_rate;
bool m_stopped;
GuiSound MusicFile;
vector<string> m_music_files;
vector<string>::iterator m_current_music;
2012-01-21 21:57:41 +01:00
};
extern MusicPlayer m_music;
2012-01-21 21:57:41 +01:00
#endif