2 //automatically generated by Makegen
4 /* located in platform.cpp */
6 //-------------------[referenced from sound/pxt.cpp]-----------------//
7 FILE *fileopen(const char *fname, const char *mode);
10 /* located in sound/sslib.cpp */
12 //-------------------[referenced from sound/pxt.cpp]-----------------//
13 void SSLockAudio(void);
14 int SSPlayChunk(int c, signed short *buffer, int len, int userdata, void(*FinishedCB)(int, int));
15 int SSEnqueueChunk(int c, signed short *buffer, int len, int userdata, void(*FinishedCB)(int, int));
16 void SSUnlockAudio(void);
17 void SSAbortChannel(int c);
20 /* located in sound/pxt.cpp */
22 //-------------------[referenced from sound/pxt.cpp]-----------------//
23 static unsigned short rand_next(void);
24 static void GenerateSineModel(unsigned char *table);
25 static void GenerateTriangleModel(unsigned char *table);
26 static void GenerateSawUpModel(unsigned char *table);
27 static void GenerateSawDownModel(unsigned char *table);
28 static void GenerateSquareModel(unsigned char *table);
29 static void GenerateRandModel(unsigned char *table);
30 void GenerateWhiteModel(void);
31 static void GeneratePulseModel(unsigned char *table);
33 char pxt_initsynth(void);
34 char pxt_SetModel(stPXWave *pxwave, int m);
35 void pxt_SetDefaultEnvelope(stPXEnvelope *env);
36 void GenerateEnvelope(stPXEnvelope *env, char *buffer);
37 void pxt_RenderPXWave(stPXWave *pxwave, signed char *buffer, int size_blocks);
38 static void CreateAudio(stPXChannel *chan);
39 static char AllocBuffers(stPXSound *snd);
40 char pxt_Render(stPXSound *snd);
41 void pxt_PrepareToPlay(stPXSound *snd, int slot);
42 void pxt_ChangePitch(stPXSound *snd, double factor);
43 int pxt_Play(int chan, int slot, char loop);
44 int pxt_PlayWithCallback(int chan, int slot, char loop, void (*FinishedCB)(int, int));
45 static void pxtSoundDone(int chan, int slot);
46 static void pxtLooper(int chan, int slot);
47 void pxt_Stop(int slot);
48 char pxt_IsPlaying(int slot);
49 char pxt_LoadSoundFX(const char *path, const char *cache_name, int top);
50 static char LoadFXCache(const char *fname, int top);
51 void pxt_freeSoundFX(void);
52 void pxt_FreeSound(int slot);
53 void FreePXTBuf(stPXSound *snd);
54 char pxt_load(const char *fname, stPXSound *snd);
55 static char LoadComponent(FILE *fp, stPXWave *pxw);
56 static char ReadToBracket(FILE *fp);
57 char pxt_save(const char *fname, stPXSound *snd);
58 static void SaveComponent(FILE *fp, const char *name, stPXWave *pxw);
59 static void SaveComponentMachine(FILE *fp, stPXWave *pxw, char trailcomma);
60 static void SaveEnvVertice(FILE *fp, stPXEnvelope *env, int v);
63 /* located in common/stat.cpp */
65 //-------------------[referenced from sound/pxt.cpp]-----------------//
66 void staterr(const char *fmt, ...);
67 void stat(const char *fmt, ...);
70 /* located in common/misc.cpp */
72 //-------------------[referenced from sound/pxt.cpp]-----------------//
73 void seedrand(uint32_t newseed);
74 int random(int min, int max);
75 void fputi(uint16_t word, FILE *fp);
76 void fputl(uint32_t word, FILE *fp);
77 uint16_t fgeti(FILE *fp);
78 uint32_t fgetl(FILE *fp);
79 int fgeticsv(FILE *fp);
80 double fgetfcsv(FILE *fp);