aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2018-03-29 08:58:09 +0200
committerGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2018-03-29 08:58:09 +0200
commitf4114ca1a7c7fe5505e0184ef2fe67162627683d (patch)
tree23511e3920257ed6a44b2fa381969088771ec52f
parent7f1a915cb54d37695a79e8027e1434eb5c80b43d (diff)
downloadsynthpod-f4114ca1a7c7fe5505e0184ef2fe67162627683d.zip
synthpod-f4114ca1a7c7fe5505e0184ef2fe67162627683d.tar.gz
synthpod-f4114ca1a7c7fe5505e0184ef2fe67162627683d.tar.bz2
synthpod-f4114ca1a7c7fe5505e0184ef2fe67162627683d.tar.xz
app: simplify idisp logic.
-rw-r--r--VERSION2
-rw-r--r--app/synthpod_app.c8
-rw-r--r--app/synthpod_app_mod.c4
-rw-r--r--app/synthpod_app_private.h1
4 files changed, 6 insertions, 9 deletions
diff --git a/VERSION b/VERSION
index 85488b3..d93e894 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.5585
+0.1.5587
diff --git a/app/synthpod_app.c b/app/synthpod_app.c
index 37b04de..f886a77 100644
--- a/app/synthpod_app.c
+++ b/app/synthpod_app.c
@@ -774,10 +774,9 @@ _sp_app_process_single_post(mod_t *mod, uint32_t nsamples, bool sparse_update_ti
// trylock
if(atomic_flag_test_and_set(&mod->idisp.lock))
{
- if(atomic_exchange(&mod->idisp.rendered, false))
+ const LV2_Inline_Display_Image_Surface *surf= mod->idisp.surf;
+ if(surf)
{
- const LV2_Inline_Display_Image_Surface *surf = mod->idisp.surf;
-
// to nk
LV2_Atom *answer = _sp_app_to_ui_request_atom(app);
if(answer)
@@ -817,8 +816,11 @@ _sp_app_process_single_post(mod_t *mod, uint32_t nsamples, bool sparse_update_ti
{
_sp_app_to_ui_overflow(app);
}
+
+ mod->idisp.surf = NULL; // invalidate
}
+ // unlock
atomic_flag_clear(&mod->idisp.lock);
}
}
diff --git a/app/synthpod_app_mod.c b/app/synthpod_app_mod.c
index deb4912..565d2c1 100644
--- a/app/synthpod_app_mod.c
+++ b/app/synthpod_app_mod.c
@@ -555,9 +555,6 @@ _mod_worker_thread(void *data)
// unlock surface
atomic_flag_clear(&mod->idisp.lock);
-
- if(mod->idisp.surf)
- atomic_store(&mod->idisp.rendered, true);
}
}
}
@@ -622,7 +619,6 @@ _sp_app_mod_add(sp_app_t *app, const char *uri, LV2_URID urn)
mod->idisp.queue_draw.handle = mod;
mod->idisp.queue_draw.queue_draw = _mod_queue_draw;
atomic_init(&mod->idisp.draw_queued, false);
- atomic_init(&mod->idisp.rendered, false);
mod->idisp.lock = (atomic_flag)ATOMIC_FLAG_INIT;
// populate options
diff --git a/app/synthpod_app_private.h b/app/synthpod_app_private.h
index 6efa042..629fe5a 100644
--- a/app/synthpod_app_private.h
+++ b/app/synthpod_app_private.h
@@ -289,7 +289,6 @@ struct _mod_t {
const LV2_Inline_Display_Image_Surface *surf;
LV2_Inline_Display queue_draw;
atomic_bool draw_queued;
- atomic_bool rendered;
atomic_flag lock;
bool subscribed;
} idisp;