void dvb_init(char *module, char *file, char *swallow) { Evas_Object *o; if (o_dvb_bg) return; if (mdl) free(mdl); mdl = strdup(module); if (swal) free(swal); swal = strdup(swallow); o = edje_object_add(evas); edje_object_file_set(o, theme, "video_container"); o_dvb_bg = o; o = emotion_object_add(evas); if (!emotion_object_init(o, module)) { printf("ERROR!\n"); } evas_object_smart_callback_add(o, "frame_decode", dvb_obj_frame_decode_cb, NULL); evas_object_smart_callback_add(o, "frame_resize", dvb_obj_frame_resize_cb, NULL); evas_object_smart_callback_add(o, "length_change", dvb_obj_length_change_cb, NULL); evas_object_smart_callback_add(o, "decode_stop", dvb_obj_stopped_cb, NULL); evas_object_smart_callback_add(o, "channels_change", dvb_obj_channels_cb, NULL); evas_object_smart_callback_add(o, "title_change", dvb_obj_title_cb, NULL); evas_object_smart_callback_add(o, "progress_change", dvb_obj_progress_cb, NULL); evas_object_smart_callback_add(o, "ref_change", dvb_obj_ref_cb, NULL); evas_object_smart_callback_add(o, "button_num_change", dvb_obj_button_num_cb, NULL); evas_object_smart_callback_add(o, "button_change", dvb_obj_button_cb, NULL); o_dvb = o; channel = 0; emotion_object_file_set(o_dvb, "dvb://0"); emotion_object_play_set(o_dvb, 1); emotion_object_audio_mute_set(o_dvb, 0); emotion_object_audio_volume_set(o_dvb, 1.0); layout_swallow(swallow, o_dvb_bg); edje_extern_object_aspect_set(o_dvb, EDJE_ASPECT_CONTROL_BOTH, 640, 480); edje_object_part_swallow(o_dvb_bg, "video", o_dvb); dvb_resize(); evas_object_show(o_dvb); evas_object_show(o_dvb_bg); _hide_timer = ecore_timer_add(10.0, dvb_menu_bg_hide_tmer_cb, NULL); /* FIXME: add this video to recently played list */ }
static void _win_song_set(Win *w, Song *s) { Edje_Message_Int mi; Song *previous; char str[32]; w->play.position = 0.0; w->play.length = 0.0; previous = w->song; w->song = s; if (!s) goto end; if (s->trackno > 0) snprintf(str, sizeof(str), "%d", s->trackno); else str[0] = '\0'; edje_object_part_text_set(w->edje, "ejy.text.trackno", str); edje_object_part_text_set(w->edje, "ejy.text.title", s->title); edje_object_part_text_set(w->edje, "ejy.text.album", s->album); edje_object_part_text_set(w->edje, "ejy.text.artist", s->artist); edje_object_part_text_set(w->edje, "ejy.text.genre", s->genre); mi.val = s->rating; edje_object_message_send(elm_layout_edje_get(w->nowplaying), EDJE_MESSAGE_INT, MSG_RATING, &mi); emotion_object_file_set(w->emotion, s->path); emotion_object_position_set(w->emotion, w->play.position); w->play.playing = EINA_TRUE; w->play.playing_last = EINA_FALSE; emotion_object_play_set(w->emotion, EINA_TRUE); emotion_object_audio_volume_set(w->emotion, w->play.volume); end: if ((!w->play.playing) && (w->timer.play_eval)) { ecore_timer_del(w->timer.play_eval); w->timer.play_eval = NULL; } else if ((w->play.playing) && (!w->timer.play_eval)) w->timer.play_eval = ecore_timer_loop_add (0.1, _win_play_eval_timer, w); _win_nowplaying_update(w, previous); _win_play_eval(w); _win_toolbar_eval(w); ecore_event_add(ENJOY_EVENT_PLAYER_CAPS_CHANGE, NULL, NULL, NULL); ecore_event_add(ENJOY_EVENT_PLAYER_TRACK_CHANGE, NULL, NULL, NULL); }
//Set the audio level void eclair_audio_level_set(Eclair *eclair, double audio_level) { if (!eclair) return; if (audio_level < 0.0) audio_level = 0.0; else if (audio_level > 1.0) audio_level = 1.0; if (eclair->video.video_object) emotion_object_audio_volume_set(eclair->video.video_object, audio_level); if (eclair->gui_window) edje_object_part_drag_value_set(eclair->gui_window->edje_object, "volume_bar_drag", audio_level, 0); }
static void dvb_obj_stopped_cb(void *data, Evas_Object *obj, void *event_info) { Evas_Object *o; char buf[256]; printf("dvb stopped!\n"); o = emotion_object_add(evas_object_evas_get(obj)); if (!emotion_object_init(o, mdl)) { printf("ERROR!\n"); } evas_object_del(o_dvb); evas_object_smart_callback_add(o, "frame_decode", dvb_obj_frame_decode_cb, NULL); evas_object_smart_callback_add(o, "frame_resize", dvb_obj_frame_resize_cb, NULL); evas_object_smart_callback_add(o, "length_change", dvb_obj_length_change_cb, NULL); evas_object_smart_callback_add(o, "decode_stop", dvb_obj_stopped_cb, NULL); evas_object_smart_callback_add(o, "channels_change", dvb_obj_channels_cb, NULL); evas_object_smart_callback_add(o, "title_change", dvb_obj_title_cb, NULL); evas_object_smart_callback_add(o, "progress_change", dvb_obj_progress_cb, NULL); evas_object_smart_callback_add(o, "ref_change", dvb_obj_ref_cb, NULL); evas_object_smart_callback_add(o, "button_num_change", dvb_obj_button_num_cb, NULL); evas_object_smart_callback_add(o, "button_change", dvb_obj_button_cb, NULL); o_dvb = o; snprintf(buf, sizeof(buf), "dvb://%i", channel); emotion_object_file_set(o_dvb, buf); emotion_object_play_set(o_dvb, 1); emotion_object_audio_mute_set(o_dvb, 0); emotion_object_audio_volume_set(o_dvb, 1.0); layout_swallow(swal, o_dvb_bg); edje_extern_object_aspect_set(o_dvb, EDJE_ASPECT_CONTROL_BOTH, 640, 480); edje_object_part_swallow(o_dvb_bg, "video", o_dvb); dvb_resize(); evas_object_show(o_dvb); // if (!dvb_stopped_job) // dvb_stopped_job = ecore_job_add(dvb_stopped_job_cb, data); }
void dvb_key(Evas_Event_Key_Down *ev) { if (!strcmp(ev->keyname, "bracketleft")) { edje_object_signal_emit(o_dvb_bg, "active", ""); } else if (!strcmp(ev->keyname, "bracketright")) { edje_object_signal_emit(o_dvb_bg, "active", ""); } else if (!strcmp(ev->keyname, "p")) { /* FIXME: play info display end */ jump = 0.0; emotion_object_play_set(o_dvb, 1); edje_object_signal_emit(o_dvb_bg, "active", ""); } else if (!strcmp(ev->keyname, "space")) { /* FIXME: play info display */ jump = 0.0; if (emotion_object_play_get(o_dvb)) emotion_object_play_set(o_dvb, 0); else emotion_object_play_set(o_dvb, 1); edje_object_signal_emit(o_dvb_bg, "active", ""); } else if (!strcmp(ev->keyname, "Up")) { channel++; { char buf[256]; snprintf(buf, sizeof(buf), "dvb://%i", channel); emotion_object_file_set(o_dvb, buf); } } else if (!strcmp(ev->keyname, "Down")) { channel--; if (channel < 0) { channel = 0; } else { char buf[256]; snprintf(buf, sizeof(buf), "dvb://%i", channel); emotion_object_file_set(o_dvb, buf); } } else if (!strcmp(ev->keyname, "Left")) emotion_object_event_simple_send(o_dvb, EMOTION_EVENT_LEFT); else if (!strcmp(ev->keyname, "Right")) emotion_object_event_simple_send(o_dvb, EMOTION_EVENT_RIGHT); else if (!strcmp(ev->keyname, "Return")) emotion_object_event_simple_send(o_dvb, EMOTION_EVENT_SELECT); else if (!strcmp(ev->keyname, "n")) emotion_object_event_simple_send(o_dvb, EMOTION_EVENT_MENU1); else if (!strcmp(ev->keyname, "Prior")) emotion_object_event_simple_send(o_dvb, EMOTION_EVENT_PREV); else if (!strcmp(ev->keyname, "Next")) emotion_object_event_simple_send(o_dvb, EMOTION_EVENT_NEXT); else if (!strcmp(ev->keyname, "0")) emotion_object_event_simple_send(o_dvb, EMOTION_EVENT_0); else if (!strcmp(ev->keyname, "1")) emotion_object_event_simple_send(o_dvb, EMOTION_EVENT_1); else if (!strcmp(ev->keyname, "2")) emotion_object_event_simple_send(o_dvb, EMOTION_EVENT_2); else if (!strcmp(ev->keyname, "3")) emotion_object_event_simple_send(o_dvb, EMOTION_EVENT_3); else if (!strcmp(ev->keyname, "4")) emotion_object_event_simple_send(o_dvb, EMOTION_EVENT_4); else if (!strcmp(ev->keyname, "5")) emotion_object_event_simple_send(o_dvb, EMOTION_EVENT_5); else if (!strcmp(ev->keyname, "6")) emotion_object_event_simple_send(o_dvb, EMOTION_EVENT_6); else if (!strcmp(ev->keyname, "7")) emotion_object_event_simple_send(o_dvb, EMOTION_EVENT_7); else if (!strcmp(ev->keyname, "8")) emotion_object_event_simple_send(o_dvb, EMOTION_EVENT_8); else if (!strcmp(ev->keyname, "9")) emotion_object_event_simple_send(o_dvb, EMOTION_EVENT_9); else if (!strcmp(ev->keyname, "k")) { /* FIXME: volume display */ emotion_object_audio_volume_set(o_dvb, emotion_object_audio_volume_get(o_dvb) - 0.1); } else if (!strcmp(ev->keyname, "l")) { /* FIXME: volume display */ emotion_object_audio_volume_set(o_dvb, emotion_object_audio_volume_get(o_dvb) + 0.1); } else if (!strcmp(ev->keyname, "m")) { /* FIXME: volume display */ if (emotion_object_audio_mute_get(o_dvb)) emotion_object_audio_mute_set(o_dvb, 0); else emotion_object_audio_mute_set(o_dvb, 1); } else if (!strcmp(ev->keyname, "s")) { /* FIXME: save position for this video */ main_mode_pop(); jump = 0.0; dvb_shutdown(); } else if (!strcmp(ev->keyname, "Home")) { /* FIXME: pop up menu for options etc. */ } else if (!strcmp(ev->keyname, "Insert")) { /* FIXME: program ? */ } else if (!strcmp(ev->keyname, "Pause")) { /* FIXME: standby ? */ } else if (!strcmp(ev->keyname, "End")) { /* FIXME: input ? */ } else if (!strcmp(ev->keyname, "BackSpace")) { /* FIXME: catv/clear ? */ } else if (!strcmp(ev->keyname, "t")) { /* FIXME: tool ? */ } else if (!strcmp(ev->keyname, "g")) { /* FIXME: tv guide ? */ } else if (!strcmp(ev->keyname, "period")) { /* FIXME: ch up ? */ } else if (!strcmp(ev->keyname, "comma")) { /* FIXME: ch down ? */ } else if (!strcmp(ev->keyname, "Tab")) { /* FIXME: photo ? */ } else if (!strcmp(ev->keyname, "q")) { /* FIXME: repeat ? */ } else if (!strcmp(ev->keyname, "w")) { /* FIXME: rotate ? (zoom mode) */ } else if (!strcmp(ev->keyname, "n")) { /* FIXME: play info display toggle */ } }