aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin/ext_urid.c1
-rw-r--r--bin/synthpod_bin.h4
-rw-r--r--bin/synthpod_jack.c19
-rw-r--r--bin/synthpod_nsm.c40
-rw-r--r--lib/patcher.c3
-rw-r--r--lib/smart_meter.c6
-rw-r--r--lib/smart_slider.c6
-rw-r--r--lib/smart_spinner.c5
-rw-r--r--lib/smart_toggle.c6
-rw-r--r--lib/synthpod_app.c13
-rw-r--r--lib/synthpod_ui.c37
-rw-r--r--plugins/synthpod_stereo.c1
12 files changed, 56 insertions, 85 deletions
diff --git a/bin/ext_urid.c b/bin/ext_urid.c
index 8f7c6925..d5534b89 100644
--- a/bin/ext_urid.c
+++ b/bin/ext_urid.c
@@ -101,7 +101,6 @@ _urid_map(LV2_URID_Map_Handle handle, const char *uri)
else
{
eina_hash_del(uri_hash->uris, uri_dup, urid);
- eina_lock_release(&uri_hash->mutex);
}
}
diff --git a/bin/synthpod_bin.h b/bin/synthpod_bin.h
index 8bf3bd4a..20952058 100644
--- a/bin/synthpod_bin.h
+++ b/bin/synthpod_bin.h
@@ -400,7 +400,9 @@ bin_run(bin_t *bin, char **argv, const synthpod_nsm_driver_t *nsm_driver)
// threads init
Eina_Bool status = eina_thread_create(&bin->worker_thread,
- EINA_THREAD_URGENT, -1, _worker_thread, bin); //TODO
+ EINA_THREAD_URGENT, -1, _worker_thread, bin);
+ if(!status)
+ fprintf(stderr, "creation of worker thread failed\n");
// main loop
elm_run();
diff --git a/bin/synthpod_jack.c b/bin/synthpod_jack.c
index 7b5ebdbe..15194012 100644
--- a/bin/synthpod_jack.c
+++ b/bin/synthpod_jack.c
@@ -177,14 +177,14 @@ _message(osc_time_t timestamp, const char *path, const char *fmt,
{
case 'i':
{
- int32_t i;
+ int32_t i = 0;
ptr = osc_get_int32(ptr, &i);
osc_forge_int32(&handle->oforge, forge, i);
break;
}
case 'f':
{
- float f;
+ float f = 0.f;
ptr = osc_get_float(ptr, &f);
osc_forge_float(&handle->oforge, forge, f);
break;
@@ -192,14 +192,14 @@ _message(osc_time_t timestamp, const char *path, const char *fmt,
case 's':
case 'S':
{
- const char *s;
+ const char *s = "";
ptr = osc_get_string(ptr, &s);
osc_forge_string(&handle->oforge, forge, s);
break;
}
case 'b':
{
- osc_blob_t b;
+ osc_blob_t b = {.size = 0, .payload=NULL};
ptr = osc_get_blob(ptr, &b);
osc_forge_blob(&handle->oforge, forge, b.size, b.payload);
break;
@@ -207,21 +207,21 @@ _message(osc_time_t timestamp, const char *path, const char *fmt,
case 'h':
{
- int64_t h;
+ int64_t h = 0;
ptr = osc_get_int64(ptr, &h);
osc_forge_int64(&handle->oforge, forge, h);
break;
}
case 'd':
{
- double d;
+ double d = 0.f;
ptr = osc_get_double(ptr, &d);
osc_forge_double(&handle->oforge, forge, d);
break;
}
case 't':
{
- uint64_t t;
+ uint64_t t = 0;
ptr = osc_get_timetag(ptr, &t);
osc_forge_timestamp(&handle->oforge, forge, t);
break;
@@ -237,14 +237,14 @@ _message(osc_time_t timestamp, const char *path, const char *fmt,
case 'c':
{
- char c;
+ char c = '\0';
ptr = osc_get_char(ptr, &c);
osc_forge_char(&handle->oforge, forge, c);
break;
}
case 'm':
{
- const uint8_t *m;
+ const uint8_t *m = NULL;
ptr = osc_get_midi(ptr, &m);
osc_forge_midi(&handle->oforge, forge, 3, m + 1); // skip port byte
break;
@@ -1135,7 +1135,6 @@ elm_main(int argc, char **argv)
bin_init(bin);
LV2_URID_Map *map = ext_urid_map_get(bin->ext_urid);
- LV2_URID_Unmap *unmap = ext_urid_unmap_get(bin->ext_urid);
lv2_atom_forge_init(&handle.forge, map);
osc_forge_init(&handle.oforge, map);
diff --git a/bin/synthpod_nsm.c b/bin/synthpod_nsm.c
index a34baf91..a07a6966 100644
--- a/bin/synthpod_nsm.c
+++ b/bin/synthpod_nsm.c
@@ -54,14 +54,14 @@ _reply(osc_time_t time, const char *path, const char *fmt, const osc_data_t *buf
{
synthpod_nsm_t *nsm = data;
- const char *target;
+ const char *target = NULL;
const osc_data_t *ptr = buf;
ptr = osc_get_string(ptr, &target);
//fprintf(stdout, "synthpod_nsm reply: %s\n", target);
- if(!strcmp(target, "/nsm/server/announce"))
+ if(target && !strcmp(target, "/nsm/server/announce"))
{
const char *message;
const char *manager;
@@ -69,7 +69,7 @@ _reply(osc_time_t time, const char *path, const char *fmt, const osc_data_t *buf
ptr = osc_get_string(ptr, &message);
ptr = osc_get_string(ptr, &manager);
- ptr = osc_get_string(ptr, &capabilities);
+ osc_get_string(ptr, &capabilities);
//TODO, e.g. toggle SM LED
}
@@ -83,14 +83,14 @@ _error(osc_time_t time, const char *path, const char *fmt, const osc_data_t *buf
{
synthpod_nsm_t *nsm = data;
- const char *msg;
- int32_t code;
- const char *err;
+ const char *msg = NULL;
+ int32_t code = 0;
+ const char *err = NULL;
const osc_data_t *ptr = buf;
ptr = osc_get_string(ptr, &msg);
ptr = osc_get_int32(ptr, &code);
- ptr = osc_get_string(ptr, &err);
+ osc_get_string(ptr, &err);
fprintf(stderr, "synthpod_nsm error: #%i in %s: %s\n", code, msg, err);
@@ -103,17 +103,18 @@ _client_open(osc_time_t time, const char *path, const char *fmt, const osc_data_
{
synthpod_nsm_t *nsm = data;
- const char *dir;
- const char *name;
- const char *id;
+ const char *dir = NULL;
+ const char *name = NULL;
+ const char *id = NULL;
const osc_data_t *ptr = buf;
ptr = osc_get_string(ptr, &path);
ptr = osc_get_string(ptr, &name);
- ptr = osc_get_string(ptr, &id);
+ osc_get_string(ptr, &id);
// open/create app
- int ret = nsm->driver->open(path, name, id, nsm->data); //TODO check
+ if(nsm->driver->open(path, name, id, nsm->data))
+ fprintf(stderr, "NSM load failed\n");
return 1;
}
@@ -126,7 +127,8 @@ _client_save(osc_time_t time, const char *path, const char *fmt, const osc_data_
const osc_data_t *ptr;
// save app
- int ret = nsm->driver->save(nsm->data); //TODO check
+ if(nsm->driver->save(nsm->data))
+ fprintf(stderr, "NSM save failed\n");
return 1;
}
@@ -138,7 +140,11 @@ _client_show_optional_gui(osc_time_t time, const char *path, const char *fmt, co
synthpod_nsm_t *nsm = data;
// show gui
- int ret = nsm->driver->show(nsm->data); //TODO check
+ if(nsm->driver->show(nsm->data))
+ {
+ fprintf(stderr, "NSM show GUI failed\n");
+ return 1;
+ }
// reply
const osc_data_t *ptr;
@@ -162,7 +168,11 @@ _client_hide_optional_gui(osc_time_t time, const char *path, const char *fmt, co
synthpod_nsm_t *nsm = data;
// hide gui
- int ret = nsm->driver->hide(nsm->data); //TODO check
+ if(nsm->driver->hide(nsm->data))
+ {
+ fprintf(stderr, "NSM hide GUI failed\n");
+ return 1;
+ }
// reply
const osc_data_t *ptr;
diff --git a/lib/patcher.c b/lib/patcher.c
index 503a5636..7d4ab93e 100644
--- a/lib/patcher.c
+++ b/lib/patcher.c
@@ -602,8 +602,6 @@ _patcher_smart_add(Evas_Object *o)
static void
_patcher_smart_del(Evas_Object *o)
{
- patcher_t *priv = evas_object_smart_data_get(o);
-
_patcher_smart_deinit(o);
_patcher_parent_sc->del(o);
@@ -612,7 +610,6 @@ _patcher_smart_del(Evas_Object *o)
static void
_patcher_smart_resize(Evas_Object *o, Evas_Coord w, Evas_Coord h)
{
- patcher_t *priv = evas_object_smart_data_get(o);
Evas_Coord ow, oh;
evas_object_geometry_get(o, NULL, NULL, &ow, &oh);
diff --git a/lib/smart_meter.c b/lib/smart_meter.c
index c25b07a5..6b42e160 100644
--- a/lib/smart_meter.c
+++ b/lib/smart_meter.c
@@ -39,7 +39,6 @@ EVAS_SMART_SUBCLASS_NEW(SMART_METER_TYPE, _smart_meter,
static void
_smart_meter_smart_init(Evas_Object *o)
{
- Evas *e = evas_object_evas_get(o);
smart_meter_t *priv = evas_object_smart_data_get(o);
Evas_Object *elmnt;
@@ -51,8 +50,6 @@ _smart_meter_smart_init(Evas_Object *o)
static void
_smart_meter_smart_deinit(Evas_Object *o)
{
- smart_meter_t *priv = evas_object_smart_data_get(o);
-
//TODO
}
@@ -85,8 +82,6 @@ _smart_meter_smart_add(Evas_Object *o)
static void
_smart_meter_smart_del(Evas_Object *o)
{
- smart_meter_t *priv = evas_object_smart_data_get(o);
-
_smart_meter_smart_deinit(o);
_smart_meter_parent_sc->del(o);
}
@@ -94,7 +89,6 @@ _smart_meter_smart_del(Evas_Object *o)
static void
_smart_meter_smart_resize(Evas_Object *o, Evas_Coord w, Evas_Coord h)
{
- smart_meter_t *priv = evas_object_smart_data_get(o);
Evas_Coord ow, oh;
evas_object_geometry_get(o, NULL, NULL, &ow, &oh);
diff --git a/lib/smart_slider.c b/lib/smart_slider.c
index 49167446..e1adf56b 100644
--- a/lib/smart_slider.c
+++ b/lib/smart_slider.c
@@ -62,7 +62,6 @@ EVAS_SMART_SUBCLASS_NEW(SMART_SLIDER_TYPE, _smart_slider,
static void
_smart_slider_smart_init(Evas_Object *o)
{
- Evas *e = evas_object_evas_get(o);
smart_slider_t *priv = evas_object_smart_data_get(o);
Evas_Object *elmnt;
@@ -87,8 +86,6 @@ _smart_slider_smart_init(Evas_Object *o)
static void
_smart_slider_smart_deinit(Evas_Object *o)
{
- smart_slider_t *priv = evas_object_smart_data_get(o);
-
//TODO
}
@@ -257,8 +254,6 @@ _smart_slider_smart_add(Evas_Object *o)
static void
_smart_slider_smart_del(Evas_Object *o)
{
- smart_slider_t *priv = evas_object_smart_data_get(o);
-
_smart_slider_smart_deinit(o);
_smart_slider_parent_sc->del(o);
}
@@ -266,7 +261,6 @@ _smart_slider_smart_del(Evas_Object *o)
static void
_smart_slider_smart_resize(Evas_Object *o, Evas_Coord w, Evas_Coord h)
{
- smart_slider_t *priv = evas_object_smart_data_get(o);
Evas_Coord ow, oh;
evas_object_geometry_get(o, NULL, NULL, &ow, &oh);
diff --git a/lib/smart_spinner.c b/lib/smart_spinner.c
index bae18936..b6617884 100644
--- a/lib/smart_spinner.c
+++ b/lib/smart_spinner.c
@@ -61,7 +61,6 @@ EVAS_SMART_SUBCLASS_NEW(SMART_SPINNER_TYPE, _smart_spinner,
static void
_smart_spinner_smart_init(Evas_Object *o)
{
- Evas *e = evas_object_evas_get(o);
smart_spinner_t *priv = evas_object_smart_data_get(o);
priv->elmnts = NULL;
@@ -239,8 +238,6 @@ _smart_spinner_smart_add(Evas_Object *o)
static void
_smart_spinner_smart_del(Evas_Object *o)
{
- smart_spinner_t *priv = evas_object_smart_data_get(o);
-
_smart_spinner_smart_deinit(o);
_smart_spinner_parent_sc->del(o);
}
@@ -248,7 +245,6 @@ _smart_spinner_smart_del(Evas_Object *o)
static void
_smart_spinner_smart_resize(Evas_Object *o, Evas_Coord w, Evas_Coord h)
{
- smart_spinner_t *priv = evas_object_smart_data_get(o);
Evas_Coord ow, oh;
evas_object_geometry_get(o, NULL, NULL, &ow, &oh);
@@ -350,7 +346,6 @@ smart_spinner_value_set(Evas_Object *o, float value)
}
itr -= 1;
- elmnt = eina_list_nth(priv->elmnts, itr);
priv->drag = 1.f / (priv->count - 1) * itr;
priv->value = INT_MAX;
diff --git a/lib/smart_toggle.c b/lib/smart_toggle.c
index e6886817..c2843783 100644
--- a/lib/smart_toggle.c
+++ b/lib/smart_toggle.c
@@ -50,7 +50,6 @@ EVAS_SMART_SUBCLASS_NEW(SMART_TOGGLE_TYPE, _smart_toggle,
static void
_smart_toggle_smart_init(Evas_Object *o)
{
- Evas *e = evas_object_evas_get(o);
smart_toggle_t *priv = evas_object_smart_data_get(o);
priv->value = 0;
@@ -63,8 +62,6 @@ _smart_toggle_smart_init(Evas_Object *o)
static void
_smart_toggle_smart_deinit(Evas_Object *o)
{
- smart_toggle_t *priv = evas_object_smart_data_get(o);
-
//TODO
}
@@ -149,8 +146,6 @@ _smart_toggle_smart_add(Evas_Object *o)
static void
_smart_toggle_smart_del(Evas_Object *o)
{
- smart_toggle_t *priv = evas_object_smart_data_get(o);
-
_smart_toggle_smart_deinit(o);
_smart_toggle_parent_sc->del(o);
}
@@ -158,7 +153,6 @@ _smart_toggle_smart_del(Evas_Object *o)
static void
_smart_toggle_smart_resize(Evas_Object *o, Evas_Coord w, Evas_Coord h)
{
- smart_toggle_t *priv = evas_object_smart_data_get(o);
Evas_Coord ow, oh;
evas_object_geometry_get(o, NULL, NULL, &ow, &oh);
diff --git a/lib/synthpod_app.c b/lib/synthpod_app.c
index 64461947..ffd72d50 100644
--- a/lib/synthpod_app.c
+++ b/lib/synthpod_app.c
@@ -781,13 +781,6 @@ _sp_app_mod_add(sp_app_t *app, const char *uri, uint32_t uid)
mod->sys.iface = lilv_instance_get_extension_data(mod->inst,
SYSTEM_PORT__interface);
- int system_source = 0;
- int system_sink = 0;
- if(!strcmp(uri, SYNTHPOD_PREFIX"source"))
- system_source = 1;
- else if(!strcmp(uri, SYNTHPOD_PREFIX"sink"))
- system_sink = 1;
-
// clear pool sizes
for(port_type_t pool=0; pool<PORT_TYPE_NUM; pool++)
mod->pools[pool].size = 0;
@@ -3396,7 +3389,8 @@ sp_app_nominal_block_length(sp_app_t *app, uint32_t nsamples)
}};
// notify new minimalBlockLength
- uint32_t ret = mod->opts.iface->set(mod->handle, options); // TODO check
+ if(mod->opts.iface->set(mod->handle, options) != LV2_OPTIONS_SUCCESS)
+ fprintf(stderr, "option setting of min_block_size failed\n");
}
const int32_t nominal_block_length = nsamples;
@@ -3414,7 +3408,8 @@ sp_app_nominal_block_length(sp_app_t *app, uint32_t nsamples)
}};
// notify new nominalBlockLength
- uint32_t ret = mod->opts.iface->set(mod->handle, options); // TODO check
+ if(mod->opts.iface->set(mod->handle, options) != LV2_OPTIONS_SUCCESS)
+ fprintf(stderr, "option setting of min_block_size failed\n");
}
}
}
diff --git a/lib/synthpod_ui.c b/lib/synthpod_ui.c
index 592745df..72eabacd 100644
--- a/lib/synthpod_ui.c
+++ b/lib/synthpod_ui.c
@@ -423,7 +423,6 @@ _std_port_event(LV2UI_Handle handle, uint32_t index, uint32_t size,
if(property && value)
{
- LV2_URID subject_val = subject ? subject->body : 0;
LV2_URID property_val = property->body;
//printf("ui got patch:Set: %u %u %s\n",
@@ -499,7 +498,6 @@ _eo_port_event(LV2UI_Handle handle, uint32_t index, uint32_t size,
uint32_t protocol, const void *buf)
{
mod_t *mod = handle;
- sp_ui_t *ui = mod->ui;
//printf("_eo_port_event: %u %u %u\n", index, size, protocol);
@@ -568,7 +566,6 @@ _port_subscribe(LV2UI_Feature_Handle handle, uint32_t index, uint32_t protocol,
const LV2_Feature *const *features)
{
mod_t *mod = handle;
- sp_ui_t *ui = mod->ui;
_port_subscription_set(mod, index, protocol, 1);
@@ -580,7 +577,6 @@ _port_unsubscribe(LV2UI_Feature_Handle handle, uint32_t index, uint32_t protocol
const LV2_Feature *const *features)
{
mod_t *mod = handle;
- sp_ui_t *ui = mod->ui;
_port_subscription_set(mod, index, protocol, 0);
@@ -904,10 +900,12 @@ _show_ui_hide(mod_t *mod)
// hide UI
int res = 0;
if(mod->show.show_iface && mod->show.show_iface->hide && mod->show.handle)
- res = mod->show.show_iface->hide(mod->show.handle);
- //TODO handle res != 0
-
- mod->show.visible = 0; // toggle visibility flag
+ {
+ if(mod->show.show_iface->hide(mod->show.handle))
+ fprintf(stderr, "show_iface->hide failed\n");
+ else
+ mod->show.visible = 0; // toggle visibility flag
+ }
// unsubscribe all ports
for(int i=0; i<mod->num_ports; i++)
@@ -995,12 +993,13 @@ _show_ui_show(mod_t *mod)
return;
// show UI
- int res = 0;
if(mod->show.show_iface && mod->show.show_iface->show && mod->show.handle)
- res = mod->show.show_iface->show(mod->show.handle);
- //TODO handle res != 0
-
- mod->show.visible = 1; // toggle visibility flag
+ {
+ if(mod->show.show_iface->show(mod->show.handle))
+ fprintf(stderr, "show_iface->show failed\n");
+ else
+ mod->show.visible = 1; // toggle visibility flag
+ }
// get idle iface if any
if(mod->show.descriptor->extension_data)
@@ -2270,7 +2269,7 @@ _modlist_expanded(void *data, Evas_Object *obj, void *event_info)
if(mod->system.sink && (port->direction == PORT_DIRECTION_OUTPUT) )
continue;
- Elm_Object_Item *parent = itm;
+ Elm_Object_Item *parent;
if(port->group)
{
const char *group_lbl = lilv_node_as_string(port->group);
@@ -2918,7 +2917,7 @@ _property_string_activated(void *data, Evas_Object *obj, void *event_info)
&ui->forge, trans, mod->uid, index, strsize,
mod->subject, prop->tar_urid, prop->type_urid);
if(atom)
- strcpy(LV2_ATOM_BODY(atom), entered);
+ strncpy(LV2_ATOM_BODY(atom), entered, strsize-1);
_sp_ui_to_app_advance(ui, len);
}
}
@@ -3469,11 +3468,6 @@ _modlist_std_content_get(void *data, Evas_Object *obj, const char *part)
Evas_Object *child = NULL;
if(port->type == PORT_TYPE_CONTROL)
{
- float step_val = port->integer
- ? 1.f / (port->max - port->min)
- : 0.001; // use 1000 steps for continuous values
- float val = port->dflt;
-
if(port->toggled)
{
Evas_Object *check = smart_toggle_add(evas_object_evas_get(lay));
@@ -3583,7 +3577,6 @@ _modlist_psets_content_get(void *data, Evas_Object *obj, const char *part)
return NULL;
mod_t *mod = data;
- sp_ui_t *ui = mod->ui;
if(strcmp(part, "elm.swallow.content"))
return NULL;
@@ -4717,7 +4710,7 @@ sp_ui_new(Evas_Object *win, const LilvWorld *world, sp_ui_driver_t *driver,
for(int t=0; t<PORT_TYPE_NUM; t++)
{
- Elm_Object_Item *itm = elm_gengrid_item_append(ui->patchgrid, ui->patchitc,
+ elm_gengrid_item_append(ui->patchgrid, ui->patchitc,
&ui->matrix[t], NULL, NULL);
}
} // patchgrid
diff --git a/plugins/synthpod_stereo.c b/plugins/synthpod_stereo.c
index 39ac71b6..1fb8324d 100644
--- a/plugins/synthpod_stereo.c
+++ b/plugins/synthpod_stereo.c
@@ -529,7 +529,6 @@ static void
connect_port(LV2_Handle instance, uint32_t port, void *data)
{
plughandle_t *handle = instance;
- sp_app_t *app = handle->app;
switch(port)
{