From 9029c87c9684d67becce819eeaf7861af111b022 Mon Sep 17 00:00:00 2001 From: Sam Ellicott Date: Sun, 17 May 2020 19:22:57 -0400 Subject: [PATCH] Make a function to manually register parameters. --- colorchord2/main.c | 62 ++++++++++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 22 deletions(-) diff --git a/colorchord2/main.c b/colorchord2/main.c index c1869ea..53421f4 100644 --- a/colorchord2/main.c +++ b/colorchord2/main.c @@ -143,9 +143,9 @@ int set_screenx = 640; REGISTER_PARAM( set_screenx, PAINT ); int set_screeny = 480; REGISTER_PARAM( set_screeny, PAINT ); char sound_source[16]; REGISTER_PARAM( sound_source, PABUFFER ); int cpu_autolimit = 1; REGISTER_PARAM( cpu_autolimit, PAINT ); -float cpu_autolimit_interval = 0.016; REGISTER_PARAM( cpu_autolimit_interval, PAFLOAT ); -int sample_channel = -1;REGISTER_PARAM( sample_channel, PAINT ); -int showfps = 1; REGISTER_PARAM( showfps, PAINT ); +float cpu_autolimit_interval = 0.016; REGISTER_PARAM( cpu_autolimit_interval, PAFLOAT ); +int sample_channel = -1; REGISTER_PARAM( sample_channel, PAINT ); +int showfps = 1; REGISTER_PARAM( showfps, PAINT ); #if defined(ANDROID) || defined( __android__ ) float in_amplitude = 2; @@ -308,17 +308,11 @@ void HandleResume() } #endif -int main(int argc, char ** argv) -{ - int i; -#if defined(__TINYC__) - // zero out the drivers list - for ( int ii = 0; i< MAX_OUT_DRIVERS; ++i) { - ODList[i].Name = NULL; - ODList[i].Init = NULL; - } +// function for calling initilization functions if we are using TCC +#ifdef TCC +void RegisterConstructorFunctions(){ - + // Basic Window stuff REGISTERheadless(); REGISTERset_screenx(); REGISTERset_screeny(); @@ -327,12 +321,43 @@ int main(int argc, char ** argv) REGISTERcpu_autolimit_interval(); REGISTERsample_channel(); REGISTERshowfps(); + REGISTERin_amplitude(); + + // Audio stuff + REGISTERNullCNFA(); + REGISTERWinCNFA(); + REGISTERcnfa_wasapi(); + + // Video Stuff + REGISTERnull(); + REGISTERDisplayArray(); + //REGISTERDisplayDMX(); + //REGISTERDisplayFileWrite(); + REGISTERDisplayHIDAPI(); + REGISTERDisplayNetwork(); + REGISTERDisplayOutDriver(); + REGISTERDisplayPie(); + //REGISTERDisplaySHM(); + + // Output stuff + //REGISTERDisplayUSB2812(); + REGISTEROutputCells(); + REGISTEROutputLinear(); + REGISTEROutputProminent(); + REGISTEROutputVoronoi(); + //REGISTERRecorderPlugin(); + + //void ManuallyRegisterDevices(); + //ManuallyRegisterDevices(); +} #endif +int main(int argc, char ** argv) +{ + int i; #ifdef TCC - void ManuallyRegisterDevices(); - ManuallyRegisterDevices(); + RegisterConstructorFunctions(); #endif printf( "Output Drivers:\n" ); @@ -345,10 +370,6 @@ int main(int argc, char ** argv) WSAStartup(0x202, &wsaData); - #ifdef TCC - REGISTERWinCNFA(); - REGISTERcnfa_wasapi(); - #endif strcpy( sound_source, "WASAPI" ); // Use either "sound_source=WASAPI" or "sound_source=WIN" in config file. #elif defined( ANDROID ) @@ -657,6 +678,3 @@ int main(int argc, char ** argv) } } - - -