aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2018-06-03 11:41:17 +0200
committerGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2018-06-03 11:41:17 +0200
commit907e5205f8e960d0c2df0923f5a4f5f277c43aae (patch)
tree0c9eafe251432c96319e86bf452410a092809a12
parent3a6b5c3e54e5f22fc0ae29e8f4ae0d22b0cbb44e (diff)
downloadsynthpod-907e5205f8e960d0c2df0923f5a4f5f277c43aae.zip
synthpod-907e5205f8e960d0c2df0923f5a4f5f277c43aae.tar.gz
synthpod-907e5205f8e960d0c2df0923f5a4f5f277c43aae.tar.bz2
synthpod-907e5205f8e960d0c2df0923f5a4f5f277c43aae.tar.xz
nk: improve mod -> mod_conn replacement.
-rw-r--r--VERSION2
-rw-r--r--plugins/synthpod_common_nk.c11
2 files changed, 10 insertions, 3 deletions
diff --git a/VERSION b/VERSION
index e9bf035..56a684f 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.5783
+0.1.5785
diff --git a/plugins/synthpod_common_nk.c b/plugins/synthpod_common_nk.c
index 8e10caa..5bf9fa0 100644
--- a/plugins/synthpod_common_nk.c
+++ b/plugins/synthpod_common_nk.c
@@ -537,6 +537,8 @@ struct _plughandle_t {
#endif
xpress_t xpress;
+
+ unsigned mods_moving;
};
static const char *bundle_search_labels [BUNDLE_SELECTOR_SEARCH_MAX] = {
@@ -6455,6 +6457,8 @@ _mod_moveable(plughandle_t *handle, struct nk_context *ctx, mod_t *mod,
if(mod->moving)
{
+ handle->mods_moving += 1;
+
if(nk_input_is_mouse_released(in, NK_BUTTON_LEFT))
{
mod->moving = false;
@@ -6463,7 +6467,7 @@ _mod_moveable(plughandle_t *handle, struct nk_context *ctx, mod_t *mod,
{
mod_conn_t *mod_conn = *mod_conn_itr;
- // if hovering over a mod_conf, insert it there, replacing the connection
+ // if hovering over a mod_conn, insert it there, replacing the connection
if(!mod_conn->moving && mod_conn->hovering)
{
mod_t *src_mod = mod_conn->source_mod;
@@ -6943,6 +6947,7 @@ _expose_mod_conn(plughandle_t *handle, struct nk_context *ctx, struct nk_rect sp
{
mod_conn->moving = false;
}
+ //XXX
else if(!nk_input_is_mouse_down(in, NK_BUTTON_MIDDLE))
{
mod_conn->pos.x += in->mouse.delta.x;
@@ -7067,7 +7072,7 @@ _expose_mod_conn(plughandle_t *handle, struct nk_context *ctx, struct nk_rect sp
const char *source_name = source_port->name;
const char *sink_name = sink_port->name;
- if(source_name && sink_name)
+ if(!handle->mods_moving && source_name && sink_name)
{
if(nk_input_is_mouse_pressed(in, NK_BUTTON_LEFT))
{
@@ -7439,6 +7444,8 @@ _expose_main_body(plughandle_t *handle, struct nk_context *ctx, float dh, float
}
}
+ handle->mods_moving = 0;
+
HASH_FOREACH(&handle->mods, mod_itr)
{
mod_t *mod = *mod_itr;