aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2016-06-07 09:58:31 +0200
committerHanspeter Portner <dev@open-music-kontrollers.ch>2016-06-07 09:58:31 +0200
commitb9e071f808b938e76d40c54b8e6c610f4674c0b5 (patch)
treef3aca7637e7565b2bd30ad53922628812671314d
parentcca6b396fba9a144f3cbea947c21915f62024bef (diff)
downloadsherlock.lv2-b9e071f808b938e76d40c54b8e6c610f4674c0b5.tar.xz
implement autofollow feature.
-rw-r--r--VERSION2
-rw-r--r--atom_inspector_eo.c35
-rw-r--r--midi_inspector_eo.c34
-rw-r--r--osc_inspector_eo.c34
4 files changed, 82 insertions, 23 deletions
diff --git a/VERSION b/VERSION
index 6c94f37..848cc0c 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.9.59
+0.9.61
diff --git a/atom_inspector_eo.c b/atom_inspector_eo.c
index 41ba32a..7295cb7 100644
--- a/atom_inspector_eo.c
+++ b/atom_inspector_eo.c
@@ -25,7 +25,6 @@
#include <sratom/sratom.h>
-#define COUNT_MAX 2048 // maximal amount of events shown
#define STRING_BUF_SIZE 2048
#define STRING_MAX 256
#define STRING_OFF (STRING_MAX - 4)
@@ -57,6 +56,7 @@ struct _UI {
Evas_Object *clear;
Evas_Object *autoclear;
Evas_Object *autoblock;
+ Evas_Object *autofollow;
Evas_Object *popup;
Elm_Genlist_Item_Class *itc_list;
@@ -71,6 +71,7 @@ struct _UI {
const char *base_uri;
char *chunk;
+ int count_max;
};
#define CODE_PRE "<style=shadow,bottom>"
@@ -358,7 +359,7 @@ _clear_update(UI *ui, int count)
return;
char *buf = ui->string_buf;
- sprintf(buf, "Clear (%"PRIi32" of %"PRIi32")", count, COUNT_MAX);
+ sprintf(buf, "Clear (%"PRIi32" of %"PRIi32")", count, ui->count_max);
elm_object_text_set(ui->clear, buf);
}
@@ -423,11 +424,11 @@ _content_get(UI *ui, Evas_Object *parent)
if(panes)
{
elm_panes_horizontal_set(panes, EINA_FALSE);
- elm_panes_content_left_size_set(panes, 0.3);
+ elm_panes_content_left_size_set(panes, 0.4);
evas_object_size_hint_weight_set(panes, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(panes, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(panes);
- elm_table_pack(ui->table, panes, 0, 0, 4, 1);
+ elm_table_pack(ui->table, panes, 0, 0, 5, 1);
ui->list = elm_genlist_add(panes);
if(ui->list)
@@ -492,6 +493,16 @@ _content_get(UI *ui, Evas_Object *parent)
elm_table_pack(ui->table, ui->autoblock, 2, 1, 1, 1);
}
+ ui->autofollow = elm_check_add(ui->table);
+ if(ui->autofollow)
+ {
+ elm_object_text_set(ui->autofollow, "follow");
+ evas_object_size_hint_weight_set(ui->autofollow, 0.f, 0.f);
+ evas_object_size_hint_align_set(ui->autofollow, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(ui->autofollow);
+ elm_table_pack(ui->table, ui->autofollow, 3, 1, 1, 1);
+ }
+
Evas_Object *info = elm_button_add(ui->table);
if(info)
{
@@ -499,7 +510,7 @@ _content_get(UI *ui, Evas_Object *parent)
evas_object_size_hint_weight_set(info, 0.f, 0.f);
evas_object_size_hint_align_set(info, 1.f, EVAS_HINT_FILL);
evas_object_show(info);
- elm_table_pack(ui->table, info, 3, 1, 1, 1);
+ elm_table_pack(ui->table, info, 4, 1, 1, 1);
Evas_Object *icon = elm_icon_add(info);
if(icon)
@@ -663,6 +674,8 @@ instantiate(const LV2UI_Descriptor *descriptor, const char *plugin_uri,
}
*(Evas_Object **)widget = ui->widget;
+ ui->count_max = 2048;
+
return ui;
}
@@ -714,7 +727,7 @@ port_event(LV2UI_Handle handle, uint32_t i, uint32_t size, uint32_t urid,
pos->nsamples = nsamples->body;
// check item count
- if(n + 1 > COUNT_MAX)
+ if(n + 1 > ui->count_max)
{
if(elm_check_state_get(ui->autoclear))
{
@@ -748,9 +761,15 @@ port_event(LV2UI_Handle handle, uint32_t i, uint32_t size, uint32_t urid,
ev, itm, ELM_GENLIST_ITEM_NONE, NULL, NULL);
elm_genlist_item_select_mode_set(itm2, ELM_OBJECT_SELECT_MODE_DEFAULT);
n++;
+
+ if(n == 1) // always select first element
+ elm_genlist_item_selected_set(itm2, EINA_TRUE);
- // scroll to last item
- //elm_genlist_item_show(itm, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE);
+ if(elm_check_state_get(ui->autofollow)) // scroll to last item
+ {
+ elm_genlist_item_show(itm2, ELM_GENLIST_ITEM_SCROLLTO_BOTTOM);
+ elm_genlist_item_selected_set(itm2, EINA_TRUE);
+ }
}
}
diff --git a/midi_inspector_eo.c b/midi_inspector_eo.c
index 0234d68..78e2c56 100644
--- a/midi_inspector_eo.c
+++ b/midi_inspector_eo.c
@@ -19,7 +19,6 @@
#include <Elementary.h>
-#define COUNT_MAX 2048 // maximal amount of events shown
#define STRING_BUF_SIZE 2048
#define STRING_MAX 256
#define STRING_OFF (STRING_MAX - 4)
@@ -40,6 +39,7 @@ struct _UI {
Evas_Object *clear;
Evas_Object *autoclear;
Evas_Object *autoblock;
+ Evas_Object *autofollow;
Evas_Object *popup;
Elm_Genlist_Item_Class *itc_midi;
@@ -47,6 +47,8 @@ struct _UI {
char string_buf [STRING_BUF_SIZE];
char *logo_path;
+
+ int count_max;
};
typedef struct _midi_msg_t midi_msg_t;
@@ -520,7 +522,7 @@ _clear_update(UI *ui, int count)
return;
char *buf = ui->string_buf;
- sprintf(buf, "Clear (%"PRIi32" of %"PRIi32")", count, COUNT_MAX);
+ sprintf(buf, "Clear (%"PRIi32" of %"PRIi32")", count, ui->count_max);
elm_object_text_set(ui->clear, buf);
}
@@ -590,7 +592,7 @@ _content_get(UI *ui, Evas_Object *parent)
evas_object_size_hint_weight_set(ui->list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(ui->list, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(ui->list);
- elm_table_pack(ui->table, ui->list, 0, 0, 4, 1);
+ elm_table_pack(ui->table, ui->list, 0, 0, 5, 1);
}
ui->clear = elm_button_add(ui->table);
@@ -624,6 +626,16 @@ _content_get(UI *ui, Evas_Object *parent)
elm_table_pack(ui->table, ui->autoblock, 2, 1, 1, 1);
}
+ ui->autofollow = elm_check_add(ui->table);
+ if(ui->autofollow)
+ {
+ elm_object_text_set(ui->autofollow, "follow");
+ evas_object_size_hint_weight_set(ui->autofollow, 0.f, 0.f);
+ evas_object_size_hint_align_set(ui->autofollow, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(ui->autofollow);
+ elm_table_pack(ui->table, ui->autofollow, 3, 1, 1, 1);
+ }
+
Evas_Object *info = elm_button_add(ui->table);
if(info)
{
@@ -631,7 +643,7 @@ _content_get(UI *ui, Evas_Object *parent)
evas_object_size_hint_weight_set(info, 0.f, 0.f);
evas_object_size_hint_align_set(info, 1.f, EVAS_HINT_FILL);
evas_object_show(info);
- elm_table_pack(ui->table, info, 3, 1, 1, 1);
+ elm_table_pack(ui->table, info, 4, 1, 1, 1);
Evas_Object *icon = elm_icon_add(info);
if(icon)
@@ -767,6 +779,8 @@ instantiate(const LV2UI_Descriptor *descriptor, const char *plugin_uri,
return NULL;
}
*(Evas_Object **)widget = ui->widget;
+
+ ui->count_max = 2048;
return ui;
}
@@ -813,7 +827,7 @@ port_event(LV2UI_Handle handle, uint32_t i, uint32_t size, uint32_t urid,
pos->nsamples = nsamples->body;
// check item count
- if(n + 1 > COUNT_MAX)
+ if(n + 1 > ui->count_max)
{
if(elm_check_state_get(ui->autoclear))
{
@@ -847,9 +861,15 @@ port_event(LV2UI_Handle handle, uint32_t i, uint32_t size, uint32_t urid,
ev, itm, ELM_GENLIST_ITEM_NONE, NULL, NULL);
elm_genlist_item_select_mode_set(itm2, ELM_OBJECT_SELECT_MODE_DEFAULT);
n++;
+
+ if(n == 1) // always select first element
+ elm_genlist_item_selected_set(itm2, EINA_TRUE);
- // scroll to last item
- //elm_genlist_item_show(itm, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE);
+ if(elm_check_state_get(ui->autofollow)) // scroll to last item
+ {
+ elm_genlist_item_show(itm2, ELM_GENLIST_ITEM_SCROLLTO_BOTTOM);
+ elm_genlist_item_selected_set(itm2, EINA_TRUE);
+ }
}
}
diff --git a/osc_inspector_eo.c b/osc_inspector_eo.c
index 3738d3a..e57c32a 100644
--- a/osc_inspector_eo.c
+++ b/osc_inspector_eo.c
@@ -23,7 +23,6 @@
#include <Elementary.h>
-#define COUNT_MAX 2048 // maximal amount of events shown
#define STRING_BUF_SIZE 2048
#define STRING_MAX 256
#define STRING_OFF (STRING_MAX - 4)
@@ -47,6 +46,7 @@ struct _UI {
Evas_Object *clear;
Evas_Object *autoclear;
Evas_Object *autoblock;
+ Evas_Object *autofollow;
Evas_Object *popup;
Elm_Genlist_Item_Class *itc_group;
@@ -55,6 +55,8 @@ struct _UI {
char string_buf [STRING_BUF_SIZE];
char *logo_path;
+
+ int count_max;
};
// there is a bug in LV2 <= 0.10
@@ -582,7 +584,7 @@ _clear_update(UI *ui, int count)
return;
char *buf = ui->string_buf;
- sprintf(buf, "Clear (%"PRIi32" of %"PRIi32")", count, COUNT_MAX);
+ sprintf(buf, "Clear (%"PRIi32" of %"PRIi32")", count, ui->count_max);
elm_object_text_set(ui->clear, buf);
}
@@ -658,7 +660,7 @@ _content_get(UI *ui, Evas_Object *parent)
evas_object_size_hint_weight_set(ui->list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(ui->list, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(ui->list);
- elm_table_pack(ui->table, ui->list, 0, 0, 4, 1);
+ elm_table_pack(ui->table, ui->list, 0, 0, 5, 1);
}
ui->clear = elm_button_add(ui->table);
@@ -692,6 +694,16 @@ _content_get(UI *ui, Evas_Object *parent)
elm_table_pack(ui->table, ui->autoblock, 2, 1, 1, 1);
}
+ ui->autofollow = elm_check_add(ui->table);
+ if(ui->autofollow)
+ {
+ elm_object_text_set(ui->autofollow, "follow");
+ evas_object_size_hint_weight_set(ui->autofollow, 0.f, 0.f);
+ evas_object_size_hint_align_set(ui->autofollow, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(ui->autofollow);
+ elm_table_pack(ui->table, ui->autofollow, 3, 1, 1, 1);
+ }
+
Evas_Object *info = elm_button_add(ui->table);
if(info)
{
@@ -699,7 +711,7 @@ _content_get(UI *ui, Evas_Object *parent)
evas_object_size_hint_weight_set(info, 0.f, 0.f);
evas_object_size_hint_align_set(info, 1.f, EVAS_HINT_FILL);
evas_object_show(info);
- elm_table_pack(ui->table, info, 3, 1, 1, 1);
+ elm_table_pack(ui->table, info, 4, 1, 1, 1);
Evas_Object *icon = elm_icon_add(info);
if(icon)
@@ -849,6 +861,8 @@ instantiate(const LV2UI_Descriptor *descriptor, const char *plugin_uri,
return NULL;
}
*(Evas_Object **)widget = ui->widget;
+
+ ui->count_max = 2048;
return ui;
}
@@ -896,7 +910,7 @@ port_event(LV2UI_Handle handle, uint32_t i, uint32_t size, uint32_t urid,
pos->nsamples = nsamples->body;
// check item count
- if(n + 1 > COUNT_MAX)
+ if(n + 1 > ui->count_max)
{
if(elm_check_state_get(ui->autoclear))
{
@@ -931,9 +945,15 @@ port_event(LV2UI_Handle handle, uint32_t i, uint32_t size, uint32_t urid,
elm_genlist_item_select_mode_set(itm2, ELM_OBJECT_SELECT_MODE_DEFAULT);
elm_genlist_item_expanded_set(itm2, EINA_FALSE);
n++;
+
+ if(n == 1) // always select first element
+ elm_genlist_item_selected_set(itm2, EINA_TRUE);
- // scroll to last item
- //elm_genlist_item_show(itm, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE);
+ if(elm_check_state_get(ui->autofollow)) // scroll to last item
+ {
+ elm_genlist_item_show(itm2, ELM_GENLIST_ITEM_SCROLLTO_BOTTOM);
+ elm_genlist_item_selected_set(itm2, EINA_TRUE);
+ }
}
}