Mercurial > otakunoraifu
annotate music2/music.h @ 32:97b752b43502
* Removed SDL_rotozoom.{cc,h} (now uses SDL_gfx). TODO: improve configure.ac
author | thib |
---|---|
date | Sat, 07 Mar 2009 21:56:18 +0000 |
parents | 5ae5533b3a9a |
children | 15a18fbe6f21 |
rev | line source |
---|---|
31 | 1 /* |
2 * Copyright (c) 2004-2006 Kazunori "jagarl" Ueno | |
3 * All rights reserved. | |
4 * | |
5 * Redistribution and use in source and binary forms, with or without | |
6 * modification, are permitted provided that the following conditions | |
7 * are met: | |
8 * 1. Redistributions of source code must retain the above copyright | |
9 * notice, this list of conditions and the following disclaimer. | |
10 * 2. Redistributions in binary form must reproduce the above copyright | |
11 * notice, this list of conditions and the following disclaimer in the | |
12 * documentation and/or other materials provided with the distribution. | |
13 * 3. The name of the author may not be used to endorse or promote products | |
14 * derived from this software without specific prior written permission. | |
15 * | |
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | |
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | |
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
26 */ | |
27 | |
28 | |
0 | 29 #ifndef __MUSIC__ /* __MUSIC__ */ |
30 #define __MUSIC__ | |
31 | |
32 #ifdef HAVE_CONFIG_H | |
33 # include "config.h" | |
34 #endif | |
35 | |
36 #include<sys/types.h> | |
37 #include<sys/time.h> | |
38 | |
39 #define MIX_PCM_BGM 4 | |
40 #define MIX_PCM_EFFEC 5 | |
41 #define MIX_PCM_KOE 6 | |
42 #define MIX_PCM_SIZE 8 | |
43 | |
44 #define DEFAULT_AUDIOBUF 4096 | |
45 | |
2
422f3cb3614b
Enabled voice playing with "%04d/%04d%05d.ogg" format. Don't use a cache for this
thib
parents:
0
diff
changeset
|
46 enum KoeType { koe_unknown, koe_nwk, koe_ovk, koe_ogg}; |
0 | 47 typedef struct { |
48 FILE* stream; | |
49 int length; | |
50 int offset; | |
51 int rate; | |
52 KoeType type; | |
53 }AvgKoeInfo; | |
54 | |
55 extern int pcm_enable; | |
56 | |
57 /* koedec.cc */ | |
58 extern AvgKoeInfo OpenKoeFile(const char* path); | |
59 extern char* decode_koe(AvgKoeInfo info, int* len); | |
60 extern char* decode_koe_nwa(AvgKoeInfo info, int* len); | |
61 extern const char* MakeWavHeader(int rate, int ch, int bps, int size); | |
62 extern AvgKoeInfo FindKoe(int file_number, int index); | |
63 | |
64 #include<unistd.h> | |
65 struct MuSys { | |
66 class AyuSysConfig& config; | |
67 char cdrom_track[128]; char effec_track[128]; | |
68 int movie_id; | |
69 int music_enable; | |
26 | 70 int volmod[4]; // BGM, KOE, PCM, Se |
0 | 71 MuSys(AyuSysConfig& _config); |
72 | |
73 void PlayCDROM(char* name, int play_count); | |
74 void StopCDROM(int time); | |
75 void PlaySE(const char* name, int loop_flag=0, int channel=0); | |
76 void PlaySE(int number); | |
77 void StopSE(int time = 0); | |
78 bool IsStopSE(void); | |
79 void PlayKoe(const char* fname); | |
80 void StopKoe(int time); | |
81 void PlayMovie(const char* fname, int x1, int y1, int x2, int y2, int loop_count); | |
82 void StopMovie(void); | |
83 bool IsStopMovie(void); | |
84 void InitMusic(void); | |
85 void FinalizeMusic(void); | |
86 }; | |
87 | |
88 #endif /* __MUSIC__ */ |