summaryrefslogtreecommitdiff
path: root/music.h
blob: 4e4847807ca9c3a6d4a0f95501eb817b4d174649 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//Chrisoft Bullet Lab Remix HGE
//In Game Music Implementations
//"Copyleft" Chrisoft 2013
HEFFECT Mus;
HCHANNEL Muc;
int lpst,lped;
//static const char* MUSIC_H_FN="music.h";

void Music_Init(const char* file)
{
	Mus=hge->Effect_Load(file);
}
void Music_Play()
{
	Muc=hge->Effect_PlayEx(Mus,100,0,1.0,true);
}
void Music_Update()
{
	if (!lpst||!lped)return;
	int Mucpos=hge->Channel_GetPos_BySample(Muc);
	if (Mucpos>=lped)hge->Channel_SetPos_BySample(Muc,lpst);
}
void Music_Stop()
{
	hge->Channel_Stop(Muc);
}
void Music_Pause()
{
	hge->Channel_Pause(Muc);
}
void Music_Resume()
{
	hge->Channel_Resume(Muc);
}