forked from enlightenment/enlightenment
e/music-control: Add name of selected playing music and allow to raise player
Patch by: José Roberto de Souza <zehortigoza@profusion.mobi> SVN revision: 81993
This commit is contained in:
parent
4cd377ca77
commit
0f3984295b
|
@ -43,8 +43,21 @@ collections {
|
||||||
}
|
}
|
||||||
group {
|
group {
|
||||||
name: "modules/music-control/popup";
|
name: "modules/music-control/popup";
|
||||||
min: 150 30;
|
min: 150 50;
|
||||||
parts {
|
parts {
|
||||||
|
part {
|
||||||
|
name: "player_name";
|
||||||
|
type: TEXT;
|
||||||
|
description {
|
||||||
|
state: "default" 0;
|
||||||
|
text.size: 12;
|
||||||
|
text.text: "Music player";
|
||||||
|
text.font: "Sans";
|
||||||
|
rel1.relative: 0.0 0.0;
|
||||||
|
rel2.relative: 1.0 0.0;
|
||||||
|
rel2.offset: 0 16;
|
||||||
|
}
|
||||||
|
}
|
||||||
part {
|
part {
|
||||||
type: IMAGE;
|
type: IMAGE;
|
||||||
name: "previous_btn";
|
name: "previous_btn";
|
||||||
|
@ -52,7 +65,8 @@ collections {
|
||||||
state: "default" 0;
|
state: "default" 0;
|
||||||
aspect: 1.0 1.0;
|
aspect: 1.0 1.0;
|
||||||
aspect_preference: BOTH;
|
aspect_preference: BOTH;
|
||||||
rel1.relative: 0.0 0.0;
|
rel1.to: "player_name";
|
||||||
|
rel1.relative: 0.0 1.0;
|
||||||
rel2.relative: 0.33 1.0;
|
rel2.relative: 0.33 1.0;
|
||||||
image.normal: "images/previous.png";
|
image.normal: "images/previous.png";
|
||||||
}
|
}
|
||||||
|
@ -64,7 +78,8 @@ collections {
|
||||||
state: "default" 0;
|
state: "default" 0;
|
||||||
aspect: 1.0 1.0;
|
aspect: 1.0 1.0;
|
||||||
aspect_preference: BOTH;
|
aspect_preference: BOTH;
|
||||||
rel1.relative: 0.33 0.0;
|
rel1.to: "player_name";
|
||||||
|
rel1.relative: 0.33 1.0;
|
||||||
rel2.relative: 0.66 1.0;
|
rel2.relative: 0.66 1.0;
|
||||||
image.normal: "images/pause.png";
|
image.normal: "images/pause.png";
|
||||||
}
|
}
|
||||||
|
@ -81,7 +96,8 @@ collections {
|
||||||
state: "default" 0;
|
state: "default" 0;
|
||||||
aspect: 1.0 1.0;
|
aspect: 1.0 1.0;
|
||||||
aspect_preference: BOTH;
|
aspect_preference: BOTH;
|
||||||
rel1.relative: 0.66 0.0;
|
rel1.to: "player_name";
|
||||||
|
rel1.relative: 0.66 1.0;
|
||||||
rel2.relative: 1.0 1.0;
|
rel2.relative: 1.0 1.0;
|
||||||
image.normal: "images/next.png";
|
image.normal: "images/next.png";
|
||||||
}
|
}
|
||||||
|
@ -117,6 +133,18 @@ collections {
|
||||||
transition: LINEAR 0.1;
|
transition: LINEAR 0.1;
|
||||||
target: "play_btn";
|
target: "play_btn";
|
||||||
}
|
}
|
||||||
|
program {
|
||||||
|
signal: "mouse,clicked,*";
|
||||||
|
source: "player_name";
|
||||||
|
action: SIGNAL_EMIT "label,clicked" "player_name";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
script {
|
||||||
|
public message(Msg_Type:type, id, ...) {
|
||||||
|
new txt[128];
|
||||||
|
getsarg (2, txt, 128);
|
||||||
|
set_text(PART:"player_name", txt);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Binary file not shown.
|
@ -34,6 +34,22 @@ _btn_clicked(void *data, Evas_Object *obj, const char *emission, const char *sou
|
||||||
media_player2_player_previous_call(inst->ctxt->mpris2_player);
|
media_player2_player_previous_call(inst->ctxt->mpris2_player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_label_clicked(void *data, Evas_Object *obj, const char *emission, const char *source)
|
||||||
|
{
|
||||||
|
E_Music_Control_Instance *inst = data;
|
||||||
|
music_control_popup_del(inst);
|
||||||
|
mpris_media_player2_raise_call(inst->ctxt->mrpis2);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_player_name_update(E_Music_Control_Instance *inst)
|
||||||
|
{
|
||||||
|
Edje_Message_String msg;
|
||||||
|
msg.str = (char *)music_player_players[inst->ctxt->config->player_selected].name;
|
||||||
|
edje_object_message_send(inst->content_popup, EDJE_MESSAGE_STRING, 0, &msg);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_popup_new(E_Music_Control_Instance *inst)
|
_popup_new(E_Music_Control_Instance *inst)
|
||||||
{
|
{
|
||||||
|
@ -44,10 +60,13 @@ _popup_new(E_Music_Control_Instance *inst)
|
||||||
edje_object_file_set(o, music_control_edj_path_get(),
|
edje_object_file_set(o, music_control_edj_path_get(),
|
||||||
"modules/music-control/popup");
|
"modules/music-control/popup");
|
||||||
edje_object_signal_callback_add(o, "btn,clicked", "*", _btn_clicked, inst);
|
edje_object_signal_callback_add(o, "btn,clicked", "*", _btn_clicked, inst);
|
||||||
|
edje_object_signal_callback_add(o, "label,clicked", "player_name", _label_clicked, inst);
|
||||||
|
|
||||||
e_gadcon_popup_content_set(inst->popup, o);
|
e_gadcon_popup_content_set(inst->popup, o);
|
||||||
e_gadcon_popup_show(inst->popup);
|
e_gadcon_popup_show(inst->popup);
|
||||||
inst->content_popup = o;
|
inst->content_popup = o;
|
||||||
|
|
||||||
|
_player_name_update(inst);
|
||||||
_play_state_update(inst);
|
_play_state_update(inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,6 +176,9 @@ music_control_mouse_down_cb(void *data, Evas *evas, Evas_Object *obj, void *even
|
||||||
E_Zone *zone = e_util_zone_current_get(e_manager_current_get());
|
E_Zone *zone = e_util_zone_current_get(e_manager_current_get());
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
|
if (inst->popup)
|
||||||
|
music_control_popup_del(inst);
|
||||||
|
|
||||||
m = e_menu_new();
|
m = e_menu_new();
|
||||||
mi = e_menu_item_new(m);
|
mi = e_menu_item_new(m);
|
||||||
e_menu_item_label_set(mi, "Settings");
|
e_menu_item_label_set(mi, "Settings");
|
||||||
|
|
Loading…
Reference in New Issue