summaryrefslogtreecommitdiff
path: root/lv2
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2015-05-22 10:34:21 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2015-05-22 10:34:21 +0200
commitbef1d5542f926a3b942374707dd56041013d35ff (patch)
tree71161b4239db1de08d5a3ee60399a596490f3486 /lv2
parentacf59a4f960b3e45db566675551b8158b47e1554 (diff)
Added framesize control mechanism to the engine, and made us of it in the cachemanager and drumkitloader.
Diffstat (limited to 'lv2')
-rw-r--r--lv2/lv2.cc34
1 files changed, 16 insertions, 18 deletions
diff --git a/lv2/lv2.cc b/lv2/lv2.cc
index d87665d..687f989 100644
--- a/lv2/lv2.cc
+++ b/lv2/lv2.cc
@@ -47,12 +47,11 @@ static DrumGizmo *dg_get_pci(LV2_Handle instance)
return dglv2->dg;
}
-LV2_State_Status
-dg_save(LV2_Handle instance,
- LV2_State_Store_Function store,
- LV2_State_Handle handle,
- uint32_t flags,
- const LV2_Feature *const * features)
+LV2_State_Status dg_save(LV2_Handle instance,
+ LV2_State_Store_Function store,
+ LV2_State_Handle handle,
+ uint32_t flags,
+ const LV2_Feature *const * features)
{
DGLV2 *dglv2 = (DGLV2 *)instance;
@@ -77,12 +76,11 @@ dg_save(LV2_Handle instance,
return LV2_STATE_SUCCESS;
}
-LV2_State_Status
-dg_restore(LV2_Handle instance,
- LV2_State_Retrieve_Function retrieve,
- LV2_State_Handle handle,
- uint32_t flags,
- const LV2_Feature *const * features)
+LV2_State_Status dg_restore(LV2_Handle instance,
+ LV2_State_Retrieve_Function retrieve,
+ LV2_State_Handle handle,
+ uint32_t flags,
+ const LV2_Feature *const * features)
{
DGLV2 *dglv2 = (DGLV2 *)instance;
@@ -148,9 +146,7 @@ LV2_Handle instantiate(const struct _LV2_Descriptor *descriptor,
return (LV2_Handle)dglv2;
}
-void connect_port(LV2_Handle instance,
- uint32_t port,
- void *data_location)
+void connect_port(LV2_Handle instance, uint32_t port, void *data_location)
{
DGLV2 *dglv2 = (DGLV2 *)instance;
@@ -171,12 +167,15 @@ void activate(LV2_Handle instance)
(void)dglv2;
}
-void run(LV2_Handle instance,
- uint32_t sample_count)
+void run(LV2_Handle instance, uint32_t sample_count)
{
static size_t pos = 0;
DGLV2 *dglv2 = (DGLV2 *)instance;
+ if(dglv2->buffer_size != sample_count) {
+ dglv2->buffer_size = sample_count;
+ dglv2->dg->setFrameSize(sample_count);
+ }
dglv2->dg->run(pos, dglv2->buffer, sample_count);
pos += sample_count;
@@ -184,7 +183,6 @@ void run(LV2_Handle instance,
void deactivate(LV2_Handle instance)
{
- // We don't really need to do anything here.
DGLV2 *dglv2 = (DGLV2 *)instance;
dglv2->dg->stop();
}