aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2016-06-03 23:16:40 +0200
committerHanspeter Portner <dev@open-music-kontrollers.ch>2016-06-03 23:16:40 +0200
commit7af7949f565b17c1a8e000e1e1e5b01799a084ee (patch)
treec60a3e3564797016914abfb6f620a89bbea5624a
parentcf38cde151f78c97d6a24c791dd32bfeed86f089 (diff)
downloadsynthpod-7af7949f565b17c1a8e000e1e1e5b01799a084ee.tar.xz
prototype new modlist layout.
-rw-r--r--data/modlist.edc150
-rw-r--r--ui/synthpod_ui_app.c2
-rw-r--r--ui/synthpod_ui_modlist.c157
-rw-r--r--ui/synthpod_ui_private.h2
4 files changed, 151 insertions, 160 deletions
diff --git a/data/modlist.edc b/data/modlist.edc
index a1316ba9..f0861065 100644
--- a/data/modlist.edc
+++ b/data/modlist.edc
@@ -24,6 +24,9 @@ images {
image: "close-circular-button.png" COMP;
image: "rec-circular-button.png" COMP;
image: "favourite-button-of-circular-shape.png" COMP;
+ image: "verification-sign-in-a-circle-outline.png" COMP;
+ image: "keyboard-of-four-buttons-circular-button-symbol.png" COMP;
+ image: "list-circular-button.png" COMP;
image: "module_border.png" COMP;
}
@@ -58,68 +61,63 @@ group {
description { state: "default" 0.20; fixed: 1 1; color: COL20; }
}
part {
- name: "text.left";
- type: RECT;
- mouse_events: 0;
- clip_to: "clip";
- description {
- state: "default" 0.0;
- rel1.to: "link";
- rel2.to: "link";
- }
- }
- part {
- name: "text.right";
- type: RECT;
- mouse_events: 0;
+ name: "enable";
+ type: IMAGE;
+ mouse_events: 1;
clip_to: "clip";
description {
state: "default" 0.0;
- rel1.to: "ui";
- rel2.to: "close";
+ fixed: 1 1;
+ align: 0.0 0.5;
+ aspect: 1.0 1.0;
+ rel1.relative: 0 0;
+ rel2.relative: 0 1;
+ image.normal: "verification-sign-in-a-circle-outline.png";
+ color: 255 255 255 0;
}
- }
- part {
- name: "text.bg";
- type: RECT;
- mouse_events: 0;
- clip_to: "clip";
description {
- state: "default" 0.0;
- rel1.to: "text.border";
- rel2.to: "text.border";
- color: 48 48 48 255;
+ state: "default" 1.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
}
}
part {
- name: "text.border";
+ name: "auto";
type: IMAGE;
- mouse_events: 0;
+ mouse_events: 1;
clip_to: "clip";
description {
state: "default" 0.0;
- rel1.to: "link";
+ fixed: 1 1;
+ align: 0.0 0.5;
+ aspect: 1.0 1.0;
+ rel1.to_x: "enable";
rel1.relative: 1 0;
- rel2.to: "ui";
- rel2.relative: 0 1;
- image {
- normal: "module_border.png";
- border: 6 6 6 6;
- middle: 0;
- }
+ rel2.to_x: "enable";
+ rel2.relative: 2 1;
+ image.normal: "list-circular-button.png";
+ color: 255 255 255 64;
+ }
+ description {
+ state: "default" 1.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
}
}
part {
name: "link";
type: IMAGE;
mouse_events: 1;
+ clip_to: "clip";
description {
state: "default" 0.0;
fixed: 1 1;
align: 0.0 0.5;
aspect: 1.0 1.0;
- rel1.relative: 0 0;
- rel2.relative: 0 1;
+ rel1.relative: 1 0;
+ rel1.to_x: "auto";
+ rel2.relative: 2 1;
+ rel2.to_x: "auto";
image.normal: "favourite-button-of-circular-shape.png";
color: 255 255 255 64;
}
@@ -129,54 +127,35 @@ group {
color: 255 255 255 255;
}
}
+
part {
- name: "elm.text";
- type: TEXT;
- mouse_events: 0;
- scale: 1;
- description {
- state: "default" 0.0;
- fixed: 1 1;
- rel1.to_x: "link";
- rel1.relative: 1 0;
- rel1.offset: 6 0; // from text.border
- rel2.to_x: "ui";
- rel2.relative: 0 1;
- text {
- text: "";
- size: 10;
- align: 0.0 0.5;
- };
- color: 255 255 255 255;
- }
- }
- part {
- name: "ui";
+ name: "close";
type: IMAGE;
mouse_events: 1;
+ clip_to: "clip";
description {
state: "default" 0.0;
fixed: 1 1;
- align: 1.0 0.5;
+ align: 0.0 0.5;
aspect: 1.0 1.0;
- rel1.to_x: "close";
+ rel1.to_x: "ui";
rel1.relative: -1 0;
- rel2.to_x: "close";
+ rel2.to_x: "ui";
rel2.relative: 0 1;
- min: 16 16;
- image.normal: "book-circular-button.png";
+ image.normal: "close-circular-button.png";
color: 255 255 255 0;
}
description {
state: "default" 1.0;
inherit: "default" 0.0;
- color: 255 255 255 255;
+ color: 255 255 255 64;
}
}
part {
- name: "close";
+ name: "ui";
type: IMAGE;
mouse_events: 1;
+ clip_to: "clip";
description {
state: "default" 0.0;
fixed: 1 1;
@@ -184,14 +163,13 @@ group {
aspect: 1.0 1.0;
rel1.relative: 1 0;
rel2.relative: 1 1;
- min: 16 16;
- image.normal: "close-circular-button.png";
+ image.normal: "keyboard-of-four-buttons-circular-button-symbol.png";
color: 255 255 255 0;
}
description {
state: "default" 1.0;
inherit: "default" 0.0;
- color: 255 255 255 255;
+ color: 255 255 255 64;
}
}
}
@@ -252,6 +230,22 @@ group {
}
program {
+ signal: "enable,show";
+ action: STATE_SET "default" 1.0;
+ target: "enable";
+ }
+ program {
+ signal: "enable,hide";
+ action: STATE_SET "default" 0.0;
+ target: "enable";
+ }
+ program {
+ signal: "mouse,down,*";
+ source: "enable";
+ action: SIGNAL_EMIT "enable,click" "";
+ }
+
+ program {
signal: "ui,show";
action: STATE_SET "default" 1.0;
target: "ui";
@@ -266,6 +260,22 @@ group {
source: "ui";
action: SIGNAL_EMIT "ui,toggle" "";
}
+
+ program {
+ signal: "auto,on";
+ action: STATE_SET "default" 1.0;
+ target: "auto";
+ }
+ program {
+ signal: "auto,off";
+ action: STATE_SET "default" 0.0;
+ target: "auto";
+ }
+ program {
+ signal: "mouse,down,*";
+ source: "auto";
+ action: SIGNAL_EMIT "auto,toggle" "";
+ }
}
}
diff --git a/ui/synthpod_ui_app.c b/ui/synthpod_ui_app.c
index 9a88e464..8eb71e31 100644
--- a/ui/synthpod_ui_app.c
+++ b/ui/synthpod_ui_app.c
@@ -298,6 +298,8 @@ _sp_ui_from_app_module_embedded(sp_ui_t *ui, const LV2_Atom *atom)
if(!mod)
return;
+ //FIXME call _mod_embedded_set(mod_t *mod, int state)
+ mod->embedded = trans->state.body;
if(mod->std.grid && !trans->state.body)
elm_object_item_del(mod->std.grid);
else if(!mod->std.grid && trans->state.body)
diff --git a/ui/synthpod_ui_modlist.c b/ui/synthpod_ui_modlist.c
index 19068384..666d2631 100644
--- a/ui/synthpod_ui_modlist.c
+++ b/ui/synthpod_ui_modlist.c
@@ -70,6 +70,8 @@ _mod_embedded_set(mod_t *mod, int state)
{
sp_ui_t *ui = mod->ui;
+ mod->embedded = state;
+
// set module embedded state
const size_t size = sizeof(transmit_module_embedded_t);
transmit_module_embedded_t *trans1 = _sp_ui_to_app_request(ui, size);
@@ -80,32 +82,6 @@ _mod_embedded_set(mod_t *mod, int state)
}
}
-static void
-_modlist_activated(void *data, Evas_Object *obj, void *event_info)
-{
- Elm_Object_Item *itm = event_info;
- sp_ui_t *ui = data;
-
- const Elm_Genlist_Item_Class *class = elm_genlist_item_item_class_get(itm);
-
- if(class == ui->listitc)
- {
- mod_t *mod = elm_object_item_data_get(itm);
-
- if(mod->std.grid)
- {
- elm_object_item_del(mod->std.grid);
- _mod_embedded_set(mod, 0);
- }
- else
- {
- mod->std.grid = elm_gengrid_item_append(ui->modgrid, ui->griditc, mod,
- NULL, NULL);
- _mod_embedded_set(mod, 1);
- }
- }
-}
-
// only called upon user interaction
static void
_modlist_moved(void *data, Evas_Object *obj, void *event_info)
@@ -180,6 +156,25 @@ _mod_link_toggle(void *data, Evas_Object *lay, const char *emission, const char
}
}
+static void
+_mod_auto_toggle(void *data, Evas_Object *lay, const char *emission, const char *source)
+{
+ mod_t *mod = data;
+ sp_ui_t *ui = mod->ui;
+
+ if(mod->std.grid)
+ {
+ elm_object_item_del(mod->std.grid);
+ _mod_embedded_set(mod, 0);
+ }
+ else
+ {
+ mod->std.grid = elm_gengrid_item_append(ui->modgrid, ui->griditc, mod,
+ NULL, NULL);
+ _mod_embedded_set(mod, 1);
+ }
+}
+
void
_mod_ui_toggle_raw(mod_t *mod, mod_ui_t *mod_ui)
{
@@ -286,7 +281,6 @@ _modlist_content_get(void *data, Evas_Object *obj, const char *part)
if(strcmp(part, "elm.swallow.content"))
return NULL;
- /* FIXME implement me!
Evas_Object *frame = elm_frame_add(obj);
if(frame)
{
@@ -296,76 +290,61 @@ _modlist_content_get(void *data, Evas_Object *obj, const char *part)
evas_object_size_hint_min_set(frame, ELM_SCALE_SIZE(50), ELM_SCALE_SIZE(50));
evas_object_show(frame);
- Evas_Object *hbox = elm_box_add(frame);
- if(hbox)
+ Evas_Object *lay = elm_layout_add(obj);
+ if(lay)
{
- elm_box_homogeneous_set(hbox, EINA_TRUE);
- elm_box_horizontal_set(hbox, EINA_TRUE);
- evas_object_size_hint_weight_set(hbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(hbox, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_show(hbox);
- elm_object_content_set(frame, hbox);
+ elm_layout_file_set(lay, SYNTHPOD_DATA_DIR"/synthpod.edj",
+ "/synthpod/modlist/module");
+ evas_object_size_hint_weight_set(lay, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(lay, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(lay);
+ elm_object_content_set(frame, lay);
- Evas_Object *lbl = elm_label_add(hbox);
- if(lbl)
- {
- elm_object_text_set(lbl, "<font=mono align=right>0.1%</font>");
- evas_object_size_hint_weight_set(lbl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(lbl, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_show(lbl);
- elm_box_pack_end(hbox, lbl);
- }
- }
- }
-
- return frame;
- */
+ elm_layout_text_set(lay, "elm.text", mod->name);
- Evas_Object *lay = elm_layout_add(obj);
- if(lay)
- {
- elm_layout_file_set(lay, SYNTHPOD_DATA_DIR"/synthpod.edj",
- "/synthpod/modlist/module");
- evas_object_size_hint_weight_set(lay, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(lay, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_show(lay);
+ char col [7];
+ sprintf(col, "col,%02i", mod->col);
+ elm_layout_signal_emit(lay, col, MODLIST_UI);
- elm_layout_text_set(lay, "elm.text", mod->name);
+ // link
+ elm_layout_signal_callback_add(lay, "link,toggle", "", _mod_link_toggle, mod);
+ elm_layout_signal_emit(lay, mod->selected ? "link,on" : "link,off", "");
- char col [7];
- sprintf(col, "col,%02i", mod->col);
- elm_layout_signal_emit(lay, col, MODLIST_UI);
+ // enable
+ //FIXME elm_layout_signal_callback_add(lay, "enable,toggle", "", _mod_enable_toggle, mod);
+ elm_layout_signal_emit(lay, "enable,show", ""); //FIXME
- // link
- elm_layout_signal_callback_add(lay, "link,toggle", "", _mod_link_toggle, mod);
- elm_layout_signal_emit(lay, mod->selected ? "link,on" : "link,off", "");
+ // auto
+ elm_layout_signal_callback_add(lay, "auto,toggle", "", _mod_auto_toggle, mod);
+ elm_layout_signal_emit(lay, mod->embedded ? "auto,on" : "auto,off", "");
- // close
- if(!mod->system.source && !mod->system.sink)
- {
- elm_layout_signal_callback_add(lay, "close,click", "", _mod_close_click, mod);
- elm_layout_signal_emit(lay, "close,show", "");
- }
- else
- {
- // system mods cannot be removed
- elm_layout_signal_emit(lay, "close,hide", "");
- }
+ // close
+ if(!mod->system.source && !mod->system.sink)
+ {
+ elm_layout_signal_callback_add(lay, "close,click", "", _mod_close_click, mod);
+ elm_layout_signal_emit(lay, "close,show", "");
+ }
+ else
+ {
+ // system mods cannot be removed
+ elm_layout_signal_emit(lay, "close,hide", "");
+ }
- // window
- //if(mod->show.ui || mod->kx.ui || mod->eo.ui || mod->x11.ui) //TODO also check for descriptor
- if(eina_list_count(mod->mod_uis) > 0)
- {
- elm_layout_signal_callback_add(lay, "ui,toggle", "", _mod_ui_toggle, mod);
- elm_layout_signal_emit(lay, "ui,show", "");
- }
- else
- {
- elm_layout_signal_emit(lay, "ui,hide", "");
- }
- } // lay
+ // window
+ //if(mod->show.ui || mod->kx.ui || mod->eo.ui || mod->x11.ui) //TODO also check for descriptor
+ if(eina_list_count(mod->mod_uis) > 0)
+ {
+ elm_layout_signal_callback_add(lay, "ui,toggle", "", _mod_ui_toggle, mod);
+ elm_layout_signal_emit(lay, "ui,show", "");
+ }
+ else
+ {
+ elm_layout_signal_emit(lay, "ui,hide", "");
+ }
+ } // lay
+ }
- return lay;
+ return frame;
}
void
@@ -679,8 +658,6 @@ _modlist_itc_add(sp_ui_t *ui)
void
_modlist_set_callbacks(sp_ui_t *ui)
{
- evas_object_smart_callback_add(ui->modlist, "activated",
- _modlist_activated, ui);
evas_object_smart_callback_add(ui->modlist, "moved",
_modlist_moved, ui);
}
diff --git a/ui/synthpod_ui_private.h b/ui/synthpod_ui_private.h
index 3bcc56d8..7c81d0dc 100644
--- a/ui/synthpod_ui_private.h
+++ b/ui/synthpod_ui_private.h
@@ -274,6 +274,8 @@ struct _mod_t {
int source;
int sink;
} system;
+
+ int embedded;
};
struct _group_t {