diff --git a/doc/fluidsynth_register_adriver.c b/doc/fluidsynth_register_adriver.c new file mode 100644 index 00000000..e9e96413 --- /dev/null +++ b/doc/fluidsynth_register_adriver.c @@ -0,0 +1,49 @@ +/** + * This is a simple C99 program that demonstrates the usage of fluid_audio_driver_register() + * + * There are 3 calls to fluid_audio_driver_register(), i.e. 3 iterations: + * First the alsa driver is registered and created, followed by the jack and portaudio driver. + * + * The usual usecase would be to call fluid_audio_driver_register() only once providing the audio drivers needed during fluidsynth usage. + * If necessary however fluid_audio_driver_register() can be called multiple times as demonstrated here. + * Therefore the user must make sure to delete all fluid-instances of any kind before making the call to fluid_audio_driver_register(). + * Else the behaviour is undefined and the application is likely to crash. + */ + +#include +#include + +int main() +{ + const char* DRV[] = { "alsa", "jack", "portaudio" }; + const char* adrivers[2]; + + for(int i=0; i