summaryrefslogtreecommitdiff
path: root/lv2/output_lv2.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2012-01-23 20:37:57 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2012-01-23 20:37:57 +0100
commit8cd3f1729a417d933744cf64e2adf78dc07e265c (patch)
tree8d677dced9b5efcb670dd3b04d7426a56e1ff96d /lv2/output_lv2.cc
parent4a4d0a84bb1b80555052f59c1a4addc870ce5fda (diff)
Make plugin store its state. Connect state and GUI (and use GUI)
Diffstat (limited to 'lv2/output_lv2.cc')
-rw-r--r--lv2/output_lv2.cc18
1 files changed, 15 insertions, 3 deletions
diff --git a/lv2/output_lv2.cc b/lv2/output_lv2.cc
index 226b92a..8187a5a 100644
--- a/lv2/output_lv2.cc
+++ b/lv2/output_lv2.cc
@@ -30,7 +30,10 @@
OutputLV2::OutputLV2()
{
- for(size_t i = 0; i < NUM_OUTPUTS; i++) outputPort[i] = NULL;
+ for(size_t i = 0; i < NUM_OUTPUTS; i++) {
+ outputPorts[i].size = 0;
+ outputPorts[i].samples = NULL;
+ }
}
OutputLV2::~OutputLV2()
@@ -59,11 +62,14 @@ void OutputLV2::pre(size_t nsamples)
{
}
+#include <stdio.h>
void OutputLV2::run(int ch, sample_t *samples, size_t nsamples)
{
if(ch < NUM_OUTPUTS) {
- if(outputPort[ch])
- memcpy(outputPort[ch], samples, nsamples * sizeof(sample_t));
+ // if(outputPorts[ch].size != nsamples) printf("port.%d nsamples.%d\n", outputPorts[ch].size, nsamples);
+ if(outputPorts[ch].samples) {
+ memcpy(outputPorts[ch].samples, samples, nsamples * sizeof(sample_t));
+ }
}
}
@@ -71,6 +77,12 @@ void OutputLV2::post(size_t nsamples)
{
}
+sample_t *OutputLV2::getBuffer(int ch)
+{
+ if(ch < NUM_OUTPUTS) return outputPorts[ch].samples;
+ return NULL;
+}
+
#ifdef TEST_OUTPUT_LV2
//Additional dependency files
//deps: