NXEngine v1.0.0.6
[NXEngine.git] / sound / org.fdh
blob9e7208d3f99b9a48f0679b990d9fa29cee548c01
1 //hash:86bec1cb
2 //automatically generated by Makegen
4 /* located in main.cpp */
6 //-------------------[referenced from sound/org.cpp]-----------------//
7 void visible_warning(const char *fmt, ...);
10 /* located in platform.cpp */
12 //-------------------[referenced from sound/org.cpp]-----------------//
13 FILE *fileopen(const char *fname, const char *mode);
16 /* located in sound/sslib.cpp */
18 //-------------------[referenced from sound/org.cpp]-----------------//
19 void SSReserveChannel(int c);
20 void SSSetVolume(int c, int newvol);
21 void SSAbortChannel(int c);
22 int SSEnqueueChunk(int c, signed short *buffer, int len, int userdata, void(*FinishedCB)(int, int));
23 char SSChannelPlaying(int c);
24 void SSLockAudio(void);
25 int SSGetCurUserData(int c);
26 int SSGetSamplePos(int c);
27 void SSUnlockAudio(void);
30 /* located in sound/org.cpp */
32 //-------------------[referenced from sound/org.cpp]-----------------//
33 static void init_pitch(void);
34 static double GetNoteSampleRate(int note, int instrument_pitch);
35 static int MSToSamples(int ms);
36 static int SamplesToMS(int samples);
37 static bool load_drumtable(const char *pxt_path);
38 static bool load_drum(char *fname, int d);
39 static bool load_drum_pxt(char *fname, int d);
40 static bool load_wavetable(const char *fname);
41 int org_init(const char *wavetable_fname, const char *drum_pxt_dir, int org_volume);
42 void org_close(void);
43 char org_load(char *fname);
44 static bool init_buffers(void);
45 static void free_buffers(void);
46 bool org_start(int startbeat);
47 void org_stop(void);
48 bool org_is_playing(void);
49 void org_fade(void);
50 void org_set_volume(int newvolume);
51 static void runfade();
52 static void mix_buffers(void);
53 static void queue_final_buffer(void);
54 static void OrgBufferFinished(int channel, int buffer_no);
55 static void ComputeVolumeRatios(int volume, int panning, double *volume_ratio, double *volume_left_ratio, double *volume_right_ratio);
56 static double Interpolate(int sample1, int sample2, double ratio);
57 static void ForceSamplePos(int m, int desired_samples);
58 static void silence_gen(stNoteChannel *chan, int num_samples);
59 static void note_open(stNoteChannel *chan, int wave, int pitch, int note);
60 static void note_gen(stNoteChannel *chan, int num_samples);
61 static int note_close(stNoteChannel *chan);
62 static int drum_open(int m_channel, int wave, int note);
63 static void drum_gen(int m_channel, int num_samples);
64 void org_run(void);
65 static void generate_music(void);
66 static void NextBeat(int m);
67 int org_GetCurrentBeat(void);
68 int org_GetCurrentBuffer(void);
71 /* located in sound/pxt.cpp */
73 //-------------------[referenced from sound/org.cpp]-----------------//
74 char pxt_initsynth(void);
75 char pxt_load(const char *fname, stPXSound *snd);
76 char pxt_Render(stPXSound *snd);
77 void FreePXTBuf(stPXSound *snd);
80 /* located in common/stat.cpp */
82 //-------------------[referenced from sound/org.cpp]-----------------//
83 void stat(const char *fmt, ...);
84 void staterr(const char *fmt, ...);
87 /* located in common/misc.cpp */
89 //-------------------[referenced from sound/org.cpp]-----------------//
90 uint32_t fgetl(FILE *fp);
91 void fputl(uint32_t word, FILE *fp);
92 uint16_t fgeti(FILE *fp);