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 = [0.4,91.825];
			}
		case(3)
			{
			time = [28,68];
			}
		case(110)
			{
			time = [55,262.425];
			}
		case(100)
			{
			time = [13,126.67];
			}
	return time;
	}

function BGMNameToNumb(name)
	{
	let numb = 0;
	alternative(name)
		case(0)
			{
			numb = 0;
			}
		case(1)
			{
			numb = 20;
			}
		case(2)
			{
			numb = 21;
			}
		case(3)
			{
			numb = 22;
			}
		case(110)
			{
			numb = 1;
			}
		case(111)
			{
			numb = 2;
			}
		case(112)
			{
			numb = 3;
			}
		case(210)
			{
			numb = 4;
			}
		case(211)
			{
			numb = 5;
			}
		case(212)
			{
			numb = 6;
			}
		case(213)
			{
			numb = 7;
			}
		case(310)
			{
			numb = 8;
			}
		case(311)
			{
			numb = 9;
			}
		case(312)
			{
			numb = 10;
			}
		case(313)
			{
			numb = 11;
			}
		case(314)
			{
			numb = 12;
			}
		case(315)
			{
			numb = 13;
			}
		case(100)
			{
			numb = 14;
			}
		case(200)
			{
			numb = 15;
			}
		case(201)
			{
			numb = 16;
			}
		case(300)
			{
			numb = 17;
			}
		case(301)
			{
			numb = 18;
			}
		case(302)
			{
			numb = 19;
			}
	return numb;
	}

function BGMNumbToName(name)
	{
	let numb = 0;
	alternative(name)
		case(0)
			{
			numb = 0;
			}
		case(1)
			{
			numb = 110;
			}
		case(2)
			{
			numb = 111;
			}
		case(3)
			{
			numb = 112;
			}
		case(4)
			{
			numb = 210;
			}
		case(5)
			{
			numb = 211;
			}
		case(6)
			{
			numb = 212;
			}
		case(7)
			{
			numb = 213;
			}
		case(8)
			{
			numb = 310;
			}
		case(9)
			{
			numb = 311;
			}
		case(10)
			{
			numb = 312;
			}
		case(11)
			{
			numb = 313;
			}
		case(12)
			{
			numb = 314;
			}
		case(13)
			{
			numb = 315;
			}
		case(14)
			{
			numb = 100;
			}
		case(15)
			{
			numb = 200;
			}
		case(16)
			{
			numb = 201;
			}
		case(17)
			{
			numb = 300;
			}
		case(18)
			{
			numb = 301;
			}
		case(19)
			{
			numb = 302;
			}
		case(20)
			{
			numb = 1;
			}
		case(21)
			{
			numb = 2;
			}
		case(22)
			{
			numb = 3;
			}
	return numb;
	}