From bfc79cef2cb743fedba3e93fd005d25b0a4923dc Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Wed, 9 Oct 2024 17:59:41 +0200 Subject: Added mutex and proper audio playback --- main.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'main.c') diff --git a/main.c b/main.c index 5a1916e..4eb4cf7 100644 --- a/main.c +++ b/main.c @@ -7,6 +7,7 @@ #include "version.h" #include "midi.h" #include "synth.h" +#include "mutex.h" void help(const char *argv0) { printf("Usage: %s [options]\n" @@ -70,6 +71,9 @@ int main(int argc, char *argv[]) { fprintf(stdout, "> Device port: %s\n", port_name); fprintf(stdout, "> Soundfont: %s\n", soundfont_file); + // Create mutex. + initialize_mutex(); + // Create synth thread. pthread_t synth_thread; SynthArgs synth_args = { soundfont_file }; @@ -91,6 +95,9 @@ int main(int argc, char *argv[]) { pthread_join(midi_thread, NULL); pthread_join(synth_thread, NULL); + // Destroy mutex. + destroy_mutex(); + fprintf(stdout, "Exiting...\n"); return 0; } -- cgit v1.2.3