From 2a4c6774a66ee138e18ec3485b8656e6a30a563a Mon Sep 17 00:00:00 2001 From: Sthithaprajna Garapaty Date: Tue, 8 Jan 2008 02:19:22 +0000 Subject: [PATCH] INDENT SVN revision: 33385 --- e_mod_config.c | 37 +- e_mod_main.c | 655 ++++++++++-------- e_mod_main.h | 28 +- mpdule.edc | 1738 ++++++++++++++++++++++++++---------------------- 4 files changed, 1348 insertions(+), 1110 deletions(-) diff --git a/e_mod_config.c b/e_mod_config.c index 4840450..7578609 100644 --- a/e_mod_config.c +++ b/e_mod_config.c @@ -36,19 +36,21 @@ _config_mpdule_module (Config_Item * ci) snprintf (buf, sizeof (buf), "%s/e-module-mpdule.edj", e_module_dir_get (mpdule_config->module)); con = e_container_current_get (e_manager_current_get ()); - cfd = e_config_dialog_new (con, D_ ("MPDule Configuration"), "MPDule", "_e_modules_mpdule_config_dialog", buf, 0, v, ci); + cfd = + e_config_dialog_new (con, D_ ("MPDule Configuration"), "MPDule", + "_e_modules_mpdule_config_dialog", buf, 0, v, ci); mpdule_config->config_dialog = cfd; } static void _fill_data (Config_Item * ci, E_Config_Dialog_Data * cfdata) { - char buf[128]; + char buf[128]; cfdata->poll_time = ci->poll_time; - cfdata->hostname = strdup(ci->hostname); - snprintf(buf, sizeof(buf), "%d", ci->port); - cfdata->port = strdup(buf); + cfdata->hostname = strdup (ci->hostname); + snprintf (buf, sizeof (buf), "%d", ci->port); + cfdata->port = strdup (buf); } static void * @@ -70,15 +72,16 @@ _free_data (E_Config_Dialog * cfd, E_Config_Dialog_Data * cfdata) if (!mpdule_config) return; mpdule_config->config_dialog = NULL; - free(cfdata->hostname); - E_FREE(cfdata); + free (cfdata->hostname); + E_FREE (cfdata); } static Evas_Object * _basic_create_widgets (E_Config_Dialog * cfd, Evas * evas, E_Config_Dialog_Data * cfdata) { - Evas_Object *o, *of, *ob, *time_entry, *time_check, *hostname_entry, *port_entry; + Evas_Object *o, *of, *ob, *time_entry, *time_check, *hostname_entry, + *port_entry; E_Radio_Group *rg; o = e_widget_list_add (evas, 0, 0); @@ -86,20 +89,24 @@ _basic_create_widgets (E_Config_Dialog * cfd, Evas * evas, of = e_widget_frametable_add (evas, D_ ("Configuration"), 1); ob = e_widget_label_add (evas, D_ ("Poll Time:")); e_widget_frametable_object_append (of, ob, 0, 0, 1, 1, 1, 0, 1, 0); - ob = e_widget_slider_add (evas, 1, 0, D_ ("%1.0f seconds"), 1, 60, 1, 0, NULL, &(cfdata->poll_time), 100); + ob = + e_widget_slider_add (evas, 1, 0, D_ ("%1.0f seconds"), 1, 60, 1, 0, NULL, + &(cfdata->poll_time), 100); e_widget_frametable_object_append (of, ob, 0, 1, 1, 1, 1, 0, 1, 0); ob = e_widget_label_add (evas, D_ ("Hostname:")); e_widget_frametable_object_append (of, ob, 0, 2, 1, 1, 1, 0, 1, 0); - hostname_entry = e_widget_entry_add (evas, &cfdata->hostname, NULL, NULL, NULL); + hostname_entry = + e_widget_entry_add (evas, &cfdata->hostname, NULL, NULL, NULL); e_widget_min_size_set (hostname_entry, 150, 1); - e_widget_frametable_object_append (of, hostname_entry, 0, 3, 1, 1, 1, 0, 1, 0); + e_widget_frametable_object_append (of, hostname_entry, 0, 3, 1, 1, 1, 0, 1, + 0); ob = e_widget_label_add (evas, D_ ("Port:")); e_widget_frametable_object_append (of, ob, 0, 4, 1, 1, 1, 0, 1, 0); port_entry = e_widget_entry_add (evas, &cfdata->port, NULL, NULL, NULL); e_widget_min_size_set (hostname_entry, 150, 1); e_widget_frametable_object_append (of, port_entry, 0, 5, 1, 1, 1, 0, 1, 0); e_widget_list_object_append (o, of, 1, 1, 0.5); - + return o; } @@ -111,9 +118,9 @@ _basic_apply_data (E_Config_Dialog * cfd, E_Config_Dialog_Data * cfdata) ci = cfd->data; ci->poll_time = cfdata->poll_time; if (ci->hostname) - evas_stringshare_del(ci->hostname); - ci->hostname = evas_stringshare_add(cfdata->hostname); - ci->port = atoi(cfdata->port); + evas_stringshare_del (ci->hostname); + ci->hostname = evas_stringshare_add (cfdata->hostname); + ci->port = atoi (cfdata->port); e_config_save_queue (); _mpdule_config_updated (ci); return 1; diff --git a/e_mod_main.c b/e_mod_main.c index 7b1893f..6691dec 100644 --- a/e_mod_main.c +++ b/e_mod_main.c @@ -21,22 +21,29 @@ static void _gc_shutdown (E_Gadcon_Client * gcc); static void _gc_orient (E_Gadcon_Client * gcc); static char *_gc_label (void); static Evas_Object *_gc_icon (Evas * evas); -static const char *_gc_id_new(void); +static const char *_gc_id_new (void); /* Module Protos */ static void _mpdule_cb_mouse_down (void *data, Evas * e, Evas_Object * obj, void *event_info); -static void _mpdule_cb_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _mpdule_cb_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _mpdule_cb_mouse_in (void *data, Evas * e, Evas_Object * obj, + void *event_info); +static void _mpdule_cb_mouse_out (void *data, Evas * e, Evas_Object * obj, + void *event_info); static void _mpdule_menu_cb_configure (void *data, E_Menu * m, E_Menu_Item * mi); static void _mpdule_menu_cb_post (void *data, E_Menu * m); static int _mpdule_cb_check (void *data); -static void _mpdule_cb_play(void *data, Evas_Object *obj, const char *emission, const char *source); -static void _mpdule_cb_stop(void *data, Evas_Object *obj, const char *emission, const char *source); -static void _mpdule_cb_pause(void *data, Evas_Object *obj, const char *emission, const char *source); -static void _mpdule_cb_next(void *data, Evas_Object *obj, const char *emission, const char *source); -static void _mpdule_cb_previous(void *data, Evas_Object *obj, const char *emission, const char *source); +static void _mpdule_cb_play (void *data, Evas_Object * obj, + const char *emission, const char *source); +static void _mpdule_cb_stop (void *data, Evas_Object * obj, + const char *emission, const char *source); +static void _mpdule_cb_pause (void *data, Evas_Object * obj, + const char *emission, const char *source); +static void _mpdule_cb_next (void *data, Evas_Object * obj, + const char *emission, const char *source); +static void _mpdule_cb_previous (void *data, Evas_Object * obj, + const char *emission, const char *source); static Config_Item *_mpdule_config_item_get (const char *id); static E_Config_DD *conf_edd = NULL; @@ -47,7 +54,8 @@ Config *mpdule_config = NULL; /* Define the class and gadcon functions this module provides */ static const E_Gadcon_Client_Class _gc_class = { GADCON_CLIENT_CLASS_VERSION, - "mpdule", {_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, _gc_id_new, NULL}, + "mpdule", {_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, + _gc_id_new, NULL}, E_GADCON_CLIENT_STYLE_PLAIN }; @@ -68,8 +76,8 @@ static void _mpdule_connect (Instance * inst); static void _mpdule_disconnect (Instance * inst); static void _mpdule_update_song (Instance * inst); static void _mpdule_update_song_cb (void *data); -static void _mpdule_popup_destroy(Instance *inst); -static void _mpdule_popup_resize(Evas_Object *obj, int *w, int *h); +static void _mpdule_popup_destroy (Instance * inst); +static void _mpdule_popup_resize (Evas_Object * obj, int *w, int *h); static E_Gadcon_Client * _gc_init (E_Gadcon * gc, const char *name, const char *id, const char *style) @@ -82,7 +90,7 @@ _gc_init (E_Gadcon * gc, const char *name, const char *id, const char *style) int w, h; inst = E_NEW (Instance, 1); - + inst->ci = _mpdule_config_item_get (id); if (!inst->ci->id) inst->ci->id = evas_stringshare_add (id); @@ -100,7 +108,7 @@ _gc_init (E_Gadcon * gc, const char *name, const char *id, const char *style) inst->gcc = gcc; inst->mpdule = o; - inst->popup = e_gadcon_popup_new(inst->gcc, _mpdule_popup_resize); + inst->popup = e_gadcon_popup_new (inst->gcc, _mpdule_popup_resize); evas = inst->popup->win->evas; o_popup = edje_object_add (evas); @@ -108,30 +116,40 @@ _gc_init (E_Gadcon * gc, const char *name, const char *id, const char *style) (o_popup, "base/theme/modules/mpdule", "modules/mpdule/popup")) edje_object_file_set (o_popup, buf, "modules/mpdule/popup"); evas_object_show (o_popup); - e_gadcon_popup_content_set(inst->popup, o_popup); + e_gadcon_popup_content_set (inst->popup, o_popup); edje_object_size_min_calc (o_popup, &w, &h); inst->o_popup = o_popup; evas_object_event_callback_add (o, EVAS_CALLBACK_MOUSE_DOWN, _mpdule_cb_mouse_down, inst); - evas_object_event_callback_add(inst->mpdule, EVAS_CALLBACK_MOUSE_IN, - _mpdule_cb_mouse_in, inst); - evas_object_event_callback_add(inst->mpdule, EVAS_CALLBACK_MOUSE_OUT, - _mpdule_cb_mouse_out, inst); - edje_object_signal_callback_add(o, "mpdule,play", "", _mpdule_cb_play, inst); - edje_object_signal_callback_add(o, "mpdule,stop", "", _mpdule_cb_stop, inst); - edje_object_signal_callback_add(o, "mpdule,pause", "", _mpdule_cb_pause, inst); - edje_object_signal_callback_add(o, "mpdule,next", "", _mpdule_cb_next, inst); - edje_object_signal_callback_add(o, "mpdule,previous", "", _mpdule_cb_previous, inst); - edje_object_signal_callback_add(o_popup, "mpdule,play", "", _mpdule_cb_play, inst); - edje_object_signal_callback_add(o_popup, "mpdule,stop", "", _mpdule_cb_stop, inst); - edje_object_signal_callback_add(o_popup, "mpdule,pause", "", _mpdule_cb_pause, inst); - edje_object_signal_callback_add(o_popup, "mpdule,next", "", _mpdule_cb_next, inst); - edje_object_signal_callback_add(o_popup, "mpdule,previous", "", _mpdule_cb_previous, inst); - _mpdule_connect(inst); - _mpdule_update_song(inst); - inst->update_timer = ecore_timer_add((double)inst->ci->poll_time, - _mpdule_update_song_cb, inst); + evas_object_event_callback_add (inst->mpdule, EVAS_CALLBACK_MOUSE_IN, + _mpdule_cb_mouse_in, inst); + evas_object_event_callback_add (inst->mpdule, EVAS_CALLBACK_MOUSE_OUT, + _mpdule_cb_mouse_out, inst); + edje_object_signal_callback_add (o, "mpdule,play", "", _mpdule_cb_play, + inst); + edje_object_signal_callback_add (o, "mpdule,stop", "", _mpdule_cb_stop, + inst); + edje_object_signal_callback_add (o, "mpdule,pause", "", _mpdule_cb_pause, + inst); + edje_object_signal_callback_add (o, "mpdule,next", "", _mpdule_cb_next, + inst); + edje_object_signal_callback_add (o, "mpdule,previous", "", + _mpdule_cb_previous, inst); + edje_object_signal_callback_add (o_popup, "mpdule,play", "", + _mpdule_cb_play, inst); + edje_object_signal_callback_add (o_popup, "mpdule,stop", "", + _mpdule_cb_stop, inst); + edje_object_signal_callback_add (o_popup, "mpdule,pause", "", + _mpdule_cb_pause, inst); + edje_object_signal_callback_add (o_popup, "mpdule,next", "", + _mpdule_cb_next, inst); + edje_object_signal_callback_add (o_popup, "mpdule,previous", "", + _mpdule_cb_previous, inst); + _mpdule_connect (inst); + _mpdule_update_song (inst); + inst->update_timer = ecore_timer_add ((double) inst->ci->poll_time, + _mpdule_update_song_cb, inst); mpdule_config->instances = evas_list_append (mpdule_config->instances, inst); @@ -145,18 +163,18 @@ _gc_shutdown (E_Gadcon_Client * gcc) inst = gcc->data; if (inst->update_timer) - ecore_timer_del(inst->update_timer); - _mpdule_disconnect(inst); + ecore_timer_del (inst->update_timer); + _mpdule_disconnect (inst); mpdule_config->instances = evas_list_remove (mpdule_config->instances, inst); evas_object_event_callback_del (inst->mpdule, EVAS_CALLBACK_MOUSE_DOWN, _mpdule_cb_mouse_down); - evas_object_event_callback_del(inst->mpdule, EVAS_CALLBACK_MOUSE_IN, - _mpdule_cb_mouse_in); - evas_object_event_callback_del(inst->mpdule, EVAS_CALLBACK_MOUSE_OUT, - _mpdule_cb_mouse_out); - _mpdule_popup_destroy(inst); + evas_object_event_callback_del (inst->mpdule, EVAS_CALLBACK_MOUSE_IN, + _mpdule_cb_mouse_in); + evas_object_event_callback_del (inst->mpdule, EVAS_CALLBACK_MOUSE_OUT, + _mpdule_cb_mouse_out); + _mpdule_popup_destroy (inst); evas_object_del (inst->mpdule); free (inst); inst = NULL; @@ -193,12 +211,12 @@ _gc_icon (Evas * evas) } static const char * -_gc_id_new(void) +_gc_id_new (void) { - Config_Item *ci; + Config_Item *ci; - ci = _mpdule_config_item_get(NULL); - return ci->id; + ci = _mpdule_config_item_get (NULL); + return ci->id; } static void @@ -237,32 +255,38 @@ _mpdule_cb_mouse_down (void *data, Evas * e, Evas_Object * obj, E_MENU_POP_DIRECTION_DOWN, ev->timestamp); evas_event_feed_mouse_up (inst->gcc->gadcon->evas, ev->button, EVAS_BUTTON_NONE, ev->timestamp, NULL); - } else if (ev->button == 1) { - //e_gadcon_popup_toggle_pinned(inst->popup); + } + else if (ev->button == 1) + { + //e_gadcon_popup_toggle_pinned(inst->popup); } } -static void -_mpdule_cb_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info) +static void +_mpdule_cb_mouse_in (void *data, Evas * e, Evas_Object * obj, + void *event_info) { - Instance *inst; - E_Gadcon_Popup *popup; - - if (!(inst = data)) return; - popup = inst->popup; - e_gadcon_popup_show(inst->popup); + Instance *inst; + E_Gadcon_Popup *popup; + + if (!(inst = data)) + return; + popup = inst->popup; + e_gadcon_popup_show (inst->popup); } -static void -_mpdule_cb_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info) +static void +_mpdule_cb_mouse_out (void *data, Evas * e, Evas_Object * obj, + void *event_info) { - Instance *inst; - E_Gadcon_Popup *popup; + Instance *inst; + E_Gadcon_Popup *popup; - if (!(inst = data)) return; - popup = inst->popup; - e_gadcon_popup_hide(inst->popup); + if (!(inst = data)) + return; + popup = inst->popup; + e_gadcon_popup_hide (inst->popup); } static void @@ -284,7 +308,7 @@ _mpdule_menu_cb_configure (void *data, E_Menu * m, E_Menu_Item * mi) } void -_mpdule_config_updated (Config_Item *ci) +_mpdule_config_updated (Config_Item * ci) { Evas_List *l; @@ -297,73 +321,77 @@ _mpdule_config_updated (Config_Item *ci) inst = l->data; if (!inst->ci != ci) continue; - _mpdule_disconnect(inst); - _mpdule_connect(inst); - _mpdule_update_song(inst); + _mpdule_disconnect (inst); + _mpdule_connect (inst); + _mpdule_update_song (inst); if (inst->update_timer) - ecore_timer_interval_set (inst->update_timer, - (double) ci->poll_time); + ecore_timer_interval_set (inst->update_timer, (double) ci->poll_time); else - inst->update_timer = - ecore_timer_add ((double) ci->poll_time, _mpdule_update_song_cb, - inst); + inst->update_timer = + ecore_timer_add ((double) ci->poll_time, _mpdule_update_song_cb, + inst); break; } } -static void -_mpdule_cb_play(void *data, Evas_Object *obj, const char *emission, const char *source) +static void +_mpdule_cb_play (void *data, Evas_Object * obj, const char *emission, + const char *source) { Instance *inst; mpd_Connection *mpd; inst = data; mpd = inst->mpd; - mpd_sendPlayCommand(mpd, -1); + mpd_sendPlayCommand (mpd, -1); } -static void -_mpdule_cb_previous(void *data, Evas_Object *obj, const char *emission, const char *source) +static void +_mpdule_cb_previous (void *data, Evas_Object * obj, const char *emission, + const char *source) { Instance *inst; mpd_Connection *mpd; inst = data; mpd = inst->mpd; - mpd_sendPrevCommand(mpd); + mpd_sendPrevCommand (mpd); } -static void -_mpdule_cb_next(void *data, Evas_Object *obj, const char *emission, const char *source) +static void +_mpdule_cb_next (void *data, Evas_Object * obj, const char *emission, + const char *source) { Instance *inst; mpd_Connection *mpd; inst = data; mpd = inst->mpd; - mpd_sendNextCommand(mpd); + mpd_sendNextCommand (mpd); } -static void -_mpdule_cb_stop(void *data, Evas_Object *obj, const char *emission, const char *source) +static void +_mpdule_cb_stop (void *data, Evas_Object * obj, const char *emission, + const char *source) { Instance *inst; mpd_Connection *mpd; inst = data; mpd = inst->mpd; - mpd_sendStopCommand(mpd); + mpd_sendStopCommand (mpd); } -static void -_mpdule_cb_pause(void *data, Evas_Object *obj, const char *emission, const char *source) +static void +_mpdule_cb_pause (void *data, Evas_Object * obj, const char *emission, + const char *source) { Instance *inst; mpd_Connection *mpd; inst = data; mpd = inst->mpd; - mpd_sendPauseCommand(mpd, 1); + mpd_sendPauseCommand (mpd, 1); } static Config_Item * @@ -371,35 +399,36 @@ _mpdule_config_item_get (const char *id) { Evas_List *l; Config_Item *ci; - char buf[128]; + char buf[128]; - if (!id) - { - int num = 0; + if (!id) + { + int num = 0; - /* Create id */ - if (mpdule_config->items) - { - const char *p; - ci = evas_list_last(mpdule_config->items)->data; - p = strrchr(ci->id, '.'); - if (p) num = atoi(p + 1) + 1; - } - snprintf(buf, sizeof(buf), "%s.%d", _gc_class.name, num); - id = buf; - } - else - { - for (l = mpdule_config->items; l; l = l->next) - { - ci = l->data; - if (!ci->id) - continue; - if (!strcmp (ci->id, id)) - return ci; - } - } + /* Create id */ + if (mpdule_config->items) + { + const char *p; + ci = evas_list_last (mpdule_config->items)->data; + p = strrchr (ci->id, '.'); + if (p) + num = atoi (p + 1) + 1; + } + snprintf (buf, sizeof (buf), "%s.%d", _gc_class.name, num); + id = buf; + } + else + { + for (l = mpdule_config->items; l; l = l->next) + { + ci = l->data; + if (!ci->id) + continue; + if (!strcmp (ci->id, id)) + return ci; + } + } ci = E_NEW (Config_Item, 1); ci->id = evas_stringshare_add (id); @@ -417,196 +446,241 @@ EAPI E_Module_Api e_modapi = { }; static void -_mpdule_connect(Instance *inst) +_mpdule_connect (Instance * inst) { - mpd_Connection *mpd; - Config_Item *ci; + mpd_Connection *mpd; + Config_Item *ci; - ci = inst->ci; - mpd = mpd_newConnection(ci->hostname, ci->port, 3.0); - inst->mpd = mpd; + ci = inst->ci; + mpd = mpd_newConnection (ci->hostname, ci->port, 3.0); + inst->mpd = mpd; } static void -_mpdule_disconnect(Instance *inst) +_mpdule_disconnect (Instance * inst) { - mpd_Connection *mpd; - - if (inst->mpd) { - mpd = inst->mpd; - mpd_closeConnection(mpd); - inst->mpd = NULL; - } + mpd_Connection *mpd; + + if (inst->mpd) + { + mpd = inst->mpd; + mpd_closeConnection (mpd); + inst->mpd = NULL; + } } static void -_mpdule_update_song_cb(void *data) +_mpdule_update_song_cb (void *data) { - Instance *inst; - - inst = data; - _mpdule_update_song(inst); - return 0; + Instance *inst; + + inst = data; + _mpdule_update_song (inst); + return 0; } static void -_mpdule_update_song(Instance *inst) +_mpdule_update_song (Instance * inst) { - mpd_Connection *mpd; - Evas_Object *mpdule; - Evas_Object *o_popup; - - if (!inst->mpd) - return; - mpd = inst->mpd; - mpdule = inst->mpdule; - o_popup = inst->o_popup; - mpd_sendStatusCommand(mpd); - if (mpd->error == 0) + mpd_Connection *mpd; + Evas_Object *mpdule; + Evas_Object *o_popup; + + if (!inst->mpd) + return; + mpd = inst->mpd; + mpdule = inst->mpdule; + o_popup = inst->o_popup; + mpd_sendStatusCommand (mpd); + if (mpd->error == 0) + { + mpd_Status *status = mpd_getStatus (mpd); + + if (status) { - mpd_Status *status = mpd_getStatus(mpd); - - if (status) + if (status->state == MPD_STATUS_STATE_UNKNOWN) + { + edje_object_part_text_set (mpdule, "mpdule.status", + D_ ("Unknown")); + edje_object_part_text_set (o_popup, "mpdule.status", + D_ ("Unknown")); + } + else if (status->state == MPD_STATUS_STATE_STOP) + { + edje_object_part_text_set (mpdule, "mpdule.status", + D_ ("Stopped")); + edje_object_part_text_set (o_popup, "mpdule.status", + D_ ("Stopped")); + } + else if (status->state == MPD_STATUS_STATE_PLAY) + { + edje_object_part_text_set (mpdule, "mpdule.status", + D_ ("Playing")); + edje_object_part_text_set (o_popup, "mpdule.status", + D_ ("Playing")); + } + else if (status->state == MPD_STATUS_STATE_PAUSE) + { + edje_object_part_text_set (mpdule, "mpdule.status", + D_ ("Paused")); + edje_object_part_text_set (o_popup, "mpdule.status", + D_ ("Paused")); + } + + if (status->state > MPD_STATUS_STATE_STOP) + { + mpd_sendCurrentSongCommand (mpd); + mpd_InfoEntity *entity = NULL; + + while ((entity = mpd_getNextInfoEntity (mpd))) { - if (status->state == MPD_STATUS_STATE_UNKNOWN) - { - edje_object_part_text_set (mpdule, "mpdule.status", D_ ("Unknown")); - edje_object_part_text_set (o_popup, "mpdule.status", D_ ("Unknown")); - } - else if (status->state == MPD_STATUS_STATE_STOP) - { - edje_object_part_text_set (mpdule, "mpdule.status", D_ ("Stopped")); - edje_object_part_text_set (o_popup, "mpdule.status", D_ ("Stopped")); - } - else if (status->state == MPD_STATUS_STATE_PLAY) - { - edje_object_part_text_set (mpdule, "mpdule.status", D_ ("Playing")); - edje_object_part_text_set (o_popup, "mpdule.status", D_ ("Playing")); - } - else if (status->state == MPD_STATUS_STATE_PAUSE) - { - edje_object_part_text_set (mpdule, "mpdule.status", D_ ("Paused")); - edje_object_part_text_set (o_popup, "mpdule.status", D_ ("Paused")); - } + if (entity->type == MPD_INFO_ENTITY_TYPE_SONG && + entity->info.song->id == status->songid) + { + mpd_Song *song = entity->info.song; - if (status->state > MPD_STATUS_STATE_STOP) + if (song->artist) { - mpd_sendCurrentSongCommand(mpd); - mpd_InfoEntity *entity = NULL; - - while ( (entity = mpd_getNextInfoEntity(mpd)) ) - { - if ( entity->type == MPD_INFO_ENTITY_TYPE_SONG && - entity->info.song->id == status->songid ) - { - mpd_Song *song = entity->info.song; - - if (song->artist) - { - edje_object_part_text_set (mpdule, "mpdule.artist", song->artist); - edje_object_part_text_set (o_popup, "mpdule.artist", song->artist); - } - else - { - edje_object_part_text_set (mpdule, "mpdule.artist", ""); - edje_object_part_text_set (o_popup, "mpdule.artist", ""); - } - if (song->title) - { - edje_object_part_text_set (mpdule, "mpdule.title", song->title); - edje_object_part_text_set (o_popup, "mpdule.title", song->title); - } - else - { - edje_object_part_text_set (mpdule, "mpdule.title", ""); - edje_object_part_text_set (o_popup, "mpdule.title", ""); - } - if (song->album) - { - edje_object_part_text_set (mpdule, "mpdule.album", song->album); - edje_object_part_text_set (o_popup, "mpdule.album", song->album); - } - else - { - edje_object_part_text_set (mpdule, "mpdule.album", ""); - edje_object_part_text_set (o_popup, "mpdule.album", ""); - } - if (song->track) - { - edje_object_part_text_set (mpdule, "mpdule.track", song->track); - edje_object_part_text_set (o_popup, "mpdule.track", song->track); - } - else - { - edje_object_part_text_set (mpdule, "mpdule.track", ""); - edje_object_part_text_set (o_popup, "mpdule.track", ""); - } - if (song->date) - { - edje_object_part_text_set (mpdule, "mpdule.date", song->date); - edje_object_part_text_set (o_popup, "mpdule.date", song->date); - } - else - { - edje_object_part_text_set (mpdule, "mpdule.date", ""); - edje_object_part_text_set (o_popup, "mpdule.date", ""); - } - if (song->genre) - { - edje_object_part_text_set (mpdule, "mpdule.genre", song->genre); - edje_object_part_text_set (o_popup, "mpdule.genre", song->genre); - } - else - { - edje_object_part_text_set (mpdule, "mpdule.genre", ""); - edje_object_part_text_set (o_popup, "mpdule.genre", ""); - } - if (song->composer) - { - edje_object_part_text_set (mpdule, "mpdule.composer", song->composer); - edje_object_part_text_set (o_popup, "mpdule.composer", song->composer); - } - else - { - edje_object_part_text_set (mpdule, "mpdule.composer", ""); - edje_object_part_text_set (o_popup, "mpdule.composer", ""); - } - if (song->time) - { - //char * songtime; - //sprintf(songtime, "%i", song->time); - //edje_object_part_text_set (mpdule, "mpdule.time", songtime); - //edje_object_part_text_set (o_popup, "mpdule.time", songtime); - } - else - { - edje_object_part_text_set (mpdule, "mpdule.time", ""); - edje_object_part_text_set (o_popup, "mpdule.time", ""); - } - if (song->file) - { - edje_object_part_text_set (mpdule, "mpdule.file", song->file); - edje_object_part_text_set (o_popup, "mpdule.file", song->file); - } - else - { - edje_object_part_text_set (mpdule, "mpdule.file", ""); - edje_object_part_text_set (o_popup, "mpdule.file", ""); - } - } - - mpd_freeInfoEntity(entity); - } + edje_object_part_text_set (mpdule, "mpdule.artist", + song->artist); + edje_object_part_text_set (o_popup, "mpdule.artist", + song->artist); } - - mpd_freeStatus(status); + else + { + edje_object_part_text_set (mpdule, "mpdule.artist", + ""); + edje_object_part_text_set (o_popup, "mpdule.artist", + ""); + } + if (song->title) + { + edje_object_part_text_set (mpdule, "mpdule.title", + song->title); + edje_object_part_text_set (o_popup, "mpdule.title", + song->title); + } + else + { + edje_object_part_text_set (mpdule, "mpdule.title", + ""); + edje_object_part_text_set (o_popup, "mpdule.title", + ""); + } + if (song->album) + { + edje_object_part_text_set (mpdule, "mpdule.album", + song->album); + edje_object_part_text_set (o_popup, "mpdule.album", + song->album); + } + else + { + edje_object_part_text_set (mpdule, "mpdule.album", + ""); + edje_object_part_text_set (o_popup, "mpdule.album", + ""); + } + if (song->track) + { + edje_object_part_text_set (mpdule, "mpdule.track", + song->track); + edje_object_part_text_set (o_popup, "mpdule.track", + song->track); + } + else + { + edje_object_part_text_set (mpdule, "mpdule.track", + ""); + edje_object_part_text_set (o_popup, "mpdule.track", + ""); + } + if (song->date) + { + edje_object_part_text_set (mpdule, "mpdule.date", + song->date); + edje_object_part_text_set (o_popup, "mpdule.date", + song->date); + } + else + { + edje_object_part_text_set (mpdule, "mpdule.date", + ""); + edje_object_part_text_set (o_popup, "mpdule.date", + ""); + } + if (song->genre) + { + edje_object_part_text_set (mpdule, "mpdule.genre", + song->genre); + edje_object_part_text_set (o_popup, "mpdule.genre", + song->genre); + } + else + { + edje_object_part_text_set (mpdule, "mpdule.genre", + ""); + edje_object_part_text_set (o_popup, "mpdule.genre", + ""); + } + if (song->composer) + { + edje_object_part_text_set (mpdule, + "mpdule.composer", + song->composer); + edje_object_part_text_set (o_popup, + "mpdule.composer", + song->composer); + } + else + { + edje_object_part_text_set (mpdule, + "mpdule.composer", ""); + edje_object_part_text_set (o_popup, + "mpdule.composer", ""); + } + if (song->time) + { + //char * songtime; + //sprintf(songtime, "%i", song->time); + //edje_object_part_text_set (mpdule, "mpdule.time", songtime); + //edje_object_part_text_set (o_popup, "mpdule.time", songtime); + } + else + { + edje_object_part_text_set (mpdule, "mpdule.time", + ""); + edje_object_part_text_set (o_popup, "mpdule.time", + ""); + } + if (song->file) + { + edje_object_part_text_set (mpdule, "mpdule.file", + song->file); + edje_object_part_text_set (o_popup, "mpdule.file", + song->file); + } + else + { + edje_object_part_text_set (mpdule, "mpdule.file", + ""); + edje_object_part_text_set (o_popup, "mpdule.file", + ""); + } + } + + mpd_freeInfoEntity (entity); } + } + + mpd_freeStatus (status); } - else - { - _mpdule_disconnect(inst); - _mpdule_connect(inst); - } + } + else + { + _mpdule_disconnect (inst); + _mpdule_connect (inst); + } } EAPI void * @@ -699,19 +773,22 @@ e_modapi_save (E_Module * m) } static void -_mpdule_popup_destroy(Instance *inst) +_mpdule_popup_destroy (Instance * inst) { - if (!inst->popup) return; - e_object_del(E_OBJECT(inst->popup)); + if (!inst->popup) + return; + e_object_del (E_OBJECT (inst->popup)); } static void -_mpdule_popup_resize(Evas_Object *obj, int *w, int *h) +_mpdule_popup_resize (Evas_Object * obj, int *w, int *h) { - int x, y; - if (!(*w)) *w = 0; - if (!(*h)) *h = 0; - edje_object_size_min_calc (obj, &x, &y); - *w = x; - *h = y; + int x, y; + if (!(*w)) + *w = 0; + if (!(*h)) + *h = 0; + edje_object_size_min_calc (obj, &x, &y); + *w = x; + *h = y; } diff --git a/e_mod_main.h b/e_mod_main.h index 8dd0817..d791255 100644 --- a/e_mod_main.h +++ b/e_mod_main.h @@ -11,29 +11,29 @@ typedef struct _Config_Item Config_Item; struct _Config { - E_Module *module; - E_Config_Dialog *config_dialog; - E_Menu *menu; - Evas_List *instances; - Evas_List *items; + E_Module *module; + E_Config_Dialog *config_dialog; + E_Menu *menu; + Evas_List *instances; + Evas_List *items; }; struct _Config_Item { - const char *id; - double poll_time; - const char *hostname; - int port; + const char *id; + double poll_time; + const char *hostname; + int port; }; EAPI extern E_Module_Api e_modapi; -EAPI void *e_modapi_init(E_Module *m); -EAPI int e_modapi_shutdown(E_Module *m); -EAPI int e_modapi_save(E_Module *m); +EAPI void *e_modapi_init (E_Module * m); +EAPI int e_modapi_shutdown (E_Module * m); +EAPI int e_modapi_save (E_Module * m); -void _config_mpdule_module(Config_Item *ci); -void _mpdule_config_updated(Config_Item *ci); +void _config_mpdule_module (Config_Item * ci); +void _mpdule_config_updated (Config_Item * ci); extern Config *mpdule_config; #endif diff --git a/mpdule.edc b/mpdule.edc index 9627d90..24a4b97 100644 --- a/mpdule.edc +++ b/mpdule.edc @@ -1,22 +1,34 @@ -fonts { - font: "VeraMono.ttf" "VeraMono"; - font: "VeraBd.ttf" "VeraBold"; +fonts +{ +font:"VeraMono.ttf" "VeraMono"; +font:"VeraBd.ttf" "VeraBold"; } -spectra { + +spectra +{ } -color_classes { + +color_classes +{ } -images { - image: "next.png" COMP; - image: "pause.png" COMP; - image: "play.png" COMP; - image: "prev.png" COMP; - image: "stop.png" COMP; + +images +{ +image:"next.png" COMP; +image:"pause.png" COMP; +image:"play.png" COMP; +image:"prev.png" COMP; +image:"stop.png" COMP; } -data { + +data +{ } -styles { + +styles +{ } + /* Available labels: mpdule.status @@ -30,785 +42,927 @@ mpdule.composer mpdule.time mpdule.file */ -collections { - group { - name: "modules/mpdule/main"; - parts { - part { - name: "base"; - type: RECT; - mouse_events: 0; - description { - state: "default" 0.00; - visible: 1; - rel1 { - relative: 0.00 0.00; - offset: 0 0; - } - rel2 { - relative: 1.00 1.00; - offset: -1 -1; - } - } - } - part { - name: "item_clip"; - type: RECT; - description { - state: "default" 0.00; - visible: 1; - rel1 { - relative: 0.00 0.00; - offset: 0 0; - } - rel2 { - relative: 1.00 1.00; - offset: -1 -1; - } - color: 255 255 255 0; - } - description { - state: "hide" 0.00; - visible: 1; - rel1 { - relative: 0.00 -1.00; - offset: 0 0; - } - rel2 { - relative: 1.00 0.00; - offset: -1 -1; - } - color: 255 255 255 0; - } - } - part { - name: "controls_clip"; - type: RECT; - description { - state: "default" 0.00; - visible: 1; - rel1 { - relative: 0.00 1.00; - offset: 0 0; - } - rel2 { - relative: 1.00 2.00; - offset: -1 -1; - } - color: 255 255 255 0; - } - description { - state: "show" 0.00; - visible: 1; - rel1 { - relative: 0.00 0.00; - offset: 0 0; - } - rel2 { - relative: 1.00 1.00; - offset: -1 -1; - } - color: 255 255 255 0; - } - } - part { - name: "mpdule.artist"; - type: TEXT; - effect: OUTLINE_SOFT_SHADOW; - clip_to: "base"; - mouse_events: 0; - description { - state: "default" 0.00; - visible: 1; - rel1 { - relative: 0.00 0.00; - offset: 0 4; - to: "item_clip"; - } - rel2 { - relative: 1.00 0.50; - offset: -1 -3; - to: "item_clip"; - } - color2: 0 0 0 96; - color3: 0 0 0 32; - text { - text: ""; - text_class: "mpdule"; - font: "VeraMono"; - size: 10; - min: 1 1; - align: 0.50 0.50; - } - } - description { - state: "hidden" 0.00; - visible: 0; - rel1 { - relative: 0.00 0.00; - offset: 0 4; - to: "item_clip"; - } - rel2 { - relative: 1.00 0.50; - offset: -1 -3; - to: "item_clip"; - } - color2: 0 0 0 96; - color3: 0 0 0 32; - text { - text: ""; - text_class: "mpdule"; - font: "VeraMono"; - size: 10; - min: 1 1; - align: 0.50 0.50; - } - } - description { - state: "visible" 0.00; - visible: 1; - rel1 { - relative: 0.00 0.00; - offset: 0 4; - to: "item_clip"; - } - rel2 { - relative: 1.00 0.50; - offset: -1 -3; - to: "item_clip"; - } - color2: 0 0 0 96; - color3: 0 0 0 32; - text { - text: ""; - text_class: "mpdule"; - font: "VeraMono"; - size: 10; - min: 1 1; - align: 0.50 0.50; - } - } - } - part { - name: "mpdule.title"; - type: TEXT; - effect: OUTLINE_SOFT_SHADOW; - clip_to: "base"; - mouse_events: 0; - description { - state: "default" 0.00; - visible: 1; - rel1 { - relative: 0.00 0.50; - offset: 0 4; - to: "item_clip"; - } - rel2 { - relative: 1.00 1.00; - offset: -1 -3; - to: "item_clip"; - } - color2: 0 0 0 96; - color3: 0 0 0 32; - text { - text: ""; - text_class: "mpdule"; - font: "VeraMono"; - size: 9; - min: 1 1; - align: 0.50 0.50; - } - } - description { - state: "hidden" 0.00; - visible: 0; - rel1 { - relative: 0.00 0.50; - offset: 0 4; - to: "item_clip"; - } - rel2 { - relative: 1.00 1.00; - offset: -1 -3; - to: "item_clip"; - } - color2: 0 0 0 96; - color3: 0 0 0 32; - text { - text: ""; - text_class: "mpdule"; - font: "VeraMono"; - size: 9; - min: 1 1; - align: 0.50 0.50; - } - } - description { - state: "visible" 0.00; - visible: 1; - rel1 { - relative: 0.00 0.50; - offset: 0 4; - to: "item_clip"; - } - rel2 { - relative: 1.00 1.00; - offset: -1 -3; - to: "item_clip"; - } - color2: 0 0 0 96; - color3: 0 0 0 32; - text { - text: ""; - text_class: "mpdule"; - font: "VeraMono"; - size: 9; - min: 1 1; - align: 0.50 0.50; - } - } - } - part { - name: "mpdule.previous"; - type: IMAGE; - mouse_events: 1; - repeat_events: 1; - description { - state: "default" 0.0; - visible: 1; - aspect: 1 1; - align: 0.0 0.5; - rel1 { - relative: 0.0 0.0; - offset: 0 0; - to: "controls_clip"; - } - rel2 { - relative: 0.0 1.0; - to: "controls_clip"; - } - image { - normal: "prev.png"; - } - } - } - part { - name: "mpdule.play"; - type: IMAGE; - mouse_events: 1; - repeat_events: 1; - description { - state: "default" 0.0; - visible: 1; - aspect: 1 1; - align: 0.0 0.5; - rel1 { - relative: 1.0 0.0; - offset: 0 0; - to_x: "mpdule.previous"; - to_y: "controls_clip"; - } - rel2 { - relative: 1.0 1.0; - to_x: "mpdule.previous"; - to_y: "controls_clip"; - } - image { - normal: "play.png"; - } - } - } - part { - name: "mpdule.pause"; - type: IMAGE; - mouse_events: 1; - repeat_events: 1; - description { - state: "default" 0.0; - visible: 1; - aspect: 1 1; - align: 0.0 0.5; - rel1 { - relative: 1.0 0.0; - offset: 0 0; - to_x: "mpdule.play"; - to_y: "controls_clip"; - } - rel2 { - relative: 1.0 1.0; - to_x: "mpdule.play"; - to_y: "controls_clip"; - } - image { - normal: "pause.png"; - } - } - } - part { - name: "mpdule.stop"; - type: IMAGE; - mouse_events: 1; - repeat_events: 1; - description { - state: "default" 0.0; - visible: 1; - aspect: 1 1; - align: 0.0 0.5; - rel1 { - relative: 1.0 0.0; - offset: 0 0; - to_x: "mpdule.pause"; - to_y: "controls_clip"; - } - rel2 { - relative: 1.0 1.0; - to_x: "mpdule.pause"; - to_y: "controls_clip"; - } - image { - normal: "stop.png"; - } - } - } - part { - name: "mpdule.next"; - type: IMAGE; - mouse_events: 1; - repeat_events: 1; - description { - state: "default" 0.0; - visible: 1; - aspect: 1 1; - align: 0.0 0.5; - rel1 { - relative: 1.0 0.0; - offset: 0 0; - to_x: "mpdule.stop"; - to_y: "controls_clip"; - } - rel2 { - relative: 1.0 1.0; - to_x: "mpdule.stop"; - to_y: "controls_clip"; - } - image { - normal: "next.png"; - } - } - } - } - programs { - program { - name: "show_controls"; - signal: "mouse,in"; - source: "item_clip"; - action: STATE_SET "show" 0.0; - transition: LINEAR 0.1; - target: "controls_clip"; - } - program { - name: "show_controls2"; - signal: "mouse,in"; - source: "item_clip"; - action: STATE_SET "hide" 0.0; - transition: LINEAR 0.1; - target: "item_clip"; - } - program { - name: "wait"; - action: STATE_SET "hide" 0.0; - transition: LINEAR 2; - target: "item_clip"; - after: "hide_controls"; - after: "hide_controls2"; - } - program { - name: "hide_controls"; - signal: "mouse,out"; - source: "controls_clip"; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.1; - target: "controls_clip"; - } - program { - name: "hide_controls2"; - signal: "mouse,out"; - source: "controls_clip"; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.1; - target: "item_clip"; - } - program { - name: "mouse_play"; - signal: "mouse,clicked,1"; - source: "mpdule.play"; - action: SIGNAL_EMIT "mpdule,play" ""; - } - program { - name: "mouse_pause"; - signal: "mouse,clicked,1"; - source: "mpdule.pause"; - action: SIGNAL_EMIT "mpdule,pause" ""; - } - program { - name: "mouse_stop"; - signal: "mouse,clicked,1"; - source: "mpdule.stop"; - action: SIGNAL_EMIT "mpdule,stop" ""; - } - program { - name: "mouse_previous"; - signal: "mouse,clicked,1"; - source: "mpdule.previous"; - action: SIGNAL_EMIT "mpdule,previous" ""; - } - program { - name: "mouse_next"; - signal: "mouse,clicked,1"; - source: "mpdule.next"; - action: SIGNAL_EMIT "mpdule,next" ""; - } - } +collections +{ + group + { + name:"modules/mpdule/main"; + parts + { + part + { + name:"base"; + type:RECT; + mouse_events:0; + description + { + state:"default" 0.00; + visible:1; + rel1 + { + relative:0.00 0.00; + offset:0 0; + } + rel2 + { + relative:1.00 1.00; + offset:-1 - 1; + } } - group { - name: "modules/mpdule/popup"; - parts { - part { - name: "base"; - type: RECT; - mouse_events: 0; - description { - state: "default" 0.00; - visible: 1; - min: 200 65; - rel1 { - relative: 0.00 0.00; - offset: 5 5; - } - rel2 { - relative: 1.00 1.00; - offset: -5 -5; - } - } - } - part { - name: "labels"; - type: RECT; - mouse_events: 0; - description { - state: "default" 0.00; - visible: 1; - rel1 { - relative: 0.00 0.00; - offset: 0 0; - to: "base"; - } - rel2 { - relative: 0.25 1.00; - offset: 0 0; - to: "base"; - } - color: 255 255 255 0; - } - } - part { - name: "values"; - type: RECT; - mouse_events: 0; - description { - state: "default" 0.00; - visible: 1; - rel1 { - relative: 0.25 0.00; - offset: 0 0; - to: "base"; - } - rel2 { - relative: 1.00 1.00; - offset: 0 0; - to: "base"; - } - color: 255 255 255 0; - } - } - part { - name: "item_clip"; - type: RECT; - description { - state: "default" 0.00; - visible: 1; - min: 5 5; - rel1 { - relative: 0.00 0.00; - offset: 0 0; - } - rel2 { - relative: 1.00 1.00; - offset: -1 -1; - } - color: 255 255 255 0; - } - } - part { - name: "mpdule.artist_label"; - type: TEXT; - effect: SHADOW; - clip_to: "base"; - description { - state: "default" 0.00; - visible: 1; - align: 0.00 0.50; - fixed: 1 1; - rel1 { - relative: -0.00 0.00; - offset: 0 0; - to: "labels"; - } - rel2 { - relative: 1.00 0.00; - offset: 0 16; - to: "labels"; - } - color: 0 0 0 255; - color3: 255 255 255 128; - text { - text: "Artist:"; - text_class: "mpdule"; - font: "VeraMono"; - size: 10; - min: 1 1; - align: 1.0 0.50; - } - } - } - part { - name: "mpdule.title_label"; - type: TEXT; - effect: SHADOW; - clip_to: "base"; - description { - state: "default" 0.00; - visible: 1; - align: 0.00 0.50; - rel1 { - relative: 0.00 1.00; - offset: 0 0; - to_x: "labels"; - to_y: "mpdule.artist_label"; - } - rel2 { - relative: 1.00 1.00; - offset: 0 12; - to_x: "labels"; - to_y: "mpdule.artist_label"; - } - color: 0 0 0 255; - color3: 255 255 255 128; - text { - text: "Title:"; - text_class: "mpdule"; - font: "VeraMono"; - size: 10; - min: 1 1; - align: 1.0 0.50; - } - } - } - part { - name: "mpdule.album_label"; - type: TEXT; - mouse_events: 0; - effect: SHADOW; - clip_to: "base"; - description { - state: "default" 0.00; - visible: 1; - align: 0.00 0.50; - rel1 { - relative: 0.00 1.00; - offset: 0 0; - to_x: "labels"; - to_y: "mpdule.title_label"; - } - rel2 { - relative: 1.00 1.00; - offset: 0 12; - to_x: "labels"; - to_y: "mpdule.title_label"; - } - color: 0 0 0 255; - color3: 255 255 255 128; - text { - text: "Album:"; - text_class: "mpdule"; - font: "VeraMono"; - size: 10; - min: 1 1; - align: 1.0 0.50; - } - } - } - part { - name: "mpdule.genre_label"; - type: TEXT; - mouse_events: 0; - effect: SHADOW; - clip_to: "base"; - description { - state: "default" 0.00; - visible: 1; - align: 0.00 0.50; - rel1 { - relative: 0.00 1.00; - offset: 0 0; - to_x: "labels"; - to_y: "mpdule.album_label"; - } - rel2 { - relative: 1.00 1.00; - offset: 0 12; - to_x: "labels"; - to_y: "mpdule.album_label"; - } - color: 0 0 0 255; - color3: 255 255 255 128; - text { - text: "Genre:"; - text_class: "mpdule"; - font: "VeraMono"; - size: 10; - min: 1 1; - align: 1.0 0.50; - } - } - } - part { - name: "mpdule.artist"; - type: TEXT; - effect: NONE; - clip_to: "base"; - description { - state: "default" 0.00; - visible: 1; - align: 0.00 0.50; - rel1 { - relative: 0.00 0.00; - offset: 0 0; - to_x: "values"; - to_y: "mpdule.artist_label"; - } - rel2 { - relative: 1.00 1.00; - to_x: "values"; - to_y: "mpdule.artist_label"; - } - color: 0 0 0 255; - text { - text: ""; - text_class: "mpdule"; - font: "VeraBold"; - size: 10; - min: 1 1; - align: 0.0 0.50; - } - } - } - part { - name: "mpdule.title"; - type: TEXT; - effect: NONE; - clip_to: "base"; - description { - state: "default" 0.00; - visible: 1; - align: 0.00 0.50; - rel1 { - relative: 0.00 0.00; - offset: 0 0; - to_x: "values"; - to_y: "mpdule.title_label"; - } - rel2 { - relative: 1.00 1.00; - to_x: "values"; - to_y: "mpdule.title_label"; - } - color: 0 0 0 255; - text { - text: ""; - text_class: "mpdule"; - font: "VeraBold"; - size: 10; - min: 1 1; - align: 0.0 0.50; - } - } - } - part { - name: "mpdule.album"; - type: TEXT; - effect: NONE; - clip_to: "base"; - description { - state: "default" 0.00; - visible: 1; - align: 0.00 0.50; - rel1 { - relative: 0.00 0.00; - offset: 0 0; - to_x: "values"; - to_y: "mpdule.album_label"; - } - rel2 { - relative: 1.00 1.00; - to_x: "values"; - to_y: "mpdule.album_label"; - } - color: 0 0 0 255; - text { - text: ""; - text_class: "mpdule"; - font: "VeraBold"; - size: 10; - min: 1 1; - align: 0.0 0.50; - } - } - } - part { - name: "mpdule.genre"; - type: TEXT; - effect: NONE; - clip_to: "base"; - description { - state: "default" 0.00; - visible: 1; - align: 0.00 0.50; - rel1 { - relative: 0.00 0.00; - offset: 0 0; - to_x: "values"; - to_y: "mpdule.genre_label"; - } - rel2 { - relative: 1.00 1.00; - to_x: "values"; - to_y: "mpdule.genre_label"; - } - color: 0 0 0 255; - text { - text: ""; - text_class: "mpdule"; - font: "VeraBold"; - size: 10; - min: 1 1; - align: 0.0 0.50; - } - } - } - } - programs { - } + } + part + { + name:"item_clip"; + type:RECT; + description + { + state:"default" 0.00; + visible:1; + rel1 + { + relative:0.00 0.00; + offset:0 0; + } + rel2 + { + relative:1.00 1.00; + offset:-1 - 1; + } + color:255 255 255 0; } + description + { + state:"hide" 0.00; + visible:1; + rel1 + { + relative:0.00 - 1.00; + offset:0 0; + } + rel2 + { + relative:1.00 0.00; + offset:-1 - 1; + } + color:255 255 255 0; + } + } + part + { + name:"controls_clip"; + type:RECT; + description + { + state:"default" 0.00; + visible:1; + rel1 + { + relative:0.00 1.00; + offset:0 0; + } + rel2 + { + relative:1.00 2.00; + offset:-1 - 1; + } + color:255 255 255 0; + } + description + { + state:"show" 0.00; + visible:1; + rel1 + { + relative:0.00 0.00; + offset:0 0; + } + rel2 + { + relative:1.00 1.00; + offset:-1 - 1; + } + color:255 255 255 0; + } + } + part + { + name:"mpdule.artist"; + type:TEXT; + effect:OUTLINE_SOFT_SHADOW; + clip_to:"base"; + mouse_events:0; + description + { + state:"default" 0.00; + visible:1; + rel1 + { + relative:0.00 0.00; + offset:0 4; + to:"item_clip"; + } + rel2 + { + relative:1.00 0.50; + offset:-1 - 3; + to:"item_clip"; + } + color2:0 0 0 96; + color3:0 0 0 32; + text + { + text:""; + text_class:"mpdule"; + font:"VeraMono"; + size:10; + min:1 1; + align:0.50 0.50; + } + } + description + { + state:"hidden" 0.00; + visible:0; + rel1 + { + relative:0.00 0.00; + offset:0 4; + to:"item_clip"; + } + rel2 + { + relative:1.00 0.50; + offset:-1 - 3; + to:"item_clip"; + } + color2:0 0 0 96; + color3:0 0 0 32; + text + { + text:""; + text_class:"mpdule"; + font:"VeraMono"; + size:10; + min:1 1; + align:0.50 0.50; + } + } + description + { + state:"visible" 0.00; + visible:1; + rel1 + { + relative:0.00 0.00; + offset:0 4; + to:"item_clip"; + } + rel2 + { + relative:1.00 0.50; + offset:-1 - 3; + to:"item_clip"; + } + color2:0 0 0 96; + color3:0 0 0 32; + text + { + text:""; + text_class:"mpdule"; + font:"VeraMono"; + size:10; + min:1 1; + align:0.50 0.50; + } + } + } + part + { + name:"mpdule.title"; + type:TEXT; + effect:OUTLINE_SOFT_SHADOW; + clip_to:"base"; + mouse_events:0; + description + { + state:"default" 0.00; + visible:1; + rel1 + { + relative:0.00 0.50; + offset:0 4; + to:"item_clip"; + } + rel2 + { + relative:1.00 1.00; + offset:-1 - 3; + to:"item_clip"; + } + color2:0 0 0 96; + color3:0 0 0 32; + text + { + text:""; + text_class:"mpdule"; + font:"VeraMono"; + size:9; + min:1 1; + align:0.50 0.50; + } + } + description + { + state:"hidden" 0.00; + visible:0; + rel1 + { + relative:0.00 0.50; + offset:0 4; + to:"item_clip"; + } + rel2 + { + relative:1.00 1.00; + offset:-1 - 3; + to:"item_clip"; + } + color2:0 0 0 96; + color3:0 0 0 32; + text + { + text:""; + text_class:"mpdule"; + font:"VeraMono"; + size:9; + min:1 1; + align:0.50 0.50; + } + } + description + { + state:"visible" 0.00; + visible:1; + rel1 + { + relative:0.00 0.50; + offset:0 4; + to:"item_clip"; + } + rel2 + { + relative:1.00 1.00; + offset:-1 - 3; + to:"item_clip"; + } + color2:0 0 0 96; + color3:0 0 0 32; + text + { + text:""; + text_class:"mpdule"; + font:"VeraMono"; + size:9; + min:1 1; + align:0.50 0.50; + } + } + } + part + { + name:"mpdule.previous"; + type:IMAGE; + mouse_events:1; + repeat_events:1; + description + { + state:"default" 0.0; + visible:1; + aspect:1 1; + align:0.0 0.5; + rel1 + { + relative:0.0 0.0; + offset:0 0; + to:"controls_clip"; + } + rel2 + { + relative:0.0 1.0; + to:"controls_clip"; + } + image + { + normal:"prev.png"; + } + } + } + part + { + name:"mpdule.play"; + type:IMAGE; + mouse_events:1; + repeat_events:1; + description + { + state:"default" 0.0; + visible:1; + aspect:1 1; + align:0.0 0.5; + rel1 + { + relative:1.0 0.0; + offset:0 0; + to_x:"mpdule.previous"; + to_y:"controls_clip"; + } + rel2 + { + relative:1.0 1.0; + to_x:"mpdule.previous"; + to_y:"controls_clip"; + } + image + { + normal:"play.png"; + } + } + } + part + { + name:"mpdule.pause"; + type:IMAGE; + mouse_events:1; + repeat_events:1; + description + { + state:"default" 0.0; + visible:1; + aspect:1 1; + align:0.0 0.5; + rel1 + { + relative:1.0 0.0; + offset:0 0; + to_x:"mpdule.play"; + to_y:"controls_clip"; + } + rel2 + { + relative:1.0 1.0; + to_x:"mpdule.play"; + to_y:"controls_clip"; + } + image + { + normal:"pause.png"; + } + } + } + part + { + name:"mpdule.stop"; + type:IMAGE; + mouse_events:1; + repeat_events:1; + description + { + state:"default" 0.0; + visible:1; + aspect:1 1; + align:0.0 0.5; + rel1 + { + relative:1.0 0.0; + offset:0 0; + to_x:"mpdule.pause"; + to_y:"controls_clip"; + } + rel2 + { + relative:1.0 1.0; + to_x:"mpdule.pause"; + to_y:"controls_clip"; + } + image + { + normal:"stop.png"; + } + } + } + part + { + name:"mpdule.next"; + type:IMAGE; + mouse_events:1; + repeat_events:1; + description + { + state:"default" 0.0; + visible:1; + aspect:1 1; + align:0.0 0.5; + rel1 + { + relative:1.0 0.0; + offset:0 0; + to_x:"mpdule.stop"; + to_y:"controls_clip"; + } + rel2 + { + relative:1.0 1.0; + to_x:"mpdule.stop"; + to_y:"controls_clip"; + } + image + { + normal:"next.png"; + } + } + } + } + programs + { + program + { + name:"show_controls"; + signal:"mouse,in"; + source:"item_clip"; + action:STATE_SET "show" 0.0; + transition:LINEAR 0.1; + target:"controls_clip"; + } + program + { + name:"show_controls2"; + signal:"mouse,in"; + source:"item_clip"; + action:STATE_SET "hide" 0.0; + transition:LINEAR 0.1; + target:"item_clip"; + } + program + { + name:"wait"; + action:STATE_SET "hide" 0.0; + transition:LINEAR 2; + target:"item_clip"; + after:"hide_controls"; + after:"hide_controls2"; + } + program + { + name:"hide_controls"; + signal:"mouse,out"; + source:"controls_clip"; + action:STATE_SET "default" 0.0; + transition:LINEAR 0.1; + target:"controls_clip"; + } + program + { + name:"hide_controls2"; + signal:"mouse,out"; + source:"controls_clip"; + action:STATE_SET "default" 0.0; + transition:LINEAR 0.1; + target:"item_clip"; + } + program + { + name:"mouse_play"; + signal:"mouse,clicked,1"; + source:"mpdule.play"; + action:SIGNAL_EMIT "mpdule,play" ""; + } + program + { + name:"mouse_pause"; + signal:"mouse,clicked,1"; + source:"mpdule.pause"; + action:SIGNAL_EMIT "mpdule,pause" ""; + } + program + { + name:"mouse_stop"; + signal:"mouse,clicked,1"; + source:"mpdule.stop"; + action:SIGNAL_EMIT "mpdule,stop" ""; + } + program + { + name:"mouse_previous"; + signal:"mouse,clicked,1"; + source:"mpdule.previous"; + action:SIGNAL_EMIT "mpdule,previous" ""; + } + program + { + name:"mouse_next"; + signal:"mouse,clicked,1"; + source:"mpdule.next"; + action:SIGNAL_EMIT "mpdule,next" ""; + } + } + } + group + { + name:"modules/mpdule/popup"; + parts + { + part + { + name:"base"; + type:RECT; + mouse_events:0; + description + { + state:"default" 0.00; + visible:1; + min:200 65; + rel1 + { + relative:0.00 0.00; + offset:5 5; + } + rel2 + { + relative:1.00 1.00; + offset:-5 - 5; + } + } + } + part + { + name:"labels"; + type:RECT; + mouse_events:0; + description + { + state:"default" 0.00; + visible:1; + rel1 + { + relative:0.00 0.00; + offset:0 0; + to:"base"; + } + rel2 + { + relative:0.25 1.00; + offset:0 0; + to:"base"; + } + color:255 255 255 0; + } + } + part + { + name:"values"; + type:RECT; + mouse_events:0; + description + { + state:"default" 0.00; + visible:1; + rel1 + { + relative:0.25 0.00; + offset:0 0; + to:"base"; + } + rel2 + { + relative:1.00 1.00; + offset:0 0; + to:"base"; + } + color:255 255 255 0; + } + } + part + { + name:"item_clip"; + type:RECT; + description + { + state:"default" 0.00; + visible:1; + min:5 5; + rel1 + { + relative:0.00 0.00; + offset:0 0; + } + rel2 + { + relative:1.00 1.00; + offset:-1 - 1; + } + color:255 255 255 0; + } + } + part + { + name:"mpdule.artist_label"; + type:TEXT; + effect:SHADOW; + clip_to:"base"; + description + { + state:"default" 0.00; + visible:1; + align:0.00 0.50; + fixed:1 1; + rel1 + { + relative:-0.00 0.00; + offset:0 0; + to:"labels"; + } + rel2 + { + relative:1.00 0.00; + offset:0 16; + to:"labels"; + } + color:0 0 0 255; + color3:255 255 255 128; + text + { + text:"Artist:"; + text_class:"mpdule"; + font:"VeraMono"; + size:10; + min:1 1; + align:1.0 0.50; + } + } + } + part + { + name:"mpdule.title_label"; + type:TEXT; + effect:SHADOW; + clip_to:"base"; + description + { + state:"default" 0.00; + visible:1; + align:0.00 0.50; + rel1 + { + relative:0.00 1.00; + offset:0 0; + to_x:"labels"; + to_y:"mpdule.artist_label"; + } + rel2 + { + relative:1.00 1.00; + offset:0 12; + to_x:"labels"; + to_y:"mpdule.artist_label"; + } + color:0 0 0 255; + color3:255 255 255 128; + text + { + text:"Title:"; + text_class:"mpdule"; + font:"VeraMono"; + size:10; + min:1 1; + align:1.0 0.50; + } + } + } + part + { + name:"mpdule.album_label"; + type:TEXT; + mouse_events:0; + effect:SHADOW; + clip_to:"base"; + description + { + state:"default" 0.00; + visible:1; + align:0.00 0.50; + rel1 + { + relative:0.00 1.00; + offset:0 0; + to_x:"labels"; + to_y:"mpdule.title_label"; + } + rel2 + { + relative:1.00 1.00; + offset:0 12; + to_x:"labels"; + to_y:"mpdule.title_label"; + } + color:0 0 0 255; + color3:255 255 255 128; + text + { + text:"Album:"; + text_class:"mpdule"; + font:"VeraMono"; + size:10; + min:1 1; + align:1.0 0.50; + } + } + } + part + { + name:"mpdule.genre_label"; + type:TEXT; + mouse_events:0; + effect:SHADOW; + clip_to:"base"; + description + { + state:"default" 0.00; + visible:1; + align:0.00 0.50; + rel1 + { + relative:0.00 1.00; + offset:0 0; + to_x:"labels"; + to_y:"mpdule.album_label"; + } + rel2 + { + relative:1.00 1.00; + offset:0 12; + to_x:"labels"; + to_y:"mpdule.album_label"; + } + color:0 0 0 255; + color3:255 255 255 128; + text + { + text:"Genre:"; + text_class:"mpdule"; + font:"VeraMono"; + size:10; + min:1 1; + align:1.0 0.50; + } + } + } + part + { + name:"mpdule.artist"; + type:TEXT; + effect:NONE; + clip_to:"base"; + description + { + state:"default" 0.00; + visible:1; + align:0.00 0.50; + rel1 + { + relative:0.00 0.00; + offset:0 0; + to_x:"values"; + to_y:"mpdule.artist_label"; + } + rel2 + { + relative:1.00 1.00; + to_x:"values"; + to_y:"mpdule.artist_label"; + } + color:0 0 0 255; + text + { + text:""; + text_class:"mpdule"; + font:"VeraBold"; + size:10; + min:1 1; + align:0.0 0.50; + } + } + } + part + { + name:"mpdule.title"; + type:TEXT; + effect:NONE; + clip_to:"base"; + description + { + state:"default" 0.00; + visible:1; + align:0.00 0.50; + rel1 + { + relative:0.00 0.00; + offset:0 0; + to_x:"values"; + to_y:"mpdule.title_label"; + } + rel2 + { + relative:1.00 1.00; + to_x:"values"; + to_y:"mpdule.title_label"; + } + color:0 0 0 255; + text + { + text:""; + text_class:"mpdule"; + font:"VeraBold"; + size:10; + min:1 1; + align:0.0 0.50; + } + } + } + part + { + name:"mpdule.album"; + type:TEXT; + effect:NONE; + clip_to:"base"; + description + { + state:"default" 0.00; + visible:1; + align:0.00 0.50; + rel1 + { + relative:0.00 0.00; + offset:0 0; + to_x:"values"; + to_y:"mpdule.album_label"; + } + rel2 + { + relative:1.00 1.00; + to_x:"values"; + to_y:"mpdule.album_label"; + } + color:0 0 0 255; + text + { + text:""; + text_class:"mpdule"; + font:"VeraBold"; + size:10; + min:1 1; + align:0.0 0.50; + } + } + } + part + { + name:"mpdule.genre"; + type:TEXT; + effect:NONE; + clip_to:"base"; + description + { + state:"default" 0.00; + visible:1; + align:0.00 0.50; + rel1 + { + relative:0.00 0.00; + offset:0 0; + to_x:"values"; + to_y:"mpdule.genre_label"; + } + rel2 + { + relative:1.00 1.00; + to_x:"values"; + to_y:"mpdule.genre_label"; + } + color:0 0 0 255; + text + { + text:""; + text_class:"mpdule"; + font:"VeraBold"; + size:10; + min:1 1; + align:0.0 0.50; + } + } + } + } + programs + { + } + } }