#pragma once
#include <Windows.h>
#include <string>
#include <vector>
#include <mmeapi.h>
class OrganyaPlayer
{
public:
	bool Init();
	void Quit();
	float GetMusicVolume();//取当前播放器音量
	void SetMusicVolume(float vol);//设置当前播放器音量
	void StopMusic();//停止播放音乐
	void FadeOutMusic(float fadeOutSecond);
	void ChangeMusic(std::wstring musicName, float fadeInSecond = 0);
	void ResumeMusic(float fadeInSecond = 0);
	bool IsPlaying();
	const wchar_t* GetLastPlayMusic();
	void FadeCounterStep();
	void FreezeMusic();//冻结
	void ActivateMusic();//恢复
	void PauseMenuFreezeMusic();//冻结
	void PauseMenuActivateMusic();//恢复
private:
	std::wstring currentMusic;
	bool pause = false;
	std::wstring RMU_Music;
	int RMU_Pos = 0;
	float fade_counter = 0;
	float fade_counter_max = 0;
	int fadeInOut = 0;//1fadeIn 2fadeOut
	bool freeze = false;
	int freeze_Pos = 0;
	bool pm_freeze = false;
	int pm_freeze_Pos = 0;
};

void MyLoadWav(const wchar_t* filename, std::vector<BYTE>* filebuff, WAVEFORMATEX* pWfmtx);