From e32591388a18c8226e61b8f88b031ed7c88ca153 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Mon, 10 Jan 2011 20:20:10 +0100 Subject: Improved in-synth-cli, still TODO The CLI can now prepare loading a note without actually loading it --- synth/jack.cpp | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'synth/jack.cpp') diff --git a/synth/jack.cpp b/synth/jack.cpp index 0c98855..fbf1ea0 100644 --- a/synth/jack.cpp +++ b/synth/jack.cpp @@ -9,6 +9,7 @@ #include "globals.h" #include "jack.h" +#include "communication.h" using namespace std; @@ -23,6 +24,28 @@ jack_port_t *out_port2[N_CHANNELS]; jack_client_t *jack_client = NULL; +void manage_program_lock(int prog, bool lock) //TODO woandershinschieben? +{ + program_lock[prog]=lock; + + if (lock) + for (int i=0;ikill_program(prog); +} + +void process_request() +{ + if (suspend_request.prog==-1) + for (int i=0;i<128;i++) + manage_program_lock(i,suspend_request.suspend); + else + manage_program_lock(suspend_request.prog,suspend_request.suspend); + + suspend_request.done=true; +} + + + void maybe_calc_stuff() //TODO woandershinschieben? lfo.cpp oder so? { static int lfocnt=0; @@ -263,6 +286,17 @@ int process_callback(jack_nframes_t nframes, void *notused) return 0; } + + + pthread_mutex_lock(&suspend_request_mutex); + if (suspend_request.done==false) + process_request(); + pthread_mutex_unlock(&suspend_request_mutex); + + + + + for (i=0;i