aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2018-06-04 08:50:01 +0200
committerGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2018-06-04 08:50:01 +0200
commit5bfbc4227536d596a6e60d41f13cc9f7785d2e09 (patch)
tree9077e253a3fbea45d9cc33655b11eebe9d2035b9 /plugins
parent05b10165702a7e87ecf71cc1838829402b9d798c (diff)
downloadsynthpod-5bfbc4227536d596a6e60d41f13cc9f7785d2e09.zip
synthpod-5bfbc4227536d596a6e60d41f13cc9f7785d2e09.tar.gz
synthpod-5bfbc4227536d596a6e60d41f13cc9f7785d2e09.tar.bz2
synthpod-5bfbc4227536d596a6e60d41f13cc9f7785d2e09.tar.xz
Enable save/restore of side/bottombar visibility.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/synthpod_common_nk.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/plugins/synthpod_common_nk.c b/plugins/synthpod_common_nk.c
index 963c3d8..8caef1e 100644
--- a/plugins/synthpod_common_nk.c
+++ b/plugins/synthpod_common_nk.c
@@ -4195,8 +4195,36 @@ _expose_main_header(plughandle_t *handle, struct nk_context *ctx, float dy)
nk_spacing(ctx, 1);
{
+ const bool show_bottombar = handle->show_bottombar;
_toolbar_toggle(ctx, &handle->show_bottombar, 'k', handle->icon.settings, "Settings");
+ if(show_bottombar != handle->show_bottombar)
+ {
+ const LV2_URID subj = 0; // aka host
+
+ if( _message_request(handle)
+ && synthpod_patcher_set(&handle->regs, &handle->forge,
+ subj, 0, handle->regs.synthpod.row_enabled.urid,
+ sizeof(int32_t), handle->forge.Bool, &handle->show_bottombar) )
+ {
+ _message_write(handle);
+ }
+ }
+
+ const bool show_sidebar = handle->show_sidebar;
_toolbar_toggle(ctx, &handle->show_sidebar, 'l', handle->icon.menu, "Controls");
+
+ if(show_sidebar != handle->show_sidebar)
+ {
+ const LV2_URID subj = 0; // aka host
+
+ if( _message_request(handle)
+ && synthpod_patcher_set(&handle->regs, &handle->forge,
+ subj, 0, handle->regs.synthpod.column_enabled.urid,
+ sizeof(int32_t), handle->forge.Bool, &handle->show_sidebar) )
+ {
+ _message_write(handle);
+ }
+ }
}
nk_menubar_end(ctx);
@@ -8079,6 +8107,22 @@ _init(plughandle_t *handle)
{
_message_write(handle);
}
+
+ // patch:Get [patch:property spod:columnEnabled]
+ if( _message_request(handle)
+ && synthpod_patcher_get(&handle->regs, &handle->forge,
+ 0, 0, handle->regs.synthpod.column_enabled.urid) )
+ {
+ _message_write(handle);
+ }
+
+ // patch:Get [patch:property spod:rowEnabled]
+ if( _message_request(handle)
+ && synthpod_patcher_get(&handle->regs, &handle->forge,
+ 0, 0, handle->regs.synthpod.row_enabled.urid) )
+ {
+ _message_write(handle);
+ }
}
static void
@@ -8940,6 +8984,24 @@ port_event(LV2UI_Handle instance, uint32_t port_index, uint32_t size,
nk_pugl_post_redisplay(&handle->win);
}
+ else if( (prop == handle->regs.synthpod.column_enabled.urid)
+ && (value->type == handle->forge.Bool) )
+ {
+ const LV2_Atom_Bool *column_enabled = (const LV2_Atom_Bool *)value;
+
+ handle->show_sidebar = column_enabled->body;
+
+ nk_pugl_post_redisplay(&handle->win);
+ }
+ else if( (prop == handle->regs.synthpod.row_enabled.urid)
+ && (value->type == handle->forge.Bool) )
+ {
+ const LV2_Atom_Bool *row_enabled = (const LV2_Atom_Bool *)value;
+
+ handle->show_bottombar = row_enabled->body;
+
+ nk_pugl_post_redisplay(&handle->win);
+ }
else if( (prop == handle->regs.synthpod.cpus_used.urid)
&& (value->type == handle->forge.Int) )
{