Commit 49e7774c authored by Hanspeter Portner's avatar Hanspeter Portner

ui: move footer to left sidebar.

parent 899d4010
......@@ -122,6 +122,9 @@ after code changes.
* [LV2](http://lv2plug.in) (LV2 Plugin Standard)
* [FAUST](https://faust.grame.fr/) (Faust Programming Language >=2.14.4)
* [OpenGl]() (OpenGl)
* [GLEW]() (GLEW)
* [VTERM]() (Virtual terminal library)
#### Build / install
......@@ -130,8 +133,8 @@ after code changes.
meson build
cd build
ninja -j4
sudo ninja install
ninja test
sudo ninja install
#### UI
......
......@@ -459,17 +459,10 @@ _expose_xfade(plughandle_t *handle, const d2tk_rect_t *rect)
d2tk_pugl_t *dpugl = handle->dpugl;
d2tk_base_t *base = d2tk_pugl_get_base(dpugl);
static const char lbl [] = "crossfade•ms";
D2TK_BASE_FRAME(base, rect, sizeof(lbl), lbl, frm)
if(d2tk_base_prop_int32_is_changed(base, D2TK_ID, rect,
10, &handle->state.xfade_dur, 1000))
{
const d2tk_rect_t *frect = d2tk_frame_get_rect(frm);
if(d2tk_base_prop_int32_is_changed(base, D2TK_ID, frect,
10, &handle->state.xfade_dur, 1000))
{
_message_set_key(handle, handle->urid_xfadeDuration);
}
_message_set_key(handle, handle->urid_xfadeDuration);
}
}
......@@ -479,17 +472,10 @@ _expose_release(plughandle_t *handle, const d2tk_rect_t *rect)
d2tk_pugl_t *dpugl = handle->dpugl;
d2tk_base_t *base = d2tk_pugl_get_base(dpugl);
static const char lbl [] = "release•s";
D2TK_BASE_FRAME(base, rect, sizeof(lbl), lbl, frm)
if(d2tk_base_prop_int32_is_changed(base, D2TK_ID, rect,
0, &handle->state.release_dur, 100))
{
const d2tk_rect_t *frect = d2tk_frame_get_rect(frm);
if(d2tk_base_prop_int32_is_changed(base, D2TK_ID, frect,
0, &handle->state.release_dur, 100))
{
_message_set_key(handle, handle->urid_releaseDuration);
}
_message_set_key(handle, handle->urid_releaseDuration);
}
}
......@@ -499,42 +485,59 @@ _expose_panic(plughandle_t *handle, const d2tk_rect_t *rect)
d2tk_pugl_t *dpugl = handle->dpugl;
d2tk_base_t *base = d2tk_pugl_get_base(dpugl);
static const char lbl [] = "panic";
static const char path [] = "libre-gui-exclamation-circle.png";
D2TK_BASE_FRAME(base, rect, sizeof(lbl), lbl, frm)
if(d2tk_base_button_image_is_changed(base, D2TK_ID, sizeof(path), path, rect))
{
const d2tk_rect_t *frect = d2tk_frame_get_rect(frm);
if(d2tk_base_button_image_is_changed(base, D2TK_ID, sizeof(path), path, frect))
{
_message_midi_allnotesoff(handle);
}
_message_midi_allnotesoff(handle);
}
}
static inline void
_expose_footer(plughandle_t *handle, const d2tk_rect_t *rect)
{
const d2tk_coord_t frac [3] = { 1, 1, 1 };
D2TK_BASE_LAYOUT(rect, 3, frac, D2TK_FLAG_LAYOUT_X_REL, lay)
d2tk_pugl_t *dpugl = handle->dpugl;
d2tk_base_t *base = d2tk_pugl_get_base(dpugl);
D2TK_BASE_TABLE(rect, 3, 2, D2TK_FLAG_TABLE_REL, tab)
{
const unsigned k = d2tk_layout_get_index(lay);
const d2tk_rect_t *lrect = d2tk_layout_get_rect(lay);
const unsigned x = d2tk_table_get_index_x(tab);
const unsigned y = d2tk_table_get_index_y(tab);
const d2tk_rect_t *trect = d2tk_table_get_rect(tab);
switch(k)
switch(y)
{
case 0:
{
_expose_xfade(handle, lrect);
static const char *lbls [3] = {
"panic",
"crossfade•ms",
"release•s"
};
if(lbls[x])
{
d2tk_base_label(base, -1, lbls[x], 0.5f, trect,
D2TK_ALIGN_MIDDLE | D2TK_ALIGN_RIGHT);
}
} break;
case 1:
{
_expose_release(handle, lrect);
} break;
case 2:
{
_expose_panic(handle, lrect);
switch(x)
{
case 0:
{
_expose_panic(handle, trect);
} break;
case 1:
{
_expose_xfade(handle, trect);
} break;
case 2:
{
_expose_release(handle, trect);
} break;
}
} break;
}
}
......@@ -578,7 +581,7 @@ _expose_slot(plughandle_t *handle, const d2tk_rect_t *rect, unsigned k)
}
static inline void
_expose_sidebar(plughandle_t *handle, const d2tk_rect_t *rect)
_expose_sidebar_right(plughandle_t *handle, const d2tk_rect_t *rect)
{
D2TK_BASE_TABLE(rect, 2, NCONTROLS/2, D2TK_FLAG_TABLE_REL, tab)
{
......@@ -721,6 +724,29 @@ _expose_editor(plughandle_t *handle, const d2tk_rect_t *rect)
}
}
static inline void
_expose_sidebar_left(plughandle_t *handle, const d2tk_rect_t *rect)
{
const d2tk_coord_t frac [2] = { 0, FOOTER };
D2TK_BASE_LAYOUT(rect, 2, frac, D2TK_FLAG_LAYOUT_Y_ABS, lay)
{
const unsigned k = d2tk_layout_get_index(lay);
const d2tk_rect_t *lrect = d2tk_layout_get_rect(lay);
switch(k)
{
case 0:
{
_expose_editor(handle, lrect);
} break;
case 1:
{
_expose_footer(handle, lrect);
} break;
}
}
}
static inline void
_expose_body(plughandle_t *handle, const d2tk_rect_t *rect)
{
......@@ -734,11 +760,11 @@ _expose_body(plughandle_t *handle, const d2tk_rect_t *rect)
{
case 0:
{
_expose_editor(handle, lrect);
_expose_sidebar_left(handle, lrect);
} break;
case 1:
{
_expose_sidebar(handle, lrect);
_expose_sidebar_right(handle, lrect);
} break;
}
}
......@@ -750,8 +776,8 @@ _expose(void *data, d2tk_coord_t w, d2tk_coord_t h)
plughandle_t *handle = data;
const d2tk_rect_t rect = D2TK_RECT(0, 0, w, h);
const d2tk_coord_t frac [3] = { HEADER, 0, FOOTER };
D2TK_BASE_LAYOUT(&rect, 3, frac, D2TK_FLAG_LAYOUT_Y_ABS, lay)
const d2tk_coord_t frac [2] = { HEADER, 0 };
D2TK_BASE_LAYOUT(&rect, 2, frac, D2TK_FLAG_LAYOUT_Y_ABS, lay)
{
const unsigned k = d2tk_layout_get_index(lay);
const d2tk_rect_t *lrect = d2tk_layout_get_rect(lay);
......@@ -766,10 +792,6 @@ _expose(void *data, d2tk_coord_t w, d2tk_coord_t h)
{
_expose_body(handle, lrect);
} break;
case 2:
{
_expose_footer(handle, lrect);
} break;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment