aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2017-12-21 18:12:20 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2017-12-21 18:12:20 +0100
commite92cfb73e0df9f9ebcce9813fae3c9064a378905 (patch)
treef1a48061ceb006e2ef3aa10c544f3659f289e1ef
parente1077e31650ddf9b9b5680c54ffda7b01bfdead6 (diff)
downloadsynthpod-e92cfb73e0df9f9ebcce9813fae3c9064a378905.tar.xz
app: support setting CV buffers in state changes.
-rw-r--r--VERSION2
-rw-r--r--app/synthpod_app_state.c47
2 files changed, 31 insertions, 18 deletions
diff --git a/VERSION b/VERSION
index 315d833d..387c82f3 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.5387
+0.1.5389
diff --git a/app/synthpod_app_state.c b/app/synthpod_app_state.c
index b9d48ee7..066b979d 100644
--- a/app/synthpod_app_state.c
+++ b/app/synthpod_app_state.c
@@ -170,26 +170,27 @@ _state_set_value(const char *symbol, void *data,
uint32_t index = lilv_port_get_index(mod->plug, port);
port_t *tar = &mod->ports[index];
+ float val = 0.f;
+
+ if( (type == app->forge.Int) && (size == sizeof(int32_t)) )
+ val = *(const int32_t *)value;
+ else if( (type == app->forge.Long) && (size == sizeof(int64_t)) )
+ val = *(const int64_t *)value;
+ else if( (type == app->forge.Float) && (size == sizeof(float)) )
+ val = *(const float *)value;
+ else if( (type == app->forge.Double) && (size == sizeof(double)) )
+ val = *(const double *)value;
+ else if( (type == app->forge.Bool) && (size == sizeof(int32_t)) )
+ val = *(const int32_t *)value;
+ else
+ {
+ sp_app_log_error(app, "%s: value of unknown type\n", __func__);
+ return;
+ }
+
if(tar->type == PORT_TYPE_CONTROL)
{
control_port_t *control = &tar->control;
- float val = 0.f;
-
- if( (type == app->forge.Int) && (size == sizeof(int32_t)) )
- val = *(const int32_t *)value;
- else if( (type == app->forge.Long) && (size == sizeof(int64_t)) )
- val = *(const int64_t *)value;
- else if( (type == app->forge.Float) && (size == sizeof(float)) )
- val = *(const float *)value;
- else if( (type == app->forge.Double) && (size == sizeof(double)) )
- val = *(const double *)value;
- else if( (type == app->forge.Bool) && (size == sizeof(int32_t)) )
- val = *(const int32_t *)value;
- else
- {
- sp_app_log_error(app, "%s: value of unknown type\n", __func__);
- return;
- }
// FIXME not rt-safe
float *buf_ptr = PORT_BASE_ALIGNED(tar);
@@ -204,6 +205,18 @@ _state_set_value(const char *symbol, void *data,
control->stash = val;
_sp_app_port_unlock(control);
}
+ else if(tar->type == PORT_TYPE_CV)
+ {
+ cv_port_t *cv = &tar->cv;
+
+ // FIXME not rt-safe
+ float *buf_ptr = PORT_BASE_ALIGNED(tar);
+ for(unsigned i=0; i<app->driver->max_block_size; i++)
+ {
+ buf_ptr[i] = val;
+ }
+ // FIXME not rt-safe
+ }
}
__non_realtime static const void *