Mercurial > otakunoraifu
annotate music2/music.h @ 8:55b577e5f5b5
Some memory leaks fixed
author | thib |
---|---|
date | Tue, 05 Aug 2008 12:56:51 +0000 |
parents | 422f3cb3614b |
children | f45da03ca631 |
rev | line source |
---|---|
0 | 1 #ifndef __MUSIC__ /* __MUSIC__ */ |
2 #define __MUSIC__ | |
3 | |
4 #ifdef HAVE_CONFIG_H | |
5 # include "config.h" | |
6 #endif | |
7 | |
8 #include<sys/types.h> | |
9 #include<sys/time.h> | |
10 | |
11 #define MIX_PCM_BGM 4 | |
12 #define MIX_PCM_EFFEC 5 | |
13 #define MIX_PCM_KOE 6 | |
14 #define MIX_PCM_SIZE 8 | |
15 | |
16 #define DEFAULT_AUDIOBUF 4096 | |
17 | |
2
422f3cb3614b
Enabled voice playing with "%04d/%04d%05d.ogg" format. Don't use a cache for this
thib
parents:
0
diff
changeset
|
18 enum KoeType { koe_unknown, koe_nwk, koe_ovk, koe_ogg}; |
0 | 19 typedef struct { |
20 FILE* stream; | |
21 int length; | |
22 int offset; | |
23 int rate; | |
24 KoeType type; | |
25 }AvgKoeInfo; | |
26 | |
27 extern int pcm_enable; | |
28 | |
29 /* koedec.cc */ | |
30 extern AvgKoeInfo OpenKoeFile(const char* path); | |
31 extern char* decode_koe(AvgKoeInfo info, int* len); | |
32 extern char* decode_koe_nwa(AvgKoeInfo info, int* len); | |
33 extern const char* MakeWavHeader(int rate, int ch, int bps, int size); | |
34 extern AvgKoeInfo FindKoe(int file_number, int index); | |
35 | |
36 #include<unistd.h> | |
37 struct MuSys { | |
38 class AyuSysConfig& config; | |
39 char cdrom_track[128]; char effec_track[128]; | |
40 int movie_id; | |
41 int music_enable; | |
42 MuSys(AyuSysConfig& _config); | |
43 | |
44 void PlayCDROM(char* name, int play_count); | |
45 void StopCDROM(int time); | |
46 void PlaySE(const char* name, int loop_flag=0, int channel=0); | |
47 void PlaySE(int number); | |
48 void StopSE(int time = 0); | |
49 bool IsStopSE(void); | |
50 void PlayKoe(const char* fname); | |
51 void StopKoe(int time); | |
52 void PlayMovie(const char* fname, int x1, int y1, int x2, int y2, int loop_count); | |
53 void StopMovie(void); | |
54 bool IsStopMovie(void); | |
55 void InitMusic(void); | |
56 void FinalizeMusic(void); | |
57 }; | |
58 | |
59 #endif /* __MUSIC__ */ |