summaryrefslogtreecommitdiff
path: root/synth/jack.cpp
diff options
context:
space:
mode:
authorFlorian Jung <flo@thinkpad.(none)>2011-01-10 20:20:10 +0100
committerFlorian Jung <flo@thinkpad.(none)>2011-01-10 20:20:10 +0100
commite32591388a18c8226e61b8f88b031ed7c88ca153 (patch)
tree999f6653d0cfac3153679a8352c28f4e92805306 /synth/jack.cpp
parentb34cab5dd6d4ac16a6a58589397a3d82df38b826 (diff)
Improved in-synth-cli, still TODO
The CLI can now prepare loading a note without actually loading it
Diffstat (limited to 'synth/jack.cpp')
-rw-r--r--synth/jack.cpp35
1 files changed, 34 insertions, 1 deletions
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;i<N_CHANNELS;i++)
+ channel[i]->kill_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<N_CHANNELS;i++)
{
outbuf[i]=(jack_default_audio_sample_t*) jack_port_get_buffer(out_port[i], nframes);
@@ -500,4 +534,3 @@ int process_callback(jack_nframes_t nframes, void *notused)
return 0;
}
-