let EV_MUSIC_PLAY = 303;
let EV_MUSIC_STOP = 304;
let EV_MUSIC_FADE = 305;
let EV_MUSIC_VOL = 306;
let EV_MUSIC_C_STOP = 307;
let EV_MUSIC_C_FADE = 308;
let EV_MUSIC_PAUSE = 309;
let EV_MUSIC_RESUME = 310;

function PlayMusic(num)
	{
	NotifyEventAll(EV_MUSIC_PLAY,[num]);
	}
task EndMusic(num)
	{
	NotifyEventAll(EV_MUSIC_STOP,[num]);
	}
task FadeMusic(num,time)
	{
	NotifyEventAll(EV_MUSIC_FADE,[num,time]);
	}
task VolumeMusic(num,vol)
	{
	NotifyEventAll(EV_MUSIC_VOL,[num,vol]);
	}
task EndCurrentMusic
	{
	NotifyEventAll(EV_MUSIC_C_STOP,[]);
	}
task FadeCurrentMusic(time)
	{
	NotifyEventAll(EV_MUSIC_C_FADE,[time]);
	}
task PauseMusic
	{
	NotifyEventAll(EV_MUSIC_PAUSE,[]);
	}
task ResumeMusic
	{
	NotifyEventAll(EV_MUSIC_RESUME,[]);
	}

function GetBGMLoopTime(num)
	{
	let time = [0,0];
	alternative(num)
		case(0)
			{
			time = [27.27,81.75];
			}
		case(3)
			{
			time = [28,68];
			}
		case(10)
			{
			time = [0.085,160.1];
			}
		case(11)
			{
			time = [23.4,230.3];
			}
	return time;
	}

function BGMNameToNumb(name)
	{
	let numb = 0;
	alternative(name)
		case(0)
			{
			numb = 0;
			}
		case(1)
			{
			numb = 15;
			}
		case(2)
			{
			numb = 16;
			}
		case(3)
			{
			numb = 17;
			}
		case(10)
			{
			numb = 1;
			}
		case(11)
			{
			numb = 2;
			}
		case(20)
			{
			numb = 3;
			}
		case(21)
			{
			numb = 4;
			}
		case(30)
			{
			numb = 5;
			}
		case(31)
			{
			numb = 6;
			}
		case(40)
			{
			numb = 7;
			}
		case(41)
			{
			numb = 8;
			}
		case(50)
			{
			numb = 9;
			}
		case(51)
			{
			numb = 10;
			}
		case(60)
			{
			numb = 11;
			}
		case(61)
			{
			numb = 12;
			}
		case(70)
			{
			numb = 13;
			}
		case(71)
			{
			numb = 14;
			}
	return numb;
	}

function BGMNumbToName(name)
	{
	let numb = 0;
	alternative(name)
		case(0)
			{
			numb = 0;
			}
		case(15)
			{
			numb = 1;
			}
		case(16)
			{
			numb = 2;
			}
		case(17)
			{
			numb = 3;
			}
		case(1)
			{
			numb = 10;
			}
		case(2)
			{
			numb = 11;
			}
		case(3)
			{
			numb = 20;
			}
		case(4)
			{
			numb = 21;
			}
		case(5)
			{
			numb = 30;
			}
		case(6)
			{
			numb = 31;
			}
		case(7)
			{
			numb = 40;
			}
		case(8)
			{
			numb = 41;
			}
		case(9)
			{
			numb = 50;
			}
		case(10)
			{
			numb = 51;
			}
		case(11)
			{
			numb = 60;
			}
		case(12)
			{
			numb = 61;
			}
		case(13)
			{
			numb = 70;
			}
		case(14)
			{
			numb = 71;
			}
	return numb;
	}