Initial commit 58/34358/1 accepted/tizen/tv/20150126.085113 submit/tizen_tv/20150126.072415
authorMinkyu Kang <mk7.kang@samsung.com>
Fri, 23 Jan 2015 08:03:59 +0000 (17:03 +0900)
committerMinkyu Kang <mk7.kang@samsung.com>
Mon, 26 Jan 2015 06:14:38 +0000 (15:14 +0900)
Change-Id: I372b888bf55bfe6c1cfac682a3d94f189c72585e
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
68 files changed:
CMakeLists.txt [new file with mode: 0644]
include/control.h [new file with mode: 0644]
include/dbg.h [new file with mode: 0644]
include/define.h [new file with mode: 0644]
include/i18n.h [new file with mode: 0644]
include/mediadata.h [new file with mode: 0644]
include/playermgr.h [new file with mode: 0644]
include/slider.h [new file with mode: 0644]
include/timeout_handler.h [new file with mode: 0644]
include/videodata.h [new file with mode: 0644]
include/view_player.h [new file with mode: 0644]
include/volume.h [new file with mode: 0644]
org.tizen.video-player-tv-ref.manifest [new file with mode: 0644]
org.tizen.video-player-tv-ref.png [new file with mode: 0644]
org.tizen.video-player-tv-ref.xml.in [new file with mode: 0644]
packaging/org.tizen.video-player-tv-ref.spec [new file with mode: 0644]
res/edc/CMakeLists.txt [new file with mode: 0644]
res/edc/images/btn_video_ff_foc.png [new file with mode: 0644]
res/edc/images/btn_video_ff_nor.png [new file with mode: 0644]
res/edc/images/btn_video_next_foc.png [new file with mode: 0644]
res/edc/images/btn_video_next_nor.png [new file with mode: 0644]
res/edc/images/btn_video_offrepeat_foc.png [new file with mode: 0644]
res/edc/images/btn_video_offrepeat_nor.png [new file with mode: 0644]
res/edc/images/btn_video_pause_foc.png [new file with mode: 0644]
res/edc/images/btn_video_pause_nor.png [new file with mode: 0644]
res/edc/images/btn_video_play_foc.png [new file with mode: 0644]
res/edc/images/btn_video_play_nor.png [new file with mode: 0644]
res/edc/images/btn_video_prev_foc.png [new file with mode: 0644]
res/edc/images/btn_video_prev_nor.png [new file with mode: 0644]
res/edc/images/btn_video_repeatall_foc.png [new file with mode: 0644]
res/edc/images/btn_video_repeatall_nor.png [new file with mode: 0644]
res/edc/images/btn_video_repeatone_foc.png [new file with mode: 0644]
res/edc/images/btn_video_repeatone_nor.png [new file with mode: 0644]
res/edc/images/btn_video_rew_foc.png [new file with mode: 0644]
res/edc/images/btn_video_rew_nor.png [new file with mode: 0644]
res/edc/images/btn_video_setting_foc.png [new file with mode: 0644]
res/edc/images/btn_video_setting_high.png [new file with mode: 0644]
res/edc/images/btn_video_setting_nor.png [new file with mode: 0644]
res/edc/images/ico_check_foc.png [new file with mode: 0644]
res/edc/images/ico_check_high.png [new file with mode: 0644]
res/edc/images/ico_mute.png [new file with mode: 0644]
res/edc/images/ico_vol.png [new file with mode: 0644]
res/edc/images/progressbar_thumb_foc.png [new file with mode: 0644]
res/edc/images/progressbar_thumb_nor.png [new file with mode: 0644]
res/edc/images/round_rectangle_9X9.png [new file with mode: 0644]
res/edc/images/tooltip_arrow.png [new file with mode: 0644]
res/edc/images/tooltip_center.png [new file with mode: 0644]
res/edc/images/tooltip_left.png [new file with mode: 0644]
res/edc/images/tooltip_right.png [new file with mode: 0644]
res/edc/images/videoplay_progress_foc_bg.png [new file with mode: 0644]
res/edc/video-player-tv-ref-theme.edc [new file with mode: 0644]
res/edc/video-player-tv-ref.edc [new file with mode: 0644]
res/edc/volume.edc [new file with mode: 0644]
res/edc/widgets/button.edc [new file with mode: 0644]
res/edc/widgets/ctxpopup.edc [new file with mode: 0644]
res/edc/widgets/progressbar.edc [new file with mode: 0644]
res/edc/widgets/slider.edc [new file with mode: 0644]
res/edc/widgets/style.edc [new file with mode: 0644]
res/images/menubtn.png [new file with mode: 0644]
src/control.c [new file with mode: 0644]
src/main.c [new file with mode: 0644]
src/mediadata.c [new file with mode: 0644]
src/playermgr.c [new file with mode: 0644]
src/slider.c [new file with mode: 0644]
src/timeout_handler.c [new file with mode: 0644]
src/videodata.c [new file with mode: 0644]
src/view_player.c [new file with mode: 0644]
src/volume.c [new file with mode: 0644]

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644 (file)
index 0000000..13347fa
--- /dev/null
@@ -0,0 +1,108 @@
+# Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT("video-player-tv-ref" C)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(PKGS REQUIRED
+               elementary
+               capi-appfw-application
+               dlog
+               ecore-x
+               efl-extension
+               edje
+               evas
+               utilX
+               x11
+               vconf
+               mm-player
+               capi-media-player
+               capi-media-sound-manager
+               capi-content-media-content)
+
+IF(NOT DEFINED PACKAGE_NAME)
+       SET(PACKAGE_NAME "org.tizen.video-player-tv-ref")
+ENDIF(NOT DEFINED PACKAGE_NAME)
+
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+IF(NOT DEFINED BINDIR)
+       SET(BINDIR "${PREFIX}/bin")
+ENDIF(NOT DEFINED BINDIR)
+IF(NOT DEFINED RESDIR)
+  SET(RESDIR "${PREFIX}/res")
+ENDIF(NOT DEFINED RESDIR)
+IF(NOT DEFINED EDJEDIR)
+       SET(EDJEDIR "${PREFIX}/res/edje")
+ENDIF(NOT DEFINED EDJEDIR)
+IF(NOT DEFINED LOCALEDIR)
+       SET(LOCALEDIR "${PREFIX}/res/locale")
+ENDIF(NOT DEFINED LOCALEDIR)
+IF(NOT DEFINED IMAGEDIR)
+  SET(IMAGEDIR "${PREFIX}/res/images")
+ENDIF(NOT DEFINED IMAGEDIR)
+IF(NOT DEFINED MANIFESTDIR)
+       SET(MANIFESTDIR "/usr/share/packages")
+ENDIF(NOT DEFINED MANIFESTDIR)
+IF(NOT DEFINED DESKTOP_ICONDIR)
+       SET(DESKTOP_ICONDIR "/usr/share/icons/default/small")
+ENDIF(NOT DEFINED DESKTOP_ICONDIR)
+IF(NOT DEFINED DESKTOP_ICON)
+       SET(DESKTOP_ICON ${PACKAGE_NAME}.png)
+ENDIF(NOT DEFINED DESKTOP_ICON)
+
+SET(SRCS
+       src/main.c
+       src/view_player.c
+       src/playermgr.c
+       src/videodata.c
+       src/mediadata.c
+       src/timeout_handler.c
+       src/volume.c
+       src/slider.c
+       src/control.c
+)
+
+SET(TARGET_EDJ "${PROJECT_NAME}.edj")
+SET(THEME_EDJ "${PROJECT_NAME}-theme.edj")
+
+ADD_DEFINITIONS("-DEDJEDIR=\"${EDJEDIR}\"")
+ADD_DEFINITIONS("-DEDJEFILE=\"${EDJEDIR}/${TARGET_EDJ}\"")
+ADD_DEFINITIONS("-DTHEMEFILE=\"${EDJEDIR}/${THEME_EDJ}\"")
+ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE_NAME}\"")
+ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
+ADD_DEFINITIONS("-DDOMAIN_NAME=\"${PROJECT_NAME}\"")
+ADD_DEFINITIONS("-DIMAGEDIR=\"${IMAGEDIR}\"")
+
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
+
+ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
+
+FOREACH(flag ${PKGS_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+#SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${PKGS_LDFLAGS})
+CONFIGURE_FILE(${PACKAGE_NAME}.xml.in ${PACKAGE_NAME}.xml)
+
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
+INSTALL(FILES ${PACKAGE_NAME}.xml DESTINATION ${MANIFESTDIR})
+INSTALL(FILES ${PACKAGE_NAME}.manifest DESTINATION ${MANIFESTDIR})
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/${DESKTOP_ICON} DESTINATION ${DESKTOP_ICONDIR})
+INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/res/images DESTINATION ${RESDIR})
+
+ADD_SUBDIRECTORY(res/edc)
diff --git a/include/control.h b/include/control.h
new file mode 100644 (file)
index 0000000..14f4612
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __CONTROL_H__
+#define __CONTROL_H__
+
+struct control_data;
+
+/**
+ * Init control data
+ *
+ * @return the pointer of allocated control_data struct
+ */
+struct control_data *control_init(void);
+
+/**
+ * Fini control data
+ *
+ * @param data the pointer of control_data struct
+ */
+void control_fini(struct control_data *data);
+
+/**
+ * Add a control buttons
+ *
+ * @param data the pointer of control_data struct
+ * @param base the base object of layout
+ * @param btns name of buttons
+ * @param count the number of buttons
+ * @return if success EINA_TRUE is returned otherwise will return EINA_FALSE
+ */
+Eina_Bool control_add_bar(struct control_data *data,
+               Evas_Object *base, const char **btns, int count);
+
+/**
+ * Show the control
+ *
+ * @return the pointer of allocated control_data struct
+ */
+void control_show(struct control_data *data);
+
+/**
+ * Hide the control
+ *
+ * @return the pointer of allocated control_data struct
+ */
+void control_hide(struct control_data *data);
+
+/**
+ * Init the event handler
+ *
+ * @param data the pointer of control_data struct
+ * @param func callback function
+ * @param param parameter of callback function
+ */
+void control_handler_init(struct control_data *data,
+               void (*func)(void *, const char *), void *param);
+
+/**
+ * Set the focus to button
+ *
+ * @param data the pointer of control_data struct
+ * @param id id of buttons
+ * @param foc EINA_TRUE to set or EINA_FALSE to unset
+ */
+void control_focus_set(struct control_data *data, int id, Eina_Bool foc);
+
+/**
+ * Emit the signal to button
+ *
+ * @param data the pointer of control_data struct
+ * @param id id of buttons
+ * @param emission name of signal
+ * @param source source name of signal
+ */
+void control_signal_emit(struct control_data *data, int id,
+               const char *emission, const char *source);
+
+#endif
diff --git a/include/dbg.h b/include/dbg.h
new file mode 100644 (file)
index 0000000..34796ff
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __DBG_H__
+#define __DBG_H__
+
+#include <dlog.h>
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "org.tizen.video-player"
+
+#ifndef _ERR
+#define _ERR(fmt, args...) LOGE("[%s:%d] "fmt"\n", __func__, __LINE__, ##args)
+#endif
+
+#ifndef _DBG
+#define _DBG(fmt, args...) LOGD("[%s:%d] "fmt"\n", __func__, __LINE__, ##args)
+#endif
+
+#ifndef _INFO
+#define _INFO(fmt, args...) LOGI("[%s:%d] "fmt"\n", __func__, __LINE__, ##args)
+#endif
+
+#endif /* __DBG_H__ */
diff --git a/include/define.h b/include/define.h
new file mode 100644 (file)
index 0000000..96262ff
--- /dev/null
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* Part name definitions */
+#define PART_CONTENTAREA "content.area"
+#define PART_TITLETEXT "title.text"
+#define PART_RESOLUTIONTEXT "resolution.text"
+#define PART_SOURCETEXT "source.text"
+#define PART_DATETEXT "date.text"
+#define PART_SWALLOWAREA "swallow.area"
+#define PART_ELM_SWALLOWICON "elm.swallow.icon"
+#define PART_SLIDER "slider.area"
+#define PART_CURTIME_TEXT "elapsed.time"
+#define PART_COUNTTEXT "count.text"
+#define PART_CURRENTTEXT "current.text"
+#define PART_TOTALTIME_TEXT "total.time"
+#define PART_VOLUME_VALUE "volume.value"
+#define PART_VOLUME_BAR "swallow.volume.bar"
+
+/* Group name definitions */
+#define GRP_VIDEO_PLAYER "video_player"
+#define GRP_VOLUME "volume"
+
+/* Signal definitions */
+#define SIG_SELECTED "selected"
+#define SIG_CLICKED "clicked"
+#define SIG_CHANGED "changed"
+#define SIG_FOCUSED "focused"
+#define SIG_UNFOCUSED "unfocused"
+#define SIG_VOLUME_MUTE "volume,mute"
+#define SIG_VOLUME_UNMUTE "volume,unmute"
+#define SIG_SHOW_VIEW "show,view"
+#define SIG_HIDE_VIEW "hide,view"
+#define SIG_SET_PAUSE "set,pause,icon"
+#define SIG_SET_PLAY "set,play,icon"
+#define SIG_SLIDER_FOCUS "slider,focus,in"
+#define SIG_SLIDER_UNFOCUS "slider,focus,out"
+#define SIG_BTN_ANI_START "mouse,anim,start"
+#define SIG_BTN_ANI_FIN "btn,anim,finish"
+
+/* Style definitions */
+#define STYLE_INVISIBLE "invisible"
+#define STYLE_CTXPOPUP_VIEWER "viewer_popup"
+#define STYLE_BTN_SHORTTEXT "shorttext"
+#define STYLE_TOOLTIP "videobtn_tooltip"
+#define STYLE_CTXPOPUP_VIEWER "viewer_popup"
+#define STYLE_SLIDER "progress_slider"
+#define STYLE_VOLUME_BAR "volume_bar"
+
+/* images */
+#define IMAGE_VIDEO_BTN_REW_NORMAL "btn_video_rew_nor.png"
+#define IMAGE_VIDEO_BTN_REW_FOCUS "btn_video_rew_foc.png"
+#define IMAGE_VIDEO_BTN_FF_NORMAL "btn_video_ff_nor.png"
+#define IMAGE_VIDEO_BTN_FF_FOCUS "btn_video_ff_foc.png"
+#define IMAGE_VIDEO_BTN_PREV_NORMAL "btn_video_prev_nor.png"
+#define IMAGE_VIDEO_BTN_PREV_FOCUS "btn_video_prev_foc.png"
+#define IMAGE_VIDEO_BTN_NEXT_NORMAL "btn_video_next_nor.png"
+#define IMAGE_VIDEO_BTN_NEXT_FOCUS "btn_video_next_foc.png"
+#define IMAGE_VIDEO_BTN_PAUSE_NORMAL "btn_video_pause_nor.png"
+#define IMAGE_VIDEO_BTN_PAUSE_FOCUS "btn_video_pause_foc.png"
+#define IMAGE_VIDEO_BTN_PLAY_NORMAL "btn_video_play_nor.png"
+#define IMAGE_VIDEO_BTN_PLAY_FOCUS "btn_video_play_foc.png"
+#define IMAGE_VIDEO_BTN_SETTING_NORMAL "btn_video_setting_nor.png"
+#define IMAGE_VIDEO_BTN_SETTING_FOCUS "btn_video_setting_foc.png"
+#define IMAGE_VIDEO_BTN_SETTING_HIGHLIGHT "btn_video_setting_high.png"
+#define IMAGE_VIDEO_BTN_REPEATOFF_NORMAL "btn_video_offrepeat_nor.png"
+#define IMAGE_VIDEO_BTN_REPEATOFF_FOCUS "btn_video_offrepeat_foc.png"
+#define IMAGE_VIDEO_BTN_REPEATALL_NORMAL "btn_video_repeatall_nor.png"
+#define IMAGE_VIDEO_BTN_REPEATALL_FOCUS "btn_video_repeatall_foc.png"
+#define IMAGE_VIDEO_BTN_REPEATONE_NORMAL "btn_video_repeatone_nor.png"
+#define IMAGE_VIDEO_BTN_REPEATONE_FOCUS "btn_video_repeatone_foc.png"
+
+#define IMAGE_TOOLTIP_ARROW "tooltip_arrow.png"
+
+#define IMAGE_ICON_CHECK_HIGH "ico_check_high.png"
+#define IMAGE_ICON_CHECK_FOC "ico_check_foc.png"
+
+#define IMAGE_SLIDER_NOB_NORMAL "progressbar_thumb_nor.png"
+#define IMAGE_SLIDER_NOB_FOCUS "progressbar_thumb_foc.png"
+#define IMAGE_VIDEO_PROGRESS_BG "videoplay_progress_foc_bg.png"
+
+/* sizes */
+#define PADDING_BOX 50
+
+#define POSITION_SETTING_POPUP_X 1285
+#define POSITION_SETTING_POPUP_Y 732
+
+#define POSITION_SCREEN_POPUP_X 1285
+#define POSITION_SCREEN_POPUP_Y 732
+
+#define POSITION_SOUND_POPUP_X 1285
+#define POSITION_SOUND_POPUP_Y 650
+
+/* others */
+#define TIMEOUT_TOOLTIP 2.0
+#define TIMEOUT_VIDEOPLAYER 5.0
diff --git a/include/i18n.h b/include/i18n.h
new file mode 100644 (file)
index 0000000..86e15ae
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __I18N_H__
+#define __I18N_H__
+
+#include <libintl.h>
+
+#define i18n_init() bindtextdomain(DOMAIN_NAME, LOCALEDIR)
+
+#ifdef _
+#undef _
+#endif
+
+#define _(s) dgettext(DOMAIN_NAME, s)
+#define dgettext_noop(s) (s)
+
+#ifdef N_
+#undef N_
+#endif
+
+#define N_(s) dgettext_noop(s)
+
+#endif /* __I18N_H__ */
diff --git a/include/mediadata.h b/include/mediadata.h
new file mode 100644 (file)
index 0000000..d5b98f1
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#ifndef __MEDIADATA_H__
+#define __MEDIADATA_H__
+
+#include <media_content.h>
+#include "videodata.h"
+
+struct mediadata;
+
+int mediadata_init();
+int mediadata_fini();
+
+struct mediadata *mediadata_create(const char *path);
+void mediadata_destroy(struct mediadata *md);
+
+const char *mediadata_get_displayname(struct mediadata *md);
+const char *mediadata_get_filepath(struct mediadata *md);
+time_t mediadata_get_modifiedtime(struct mediadata *md);
+
+const struct videodata *mediadata_get_video_info(struct mediadata *md);
+
+#endif
diff --git a/include/playermgr.h b/include/playermgr.h
new file mode 100644 (file)
index 0000000..d5bf35f
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#ifndef __PLAYERMGR_H__
+#define __PLAYERMGR_H__
+
+#include <player.h>
+
+enum display_mode {
+       E_FULL_SCREEN = 0,
+       E_ORIGINAL
+};
+
+struct playermgr;
+
+struct playermgr *playermgr_init(Evas_Object *win,
+               const char *path, const char *playlist);
+
+int playermgr_play_video(struct playermgr *mgr);
+
+int playermgr_stop_video(struct playermgr *mgr);
+
+void playermgr_fini(struct playermgr *mgr);
+
+int playermgr_pause(struct playermgr *mgr);
+
+int playermgr_resume(struct playermgr *mgr);
+
+void playermgr_set_prev_video(struct playermgr *mgr);
+
+Eina_Bool playermgr_set_next_video(struct playermgr *mgr, Eina_Bool repeat);
+
+const char *playermgr_get_video_path(struct playermgr *mgr);
+
+int playermgr_get_state(struct playermgr *mgr, player_state_e *state);
+
+int playermgr_get_position(struct playermgr *mgr, int *position);
+
+int playermgr_set_position(struct playermgr *mgr,
+               int sec, player_seek_completed_cb cb, void *data);
+
+int playermgr_seek(struct playermgr *mgr,
+               int sec, player_seek_completed_cb cb, void *data);
+
+int playermgr_set_playback_rate(struct playermgr *mgr, float speed);
+
+int playermgr_get_playback_rate(struct playermgr *mgr, float *speed);
+
+int playermgr_set_looping(struct playermgr *mgr, bool value);
+
+int playermgr_set_audio_effect(struct playermgr *mgr, int value);
+
+int playermgr_set_display_mode(struct playermgr *mgr, int value);
+
+int playermgr_set_completed_cb(struct playermgr *mgr,
+               player_completed_cb cb, void *data);
+
+void playermgr_get_play_count(struct playermgr *mgr, char *str, int len);
+
+#endif
diff --git a/include/slider.h b/include/slider.h
new file mode 100644 (file)
index 0000000..c07bd83
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __SLIDER_H__
+#define __SLIDER_H__
+
+struct slider_data;
+
+/**
+ * Init slider data
+ *
+ * @return the pointer of allocated slider_data struct
+ */
+struct slider_data *slider_init(void);
+
+/**
+ * Fini slider data
+ *
+ * @param data the pointer of slider_data struct
+ */
+void slider_fini(struct slider_data *data);
+
+/**
+ * Add a slider bar
+ *
+ * @param data the pointer of slider_data struct
+ * @param base the base object of slider layout
+ * @param player the pointer of playermgr struct
+ * @return if success EINA_TRUE is returned otherwise will return EINA_FALSE
+ */
+Eina_Bool slider_add_bar(struct slider_data *data, Evas_Object *base,
+               struct playermgr *player);
+
+/**
+ * Reset the slider data
+ *
+ * @param data the pointer of slider_data struct
+ * @param duration duration time of video file
+ */
+void slider_reset(struct slider_data *data, int duration);
+
+/**
+ * Resume the slider timer
+ *
+ * @param data the pointer of slider_data struct
+ */
+void slider_resume(struct slider_data *data);
+
+/**
+ * Pause the slider timer
+ *
+ * @param data the pointer of slider_data struct
+ */
+void slider_pause(struct slider_data *data);
+
+#endif
diff --git a/include/timeout_handler.h b/include/timeout_handler.h
new file mode 100644 (file)
index 0000000..aa80dfb
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#ifndef __TIMEOUT_HANDLER_H__
+#define __TIMEOUT_HANDLER_H__
+
+struct timeout_handler;
+
+typedef void (*timeout_event_cb)(void *data, int type, void *ev);
+
+struct timeout_handler *timeout_handler_init(double timeout,
+               timeout_event_cb timeout_cb, void *timeout_data,
+               timeout_event_cb event_cb, void *event_data);
+
+void timeout_handler_fini(struct timeout_handler *handle);
+
+void timeout_handler_reset(struct timeout_handler *handle);
+
+#endif
diff --git a/include/videodata.h b/include/videodata.h
new file mode 100644 (file)
index 0000000..555fc29
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#ifndef __VIDEODATA_H__
+#define __VIDEODATA_H__
+
+#include <media_content.h>
+
+struct videodata;
+
+struct videodata *videodata_create(media_info_h media_h);
+
+void videodata_destroy(struct videodata *video_info);
+
+int videodata_get_duration(const struct videodata *video_info);
+int videodata_get_played_position(const struct videodata *video_info);
+
+int videodata_get_width(const struct videodata *video_info);
+int videodata_get_height(const struct videodata *video_info);
+
+#endif
diff --git a/include/view_player.h b/include/view_player.h
new file mode 100644 (file)
index 0000000..b837456
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#ifndef __VIEW_PLAYER_H__
+#define __VIEW_PLAYER_H__
+
+struct viewdata;
+
+struct viewdata *view_player_init(Evas_Object *win,
+               char *path, char *playlist);
+
+void view_player_fini(struct viewdata *mgr);
+
+int view_player_create(struct viewdata *mgr);
+
+int view_player_pause(struct viewdata *mgr);
+
+int view_player_resume(struct viewdata *mgr);
+
+#endif
diff --git a/include/volume.h b/include/volume.h
new file mode 100644 (file)
index 0000000..e89af5c
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#ifndef __VOLUME_H__
+#define __VOLUME_H__
+
+enum volume_val {
+       E_VOLUME_DOWN = -1,
+       E_VOLUME_MUTE = 0,
+       E_VOLUME_UP = 1
+};
+
+struct volume_data;
+
+/**
+ * Init volume data
+ *
+ * @return the pointer of allocated volume_data struct
+ */
+struct volume_data *volume_init(void);
+
+/**
+ * Fini volume data
+ *
+ * @param data the pointer of volume_data struct
+ */
+void volume_fini(struct volume_data *data);
+
+/**
+ * Add a volume bar
+ *
+ * @param data the pointer of volume_data struct
+ * @param base the base object of volume layout
+ * @return if success EINA_TRUE is returned otherwise will return EINA_FALSE
+ */
+Eina_Bool volume_add_bar(struct volume_data *data, Evas_Object *base);
+
+/*
+ * hide the volume bar
+ *
+ * @param data the pointer of volume_data struct
+ */
+void volume_hide_bar(struct volume_data *data);
+
+/*
+ * Handle the volume key
+ *
+ * @param data the pointer of volume_data struct
+ * @param val value of volme key
+ */
+void volume_handle_key(struct volume_data *data, enum volume_val val);
+
+#endif
diff --git a/org.tizen.video-player-tv-ref.manifest b/org.tizen.video-player-tv-ref.manifest
new file mode 100644 (file)
index 0000000..f7f6493
--- /dev/null
@@ -0,0 +1,10 @@
+<manifest>
+    <define>
+        <domain name="org.tizen.video-player-tv-ref"/>
+               <request>
+               </request>
+    </define>
+    <request>
+        <domain name="org.tizen.video-player-tv-ref"/>
+    </request>
+</manifest>
diff --git a/org.tizen.video-player-tv-ref.png b/org.tizen.video-player-tv-ref.png
new file mode 100644 (file)
index 0000000..affa436
Binary files /dev/null and b/org.tizen.video-player-tv-ref.png differ
diff --git a/org.tizen.video-player-tv-ref.xml.in b/org.tizen.video-player-tv-ref.xml.in
new file mode 100644 (file)
index 0000000..b865e7f
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" package="@PACKAGE_NAME@" version="@VERSION@" install-location="internal-only">
+       <label>video-player</label>
+       <author email="mk7.kang@samsung.com" href="www.samsung.com">Minkyu Kang</author>
+       <description>video player app for playing videos</description>
+       <ui-application appid="@PACKAGE_NAME@" exec="@BINDIR@/@PROJECT_NAME@" nodisplay="true" multiple="false" type="capp" taskmanage="true">
+               <label>Video Player</label>
+               <icon>@DESKTOP_ICON@</icon>
+       </ui-application>
+</manifest>
diff --git a/packaging/org.tizen.video-player-tv-ref.spec b/packaging/org.tizen.video-player-tv-ref.spec
new file mode 100644 (file)
index 0000000..1e472ac
--- /dev/null
@@ -0,0 +1,68 @@
+Name:      org.tizen.video-player-tv-ref
+Summary:   Video Player Application
+Version:   0.2
+Release:   1
+Group:     Applications/Core Applications
+License:   Apache-2.0
+Source0:   %{name}-%{version}.tar.gz
+
+BuildRequires: cmake
+BuildRequires: pkgconfig(capi-appfw-application)
+BuildRequires: pkgconfig(elementary)
+BuildRequires: pkgconfig(ecore-x)
+BuildRequires: pkgconfig(efl-extension)
+BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(edje)
+BuildRequires: pkgconfig(utilX)
+BuildRequires: pkgconfig(capi-media-player)
+BuildRequires: pkgconfig(capi-media-sound-manager)
+BuildRequires: pkgconfig(capi-content-media-content)
+BuildRequires: pkgconfig(mm-player)
+BuildRequires: pkgconfig(utilX)
+BuildRequires: pkgconfig(x11)
+BuildRequires: pkgconfig(vconf)
+BuildRequires: gettext-devel
+BuildRequires: edje-bin
+
+%define _pkgdir /usr/apps/%{name}
+%define _bindir %{_pkgdir}/bin
+%define _resdir %{_pkgdir}/res
+%define _datadir %{_pkgdir}/data
+%define _localedir %{_resdir}/locale
+%define _manifestdir /usr/share/packages
+%define _desktop_icondir /usr/share/icons/default/small
+
+%description
+Video Player Reference Application
+
+%prep
+%setup -q
+
+%build
+cmake \
+       -DCMAKE_INSTALL_PREFIX=%{_pkgdir} \
+       -DPACKAGE_NAME=%{name} \
+       -DBINDIR=%{_bindir} \
+       -DLOCALEDIR=%{_localedir} \
+       -DMANIFESTDIR=%{_manifestdir} \
+       -DDESKTOP_ICONDIR=%{_desktop_icondir} \
+       -DDESKTOP_ICON=%{name}.png \
+       -DVERSION=%{version}
+
+make %{?jobs:-j%jobs}
+
+%install
+%make_install
+install --directory %{buildroot}/%{_datadir}
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(-,root,root,-)
+%manifest %{_manifestdir}/%{name}.manifest
+%{_bindir}/*
+%{_resdir}/*
+%{_datadir}
+%{_manifestdir}/%{name}.xml
+%{_desktop_icondir}/%{name}.png
diff --git a/res/edc/CMakeLists.txt b/res/edc/CMakeLists.txt
new file mode 100644 (file)
index 0000000..0cd5335
--- /dev/null
@@ -0,0 +1,17 @@
+ADD_CUSTOM_TARGET(${TARGET_EDJ}
+               COMMAND edje_cc -id images
+               ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.edc
+               ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_EDJ}
+               DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.edc
+)
+ADD_DEPENDENCIES(${PROJECT_NAME} ${TARGET_EDJ})
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_EDJ} DESTINATION ${EDJEDIR})
+
+ADD_CUSTOM_TARGET(${THEME_EDJ}
+               COMMAND edje_cc -id images
+               ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}-theme.edc
+               ${CMAKE_CURRENT_BINARY_DIR}/${THEME_EDJ}
+               DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}-theme.edc
+)
+ADD_DEPENDENCIES(${PROJECT_NAME} ${THEME_EDJ})
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${THEME_EDJ} DESTINATION ${EDJEDIR})
diff --git a/res/edc/images/btn_video_ff_foc.png b/res/edc/images/btn_video_ff_foc.png
new file mode 100644 (file)
index 0000000..58c9459
Binary files /dev/null and b/res/edc/images/btn_video_ff_foc.png differ
diff --git a/res/edc/images/btn_video_ff_nor.png b/res/edc/images/btn_video_ff_nor.png
new file mode 100644 (file)
index 0000000..d2aefb0
Binary files /dev/null and b/res/edc/images/btn_video_ff_nor.png differ
diff --git a/res/edc/images/btn_video_next_foc.png b/res/edc/images/btn_video_next_foc.png
new file mode 100644 (file)
index 0000000..439475e
Binary files /dev/null and b/res/edc/images/btn_video_next_foc.png differ
diff --git a/res/edc/images/btn_video_next_nor.png b/res/edc/images/btn_video_next_nor.png
new file mode 100644 (file)
index 0000000..54f7dbb
Binary files /dev/null and b/res/edc/images/btn_video_next_nor.png differ
diff --git a/res/edc/images/btn_video_offrepeat_foc.png b/res/edc/images/btn_video_offrepeat_foc.png
new file mode 100644 (file)
index 0000000..c42caab
Binary files /dev/null and b/res/edc/images/btn_video_offrepeat_foc.png differ
diff --git a/res/edc/images/btn_video_offrepeat_nor.png b/res/edc/images/btn_video_offrepeat_nor.png
new file mode 100644 (file)
index 0000000..a344079
Binary files /dev/null and b/res/edc/images/btn_video_offrepeat_nor.png differ
diff --git a/res/edc/images/btn_video_pause_foc.png b/res/edc/images/btn_video_pause_foc.png
new file mode 100644 (file)
index 0000000..acbc919
Binary files /dev/null and b/res/edc/images/btn_video_pause_foc.png differ
diff --git a/res/edc/images/btn_video_pause_nor.png b/res/edc/images/btn_video_pause_nor.png
new file mode 100644 (file)
index 0000000..6e5b9ac
Binary files /dev/null and b/res/edc/images/btn_video_pause_nor.png differ
diff --git a/res/edc/images/btn_video_play_foc.png b/res/edc/images/btn_video_play_foc.png
new file mode 100644 (file)
index 0000000..b9f8f90
Binary files /dev/null and b/res/edc/images/btn_video_play_foc.png differ
diff --git a/res/edc/images/btn_video_play_nor.png b/res/edc/images/btn_video_play_nor.png
new file mode 100644 (file)
index 0000000..d5a4ab1
Binary files /dev/null and b/res/edc/images/btn_video_play_nor.png differ
diff --git a/res/edc/images/btn_video_prev_foc.png b/res/edc/images/btn_video_prev_foc.png
new file mode 100644 (file)
index 0000000..23264bd
Binary files /dev/null and b/res/edc/images/btn_video_prev_foc.png differ
diff --git a/res/edc/images/btn_video_prev_nor.png b/res/edc/images/btn_video_prev_nor.png
new file mode 100644 (file)
index 0000000..dc94857
Binary files /dev/null and b/res/edc/images/btn_video_prev_nor.png differ
diff --git a/res/edc/images/btn_video_repeatall_foc.png b/res/edc/images/btn_video_repeatall_foc.png
new file mode 100644 (file)
index 0000000..a9cff55
Binary files /dev/null and b/res/edc/images/btn_video_repeatall_foc.png differ
diff --git a/res/edc/images/btn_video_repeatall_nor.png b/res/edc/images/btn_video_repeatall_nor.png
new file mode 100644 (file)
index 0000000..7f82251
Binary files /dev/null and b/res/edc/images/btn_video_repeatall_nor.png differ
diff --git a/res/edc/images/btn_video_repeatone_foc.png b/res/edc/images/btn_video_repeatone_foc.png
new file mode 100644 (file)
index 0000000..db82f01
Binary files /dev/null and b/res/edc/images/btn_video_repeatone_foc.png differ
diff --git a/res/edc/images/btn_video_repeatone_nor.png b/res/edc/images/btn_video_repeatone_nor.png
new file mode 100644 (file)
index 0000000..d64fa1f
Binary files /dev/null and b/res/edc/images/btn_video_repeatone_nor.png differ
diff --git a/res/edc/images/btn_video_rew_foc.png b/res/edc/images/btn_video_rew_foc.png
new file mode 100644 (file)
index 0000000..3e810f2
Binary files /dev/null and b/res/edc/images/btn_video_rew_foc.png differ
diff --git a/res/edc/images/btn_video_rew_nor.png b/res/edc/images/btn_video_rew_nor.png
new file mode 100644 (file)
index 0000000..228fb83
Binary files /dev/null and b/res/edc/images/btn_video_rew_nor.png differ
diff --git a/res/edc/images/btn_video_setting_foc.png b/res/edc/images/btn_video_setting_foc.png
new file mode 100644 (file)
index 0000000..3cca0b6
Binary files /dev/null and b/res/edc/images/btn_video_setting_foc.png differ
diff --git a/res/edc/images/btn_video_setting_high.png b/res/edc/images/btn_video_setting_high.png
new file mode 100644 (file)
index 0000000..9c800ae
Binary files /dev/null and b/res/edc/images/btn_video_setting_high.png differ
diff --git a/res/edc/images/btn_video_setting_nor.png b/res/edc/images/btn_video_setting_nor.png
new file mode 100644 (file)
index 0000000..db518fb
Binary files /dev/null and b/res/edc/images/btn_video_setting_nor.png differ
diff --git a/res/edc/images/ico_check_foc.png b/res/edc/images/ico_check_foc.png
new file mode 100644 (file)
index 0000000..3deec02
Binary files /dev/null and b/res/edc/images/ico_check_foc.png differ
diff --git a/res/edc/images/ico_check_high.png b/res/edc/images/ico_check_high.png
new file mode 100644 (file)
index 0000000..3a16a9f
Binary files /dev/null and b/res/edc/images/ico_check_high.png differ
diff --git a/res/edc/images/ico_mute.png b/res/edc/images/ico_mute.png
new file mode 100644 (file)
index 0000000..df63c4c
Binary files /dev/null and b/res/edc/images/ico_mute.png differ
diff --git a/res/edc/images/ico_vol.png b/res/edc/images/ico_vol.png
new file mode 100644 (file)
index 0000000..c77faf1
Binary files /dev/null and b/res/edc/images/ico_vol.png differ
diff --git a/res/edc/images/progressbar_thumb_foc.png b/res/edc/images/progressbar_thumb_foc.png
new file mode 100644 (file)
index 0000000..1c5d31f
Binary files /dev/null and b/res/edc/images/progressbar_thumb_foc.png differ
diff --git a/res/edc/images/progressbar_thumb_nor.png b/res/edc/images/progressbar_thumb_nor.png
new file mode 100644 (file)
index 0000000..a0b0d9c
Binary files /dev/null and b/res/edc/images/progressbar_thumb_nor.png differ
diff --git a/res/edc/images/round_rectangle_9X9.png b/res/edc/images/round_rectangle_9X9.png
new file mode 100644 (file)
index 0000000..c25f58f
Binary files /dev/null and b/res/edc/images/round_rectangle_9X9.png differ
diff --git a/res/edc/images/tooltip_arrow.png b/res/edc/images/tooltip_arrow.png
new file mode 100644 (file)
index 0000000..9bb8e3d
Binary files /dev/null and b/res/edc/images/tooltip_arrow.png differ
diff --git a/res/edc/images/tooltip_center.png b/res/edc/images/tooltip_center.png
new file mode 100644 (file)
index 0000000..d2b7b7a
Binary files /dev/null and b/res/edc/images/tooltip_center.png differ
diff --git a/res/edc/images/tooltip_left.png b/res/edc/images/tooltip_left.png
new file mode 100644 (file)
index 0000000..63852e3
Binary files /dev/null and b/res/edc/images/tooltip_left.png differ
diff --git a/res/edc/images/tooltip_right.png b/res/edc/images/tooltip_right.png
new file mode 100644 (file)
index 0000000..f66fa15
Binary files /dev/null and b/res/edc/images/tooltip_right.png differ
diff --git a/res/edc/images/videoplay_progress_foc_bg.png b/res/edc/images/videoplay_progress_foc_bg.png
new file mode 100644 (file)
index 0000000..a03e7dc
Binary files /dev/null and b/res/edc/images/videoplay_progress_foc_bg.png differ
diff --git a/res/edc/video-player-tv-ref-theme.edc b/res/edc/video-player-tv-ref-theme.edc
new file mode 100644 (file)
index 0000000..e3900de
--- /dev/null
@@ -0,0 +1,9 @@
+#include "../../include/define.h"
+
+collections {
+       #include "widgets/style.edc"
+       #include "widgets/button.edc"
+       #include "widgets/ctxpopup.edc"
+       #include "widgets/slider.edc"
+       #include "widgets/progressbar.edc"
+}
diff --git a/res/edc/video-player-tv-ref.edc b/res/edc/video-player-tv-ref.edc
new file mode 100644 (file)
index 0000000..be5c5ec
--- /dev/null
@@ -0,0 +1,669 @@
+#include "../../include/define.h"
+
+collections {
+       #include "widgets/style.edc"
+       #include "volume.edc"
+       images {
+               image: IMAGE_VIDEO_PROGRESS_BG COMP;
+       }
+       group {
+               name: GRP_VIDEO_PLAYER;
+               parts {
+                       part {
+                               name: "bgarea";
+                               type: RECT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 1920 1080;
+                                       rel2.relative: 0.0 0.0;
+                                       align: 0.0 0.0;
+                                       fixed: 1 1;
+                                       color: 0 0 0 0;
+                               }
+                       }
+                       part {
+                               name: "toparea";
+                               type: RECT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 0 150;
+                                       rel1 {
+                                               to: "bgarea";
+                                       }
+                                       rel2 {
+                                               to: "bgarea";
+                                               relative: 1.0 0.0;
+                                       }
+                                       align: 0.5 1.0;
+                                       fixed: 0 1;
+                               }
+                               description {
+                                       state: "show" 0.0;
+                                       inherit: "default" 0.0;
+                                       align: 0.5 0.0;
+                               }
+                       }
+                       part {
+                               name: "toparea_bg";
+                               type: RECT;
+                               scale: 1;
+                               clip_to: "toparea";
+                               description {
+                                       state: "default" 0.0;
+                                       color: 18 22 34 204;
+                                       rel1 {
+                                               to: "toparea";
+                                       }
+                                       rel2 {
+                                               to: "toparea";
+                                       }
+                               }
+                       }
+                       part {
+                               name: "padding_title";
+                               type: RECT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 71 31;
+                                       rel1 {
+                                               to: "toparea";
+                                       }
+                                       rel2 {
+                                               to: "toparea";
+                                               relative: 0.0 0.0;
+                                       }
+                                       fixed: 1 1;
+                                       visible: 0;
+                                       align: 0.0 0.0;
+                               }
+                       }
+                       part {
+                               name: PART_TITLETEXT;
+                               type: TEXT;
+                               clip_to: "toparea";
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 807 52;
+                                       rel1 {
+                                               to: "padding_title";
+                                               relative: 1.0 1.0;
+                                       }
+                                       rel2 {
+                                               to: "padding_title";
+                                       }
+                                       text {
+                                               font: FONT_STYLE_SANS_MEDIUM;
+                                               size: 40;
+                                               align: 0.0 0.5;
+                                       }
+                                       color: 255 255 255 255;
+                                       fixed: 1 1;
+                                       align: 0.0 0.0;
+                               }
+                       }
+                       part {
+                               name: PART_RESOLUTIONTEXT;
+                               type: TEXT;
+                               clip_to: "toparea";
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 0 32;
+                                       rel1 {
+                                               to: PART_TITLETEXT;
+                                               relative: 0.0 1.0;
+                                       }
+                                       rel2 {
+                                               to: PART_TITLETEXT;
+                                               relative: 0.0 1.0;
+                                       }
+                                       text {
+                                               font: FONT_STYLE_SANS_REGULAR;
+                                               size: 26;
+                                               min: 1 0;
+                                               ellipsis: -1;
+                                       }
+                                       color: 188 188 188 255;
+                                       fixed: 1 1;
+                                       align: 0.0 0.0;
+                               }
+                       }
+                       part {
+                               name: "separator_area1";
+                               type: SPACER;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 38 32;
+                                       rel1 {
+                                               to: PART_RESOLUTIONTEXT;
+                                               relative: 1.0 0.0;
+                                       }
+                                       rel2 {
+                                               to: PART_RESOLUTIONTEXT;
+                                               relative: 1.0 0.0;
+                                       }
+                                       fixed: 1 1;
+                                       align: 0.0 0.0;
+                               }
+                       }
+                       part {
+                               name: "separator1";
+                               type: RECT;
+                               scale: 1;
+                               clip_to: "toparea";
+                               description {
+                                       state: "default" 0.0;
+                                       min: 2 20;
+                                       max: 2 20;
+                                       rel1 {
+                                               to: "separator_area1";
+                                       }
+                                       rel2 {
+                                               to: "separator_area1";
+                                       }
+                               }
+                       }
+                       part {
+                               name: PART_SOURCETEXT;
+                               type: TEXT;
+                               scale: 1;
+                               clip_to: "toparea";
+                               description {
+                                       state: "default" 0.0;
+                                       min: 0 32;
+                                       rel1 {
+                                               to: "separator_area1";
+                                               relative: 1.0 0.0;
+                                       }
+                                       rel2 {
+                                               to: "separator_area1";
+                                               relative: 1.0 0.0;
+                                       }
+                                       text {
+                                               font: FONT_STYLE_SANS_REGULAR;
+                                               size: 26;
+                                               min: 1 0;
+                                               ellipsis: -1;
+                                       }
+                                       color: 188 188 188 255;
+                                       fixed: 1 1;
+                                       align: 0.0 0.0;
+                               }
+                       }
+                       part {
+                               name: "separator_area2";
+                               type: SPACER;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 38 32;
+                                       rel1 {
+                                               to: PART_SOURCETEXT;
+                                               relative: 1.0 0.0;
+                                       }
+                                       rel2 {
+                                               to: PART_SOURCETEXT;
+                                               relative: 1.0 0.0;
+                                       }
+                                       fixed: 1 1;
+                                       align: 0.0 0.0;
+                               }
+                       }
+                       part {
+                               name: "separator2";
+                               type: RECT;
+                               scale: 1;
+                               clip_to: "toparea";
+                               description {
+                                       state: "default" 0.0;
+                                       min: 2 20;
+                                       max: 2 20;
+                                       rel1 {
+                                               to: "separator_area2";
+                                       }
+                                       rel2 {
+                                               to: "separator_area2";
+                                       }
+                               }
+                       }
+                       part {
+                               name: PART_DATETEXT;
+                               type: TEXT;
+                               scale: 1;
+                               clip_to: "toparea";
+                               description {
+                                       state: "default" 0.0;
+                                       min: 0 32;
+                                       rel1 {
+                                               to: "separator_area2";
+                                               relative: 1.0 0.0;
+                                       }
+                                       rel2 {
+                                               to: "separator_area2";
+                                               relative: 1.0 0.0;
+                                       }
+                                       text {
+                                               font: FONT_STYLE_SANS_REGULAR;
+                                               size: 26;
+                                               min: 1 0;
+                                               ellipsis: -1;
+                                       }
+                                       color: 188 188 188 255;
+                                       fixed: 1 1;
+                                       align: 0.0 0.0;
+                               }
+                       }
+                       part {
+                               name: "padding_counttext";
+                               type: RECT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 71 31;
+                                       rel1 {
+                                               to: "toparea";
+                                               relative: 1.0 0.0;
+                                       }
+                                       rel2 {
+                                               to: "toparea";
+                                               relative: 1.0 0.0;
+                                       }
+                                       fixed: 1 1;
+                                       visible: 0;
+                                       align: 1.0 0.0;
+                               }
+                       }
+                       part {
+                               name: PART_COUNTTEXT;
+                               type: TEXT;
+                               clip_to: "toparea";
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 0 50;
+                                       rel1 {
+                                               to: "padding_counttext";
+                                               relative: 0.0 1.0;
+                                       }
+                                       rel2 {
+                                               to: "padding_counttext";
+                                               relative: 0.0 1.0;
+                                       }
+                                       text {
+                                               font: FONT_STYLE_SANS_REGULAR;
+                                               size: 40;
+                                               align: 1.0 0.5;
+                                               min: 1 0;
+                                               ellipsis: -1;
+                                       }
+                                       color: 169 169 169 255;
+                                       fixed: 1 1;
+                                       align: 1.0 0.0;
+                               }
+                       }
+                       part {
+                               name: PART_CURRENTTEXT;
+                               type: TEXT;
+                               scale: 1;
+                               clip_to: "toparea";
+                               description {
+                                       state: "default" 0.0;
+                                       min: 0 50;
+                                       rel1 {
+                                               to: PART_COUNTTEXT;
+                                       }
+                                       rel2 {
+                                               to: PART_COUNTTEXT;
+                                               relative: 0.0 0.0;
+                                       }
+                                       text {
+                                               font: FONT_STYLE_SANS_MEDIUM;
+                                               size: 40;
+                                               align: 1.0 0.5;
+                                               min: 1 0;
+                                               ellipsis: -1;
+                                       }
+                                       color: 255 255 255 255;
+                                       fixed: 1 1;
+                                       align: 1.0 0.0;
+                               }
+                       }
+       /* bottom area drawing */
+                       part {
+                               name: "bottomarea";
+                               type: RECT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 0 274;
+                                       rel1 {
+                                               to: "bgarea";
+                                               relative: 0.0 1.0;
+                                       }
+                                       rel2 {
+                                               to: "bgarea";
+                                       }
+                                       align: 0.5 0.0;
+                                       fixed: 0 1;
+                               }
+                               description {
+                                       state: "show" 0.0;
+                                       inherit: "default" 0.0;
+                                       align: 0.5 1.0;
+                               }
+                       }
+                       part {
+                               name: "bg_bottom";
+                               type: RECT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 0 214;
+                                       rel1 {
+                                               to: "bottomarea";
+                                               relative: 0.0 1.0;
+                                       }
+                                       rel2 {
+                                               to: "bottomarea";
+                                       }
+                                       align: 0.5 1.0;
+                                       fixed: 0 1;
+                                       visible: 0;
+                               }
+                       }
+                       part {
+                               name: "slider_focus_bg";
+                               scale: 1;
+                               clip_to: "bottomarea";
+                               description {
+                                       state: "default" 0.0;
+                                       min: 0 60;
+                                       rel1 {
+                                               to: "bg_bottom";
+                                       }
+                                       rel2 {
+                                               to: "bg_bottom";
+                                               relative: 1.0 0.0;
+                                       }
+                                       image.normal: IMAGE_VIDEO_PROGRESS_BG;
+                                       fixed: 0 1;
+                                       align: 0.5 1.0;
+                                       visible: 0;
+                               }
+                               description {
+                                       state: "visible" 0.0;
+                                       inherit: "default" 0.0;
+                                       visible: 1;
+                               }
+                       }
+                       part {
+                               name: "bottomarea_bg";
+                               type: RECT;
+                               scale: 1;
+                               clip_to: "bottomarea";
+                               description {
+                                       state: "default" 0.0;
+                                       color: 18 22 34 204;
+                                       rel1.to: "bg_bottom";
+                                       rel2.to: "bg_bottom";
+                               }
+                       }
+                       part {
+                               name: "padding_slider";
+                               type: RECT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 0 26;
+                                       rel1 {
+                                               to: "bg_bottom";
+                                       }
+                                       rel2 {
+                                               to: "bg_bottom";
+                                               relative: 1.0 0.0;
+                                       }
+                                       fixed: 1 1;
+                                       visible: 0;
+                                       align: 0.5 1.0;
+                               }
+                       }
+                       part {
+                               name: PART_SLIDER;
+                               type: SWALLOW;
+                               scale: 1;
+                               clip_to: "bottomarea";
+                               description {
+                                       state: "default" 0.0;
+                                       min: 0 60;
+                                       rel1 {
+                                               to: "padding_slider";
+                                       }
+                                       rel2 {
+                                               to: "padding_slider";
+                                               relative: 1.0 0.0;
+                                       }
+                                       fixed: 0 1;
+                                       align: 0.5 0.0;
+                               }
+                       }
+                       part {
+                               name: "padding_elapsedtime";
+                               type: RECT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 71 6;
+                                       rel1 {
+                                               to: PART_SLIDER;
+                                               relative: 0.0 1.0;
+                                       }
+                                       rel2 {
+                                               to: PART_SLIDER;
+                                               relative: 0.0 1.0;
+                                       }
+                                       fixed: 1 1;
+                                       visible: 0;
+                                       align: 0.0 0.0;
+                               }
+                       }
+                       part {
+                               name: PART_CURTIME_TEXT;
+                               type: TEXT;
+                               scale: 1;
+                               clip_to: "bottomarea";
+                               description {
+                                       state: "default" 0.0;
+                                       min: 167 40;
+                                       rel1 {
+                                               to: "padding_elapsedtime";
+                                               relative: 1.0 1.0;
+                                       }
+                                       rel2 {
+                                               to: "padding_elapsedtime";
+                                       }
+                                       text {
+                                               font: FONT_STYLE_SANS_REGULAR;
+                                               size: 26;
+                                               align: 0.0 0.5;
+                                       }
+                                       color: 188 188 188 255;
+                                       fixed: 1 1;
+                                       align: 0.0 0.0;
+                               }
+                       }
+                       part {
+                               name: "padding_totaltime";
+                               type: RECT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 71 6;
+                                       rel1 {
+                                               to: PART_SLIDER;
+                                               relative: 1.0 1.0;
+                                       }
+                                       rel2 {
+                                               to: PART_SLIDER;
+                                       }
+                                       fixed: 1 1;
+                                       visible: 0;
+                                       align: 1.0 0.0;
+                               }
+                       }
+                       part {
+                               name: PART_TOTALTIME_TEXT;
+                               type: TEXT;
+                               scale: 1;
+                               clip_to: "bottomarea";
+                               description {
+                                       state: "default" 0.0;
+                                       min: 167 40;
+                                       rel1 {
+                                               to: "padding_totaltime";
+                                               relative: 0.0 1.0;
+                                       }
+                                       rel2 {
+                                               to: "padding_totaltime";
+                                               relative: 0.0 1.0;
+                                       }
+                                       text {
+                                               font: FONT_STYLE_SANS_REGULAR;
+                                               size: 26;
+                                               align: 1.0 0.5;
+                                       }
+                                       color: 188 188 188 255;
+                                       fixed: 1 1;
+                                       align: 1.0 0.0;
+                               }
+                       }
+                       part {
+                               name: "padding_btn0";
+                               type: SPACER;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       min: 425 52;
+                                       rel1 {
+                                               to: "bg_bottom";
+                                       }
+                                       rel2 {
+                                               to: "bg_bottom";
+                                               relative: 0.0 0.0;
+                                       }
+                                       fixed: 1 1;
+                                       align: 0.0 0.0;
+                               }
+                       }
+                       part {
+                               name: "part_btn0";
+                               type: SWALLOW;
+                               scale: 1;
+                               clip_to: "bottomarea";
+                               description {
+                                       state: "default" 0.0;
+                                       min: 110 110;
+                                       rel1 {
+                                               to: "padding_btn0";
+                                               relative: 1.0 1.0;
+                                       }
+                                       rel2 {
+                                               to: "padding_btn0";
+                                       }
+                                       fixed: 1 1;
+                                       align: 0.0 0.0;
+                               }
+                       }
+
+#define PART_BTN(nameno, padno) \
+                       part { \
+                               name: "padding_btn"nameno; \
+                               type: SPACER; \
+                               scale: 1; \
+                               description { \
+                                       state: "default" 0.0; \
+                                       min: 50 0; \
+                                       rel1 { \
+                                               to: "part_btn"padno; \
+                                               relative: 1.0 0.0; \
+                                       } \
+                                       rel2 { \
+                                               to: "part_btn"padno; \
+                                       } \
+                                       fixed: 1 1; \
+                                       align: 0.0 0.0; \
+                               } \
+                       } \
+                       part { \
+                               name: "part_btn"nameno; \
+                               type: SWALLOW; \
+                               scale: 1; \
+                               clip_to: "bottomarea"; \
+                               description { \
+                                       state: "default" 0.0; \
+                                       min: 110 110; \
+                                       rel1 { \
+                                               to: "padding_btn"nameno; \
+                                               relative: 1.0 0.0; \
+                                       } \
+                                       rel2 { \
+                                               to: "padding_btn"nameno; \
+                                       } \
+                                       fixed: 1 1; \
+                                       align: 0.0 0.0; \
+                               } \
+                       }
+
+                       PART_BTN(1, 0)
+                       PART_BTN(2, 1)
+                       PART_BTN(3, 2)
+                       PART_BTN(4, 3)
+                       PART_BTN(5, 4)
+                       PART_BTN(6, 5)
+
+               }
+               programs {
+                       program {
+                               name : "hide,view";
+                               signal: "hide,view";
+                               source: "";
+                               action: STATE_SET "default" 0.0;
+                               target: "bottomarea";
+                               target: "toparea";
+                               transition: LINEAR 0.2;
+                       }
+                       program {
+                               name : "show,view";
+                               signal: "show,view";
+                               source: "";
+                               action: STATE_SET "show" 0.0;
+                               target: "bottomarea";
+                               target: "toparea";
+                               transition: LINEAR 0.2;
+                               after: "emit,signal";
+                       }
+                       program {
+                               name: "emit,signal";
+                               action: SIGNAL_EMIT "show,view,finish" "";
+                       }
+                       program {
+                               name : "slider,focus,in";
+                               signal: "slider,focus,in";
+                               source: "";
+                               action: STATE_SET "visible" 0.0;
+                               target: "slider_focus_bg";
+                       }
+                       program {
+                               name : "slider,focus,out";
+                               signal: "slider,focus,out";
+                               source: "";
+                               action: STATE_SET "default" 0.0;
+                               target: "slider_focus_bg";
+                       }
+               }
+       }
+}
diff --git a/res/edc/volume.edc b/res/edc/volume.edc
new file mode 100644 (file)
index 0000000..9db36f3
--- /dev/null
@@ -0,0 +1,195 @@
+group {
+       name: GRP_VOLUME;
+       images {
+               image: "ico_vol.png" COMP;
+               image: "ico_mute.png" COMP;
+               image: "round_rectangle_9X9.png" COMP;
+       }
+       styles {
+               style {
+                       name: "volume_style";
+                       base: "align=center font=TizenSans font_size=34 color=#93AA00FF font_weight=Bold";
+               }
+       }
+       parts {
+               part {
+                       name: "padding.banner";
+                       type: RECT;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               rel1.relative: 0.5 1.0;
+                               rel2.relative: 0.5 1.0;
+                               min: 0 127;
+                               align: 1.0 1.0;
+                               fixed: 1 1;
+                               visible: 0;
+                       }
+               }
+               part {
+                       name: "banner.volume";
+                       type: IMAGE;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               rel1 {
+                                       to: "padding.banner";
+                                       relative: 0.0 0.0;
+                               }
+                               rel2 {
+                                       to: "padding.banner";
+                                       relative: 0.0 0.0;
+                               }
+                               min: 527 154;
+                               align: 0.5 0.5;
+                               fixed: 1 1;
+                               image {
+                                       normal: "round_rectangle_9X9.png";
+                                       border: 9 9 9 9;
+                               }
+                               color: 18 22 34 255;
+                       }
+               }
+               part {
+                       name: "padding.icon";
+                       type: RECT;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               rel1 {
+                                       to: "banner.volume";
+                                       relative: 0.0 0.0;
+                               }
+                               rel2 {
+                                       to: "banner.volume";
+                                       relative: 0.0 0.0;
+                               }
+                               min: 57 52;
+                               align: 0.0 0.0;
+                               fixed: 1 1;
+                               visible: 0;
+
+                       }
+               }
+               part {
+                       name: "part.icon";
+                       type: IMAGE;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               rel1 {
+                                       to: "padding.icon";
+                                       relative: 1.0 1.0;
+                               }
+                               rel2 {
+                                       to: "padding.icon";
+                                       relative: 1.0 1.0;
+                               }
+                               min: 50 50;
+                               align: 0.0 0.0;
+                               fixed: 1 1;
+                               image.normal: "ico_vol.png";
+                       }
+                       description {
+                               state: "mute" 0.0;
+                               inherit: "default" 0.0;
+                               image.normal: "ico_mute.png";
+                       }
+               }
+               part {
+                       name: "padding.progressbar";
+                       type: RECT;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               rel1 {
+                                       to: "part.icon";
+                                       relative: 1.0 0.0;
+                               }
+                               rel2 {
+                                       to: "part.icon";
+                                       relative: 1.0 0.0;
+                               }
+                               min: 18 10;
+                               align: 0.0 0.0;
+                               fixed: 1 1;
+                               visible: 0;
+                       }
+               }
+               part {
+                       name: PART_VOLUME_BAR;
+                       type: SWALLOW;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               rel1 {
+                                       to: "padding.progressbar";
+                                       relative: 1.0 1.0;
+                               }
+                               rel2 {
+                                       to: "padding.progressbar";
+                                       relative: 1.0 1.0;
+                               }
+                               min: 280 8;
+                               align: 0.0 0.0;
+                               fixed: 1 1;
+                       }
+               }
+               part {
+                       name: "padding.volume";
+                       type: RECT;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               rel1 {
+                                       to: "banner.volume";
+                                       relative: 1.0 0.0;
+                               }
+                               rel2 {
+                                       to: "banner.volume";
+                                       relative: 1.0 0.0;
+                               }
+                               min: 51 0;
+                               align: 1.0 0.0;
+                               fixed: 1 1;
+                               visible: 0;
+                       }
+               }
+               part {
+                       name: PART_VOLUME_VALUE;
+                       type: TEXTBLOCK;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               rel1 {
+                                       to: "padding.volume";
+                                       relative: 0.0 0.0;
+                               }
+                               rel2 {
+                                       to: "padding.volume";
+                                       relative: 0.0 0.0;
+                               }
+                               min: 60 154;
+                               align: 1.0 0.0;
+                               fixed: 1 1;
+                               text.style: "volume_style";
+                       }
+               }
+       }
+       programs {
+               program {
+                       name: "show.mute";
+                       signal: "volume,mute";
+                       source: "base";
+                       action: STATE_SET "mute" 0.0;
+                       target: "part.icon";
+               }
+               program {
+                       name: "hide.mute";
+                       signal: "volume,unmute";
+                       source: "base";
+                       action: STATE_SET "default" 0.0;
+                       target: "part.icon";
+               }
+       }
+}
diff --git a/res/edc/widgets/button.edc b/res/edc/widgets/button.edc
new file mode 100644 (file)
index 0000000..21b6e7c
--- /dev/null
@@ -0,0 +1,949 @@
+#define STATE_NORMAL 0
+#define STATE_HIGHLIGHT 1
+#define STATE_PAUSE 0
+#define STATE_PLAY 1
+
+group {
+       name: "elm/button/base/video_btn_prev";
+       images {
+               image: IMAGE_VIDEO_BTN_PREV_NORMAL COMP;
+               image: IMAGE_VIDEO_BTN_PREV_FOCUS COMP;
+       }
+       parts {
+               part {
+                       name: "bg";
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               min: 110 110;
+                               image.normal: IMAGE_VIDEO_BTN_PREV_NORMAL;
+                       }
+                       description {
+                               state: "selected" 0.0;
+                               inherit: "default" 0.0;
+                               image.normal: IMAGE_VIDEO_BTN_PREV_FOCUS;
+                       }
+                       description {
+                               state: "selected_in" 0.0;
+                               min: 60 60;
+                               max: 60 60;
+                               image.normal: IMAGE_VIDEO_BTN_PREV_FOCUS;
+                       }
+               }
+       }
+       programs {
+               program {
+                       name: "button_down";
+                       signal: "mouse,down,1";
+                       source: "bg";
+                       action: SIGNAL_EMIT "elm,action,press" "";
+               }
+               program {
+                       name: "button_mouseup";
+                       signal: "mouse,up,1";
+                       source: "bg";
+                       action: SIGNAL_EMIT "elm,action,unpress" "";
+               }
+               program {
+                       name: "button_clicked";
+                       signal: "mouse,clicked,1";
+                       source: "bg";
+                       action: SIGNAL_EMIT "elm,action,click" "";
+               }
+               program {
+                       name: "mouse,anim,start";
+                       signal: "mouse,anim,start";
+                       source: "";
+                       action: STATE_SET "selected_in" 0.0;
+                       target: "bg";
+                       transition: LINEAR 0.1;
+                       after: "mouse,anim,end";
+               }
+               program {
+                       name: "mouse,anim,end";
+                       action: STATE_SET "selected" 0.0;
+                       target: "bg";
+                       transition: LINEAR 0.1;
+                       after: "emit,signal";
+               }
+               program {
+                       name: "emit,signal";
+                       action: SIGNAL_EMIT "btn,anim,finish" "prev";
+               }
+               program {
+                       name: "focused";
+                       signal: "elm,action,focus";
+                       source: "elm";
+                       action: STATE_SET "selected" 0.0;
+                       target: "bg";
+               }
+               program {
+                       name: "unfocused";
+                       signal: "elm,action,unfocus";
+                       source: "elm";
+                       action: STATE_SET "default" 0.0;
+                       target: "bg";
+               }
+       }
+}
+
+group {
+       inherit: "elm/button/base/video_btn_prev";
+       name: "elm/button/base/video_btn_next";
+       images {
+               image: IMAGE_VIDEO_BTN_NEXT_NORMAL COMP;
+               image: IMAGE_VIDEO_BTN_NEXT_FOCUS COMP;
+       }
+       parts {
+               part {
+                       name: "bg";
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               min: 110 110;
+                               image.normal: IMAGE_VIDEO_BTN_NEXT_NORMAL;
+                       }
+                       description {
+                               state: "selected" 0.0;
+                               inherit: "default" 0.0;
+                               image.normal: IMAGE_VIDEO_BTN_NEXT_FOCUS;
+                       }
+                       description {
+                               state: "selected_in" 0.0;
+                               min: 60 60;
+                               max: 60 60;
+                               image.normal: IMAGE_VIDEO_BTN_NEXT_FOCUS;
+                       }
+               }
+       }
+       programs {
+               program {
+                       name: "emit,signal";
+                       action: SIGNAL_EMIT "btn,anim,finish" "next";
+               }
+       }
+}
+
+group {
+       inherit: "elm/button/base/video_btn_prev";
+       name: "elm/button/base/video_btn_rew";
+       images {
+               image: IMAGE_VIDEO_BTN_REW_NORMAL COMP;
+               image: IMAGE_VIDEO_BTN_REW_FOCUS COMP;
+       }
+       parts {
+               part {
+                       name: "bg";
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               min: 110 110;
+                               image.normal: IMAGE_VIDEO_BTN_REW_NORMAL;
+                       }
+                       description {
+                               state: "selected" 0.0;
+                               inherit: "default" 0.0;
+                               image.normal: IMAGE_VIDEO_BTN_REW_FOCUS;
+                       }
+                       description {
+                               state: "selected_in" 0.0;
+                               min: 60 60;
+                               max: 60 60;
+                               image.normal: IMAGE_VIDEO_BTN_REW_FOCUS;
+                       }
+               }
+       }
+       programs {
+               program {
+                       name: "emit,signal";
+                       action: SIGNAL_EMIT "btn,anim,finish" "rew";
+               }
+       }
+}
+
+group {
+       inherit: "elm/button/base/video_btn_prev";
+       name: "elm/button/base/video_btn_ff";
+       images {
+               image: IMAGE_VIDEO_BTN_FF_NORMAL COMP;
+               image: IMAGE_VIDEO_BTN_FF_FOCUS COMP;
+       }
+       parts {
+               part {
+                       name: "bg";
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               min: 110 110;
+                               image.normal: IMAGE_VIDEO_BTN_FF_NORMAL;
+                       }
+                       description {
+                               state: "selected" 0.0;
+                               inherit: "default" 0.0;
+                               image.normal: IMAGE_VIDEO_BTN_FF_FOCUS;
+                       }
+                       description {
+                               state: "selected_in" 0.0;
+                               min: 60 60;
+                               max: 60 60;
+                               image.normal: IMAGE_VIDEO_BTN_FF_FOCUS;
+                       }
+               }
+       }
+       programs {
+               program {
+                       name: "emit,signal";
+                       action: SIGNAL_EMIT "btn,anim,finish" "ff";
+               }
+       }
+}
+
+group {
+       name: "elm/button/base/video_btn_playpause";
+       images {
+               image: IMAGE_VIDEO_BTN_PAUSE_NORMAL COMP;
+               image: IMAGE_VIDEO_BTN_PAUSE_FOCUS COMP;
+               image: IMAGE_VIDEO_BTN_PLAY_NORMAL COMP;
+               image: IMAGE_VIDEO_BTN_PLAY_FOCUS COMP;
+       }
+       script {
+               public cur_state;
+       }
+       parts {
+               part {
+                       name: "bg";
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               min: 110 110;
+                               image.normal: IMAGE_VIDEO_BTN_PAUSE_NORMAL;
+                       }
+                       description {
+                               state: "selected" 0.0;
+                               inherit: "default" 0.0;
+                               image.normal: IMAGE_VIDEO_BTN_PAUSE_FOCUS;
+                       }
+                       description {
+                               state: "selected_in" 0.0;
+                               inherit: "selected" 0.0;
+                               min: 60 60;
+                               max: 60 60;
+                       }
+                       description {
+                               state: "default_play" 0.0;
+                               inherit: "default" 0.0;
+                               image.normal: IMAGE_VIDEO_BTN_PLAY_NORMAL;
+                       }
+                       description {
+                               state: "selected_play" 0.0;
+                               inherit: "default" 0.0;
+                               image.normal: IMAGE_VIDEO_BTN_PLAY_FOCUS;
+                       }
+                       description {
+                               state: "selected_play_in" 0.0;
+                               inherit: "selected_play" 0.0;
+                               min: 60 60;
+                               max: 60 60;
+                       }
+               }
+       }
+       programs {
+               program {
+                       name: "load";
+                       signal: "load";
+                       source: "";
+                       script {
+                               set_int(cur_state, STATE_PAUSE);
+                       }
+               }
+               program {
+                       name: "button_down";
+                       signal: "mouse,down,1";
+                       source: "bg";
+                       action: SIGNAL_EMIT "elm,action,press" "";
+               }
+               program {
+                       name: "button_mouseup";
+                       signal: "mouse,up,1";
+                       source: "bg";
+                       action: SIGNAL_EMIT "elm,action,unpress" "";
+               }
+               program {
+                       name: "button_clicked";
+                       signal: "mouse,clicked,1";
+                       source: "bg";
+                       action: SIGNAL_EMIT "elm,action,click" "";
+               }
+               program {
+                       name: "mouse,anim,start";
+                       signal: "mouse,anim,start";
+                       source: "";
+                       script {
+                               new state;
+                               state = get_int(cur_state);
+
+                               if (state == STATE_PAUSE) {
+                                       run_program(PROGRAM:"pause_to_play_anim_start");
+                                       set_int(cur_state, STATE_PLAY);
+                               } else {
+                                       run_program(PROGRAM:"play_to_pause_anim_start");
+                                       set_int(cur_state, STATE_PAUSE);
+                               }
+                       }
+               }
+               program {
+                       name: "pause_to_play_anim_start";
+                       action: STATE_SET "selected_in" 0.0;
+                       target: "bg";
+                       transition: LINEAR 0.1;
+                       after: "pause_to_play_anim_end";
+               }
+               program {
+                       name: "pause_to_play_anim_end";
+                       action: STATE_SET "selected_play" 0.0;
+                       target: "bg";
+                       transition: LINEAR 0.1;
+                       after: "emit,signal";
+               }
+               program {
+                       name: "play_to_pause_anim_start";
+                       action: STATE_SET "selected_play_in" 0.0;
+                       target: "bg";
+                       transition: LINEAR 0.1;
+                       after: "play_to_pause_anim_end";
+               }
+               program {
+                       name: "play_to_pause_anim_end";
+                       action: STATE_SET "selected" 0.0;
+                       target: "bg";
+                       transition: LINEAR 0.1;
+                       after: "emit,signal";
+               }
+               program {
+                       name: "emit,signal";
+                       action: SIGNAL_EMIT "btn,anim,finish" "playpause";
+               }
+               program {
+                       name: "focused";
+                       signal: "elm,action,focus";
+                       source: "elm";
+                       script {
+                               new state;
+                               state = get_int(cur_state);
+
+                               if (state == STATE_PAUSE)
+                                       set_state(PART:"bg", "selected", 0.0);
+                               else
+                                       set_state(PART:"bg", "selected_play", 0.0);
+                       }
+               }
+               program {
+                       name: "unfocused";
+                       signal: "elm,action,unfocus";
+                       source: "elm";
+                       script {
+                               new state;
+                               state = get_int(cur_state);
+
+                               if (state == STATE_PAUSE)
+                                       set_state(PART:"bg", "default", 0.0);
+                               else
+                                       set_state(PART:"bg", "default_play", 0.0);
+                       }
+               }
+               program {
+                       name: "set,play,icon";
+                       signal: "set,play,icon";
+                       source: "";
+                       script {
+                               set_int(cur_state, STATE_PLAY);
+                               set_state(PART:"bg", "default_play", 0.0);
+                       }
+               }
+               program {
+                       name: "set,pause,icon";
+                       signal: "set,pause,icon";
+                       source: "";
+                       script {
+                               set_int(cur_state, STATE_PAUSE);
+                               set_state(PART:"bg", "default", 0.0);
+                       }
+               }
+       }
+}
+
+#define STATE_REPEAT_ALL 0
+#define STATE_REPEAT_ONE 1
+#define STATE_REPEAT_OFF 2
+group {
+       name: "elm/button/base/video_btn_repeat";
+       images {
+               image: IMAGE_VIDEO_BTN_REPEATOFF_NORMAL COMP;
+               image: IMAGE_VIDEO_BTN_REPEATOFF_FOCUS COMP;
+               image: IMAGE_VIDEO_BTN_REPEATALL_NORMAL COMP;
+               image: IMAGE_VIDEO_BTN_REPEATALL_FOCUS COMP;
+               image: IMAGE_VIDEO_BTN_REPEATONE_NORMAL COMP;
+               image: IMAGE_VIDEO_BTN_REPEATONE_FOCUS COMP;
+       }
+       script {
+               public cur_state;
+       }
+       parts {
+               part {
+                       name: "bg";
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               min: 110 110;
+                               image.normal: IMAGE_VIDEO_BTN_REPEATALL_NORMAL;
+                       }
+                       description {
+                               state: "selected" 0.0;
+                               inherit: "default" 0.0;
+                               image.normal: IMAGE_VIDEO_BTN_REPEATALL_FOCUS;
+                       }
+                       description {
+                               state: "selected_in" 0.0;
+                               inherit: "selected" 0.0;
+                               min: 60 60;
+                               max: 60 60;
+                       }
+                       description {
+                               state: "default_repeatone" 0.0;
+                               inherit: "default" 0.0;
+                               image.normal: IMAGE_VIDEO_BTN_REPEATONE_NORMAL;
+                       }
+                       description {
+                               state: "selected_repeatone" 0.0;
+                               inherit: "default" 0.0;
+                               image.normal: IMAGE_VIDEO_BTN_REPEATONE_FOCUS;
+                       }
+                       description {
+                               state: "selected_repeatone_in" 0.0;
+                               inherit: "selected_repeatone" 0.0;
+                               min: 60 60;
+                               max: 60 60;
+                       }
+                       description {
+                               state: "default_repeatoff" 0.0;
+                               inherit: "default" 0.0;
+                               image.normal: IMAGE_VIDEO_BTN_REPEATOFF_NORMAL;
+                       }
+                       description {
+                               state: "selected_repeatoff" 0.0;
+                               inherit: "default" 0.0;
+                               image.normal: IMAGE_VIDEO_BTN_REPEATOFF_FOCUS;
+                       }
+                       description {
+                               state: "selected_repeatoff_in" 0.0;
+                               inherit: "selected_repeatoff" 0.0;
+                               min: 60 60;
+                               max: 60 60;
+                       }
+               }
+       }
+       programs {
+               program {
+                       name: "load";
+                       signal: "load";
+                       source: "";
+                       script {
+                               set_int(cur_state, STATE_REPEAT_ALL);
+                       }
+               }
+               program {
+                       name: "button_down";
+                       signal: "mouse,down,1";
+                       source: "bg";
+                       action: SIGNAL_EMIT "elm,action,press" "";
+               }
+               program {
+                       name: "button_mouseup";
+                       signal: "mouse,up,1";
+                       source: "bg";
+                       action: SIGNAL_EMIT "elm,action,unpress" "";
+               }
+               program {
+                       name: "button_clicked";
+                       signal: "mouse,clicked,1";
+                       source: "bg";
+                       action: SIGNAL_EMIT "elm,action,click" "";
+               }
+               program {
+                       name: "mouse,anim,start";
+                       signal: "mouse,anim,start";
+                       source: "";
+                       script {
+                               new state;
+                               state = get_int(cur_state);
+
+                               if (state == STATE_REPEAT_ALL) {
+                                       run_program(PROGRAM:"repeatall_to_repeatone_start");
+                                       set_int(cur_state, STATE_REPEAT_ONE);
+                               } else if (state == STATE_REPEAT_ONE) {
+                                       run_program(PROGRAM:"repeatone_to_repeatoff_start");
+                                       set_int(cur_state, STATE_REPEAT_OFF);
+                               } else {
+                                       run_program(PROGRAM:"repeatoff_to_repeatall_start");
+                                       set_int(cur_state, STATE_REPEAT_ALL);
+                               }
+                       }
+               }
+               program {
+                       name: "repeatall_to_repeatone_start";
+                       action: STATE_SET "selected_in" 0.0;
+                       target: "bg";
+                       transition: LINEAR 0.1;
+                       after: "repeatall_to_repeatone_end";
+               }
+               program {
+                       name: "repeatall_to_repeatone_end";
+                       action: STATE_SET "selected_repeatone" 0.0;
+                       target: "bg";
+                       transition: LINEAR 0.1;
+                       after: "emit,signal";
+               }
+               program {
+                       name: "repeatone_to_repeatoff_start";
+                       action: STATE_SET "selected_repeatone_in" 0.0;
+                       target: "bg";
+                       transition: LINEAR 0.1;
+                       after: "repeatone_to_repeatoff_end";
+               }
+               program {
+                       name: "repeatone_to_repeatoff_end";
+                       action: STATE_SET "selected_repeatoff" 0.0;
+                       target: "bg";
+                       transition: LINEAR 0.1;
+                       after: "emit,signal";
+               }
+               program {
+                       name: "repeatoff_to_repeatall_start";
+                       action: STATE_SET "selected_repeatoff_in" 0.0;
+                       target: "bg";
+                       transition: LINEAR 0.1;
+                       after: "repeatoff_to_repeatall_end";
+               }
+               program {
+                       name: "repeatoff_to_repeatall_end";
+                       action: STATE_SET "selected" 0.0;
+                       target: "bg";
+                       transition: LINEAR 0.1;
+                       after: "emit,signal";
+               }
+               program {
+                       name: "emit,signal";
+                       action: SIGNAL_EMIT "btn,anim,finish" "repeat";
+               }
+               program {
+                       name: "focused";
+                       signal: "elm,action,focus";
+                       source: "elm";
+                       script {
+                               new state;
+                               state = get_int(cur_state);
+
+                               if (state == STATE_REPEAT_ALL)
+                                       set_state(PART:"bg", "selected", 0.0);
+                               else if (state == STATE_REPEAT_ONE)
+                                       set_state(PART:"bg", "selected_repeatone", 0.0);
+                               else
+                                       set_state(PART:"bg", "selected_repeatoff", 0.0);
+                       }
+               }
+               program {
+                       name: "unfocused";
+                       signal: "elm,action,unfocus";
+                       source: "elm";
+                       script {
+                               new state;
+                               state = get_int(cur_state);
+
+                               if (state == STATE_REPEAT_ALL)
+                                       set_state(PART:"bg", "default", 0.0);
+                               else if (state == STATE_REPEAT_ONE)
+                                       set_state(PART:"bg", "default_repeatone", 0.0);
+                               else
+                                       set_state(PART:"bg", "default_repeatoff", 0.0);
+                       }
+               }
+       }
+}
+
+group {
+       name: "elm/button/base/video_btn_settings";
+       images {
+               image: IMAGE_VIDEO_BTN_SETTING_NORMAL COMP;
+               image: IMAGE_VIDEO_BTN_SETTING_FOCUS COMP;
+               image: IMAGE_VIDEO_BTN_SETTING_HIGHLIGHT COMP;
+       }
+       script {
+               public cur_state;
+       }
+       parts {
+               part {
+                       name: "bg";
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               min: 110 110;
+                               image.normal: IMAGE_VIDEO_BTN_SETTING_NORMAL;
+                       }
+                       description {
+                               state: "selected" 0.0;
+                               inherit: "default" 0.0;
+                               image.normal: IMAGE_VIDEO_BTN_SETTING_FOCUS;
+                       }
+                       description {
+                               state: "selected_in" 0.0;
+                               inherit: "selected" 0.0;
+                               min: 60 60;
+                               max: 60 60;
+                       }
+                       description {
+                               state: "highlight" 0.0;
+                               inherit: "default" 0.0;
+                               image.normal: IMAGE_VIDEO_BTN_SETTING_HIGHLIGHT;
+                       }
+               }
+       }
+       programs {
+               program {
+                       name: "load";
+                       signal: "load";
+                       source: "";
+                       script {
+                               set_int(cur_state, STATE_NORMAL);
+                       }
+               }
+               program {
+                       name: "button_down";
+                       signal: "mouse,down,1";
+                       source: "bg";
+                       action: SIGNAL_EMIT "elm,action,press" "";
+               }
+               program {
+                       name: "button_mouseup";
+                       signal: "mouse,up,1";
+                       source: "bg";
+                       action: SIGNAL_EMIT "elm,action,unpress" "";
+               }
+               program {
+                       name: "button_clicked";
+                       signal: "mouse,clicked,1";
+                       source: "bg";
+                       action: SIGNAL_EMIT "elm,action,click" "";
+               }
+               program {
+                       name: "focused";
+                       signal: "elm,action,focus";
+                       source: "elm";
+                       script {
+                               set_int(cur_state, STATE_NORMAL);
+                               set_state(PART:"bg", "selected", 0.0);
+                       }
+               }
+               program {
+                       name: "unfocused";
+                       signal: "elm,action,unfocus";
+                       source: "elm";
+                       script {
+                               new state;
+                               state = get_int(cur_state);
+                               if (state == STATE_HIGHLIGHT)
+                                       set_state(PART:"bg", "highlight", 0.0);
+                               else
+                                       set_state(PART:"bg", "default", 0.0);
+                       }
+               }
+               program {
+                       name: "mouse,anim,start";
+                       signal: "mouse,anim,start";
+                       source: "";
+                       action: STATE_SET "selected_in" 0.0;
+                       target: "bg";
+                       transition: LINEAR 0.1;
+                       after: "mouse,anim,end";
+               }
+               program {
+                       name: "mouse,anim,end";
+                       action: STATE_SET "highlight" 0.0;
+                       target: "bg";
+                       transition: LINEAR 0.1;
+                       after: "emit,signal";
+               }
+               program {
+                       name: "emit,signal";
+                       action: SIGNAL_EMIT "btn,anim,finish" "settings";
+               }
+               program {
+                       name: "highlight";
+                       signal: "elm,action,highlight";
+                       source: "elm";
+                       script {
+                               set_int(cur_state, STATE_HIGHLIGHT);
+                               set_state(PART:"bg", "highlight", 0.0);
+                       }
+               }
+       }
+}
+
+group {
+       name: "elm/button/base/shorttext";
+       images {
+               image: IMAGE_ICON_CHECK_HIGH COMP;
+               image: IMAGE_ICON_CHECK_FOC COMP;
+       }
+       script {
+               public cur_state;
+       }
+       parts {
+               part {
+                       name: "bg";
+                       type: RECT;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               min: 310 82;
+                               color: 255 255 255 255;
+                       }
+                       description {
+                               state: "selected" 0.0;
+                               inherit: "default" 0.0;
+                               color: 147 170 0 255;
+                       }
+                       description {
+                               state: "highlight" 0.0;
+                               inherit: "default" 0.0;
+                               color: 255 255 255 255;
+                       }
+               }
+               part {
+                       name: "division_line";
+                       type: RECT;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               min: 310 2;
+                               color: 89 89 89 51;
+                               rel1 {
+                                       to: "bg";
+                                       relative: 1.0 1.0;
+                               }
+                               rel2 {
+                                       to: "bg";
+                               }
+                               align: 1.0 1.0;
+                               fixed: 1 1;
+                       }
+                       description {
+                               state: "selected" 0.0;
+                               inherit: "default" 0.0;
+                               visible: 0;
+                       }
+                       description {
+                               state: "highlight" 0.0;
+                               inherit: "default" 0.0;
+                       }
+               }
+               part {
+                       name: "padding_text";
+                       type: RECT;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               min: 40 0;
+                               rel1 {
+                                       to: "bg";
+                               }
+                               rel2 {
+                                       to: "bg";
+                                       relative: 0.0 1.0;
+                               }
+                               fixed: 1 0;
+                               visible: 0;
+                               align: 0.0 0.0;
+                       }
+               }
+               part {
+                       name: "elm.text";
+                       type: TEXT;
+                       mouse_events: 0;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               min: 190 80;
+                               rel1 {
+                                       to: "padding_text";
+                                       relative: 1.0 0.0;
+                               }
+                               rel2 {
+                                       to: "padding_text";
+                               }
+                               text {
+                                       font: FONT_STYLE_SANS_REGULAR;
+                                       size: 30;
+                                       align: 0.0 0.5;
+                               }
+                               color: 89 89 89 255;
+                               fixed: 1 1;
+                               align: 0.0 0.0;
+                       }
+                       description {
+                               state: "selected" 0.0;
+                               inherit: "default" 0.0;
+                               text {
+                                       font: FONT_STYLE_SANS_MEDIUM;
+                               }
+                               color: 255 255 255 255;
+                       }
+                       description {
+                               state: "highlight" 0.0;
+                               inherit: "default" 0.0;
+                               text {
+                                       font: FONT_STYLE_SANS_MEDIUM;
+                               }
+                               color: 147 170 0 255;
+                       }
+               }
+               part {
+                       name: "padding_icon";
+                       type: RECT;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               min: 20 30;
+                               rel1 {
+                                       to: "elm.text";
+                                       relative: 1.0 0.0;
+                               }
+                               rel2 {
+                                       to: "elm.text";
+                                       relative: 1.0 0.0;
+                               }
+                               fixed: 1 1;
+                               visible: 0;
+                               align: 0.0 0.0;
+                       }
+               }
+               part {
+                       name: PART_ELM_SWALLOWICON;
+                       mouse_events: 0;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               min: 20 20;
+                               rel1 {
+                                       to: "padding_icon";
+                                       relative: 1.0 1.0;
+                               }
+                               rel2 {
+                                       to: "padding_icon";
+                               }
+                               image.normal: IMAGE_ICON_CHECK_FOC;
+                               fixed: 1 1;
+                               align: 0.0 0.0;
+                               visible: 0;
+                       }
+                       description {
+                               state: "selected" 0.0;
+                               inherit: "default" 0.0;
+                               visible: 1;
+                       }
+                       description {
+                               state: "highlight" 0.0;
+                               inherit: "default" 0.0;
+                               image.normal: IMAGE_ICON_CHECK_HIGH;
+                               visible: 1;
+                       }
+               }
+       }
+       programs {
+               program {
+                       name: "load";
+                       signal: "load";
+                       source: "";
+                       script {
+                               set_int(cur_state, STATE_NORMAL);
+                       }
+               }
+               program {
+                       name: "button_down";
+                       signal: "mouse,down,1";
+                       source: "bg";
+                       action: SIGNAL_EMIT "elm,action,press" "";
+               }
+               program {
+                       name: "button_mouseup";
+                       signal: "mouse,up,1";
+                       source: "bg";
+                       action: SIGNAL_EMIT "elm,action,unpress" "";
+               }
+               program {
+                       name: "button_clicked";
+                       signal: "mouse,clicked,1";
+                       source: "bg";
+                       action: SIGNAL_EMIT "elm,action,click" "";
+               }
+               program {
+                       name: "focused";
+                       signal: "elm,action,focus";
+                       source: "elm";
+                       script {
+                               new state;
+                               state = get_int(cur_state);
+
+                               if (state == STATE_HIGHLIGHT)
+                                       set_state(PART:PART_ELM_SWALLOWICON, "selected", 0.0);
+
+                               set_state(PART:"bg", "selected", 0.0);
+                               set_state(PART:"division_line", "selected", 0.0);
+                               set_state(PART:"elm.text", "selected", 0.0);
+                       }
+               }
+               program {
+                       name: "unfocused";
+                       signal: "elm,action,unfocus";
+                       source: "elm";
+                       script {
+                               new state;
+                               new buf[100];
+                               state = get_int(cur_state);
+
+                               if (state == STATE_HIGHLIGHT)
+                                       snprintf(buf, sizeof(buf), "highlight");
+                               else
+                                       snprintf(buf, sizeof(buf), "default");
+
+                               set_state(PART:"bg", buf, 0.0);
+                               set_state(PART:"division_line", buf, 0.0);
+                               set_state(PART:"elm.text", buf, 0.0);
+                               set_state(PART:PART_ELM_SWALLOWICON, buf, 0.0);
+                       }
+               }
+               program {
+                       name: "highlight";
+                       signal: "elm,action,highlight";
+                       source: "elm";
+                       script {
+                               set_int(cur_state, STATE_HIGHLIGHT);
+                       }
+                       after: "highlight1";
+               }
+               program {
+                       name: "highlight1";
+                       action: STATE_SET "highlight" 0.0;
+                       target: "bg";
+                       target: "elm.text";
+                       target: PART_ELM_SWALLOWICON;
+                       target: "division_line";
+               }
+               program {
+                       name: "hide_line";
+                       signal: "elm,action,hideline";
+                       source: "elm";
+                       action: STATE_SET "selected" 0.0;
+                       target: "division_line";
+               }
+       }
+}
diff --git a/res/edc/widgets/ctxpopup.edc b/res/edc/widgets/ctxpopup.edc
new file mode 100644 (file)
index 0000000..1401584
--- /dev/null
@@ -0,0 +1,35 @@
+group {
+       name: "elm/ctxpopup/base/viewer_popup";
+       images {
+               image: IMAGE_TOOLTIP_ARROW COMP;
+       }
+       parts {
+               part {
+                       name: "elm.swallow.content";
+                       type: SWALLOW;
+                       description {
+                               state: "default" 0.0;
+                       }
+               }
+               part {
+                       name: "ctxpopup_arrow";
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               min: 14 9;
+                               fixed: 1 1;
+                               rel1 {
+                                       to: "elm.swallow.content";
+                                       relative: 0.5 1;
+                               }
+                               rel2 {
+                                       to: "elm.swallow.content";
+                                       relative: 0.5 1;
+                               }
+                               align: 0.5 0.0;
+                               image.normal: IMAGE_TOOLTIP_ARROW;
+                               color: 255 255 255 255;
+                       }
+               }
+       }
+}
diff --git a/res/edc/widgets/progressbar.edc b/res/edc/widgets/progressbar.edc
new file mode 100644 (file)
index 0000000..ef101d4
--- /dev/null
@@ -0,0 +1,372 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+group {
+       name: "elm/progressbar/horizontal/volume_bar";
+       parts {
+               part {
+                       name: "elm.background.progressbar";
+                       type: RECT;
+                       mouse_events: 0;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                       }
+               }
+               part {
+                       name: "elm.swallow.bar";
+                       type: SWALLOW;
+                       mouse_events: 0;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               min: 0 28;
+                               max: 99999 28;
+                               rel1 {
+                                       to_x: "elm.text";
+                                       to_y: "elm.background.progressbar";
+                                       relative: 1.0 0.0;
+                               }
+                               rel2 {
+                                       to: "elm.background.progressbar";
+                               }
+                       }
+               }
+               part {
+                       name: "elm.swallow.content";
+                       type: SWALLOW;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               visible: 0;
+                               align: 0.0 0.5;
+                               rel1 {
+                                       to_y: "elm.background.progressbar";
+                               }
+                               rel2 {
+                                       relative: 0.0 1.0;
+                                       to_y: "elm.background.progressbar";
+                               }
+                       }
+                       description {
+                               state: "visible" 0.0;
+                               inherit: "default" 0.0;
+                               visible: 1;
+                               aspect: 1.0 1.0;
+                               aspect_preference: VERTICAL;
+                       }
+               }
+               part {
+                       name: "elm.text";
+                       type: TEXT;
+                       mouse_events: 0;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               visible: 0;
+                               fixed: 1 1;
+                               align: 0.0 0.5;
+                               rel1.to_x: "elm.swallow.content";
+                               rel1.relative: 1.0 0.0;
+                               rel2.to_x: "elm.swallow.content";
+                               rel2.relative: 1.0 1.0;
+                               color: 0 0 0 255;
+                               text {
+                                       font: "Sans,Edje-Vera";
+                                       size: 10;
+                                       min: 0 0;
+                                       align: 0.0 0.5;
+                               }
+                       }
+                       description {
+                               state: "visible" 0.0;
+                               inherit: "default" 0.0;
+                               visible: 1;
+                               text.min: 1 1;
+                               text.ellipsis: -1;
+                       }
+               }
+               part {
+                       name: "background";
+                       type: RECT;
+                       mouse_events: 0;
+                       clip_to: "elm.background.progressbar";
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               min: 0 14;
+                               max: 9999 14;
+                               rel1.to: "elm.swallow.bar";
+                               rel2.to: "elm.swallow.bar";
+                               color, 255 255 255 25;
+                       }
+               }
+               part {
+                       name: "elm.text.status";
+                       type: TEXT;
+                       mouse_events: 0;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               fixed: 1 1;
+                               visible: 0;
+                               rel1 {
+                                       to: "background";
+                                       relative: 0.5 0.5;
+                               }
+                               rel2 {
+                                       to: "background";
+                                       relative: 0.5 0.5;
+                               }
+                               text {
+                                       font: "Sans:style=Bold,Edje-Vera-Bold";
+                                       size: 10;
+                                       min: 1 1;
+                                       ellipsis: -1;
+                                       align: 0.5 0.0;
+                               }
+                               color: 0 0 0 255;
+                       }
+                       description {
+                               state: "hidden" 0.0;
+                               inherit: "default" 0.0;
+                               visible: 0;
+                               text.min: 0 0;
+                       }
+               }
+               part {
+                       name: "elm.progress.progressbar";
+                       type, RECT;
+                       mouse_events: 0;
+                       scale: 1;
+                       clip_to: "elm.background.progressbar";
+                       description {
+                               state: "default" 0.0;
+                               min: 0 14;
+                               max: 9999 14;
+                               fixed: 1 1;
+                               rel1.to: "elm.swallow.bar";
+                               rel2 {
+                                       to_y: "elm.swallow.bar";
+                                       to_x: "elm.cur.progressbar";
+                               }
+                               color, 147 170 0 255;
+                       }
+                       description {
+                               state: "invert" 0.0;
+                               inherit: "default" 0.0;
+                               rel1 {
+                                       to_y: "elm.swallow.bar";
+                                       to_x: "elm.cur.progressbar";
+                               }
+                               rel2.to: "elm.swallow.bar";
+                       }
+                       description {
+                               state: "state_begin" 0.0;
+                               inherit: "default" 0.0;
+                               rel1.to: "elm.swallow.bar";
+                               rel2 {
+                                       to: "elm.swallow.bar";
+                                       relative: 0.1 1.0;
+                               }
+                       }
+                       description {
+                               state: "state_end" 0.0;
+                               inherit: "default" 0.0;
+                               rel1 {
+                                       to: "elm.swallow.bar";
+                                       relative: 0.9 0.0;
+                               }
+                               rel2.to: "elm.swallow.bar";
+                       }
+               }
+               part {
+                       name: "text-bar";
+                       type: TEXT;
+                       mouse_events: 0;
+                       clip_to: "progress-rect";
+                       effect: SOFT_SHADOW;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               align: 0.0 0.0;
+                               fixed: 1 1;
+                               visible: 0;
+                               rel1.to: "elm.text.status";
+                               rel2.to: "elm.text.status";
+                               text {
+                                       text_source: "elm.text.status";
+                                       font: "Sans:style=Bold,Edje-Vera-Bold";
+                                       size: 10;
+                                       min: 1 1;
+                                       ellipsis: -1;
+                                       align: 0.0 0.0;
+                               }
+                               color: 224 224 224 255;
+                               color3: 0 0 0 64;
+                       }
+                       description {
+                               state: "hidden" 0.0;
+                               inherit: "default" 0.0;
+                               visible: 0;
+                               text.min: 0 0;
+                       }
+               }
+               part {
+                       name: "elm.cur.progressbar";
+                       mouse_events: 0;
+                       scale: 1;
+                       dragable {
+                               confine: "background";
+                               x: 1 1 1;
+                               y: 0 0 0;
+                       }
+                       description {
+                               state: "default" 0.0;
+                               min: 0 28;
+                               fixed: 1 1;
+                               visible: 0;
+                               rel1 {
+                                       to: "background";
+                                       relative: 0 0;
+                               }
+                               rel2.to: "background";
+                       }
+               }
+               part {
+                       name: "progress-rect";
+                       type: RECT;
+                       mouse_events: 0;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               rel1.to: "elm.progress.progressbar";
+                               rel2.to: "elm.progress.progressbar";
+                       }
+               }
+        }
+        programs {
+               program {
+                       name: "label_show";
+                       signal: "elm,state,text,visible";
+                       source: "elm";
+                       action:  STATE_SET "visible" 0.0;
+                       target: "elm.text";
+               }
+               program {
+                       name: "label_hide";
+                       signal: "elm,state,text,hidden";
+                       source: "elm";
+                       action:  STATE_SET "default" 0.0;
+                       target: "elm.text";
+               }
+               program {
+                       name: "icon_show";
+                       signal: "elm,state,icon,visible";
+                       source: "elm";
+                       action:  STATE_SET "visible" 0.0;
+                       target: "elm.swallow.content";
+               }
+               program {
+                       name: "icon_hide";
+                       signal: "elm,state,icon,hidden";
+                       source: "elm";
+                       action:  STATE_SET "default" 0.0;
+                       target: "elm.swallow.content";
+               }
+               program {
+                       name: "units_show";
+                       signal: "elm,state,units,visible";
+                       source: "elm";
+                       action:  STATE_SET "default" 0.0;
+                       target: "text-bar";
+                       target: "elm.text.status";
+               }
+               program {
+                       name: "units_hide";
+                       signal: "elm,state,units,hidden";
+                       source: "elm";
+                       action:  STATE_SET "hidden" 0.0;
+                       target: "text-bar";
+                       target: "elm.text.status";
+               }
+               program {
+                       name: "slide_to_end";
+                       action:  STATE_SET "state_end" 0.0;
+                       transition: LINEAR 0.5;
+                       target: "elm.progress.progressbar";
+                       after: "slide_to_begin";
+               }
+               program {
+                       name: "slide_to_begin";
+                       signal: "elm,state,slide,begin";
+                       action: STATE_SET "state_begin" 0.0;
+                       target: "elm.progress.progressbar";
+                       transition: LINEAR 0.5;
+                       after: "slide_to_end";
+               }
+               program {
+                       name: "start_pulse";
+                       signal: "elm,state,pulse,start";
+                       source: "elm";
+                       after: "slide_to_end";
+               }
+               program {
+                       name: "stop_pulse";
+                       signal: "elm,state,pulse,stop";
+                       source: "elm";
+                       action: ACTION_STOP;
+                       target: "slide_to_begin";
+                       target: "slide_to_end";
+                       target: "start_pulse";
+                       after: "state_pulse";
+               }
+               program {
+                       name: "state_pulse";
+                       signal: "elm,state,pulse"; source: "elm";
+                       action: STATE_SET "state_begin" 0.0;
+                       target: "elm.progress.progressbar";
+                       after: "units_hide";
+               }
+               program {
+                       name: "state_fraction";
+                       signal: "elm,state,fraction";
+                       source: "elm";
+                       action: ACTION_STOP;
+                       target: "slide_to_begin";
+                       target: "slide_to_end";
+                       target: "start_pulse";
+                       action: STATE_SET "default" 0.0;
+                       target: "elm.progress.progressbar";
+               }
+               program {
+                       name: "set_invert_on";
+                       signal: "elm,state,inverted,on";
+                       source: "elm";
+                       action:  STATE_SET "invert" 0.0;
+                       target: "elm.progress.progressbar";
+               }
+               program {
+                       name: "set_invert_off";
+                       signal: "elm,state,inverted,off";
+                       source: "elm";
+                       action:  STATE_SET "default" 0.0;
+                       target: "elm.progress.progressbar";
+               }
+        }
+}
+
diff --git a/res/edc/widgets/slider.edc b/res/edc/widgets/slider.edc
new file mode 100644 (file)
index 0000000..ddd9455
--- /dev/null
@@ -0,0 +1,309 @@
+group { name: "elm/slider/horizontal/progress_slider";
+   parts {
+      part { name: "background"; type: RECT;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: 0 8;
+                       max: 1920 8;
+            color: 255 255 255 64;
+         }
+      }
+      part { name: "bg"; type: RECT;
+         description { state: "default" 0.0;
+            rel1 {
+               to: "pad.left";
+               relative: 1 0.5;
+            }
+            rel2{
+               to: "pad.right";
+               relative: 0 0.5;
+            }
+         }
+      }
+      part { name: "pad.left"; type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: 0 0;
+            max: 0 0;
+            align: 0 0.5;
+         }
+      }
+      part { name: "pad.right"; type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: 0 0;
+            max: 0 0;
+            align: 1 0.5;
+         }
+      }
+      part { name: "base";
+         type: RECT;
+         scale: 1;
+         description { state: "default" 0.0;
+            rel1.to: "background";
+            rel2.to: "background";
+            min: 0 8;
+            max: 99999 8;
+            fixed: 0 1;
+            color: 255 255 255 64;
+         }
+      }
+      part { name: "glow"; mouse_events: 0;
+         scale: 1;
+         type: RECT;
+         description { state: "default" 0.0;
+            rel1.to: "base";
+            rel2 {
+               relative: 0.5 1.0;
+               to_x: "button";
+               to_y: "base";
+            }
+            min: 0 8;
+            max: 99999 8;
+            fixed: 0 1;
+            align: 0.0 0.5;
+            color: 255 255 255 255;
+         }
+         description { state: "focused" 0.0;
+            inherit: "default" 0.0;
+            color: 147 170 0 255;
+                }
+         description { state: "disabled" 0.0;
+            inherit: "default" 0.0;
+            color: 32 9 21 64;
+         }
+      }
+      part { name: "pad.align"; type: SPACER; mouse_events: 0;
+         description { state: "default" 0.0;
+            fixed: 1 1;
+            rel1.to: "elm.dragable.slider";
+            rel2.to: "elm.dragable.slider";
+            align: 0.0 1.0;
+            min: 10 1;
+            max: 10 1;
+         }
+      }
+      part { name: "clip"; type: RECT;
+         scale: 1;
+         description { state: "default" 0.0;
+            color: 255 255 255 0;
+            min: 76 40;
+            max: 76 40;
+            fixed: 1 1;
+            rel1 {
+               to: "elm.dragable.slider";
+               to_y: "bg";
+            }
+            rel2{
+               to: "elm.dragable.slider";
+               to_y: "bg";
+            }
+         }
+      }
+      part { name: "button"; type: GROUP; mouse_events: 1;
+         source: "elm/slider/horizontal/progress_indicator/default";
+         description { state: "default" 0.0;
+            fixed: 1 1;
+            rel1 {
+               to: "elm.dragable.slider";
+               to_y: "bg";
+            }
+            rel2{
+               to: "elm.dragable.slider";
+               to_y: "bg";
+            }
+            align: 0.0 0.5;
+         }
+         description { state: "hidden" 0.0;
+            inherit: "default" 0.0;
+            visible: 0;
+         }
+      }
+      part { name: "elm.swallow.bar"; type: SWALLOW;
+         repeat_events: 1;
+         description { state: "default" 0.0;
+            rel1.to_y: "bg";
+            rel2.to_y: "bg";
+            fixed: 1 1;
+            min: 30 30;
+         }
+      }
+      part { name: "elm.dragable.slider"; type: RECT; mouse_events: 0;
+         scale: 1;
+         dragable.x: 1 1 0;
+         dragable.y: 0 0 0;
+         dragable.confine: "bg";
+         description { state: "default" 0.0;
+            min: 21 0;
+            max: 21 0;
+            rel1 {
+               to_x: "bg";
+               relative: 0 0.5;
+            }
+            rel2 {
+               to_x: "bg";
+               relative: 1 0.5;
+            }
+            color: 0 0 0 0;
+            fixed: 1 1;
+         }
+      }
+      part { name: "elm.track.slider"; type: SWALLOW; mouse_events: 0;
+         description { state: "default" 0.0;
+            max: 21 0;
+            rel1.to: "elm.dragable.slider";
+            rel2.to: "elm.dragable.slider";
+         }
+      }
+      part { name: "event"; type: RECT;
+         description { state: "default" 0.0;
+            color: 0 0 0 0;
+            visible: 0;
+         }
+         description { state: "disabled" 0.0;
+            inherit: "default" 0.0;
+            visible: 1;
+         }
+      }
+   }
+
+   programs {
+      program { name: "startup";
+         signal: "load";
+         source: "";
+         script {
+                emit("highlight,hide", "elm");
+       }
+      }
+      program { name: "focuse_in";
+         signal: "elm,action,focus";
+         source: "elm";
+         script {
+                set_state(PART:"glow", "focused", 0.0);
+                emit("highlight,show", "elm");
+       }
+      }
+      program {  name: "focuse_out";
+         signal: "elm,action,unfocus";
+         source: "elm";
+         script {
+                set_state(PART:"glow", "default", 0.0);
+                emit("highlight,hide", "elm");
+       }
+      }
+      program { name: "text_visible";
+         signal: "elm,state,text,visible";
+         source: "elm";
+         action: STATE_SET "active" 0.0;
+         target: "bg";
+      }
+      program { name: "text_hidden";
+         signal: "elm,state,text,hidden";
+         source: "elm";
+         action: STATE_SET "default" 0.0;
+         target: "bg";
+      }
+      program { name: "disable";
+         signal: "elm,state,disabled";
+         source: "elm";
+         action: STATE_SET "disabled" 0.0;
+         target: "event";
+         target: "glow";
+         target: "base";
+         after: "disable_ind";
+      }
+      program { name: "enable";
+         signal: "elm,state,enabled";
+         source: "elm";
+         action: STATE_SET "default" 0.0;
+         target: "event";
+         target: "glow";
+         target: "base";
+         after: "enable_ind";
+      }
+      program { name: "enable_ind";
+         action: SIGNAL_EMIT "highlight,hide" "elm";
+      }
+      program { name: "disable_ind";
+         action: SIGNAL_EMIT "highlight,disabled" "elm";
+      }
+   }
+}
+
+group { name: "elm/slider/horizontal/progress_indicator/default";
+   alias: "elm/slider/horizontal/popup/default";
+   images{
+      image: IMAGE_SLIDER_NOB_NORMAL COMP;
+      image: IMAGE_SLIDER_NOB_FOCUS COMP;
+   }
+   parts{
+      part { name: "knob";
+         repeat_events: 1;
+         scale: 1;
+         description { state: "default" 0.0;
+            image.normal: IMAGE_SLIDER_NOB_NORMAL;
+            min: 30 30;
+            max: 30 30;
+            align: 0.5 0.5;
+            fixed: 1 1;
+            visible: 0;
+         }
+         description { state: "unfocused" 0.0;
+            inherit: "default" 0.0;
+            visible: 1;
+                }
+         description { state: "focused" 0.0;
+            inherit: "default" 0.0;
+            min: 36 36;
+            max: 36 36;
+            image.normal: IMAGE_SLIDER_NOB_FOCUS;
+            visible: 1;
+         }
+         description { state: "disabled" 0.0;
+            inherit: "default" 0.0;
+            image.normal: IMAGE_SLIDER_NOB_NORMAL;
+            visible: 1;
+         }
+      }
+   }
+   programs {
+      program { name: "highlight_show";
+         signal: "highlight,show";
+         source: "elm";
+         script {
+               set_state(PART:"knob", "focused", 0.0);
+         }
+      }
+      program { name: "highlight_hide";
+         signal: "highlight,hide";
+         source: "elm";
+         script {
+               set_state(PART:"knob", "unfocused", 0.0);
+         }
+      }
+       program { name: "enable";
+         signal: "highlight,enabled";
+         source: "elm";
+         script {
+               set_state(PART:"knob", "default", 0.0);
+         }
+      }
+      program { name: "disable";
+         signal: "highlight,disabled";
+         source: "elm";
+         script {
+               set_state(PART:"knob", "disabled", 0.0);
+         }
+      }
+      /* These events are coming from elementary if alias is popup, otherwise
+      default nob is popping up
+      program { name: "popup_show";
+         signal: "popup,show";
+         source: "elm";
+      }
+      program { name: "popup_hide";
+         signal: "popup,hide";
+         source: "elm";
+      }*/
+   }
+}
diff --git a/res/edc/widgets/style.edc b/res/edc/widgets/style.edc
new file mode 100644 (file)
index 0000000..f6c752e
--- /dev/null
@@ -0,0 +1,4 @@
+
+#define FONT_STYLE_SANS_BOLD "TizenSans:style=Bold"
+#define FONT_STYLE_SANS_REGULAR "TizenSans"
+#define FONT_STYLE_SANS_MEDIUM "TizenSans:style=Medium"
diff --git a/res/images/menubtn.png b/res/images/menubtn.png
new file mode 100644 (file)
index 0000000..9fb8bda
Binary files /dev/null and b/res/images/menubtn.png differ
diff --git a/src/control.c b/src/control.c
new file mode 100644 (file)
index 0000000..51b3d37
--- /dev/null
@@ -0,0 +1,228 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <Elementary.h>
+#include <Eina.h>
+#include <dbg.h>
+#include "define.h"
+#include "i18n.h"
+#include "control.h"
+
+#define MAX_CONTROL_BTNS 7
+
+struct _event_cb {
+       void (*func)(void *data, const char *ev);
+       void *data;
+};
+
+struct control_data {
+       Evas_Object *base;
+       Evas_Object *focused;
+       Evas_Object *btn[MAX_CONTROL_BTNS];
+       int btns;
+       struct _event_cb cb;
+};
+
+static void _event_callback(void *dt, Evas_Object *obj,
+               const char *emission, const char *source)
+{
+       struct control_data *data;
+
+       if (!dt)
+               return;
+
+       data = dt;
+
+       data->cb.func(data->cb.data, source);
+}
+
+static void _btn_mousemove(void *dt, Evas *e, Evas_Object *obj, void *ei)
+{
+       if (!elm_object_focus_get(obj))
+               elm_object_focus_set(obj, EINA_TRUE);
+}
+
+static void _btn_clicked(void *dt, Evas_Object *obj, void *ev)
+{
+       elm_object_signal_emit(obj, SIG_BTN_ANI_START, "");
+}
+
+static void _set_focus_directions(Evas_Object **btn, int count)
+{
+       Evas_Object *obj;
+       int i;
+
+       for (i = 0; i < count; i++) {
+               if (i == count - 1)
+                       obj = btn[0];
+               else
+                       obj = btn[i + 1];
+
+               elm_object_focus_next_object_set(btn[i], obj, ELM_FOCUS_RIGHT);
+
+               if (i == 0)
+                       obj = btn[count - 1];
+               else
+                       obj = btn[i - 1];
+
+               elm_object_focus_next_object_set(btn[i], obj, ELM_FOCUS_LEFT);
+       }
+}
+
+static inline Evas_Object *_add_button(Evas_Object *base, const char *style)
+{
+       Evas_Object *btn;
+
+       btn = elm_button_add(base);
+       if (!btn)
+               return NULL;
+
+       elm_object_style_set(btn, style);
+       evas_object_show(btn);
+
+       return btn;
+}
+
+static int _add_controls(struct control_data *data,
+               const char **btns, int count)
+{
+       int i, j;
+       char buf[32];
+
+       for (i = 0; i < count; i++) {
+               snprintf(buf, sizeof(buf), "video_btn_%s", btns[i]);
+               data->btn[i] = _add_button(data->base, buf);
+               if (!data->btn[i]) {
+                       for (j = 0; j < i; j++)
+                               data->btn[j] = NULL;
+                       return -1;
+               }
+
+               snprintf(buf, sizeof(buf), "part_btn%d", i);
+               elm_object_part_content_set(data->base,
+                               buf, data->btn[i]);
+
+               /* FIXME: disable setting button temporary */
+               if (i == count - 1) {
+                       elm_object_focus_allow_set(data->btn[i], EINA_FALSE);
+                       break;
+               }
+
+               evas_object_smart_callback_add(data->btn[i], SIG_CLICKED,
+                               _btn_clicked, data);
+               elm_object_signal_callback_add(data->btn[i],
+                               SIG_BTN_ANI_FIN, btns[i],
+                               _event_callback, data);
+               evas_object_event_callback_add(data->btn[i],
+                               EVAS_CALLBACK_MOUSE_MOVE,
+                               _btn_mousemove, data);
+
+               elm_object_focus_next_object_set(data->btn[i],
+                               data->btn[i], ELM_FOCUS_DOWN);
+
+               data->btns++;
+       }
+
+       return 0;
+}
+
+Eina_Bool control_add_bar(struct control_data *data,
+               Evas_Object *base, const char **btns, int count)
+{
+       int r;
+
+       if (!data || !base || !btns)
+               return EINA_FALSE;
+
+       data->base = base;
+       data->btns = 0;
+
+       r = _add_controls(data, btns, count);
+       if (r < 0)
+               return EINA_FALSE;
+
+       _set_focus_directions(data->btn, data->btns);
+
+       return EINA_TRUE;
+}
+
+void control_handler_init(struct control_data *data,
+               void (*func)(void *, const char *), void *param)
+{
+       if (!data || !func)
+               return;
+
+       data->cb.func = func;
+       data->cb.data = param;
+}
+
+void control_focus_set(struct control_data *data, int id, Eina_Bool foc)
+{
+       if (!data)
+               return;
+
+       elm_object_focus_set(data->btn[id], foc);
+}
+
+void control_signal_emit(struct control_data *data, int id,
+               const char *emission, const char *source)
+{
+       if (!data)
+               return;
+
+       elm_object_signal_emit(data->btn[id], emission, source);
+}
+
+void control_hide(struct control_data *data)
+{
+       int i;
+
+       for (i = 0; i < data->btns; i++) {
+               evas_object_freeze_events_set(data->btn[i], EINA_TRUE);
+               elm_object_focus_allow_set(data->btn[i], EINA_FALSE);
+       }
+}
+
+void control_show(struct control_data *data)
+{
+       int i;
+
+       for (i = 0; i < data->btns; i++) {
+               evas_object_freeze_events_set(data->btn[i], EINA_FALSE);
+               elm_object_focus_allow_set(data->btn[i], EINA_TRUE);
+       }
+}
+
+void control_fini(struct control_data *data)
+{
+       if (!data)
+               return;
+
+       free(data);
+}
+
+struct control_data *control_init(void)
+{
+       struct control_data *data;
+
+       data = calloc(1, sizeof(*data));
+       if (!data) {
+               _ERR("allocation fail");
+               return NULL;
+       }
+
+       return data;
+}
diff --git a/src/main.c b/src/main.c
new file mode 100644 (file)
index 0000000..cf58408
--- /dev/null
@@ -0,0 +1,184 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <app.h>
+#include <Elementary.h>
+#include <dbg.h>
+#include "define.h"
+#include "view_player.h"
+#include "i18n.h"
+
+#define PARAM_URI "uri"
+#define PARAM_PLAYLIST_ID "playlist_id"
+
+struct _appdata {
+       const char *name;
+       Evas_Object *win;
+
+       struct viewdata *vdata;
+};
+
+static Evas_Object *_add_win(const char *name)
+{
+       Evas_Object *win;
+       Evas_Object *obj;
+       Evas *evas;
+
+       if (!name)
+               return NULL;
+
+       win = elm_win_add(NULL, name, ELM_WIN_BASIC);
+       if (!win)
+               return NULL;
+
+       elm_win_title_set(win, "Video player");
+
+       evas_object_show(win);
+
+       evas = evas_object_evas_get(win);
+       obj = evas_object_rectangle_add(evas);
+       evas_object_color_set(obj, 0, 0, 0, 0);
+       evas_object_render_op_set(obj, EVAS_RENDER_COPY);
+       elm_win_resize_object_add(win, obj);
+       evas_object_show(obj);
+
+       return win;
+}
+
+static bool _create(void *user_data)
+{
+       struct _appdata *ad;
+       Evas_Object *win;
+
+       if (!user_data)
+               return false;
+
+       ad = user_data;
+
+       elm_theme_overlay_add(NULL, THEMEFILE);
+       elm_config_focus_move_policy_set(ELM_FOCUS_MOVE_POLICY_CLICK);
+
+       win = _add_win(ad->name);
+       if (!win)
+               return false;
+
+       ad->win = win;
+
+       elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
+       elm_win_focus_highlight_style_set(win, STYLE_INVISIBLE);
+
+       return true;
+}
+
+static void _terminate(void *user_data)
+{
+       struct _appdata *ad;
+
+       if (!user_data)
+               return;
+
+       ad = user_data;
+
+       view_player_fini(ad->vdata);
+}
+
+static void _pause(void *user_data)
+{
+       struct _appdata *ad;
+
+       if (!user_data) {
+               _ERR("App Data is NULL");
+               return;
+       }
+
+       ad = user_data;
+       if (!ad->vdata)
+               return;
+
+       view_player_pause(ad->vdata);
+}
+
+static void _resume(void *user_data)
+{
+       struct _appdata *ad;
+
+       if (!user_data) {
+               _ERR("App Data is NULL");
+               return;
+       }
+
+       ad = user_data;
+       if (!ad->vdata)
+               return;
+
+       view_player_resume(ad->vdata);
+}
+
+static void _service(service_h service, void *user_data)
+{
+       struct _appdata *ad;
+       struct viewdata *vdata;
+       char *uri;
+       char *playlist_id;
+       int r;
+
+       if (!user_data)
+               return;
+
+       ad = user_data;
+
+       r = service_get_extra_data(service, PARAM_URI, &uri);
+       if (r != SERVICE_ERROR_NONE)
+               uri = NULL;
+
+       r = service_get_extra_data(service, PARAM_PLAYLIST_ID, &playlist_id);
+       if (r != SERVICE_ERROR_NONE)
+               playlist_id = NULL;
+
+       vdata = view_player_init(ad->win, uri, playlist_id);
+
+       free(uri);
+       free(playlist_id);
+
+       if (!vdata)
+               elm_exit();
+
+       if (view_player_create(vdata) == -1)
+               elm_exit();
+
+       ad->vdata = vdata;
+}
+
+int main(int argc, char **argv)
+{
+       struct _appdata ad;
+       app_event_callback_s cbs = {
+               .create = _create,
+               .terminate = _terminate,
+               .pause = _pause,
+               .resume = _resume,
+               .service = _service,
+       };
+
+       memset(&ad, 0x00, sizeof(ad));
+       ad.name = PACKAGE;
+
+       i18n_init();
+
+       app_efl_main(&argc, &argv, &cbs, &ad);
+
+       return 0;
+}
diff --git a/src/mediadata.c b/src/mediadata.c
new file mode 100644 (file)
index 0000000..3395a52
--- /dev/null
@@ -0,0 +1,199 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#include <Elementary.h>
+#include <Eina.h>
+#include <dbg.h>
+#include "define.h"
+#include "mediadata.h"
+
+struct mediadata {
+       char *name;
+       char *path;
+       time_t modified;
+       struct videodata *video_info;
+};
+
+static int g_ref_count;
+
+int mediadata_init(void)
+{
+       int r;
+
+       if (g_ref_count > 0) {
+               g_ref_count++;
+               return -1;
+       }
+
+       r = media_content_connect();
+       if (r != MEDIA_CONTENT_ERROR_NONE) {
+               _ERR("Media Content Connect Failed");
+               return -1;
+       }
+       g_ref_count++;
+
+       return 0;
+}
+
+int mediadata_fini(void)
+{
+       int r;
+
+       if (g_ref_count <= 0)
+               return -1;
+
+       g_ref_count--;
+
+       if (g_ref_count == 0) {
+               r = media_content_disconnect();
+               if (r != MEDIA_CONTENT_ERROR_NONE) {
+                       _ERR("Media Content Connect Failed");
+                       return -1;
+               }
+       }
+
+       return 0;
+}
+
+static void _free_mediadata_item(struct mediadata *md)
+{
+       free(md->name);
+       free(md->path);
+
+       videodata_destroy(md->video_info);
+
+       free(md);
+}
+
+static bool _get_each_media_info(media_info_h media_h, void *dt)
+{
+       struct mediadata *md;
+       int r;
+
+       md = *((struct mediadata **)dt);
+
+       r = media_info_get_display_name(media_h, &(md->name));
+       if (r != MEDIA_CONTENT_ERROR_NONE)
+               goto error;
+
+       r = media_info_get_file_path(media_h, &(md->path));
+       if (r != MEDIA_CONTENT_ERROR_NONE)
+               goto error;
+
+       r = media_info_get_modified_time(media_h, &(md->modified));
+       if (r != MEDIA_CONTENT_ERROR_NONE)
+               goto error;
+
+       md->video_info = videodata_create(media_h);
+       if (!md->video_info)
+               goto error;
+
+       return true;
+
+error:
+       _free_mediadata_item(md);
+       return false;
+}
+
+struct mediadata *mediadata_create(const char *path)
+{
+       filter_h filter;
+       struct mediadata *md;
+       char buf[1024];
+       int r;
+
+       r = media_filter_create(&filter);
+       if (r != MEDIA_CONTENT_ERROR_NONE) {
+               _ERR("Media Filter Creation Failed");
+               return NULL;
+       }
+
+       snprintf(buf, sizeof(buf), "MEDIA_PATH = \"%s\"", path);
+
+       r = media_filter_set_condition(filter, buf,
+                       MEDIA_CONTENT_COLLATE_DEFAULT);
+       if (r != MEDIA_CONTENT_ERROR_NONE) {
+               _ERR("Fail to set filter condition");
+               media_filter_destroy(filter);
+               return NULL;
+       }
+
+       md = calloc(1, sizeof(*md));
+       if (!md) {
+               _ERR("allocation failed");
+               return NULL;
+       }
+
+       r = media_info_foreach_media_from_db(filter,
+                       _get_each_media_info, &md);
+       if (r != MEDIA_CONTENT_ERROR_NONE) {
+               if (r == MEDIA_CONTENT_ERROR_DB_FAILED)
+                       _ERR("MEDIA CONTENT ERROR DB FAILED");
+               else if (r == MEDIA_CONTENT_ERROR_DB_BUSY)
+                       _ERR("MEDIA CONTENT ERROR DB BUSY");
+               else
+                       _ERR("MEDIA CONTENT ERROR");
+
+               free(md);
+               media_filter_destroy(filter);
+
+               return NULL;
+       }
+
+       media_filter_destroy(filter);
+
+       return md;
+}
+
+void mediadata_destroy(struct mediadata *md)
+{
+       if (!md)
+               return;
+
+       _free_mediadata_item(md);
+}
+
+const char *mediadata_get_displayname(struct mediadata *md)
+{
+       if (!md)
+               return NULL;
+
+       return md->name;
+}
+
+const char *mediadata_get_filepath(struct mediadata *md)
+{
+       if (!md)
+               return NULL;
+
+       return md->path;
+}
+
+time_t mediadata_get_modifiedtime(struct mediadata *md)
+{
+       if (!md)
+               return -1;
+
+       return md->modified;
+}
+
+const struct videodata *mediadata_get_video_info(struct mediadata *md)
+{
+       if (!md)
+               return NULL;
+
+       return md->video_info;
+}
diff --git a/src/playermgr.c b/src/playermgr.c
new file mode 100644 (file)
index 0000000..f79b255
--- /dev/null
@@ -0,0 +1,491 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#include <Elementary.h>
+#include <Eina.h>
+#include <dbg.h>
+#include "define.h"
+#include "playermgr.h"
+
+#define SPEED_MAX 5.0
+#define SPEED_MIN -5.0
+
+struct playermgr {
+       player_h player;
+       Evas_Object *win;
+       Eina_List *media_list;
+       float speed;
+       int display_mode;
+       int audio_effect;
+       int current;
+       int total;
+};
+
+static void _destroy_list(Eina_List *list)
+{
+       char *buf;
+
+       if (!list)
+               return;
+
+       EINA_LIST_FREE(list, buf)
+               free(buf);
+}
+
+static Eina_List *_create_list(const char *playlist)
+{
+       Eina_List *list = NULL;
+       FILE *fp;
+       char buf[1024];
+
+       if (!playlist)
+               return NULL;
+
+       fp = fopen(playlist, "r");
+       if (!fp)
+               return NULL;
+
+       while (fscanf(fp, "%s\n", buf) != EOF)
+               list = eina_list_append(list, strdup(buf));
+
+       fclose(fp);
+
+       return list;
+}
+
+static int _get_current(Eina_List *list, const char *path)
+{
+       Eina_List *l;
+       const char *filepath;
+       int cur;
+
+       if (!list || !path)
+               return 0;
+
+       cur = 0;
+
+       EINA_LIST_FOREACH(list, l, filepath) {
+               if (!strcmp(filepath, path))
+                       break;
+               cur++;
+       }
+
+       return cur;
+}
+
+struct playermgr *playermgr_init(Evas_Object *win,
+               const char *path, const char *playlist)
+{
+       struct playermgr *mgr;
+
+       mgr = calloc(1, sizeof(*mgr));
+       if (!mgr) {
+               _ERR("Allocation fail");
+               return NULL;
+       }
+
+       mgr->win = win;
+       mgr->display_mode = E_FULL_SCREEN;
+       mgr->audio_effect = 0;
+
+       mgr->media_list = _create_list(playlist);
+       if (!mgr->media_list) {
+               _ERR("play list is null");
+               free(mgr);
+               return NULL;
+       }
+
+       mgr->current = _get_current(mgr->media_list, path);
+       mgr->total = eina_list_count(mgr->media_list);
+
+       if (player_create(&mgr->player) != PLAYER_ERROR_NONE) {
+               _ERR("PLAYER CREATION ERROR");
+               free(mgr);
+               return NULL;
+       }
+
+
+       return mgr;
+}
+
+static int _play_video(struct playermgr *mgr, const char *path)
+{
+       Ecore_X_Window xwin;
+       int r;
+
+       if (player_set_uri(mgr->player, path) != PLAYER_ERROR_NONE) {
+               _ERR("PLAYER SET URI ERROR");
+               return -1;
+       }
+
+       xwin = elm_win_xwindow_get(mgr->win);
+       r = player_set_display(mgr->player, PLAYER_DISPLAY_TYPE_X11,
+                       GET_DISPLAY(xwin));
+       if (r != PLAYER_ERROR_NONE) {
+               _ERR("SETTING DISPLAY ERROR");
+               return -1;
+       }
+
+       playermgr_set_display_mode(mgr, mgr->display_mode);
+
+       r = player_prepare(mgr->player);
+       if (r != PLAYER_ERROR_NONE) {
+               if (r == PLAYER_ERROR_NOT_SUPPORTED_FILE)
+                       _ERR("PLAYER PREPARE ERROR NOT SUPPORTED FILE %d", r);
+               else if (r == PLAYER_ERROR_INVALID_URI)
+                       _ERR("PLAYER PREPARE ERROR INVALID URI %d", r);
+               else
+                       _ERR("PLAYER PREPARE ERROR");
+
+               return -1;
+       }
+
+       r = player_start(mgr->player);
+       if (r != PLAYER_ERROR_NONE) {
+               _ERR("PLAYER START ERROR");
+               return -1;
+       }
+
+       playermgr_set_audio_effect(mgr, mgr->audio_effect);
+
+       return 0;
+}
+
+int playermgr_stop_video(struct playermgr *mgr)
+{
+       if (!mgr || !mgr->player) {
+               _ERR("invalid parameter");
+               return -1;
+       }
+
+       player_pause(mgr->player);
+       player_stop(mgr->player);
+       player_unprepare(mgr->player);
+
+       return 0;
+}
+
+int playermgr_play_video(struct playermgr *mgr)
+{
+       const char *path;
+       int r;
+
+       if (!mgr || !mgr->media_list) {
+               _ERR("invalid parameter");
+               return -1;
+       }
+
+       r = playermgr_stop_video(mgr);
+       if (r < 0)
+               return r;
+
+       path = playermgr_get_video_path(mgr);
+       r = _play_video(mgr, path);
+
+       return r;
+}
+
+void playermgr_set_prev_video(struct playermgr *mgr)
+{
+       if (!mgr) {
+               _ERR("invalid parameter");
+               return;
+       }
+
+       if (mgr->current == 0)
+               mgr->current = mgr->total - 1;
+       else
+               mgr->current--;
+}
+
+Eina_Bool playermgr_set_next_video(struct playermgr *mgr, Eina_Bool repeat)
+{
+       if (!mgr) {
+               _ERR("invalid parameter");
+               return EINA_FALSE;
+       }
+
+       if (mgr->current == mgr->total - 1) {
+               mgr->current = 0;
+
+               if (!repeat)
+                       return EINA_FALSE;
+       } else {
+               mgr->current++;
+       }
+
+       return EINA_TRUE;
+}
+
+const char *playermgr_get_video_path(struct playermgr *mgr)
+{
+       if (!mgr || !mgr->media_list) {
+               _ERR("invalid parameter");
+               return NULL;
+       }
+
+       return eina_list_nth(mgr->media_list, mgr->current);
+}
+
+void playermgr_fini(struct playermgr *mgr)
+{
+       if (!mgr)
+               return;
+
+       if (mgr->media_list)
+               _destroy_list(mgr->media_list);
+
+       if (mgr->player) {
+               player_pause(mgr->player);
+               player_stop(mgr->player);
+               player_unprepare(mgr->player);
+               player_destroy(mgr->player);
+       }
+
+       free(mgr);
+}
+
+int playermgr_pause(struct playermgr *mgr)
+{
+       if (!mgr || !mgr->player) {
+               _ERR("invalid parameter");
+               return -1;
+       }
+
+       if (player_pause(mgr->player) != PLAYER_ERROR_NONE) {
+               _ERR("Player pause error");
+               return -1;
+       }
+
+       return 0;
+}
+
+int playermgr_resume(struct playermgr *mgr)
+{
+       if (!mgr || !mgr->player) {
+               _ERR("invalid parameter");
+               return -1;
+       }
+
+       if (player_start(mgr->player) != PLAYER_ERROR_NONE) {
+               _ERR("Player resume error");
+               return -1;
+       }
+
+       return 0;
+}
+
+int playermgr_get_state(struct playermgr *mgr, player_state_e *state)
+{
+       int r;
+
+       if (!mgr || !mgr->player) {
+               _ERR("invalid parameter");
+               return -1;
+       }
+
+       r = player_get_state(mgr->player, state);
+       if (r != PLAYER_ERROR_NONE) {
+               _ERR("Player get state error");
+               return -1;
+       }
+
+       return 0;
+}
+
+int playermgr_get_position(struct playermgr *mgr, int *position)
+{
+       int r;
+
+       if (!mgr || !mgr->player) {
+               _ERR("invalid parameter");
+               return -1;
+       }
+
+       /* deprecated */
+       r = player_get_position(mgr->player, position);
+       if (r != PLAYER_ERROR_NONE) {
+               _ERR("Player get position error");
+               return -1;
+       }
+
+       return 0;
+}
+
+int playermgr_seek(struct playermgr *mgr,
+               int sec, player_seek_completed_cb cb, void *data)
+{
+       int r;
+
+       if (!mgr || !mgr->player) {
+               _ERR("invalid parameter");
+               return -1;
+       }
+
+       /* deprecated */
+       r = player_seek(mgr->player, sec, false, cb, data);
+       if (r != PLAYER_ERROR_NONE) {
+               _ERR("Player seek error");
+               return -1;
+       }
+
+       return 0;
+}
+
+int playermgr_set_position(struct playermgr *mgr,
+               int sec, player_seek_completed_cb cb, void *data)
+{
+       int r;
+
+       if (!mgr || !mgr->player) {
+               _ERR("invalid parameter");
+               return -1;
+       }
+
+       /* deprecated */
+       r = player_set_position(mgr->player, sec, cb, data);
+       if (r != PLAYER_ERROR_NONE) {
+               _ERR("Player set position error");
+               return -1;
+       }
+
+       return 0;
+}
+
+int playermgr_set_playback_rate(struct playermgr *mgr, float speed)
+{
+       int r;
+
+       if (!mgr || !mgr->player) {
+               _ERR("invalid parameter");
+               return -1;
+       }
+
+       if (speed > SPEED_MAX)
+               speed = SPEED_MAX;
+       else if (speed < SPEED_MIN)
+               speed = SPEED_MIN;
+
+       r = player_set_playback_rate(mgr->player, speed);
+       if (r != PLAYER_ERROR_NONE) {
+               _ERR("Player set playback error");
+               return -1;
+       }
+
+       mgr->speed = speed;
+
+       return 0;
+}
+
+int playermgr_get_playback_rate(struct playermgr *mgr, float *speed)
+{
+       if (!mgr) {
+               _ERR("invalid parameter");
+               return -1;
+       }
+
+       *speed = mgr->speed;
+
+       return 0;
+}
+
+int playermgr_set_looping(struct playermgr *mgr, bool value)
+{
+       int r;
+
+       if (!mgr || !mgr->player) {
+               _ERR("invalid parameter");
+               return -1;
+       }
+
+       r = player_set_looping(mgr->player, value);
+       if (r != PLAYER_ERROR_NONE) {
+               _ERR("Player set looping error");
+               return -1;
+       }
+
+       return 0;
+}
+
+int playermgr_set_audio_effect(struct playermgr *mgr, int value)
+{
+       /* audio_effect not supported, just return 0 */
+       mgr->audio_effect = value;
+
+       return 0;
+}
+
+int playermgr_set_display_mode(struct playermgr *mgr, int value)
+{
+       int r;
+       int mode;
+
+       if (!mgr || !mgr->player) {
+               _ERR("invalid parameter");
+               return -1;
+       }
+
+       switch (value) {
+       case E_FULL_SCREEN:
+               mode = PLAYER_DISPLAY_MODE_FULL_SCREEN;
+               break;
+       case E_ORIGINAL:
+               mode = PLAYER_DISPLAY_MODE_ORIGIN_SIZE;
+               break;
+       default:
+               _ERR("Invalid value");
+               return -1;
+       }
+
+       r = player_set_display_mode(mgr->player, mode);
+       if (r != PLAYER_ERROR_NONE) {
+               _ERR("Player display mode set error");
+               return -1;
+       }
+
+       mgr->display_mode = value;
+
+       return 0;
+}
+
+int playermgr_set_completed_cb(struct playermgr *mgr,
+               player_completed_cb cb, void *data)
+{
+       int r;
+
+       if (!mgr || !mgr->player) {
+               _ERR("invalid parameter");
+               return -1;
+       }
+
+       r = player_set_completed_cb(mgr->player, cb, data);
+       if (r != PLAYER_ERROR_NONE) {
+               _ERR("Player set completed cb error");
+               return -1;
+       }
+
+       return 0;
+}
+
+void playermgr_get_play_count(struct playermgr *mgr, char *str, int len)
+{
+       if (!mgr) {
+               _ERR("invalid parameter");
+               return;
+       }
+
+       snprintf(str, len, "%d/%d", mgr->current + 1, mgr->total);
+}
diff --git a/src/slider.c b/src/slider.c
new file mode 100644 (file)
index 0000000..f608ce1
--- /dev/null
@@ -0,0 +1,268 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <Elementary.h>
+#include <Eina.h>
+#include <dbg.h>
+#include "define.h"
+#include "playermgr.h"
+#include "slider.h"
+
+#define TIME_STR_START "00:00:00"
+#define TIME_INTERVAL 0.1
+#define SLIDER_STEP 0.05
+
+struct slider_data {
+       Evas_Object *base;
+       Evas_Object *slider;
+       Ecore_Timer *timer;
+       struct playermgr *player;
+};
+
+static void _get_timestr(char *str, int size, unsigned int ms)
+{
+       int sec;
+
+       sec = ms / 1000;
+
+       snprintf(str, size, "%02d:%02d:%02d",
+                       sec / 3600, (sec % 3600) / 60, sec % 60);
+}
+
+static void _slider_btn_mousemove(void *dt, Evas *e, Evas_Object *obj, void *ei)
+{
+       if (!obj)
+               return;
+
+       if (!elm_object_focus_get(obj))
+               elm_object_focus_set(obj, EINA_TRUE);
+}
+
+static void _slider_seek_completed(void *dt)
+{
+       struct slider_data *data;
+       char str[32];
+       int pos, r;
+
+       if (!dt)
+               return;
+
+       data = dt;
+
+       r = playermgr_get_position(data->player, &pos);
+       if (r < 0) {
+               _ERR("Get Position Failed");
+               slider_resume(data);
+               return;
+       }
+
+       _get_timestr(str, sizeof(str), pos);
+       elm_object_part_text_set(data->base, PART_CURTIME_TEXT, str);
+
+       slider_resume(data);
+}
+
+static void _slider_value_changed(void *dt, Evas_Object *obj, void *ev)
+{
+       struct slider_data *data;
+       int v, r;
+
+       if (!dt)
+               return;
+
+       data = dt;
+
+       slider_pause(data);
+
+       v = elm_slider_value_get(obj);
+       r = playermgr_set_position(data->player,
+                       v, _slider_seek_completed, data);
+       if (r < 0)
+               slider_resume(data);
+}
+
+static void _slider_focused(void *dt, Evas_Object *obj, void *ev)
+{
+       struct slider_data *data;
+
+       if (!dt)
+               return;
+
+       data = dt;
+
+       elm_object_signal_emit(data->base, SIG_SLIDER_FOCUS, "");
+}
+
+static void _slider_unfocused(void *dt, Evas_Object *obj, void *ev)
+{
+       struct slider_data *data;
+
+       if (!dt)
+               return;
+
+       data = dt;
+
+       elm_object_signal_emit(data->base, SIG_SLIDER_UNFOCUS, "");
+}
+
+static Eina_Bool _slider_timer_cb(void *dt)
+{
+       struct slider_data *data;
+       int pos, r;
+       char str[32];
+
+       if (!dt)
+               return ECORE_CALLBACK_CANCEL;
+
+       data = dt;
+
+       if (!data->player)
+               goto error;
+
+       r = playermgr_get_position(data->player, &pos);
+       if (r < 0)
+               goto error;
+
+       elm_slider_value_set(data->slider, pos);
+
+       _get_timestr(str, sizeof(str), pos);
+       elm_object_part_text_set(data->base, PART_CURTIME_TEXT, str);
+
+       return ECORE_CALLBACK_RENEW;
+
+error:
+       data->timer = NULL;
+
+       return ECORE_CALLBACK_CANCEL;
+}
+
+static void _slider_set_timer(struct slider_data *data)
+{
+       if (data->timer)
+               ecore_timer_reset(data->timer);
+       else
+               data->timer = ecore_timer_add(TIME_INTERVAL,
+                               _slider_timer_cb, data);
+}
+
+void slider_pause(struct slider_data *data)
+{
+       if (!data)
+               return;
+
+       if (data->timer)
+               ecore_timer_freeze(data->timer);
+}
+
+void slider_resume(struct slider_data *data)
+{
+       if (!data)
+               return;
+
+       if (data->timer)
+               ecore_timer_thaw(data->timer);
+}
+
+void slider_reset(struct slider_data *data, int duration)
+{
+       char str[32];
+
+       if (!data)
+               return;
+
+       ecore_timer_del(data->timer);
+       data->timer = ecore_timer_add(TIME_INTERVAL, _slider_timer_cb, data);
+
+       elm_slider_value_set(data->slider, 0);
+       elm_slider_min_max_set(data->slider, 0, duration);
+
+       _get_timestr(str, sizeof(str), duration);
+       elm_object_part_text_set(data->base, PART_CURTIME_TEXT, TIME_STR_START);
+       elm_object_part_text_set(data->base, PART_TOTALTIME_TEXT, str);
+}
+
+Eina_Bool slider_add_bar(struct slider_data *data, Evas_Object *base,
+               struct playermgr *player)
+{
+       Evas_Object *slider;
+
+       if (!data || !base) {
+               _ERR("invalid parameter");
+               return EINA_FALSE;
+       }
+
+       if (data->slider) {
+               _slider_set_timer(data);
+               return EINA_TRUE;
+       }
+
+       slider = elm_slider_add(base);
+       if (!slider) {
+               _ERR("failed to add slider");
+               return EINA_FALSE;
+       }
+
+       elm_slider_indicator_show_set(slider, EINA_FALSE);
+       elm_slider_indicator_show_on_focus_set(slider, EINA_FALSE);
+       elm_object_style_set(slider, STYLE_SLIDER);
+       elm_slider_horizontal_set(slider, EINA_TRUE);
+       elm_slider_step_set(slider, SLIDER_STEP);
+
+       evas_object_event_callback_add(slider,
+                       EVAS_CALLBACK_MOUSE_MOVE,
+                       _slider_btn_mousemove, data);
+       evas_object_smart_callback_add(slider, SIG_FOCUSED,
+                       _slider_focused, data);
+       evas_object_smart_callback_add(slider, SIG_UNFOCUSED,
+                       _slider_unfocused, data);
+       evas_object_smart_callback_add(slider, SIG_CHANGED,
+                       _slider_value_changed, data);
+
+       elm_object_part_content_set(base, PART_SLIDER, slider);
+
+       data->base = base;
+       data->slider = slider;
+       data->player = player;
+
+       if (player)
+               _slider_set_timer(data);
+       else
+               elm_object_focus_allow_set(slider, EINA_FALSE);
+
+       return EINA_TRUE;
+}
+
+void slider_fini(struct slider_data *data)
+{
+       if (!data)
+               return;
+
+       ecore_timer_del(data->timer);
+       free(data);
+}
+
+struct slider_data *slider_init(void)
+{
+       struct slider_data *data;
+
+       data = calloc(1, sizeof(*data));
+       if (!data) {
+               _ERR("allocation fail");
+               return NULL;
+       }
+
+       return data;
+}
diff --git a/src/timeout_handler.c b/src/timeout_handler.c
new file mode 100644 (file)
index 0000000..65e5861
--- /dev/null
@@ -0,0 +1,161 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#include <Elementary.h>
+#include <Eina.h>
+#include <Ecore.h>
+#include <vconf.h>
+#include "timeout_handler.h"
+#include "dbg.h"
+
+#define NUM_EVENT_HANDLERS 7
+#define VCONF_CURSOR_VISIBILITY_KEY "memory/window_system/input/cursor_visible"
+
+struct timeout_handler {
+       Eina_List *eventhandler_list;
+       Ecore_Timer *timer;
+
+       timeout_event_cb event_cb;
+       void *event_data;
+
+       timeout_event_cb timeout_cb;
+       void *timeout_data;
+
+       double timeout;
+       int cursor;
+};
+
+static Eina_Bool _timer_cb(void *data)
+{
+       struct timeout_handler *handle;
+
+       if (!data)
+               return EINA_FALSE;
+
+       handle = data;
+
+       handle->timeout_cb(handle->timeout_data, 0, NULL);
+       handle->timer = NULL;
+
+       return EINA_FALSE;
+}
+
+static Eina_Bool _event_occured(void *data, int type, void *event)
+{
+       struct timeout_handler *handle;
+       int visible;
+
+       if (!data)
+               return ECORE_CALLBACK_PASS_ON;
+
+       handle = data;
+
+       vconf_get_int(VCONF_CURSOR_VISIBILITY_KEY, &visible);
+       if (handle->cursor && !visible) {
+               handle->cursor = visible;
+               return ECORE_CALLBACK_PASS_ON;
+       }
+
+       handle->cursor = visible;
+
+       if (type == ECORE_EVENT_KEY_UP ||
+                       type == ECORE_EVENT_MOUSE_MOVE)
+               handle->event_cb(handle->event_data, type, event);
+
+       if (handle->timer)
+               ecore_timer_reset(handle->timer);
+       else
+               handle->timer = ecore_timer_add(handle->timeout,
+                               _timer_cb, handle);
+
+       return ECORE_CALLBACK_PASS_ON;
+}
+
+void timeout_handler_reset(struct timeout_handler *handle)
+{
+       if (handle->timer)
+               ecore_timer_reset(handle->timer);
+       else
+               handle->timer = ecore_timer_add(handle->timeout,
+                               _timer_cb, handle);
+}
+
+struct timeout_handler *timeout_handler_init(double timeout,
+               timeout_event_cb timeout_cb, void *timeout_data,
+               timeout_event_cb event_cb, void *event_data)
+{
+       struct timeout_handler *handle;
+       Ecore_Event_Handler *event_handler;
+       int i;
+       int event_type[NUM_EVENT_HANDLERS] = {
+               ECORE_EVENT_KEY_UP,
+               ECORE_EVENT_MOUSE_BUTTON_DOWN,
+               ECORE_EVENT_MOUSE_BUTTON_UP,
+               ECORE_EVENT_MOUSE_MOVE,
+               ECORE_EVENT_MOUSE_WHEEL,
+               ECORE_EVENT_MOUSE_IN,
+               ECORE_EVENT_MOUSE_OUT
+       };
+
+       handle = calloc(1, sizeof(*handle));
+       if (!handle)
+               return NULL;
+
+       for (i = 0; i < NUM_EVENT_HANDLERS; i++) {
+               event_handler = ecore_event_handler_add(
+                               event_type[i], _event_occured, handle);
+               if (!event_handler)
+                       goto error;
+
+               handle->eventhandler_list = eina_list_append(
+                               handle->eventhandler_list, event_handler);
+       }
+
+       handle->timer = ecore_timer_add(timeout, _timer_cb, handle);
+       if (!handle->timer)
+               goto error;
+
+       handle->event_cb = event_cb;
+       handle->event_data = event_data;
+       handle->timeout_cb = timeout_cb;
+       handle->timeout_data = timeout_data;
+       handle->timeout = timeout;
+
+       return handle;
+
+error:
+       timeout_handler_fini(handle);
+
+       return NULL;
+}
+
+void timeout_handler_fini(struct timeout_handler *handle)
+{
+       Ecore_Event_Handler *event_handler;
+
+       if (!handle)
+               return;
+
+       EINA_LIST_FREE(handle->eventhandler_list, event_handler)
+               ecore_event_handler_del(event_handler);
+
+       if (handle->timer) {
+               ecore_timer_del(handle->timer);
+               handle->timer = NULL;
+       }
+
+       free(handle);
+}
diff --git a/src/videodata.c b/src/videodata.c
new file mode 100644 (file)
index 0000000..5e6c4dd
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#include <Elementary.h>
+#include <Eina.h>
+#include <dbg.h>
+#include "define.h"
+#include "videodata.h"
+
+struct videodata {
+       int duration;
+       int position;
+       int width;
+       int height;
+};
+
+void videodata_destroy(struct videodata *video_info)
+{
+       free(video_info);
+       video_info = NULL;
+}
+
+struct videodata *videodata_create(media_info_h media_h)
+{
+       int r;
+       struct videodata *video_info;
+       video_meta_h video_h;
+
+       if (!media_h)
+               return NULL;
+
+       r = media_info_get_video(media_h, &video_h);
+       if (r != MEDIA_CONTENT_ERROR_NONE || !video_h) {
+               _ERR("Media video handle fetch error");
+               return NULL;
+       }
+
+       video_info = calloc(1, sizeof(*video_info));
+       if (!video_info)
+               goto error;
+
+       r = video_meta_get_duration(video_h, &video_info->duration);
+       if (r != MEDIA_CONTENT_ERROR_NONE) {
+               _ERR("video meta get duration error");
+               goto error;
+       }
+
+       r = video_meta_get_width(video_h, &video_info->width);
+       if (r != MEDIA_CONTENT_ERROR_NONE) {
+               _ERR("video meta get width error");
+               goto error;
+       }
+
+       r = video_meta_get_height(video_h, &video_info->height);
+       if (r != MEDIA_CONTENT_ERROR_NONE) {
+               _ERR("video meta get width error");
+               goto error;
+       }
+
+       r = video_meta_get_played_position(video_h, &video_info->position);
+       if (r != MEDIA_CONTENT_ERROR_NONE) {
+               _ERR("video meta get played position error");
+               goto error;
+       }
+
+       video_meta_destroy(video_h);
+
+       return video_info;
+
+error:
+       video_meta_destroy(video_h);
+       videodata_destroy(video_info);
+
+       return NULL;
+}
+
+int videodata_get_duration(const struct videodata *video_info)
+{
+       if (!video_info)
+               return -1;
+
+       return video_info->duration;
+}
+
+int videodata_get_played_position(const struct videodata *video_info)
+{
+       if (!video_info)
+               return -1;
+
+       return video_info->position;
+}
+
+int videodata_get_width(const struct videodata *video_info)
+{
+       if (!video_info)
+               return -1;
+
+       return video_info->width;
+}
+
+int videodata_get_height(const struct videodata *video_info)
+{
+       if (!video_info)
+               return -1;
+
+       return video_info->height;
+}
diff --git a/src/view_player.c b/src/view_player.c
new file mode 100644 (file)
index 0000000..34f8663
--- /dev/null
@@ -0,0 +1,753 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#include <Elementary.h>
+#include <Eina.h>
+#include <utilX.h>
+#include <efl_extension.h>
+#include <dbg.h>
+#include "define.h"
+#include "i18n.h"
+#include "playermgr.h"
+#include "timeout_handler.h"
+#include "mediadata.h"
+#include "control.h"
+#include "volume.h"
+#include "slider.h"
+
+#define BTN_ID "BTN_ID"
+#define TIME_INTERVAL 1.0
+
+#define TEXT_NOVIDEO N_("No Video")
+#define TEXT_NORES N_("---- x ----")
+#define TEXT_NODATE N_("----.--.--")
+#define TEXT_NOSOURCE N_("-")
+
+#define SPEED_MIN 0
+#define SPEED_MAX 3
+
+#define CONTROL_BTNS 7
+
+static const char const *_control_name[] = {
+       "prev",
+       "rew",
+       "playpause",
+       "ff",
+       "next",
+       "repeat",
+       "settings"
+};
+
+static int _speed[] = {
+       0,
+       2000,
+       4000,
+       8000
+};
+
+typedef void (*btn_event_cb)(void *dt);
+
+struct viewdata {
+       Evas_Object *win;
+       Evas_Object *base;
+
+       struct playermgr *player;
+       struct control_data *control;
+       struct volume_data *volume;
+       struct slider_data *slider;
+
+       struct timeout_handler *timeout_handle;
+       bool view_hidden;
+       bool error;
+
+       Ecore_Timer *drawanim_timer;
+       Ecore_Timer *ffrew_timer;
+       int duration;
+       int rew_speed;
+       int ff_speed;
+       int repeat;
+};
+
+enum _control_btn {
+       E_PREV_BTN = 0,
+       E_REW_BTN,
+       E_PLAYPAUSE_BTN,
+       E_FF_BTN,
+       E_NEXT_BTN,
+       E_REPEAT_BTN,
+       E_SETTINGS_BTN
+};
+
+enum _repeat_option {
+       E_REPEAT_ALL = 0,
+       E_REPEAT_ONE,
+       E_REPEAT_NONE
+};
+
+static void _show_view(struct viewdata *data);
+
+struct viewdata *view_player_init(Evas_Object *win, char *path, char *playlist)
+{
+       struct viewdata *data;
+       int r;
+
+       if (!win) {
+               _ERR("invalid parameter");
+               return NULL;
+       }
+
+       data = (struct viewdata *)calloc(1, sizeof(*data));
+       if (!data) {
+               _ERR("alloc failed");
+               return NULL;
+       }
+
+       data->win = win;
+       data->error = false;
+
+       r = mediadata_init();
+       if (r < 0)
+               _ERR("mediadata init failed");
+
+       data->player = playermgr_init(win, path, playlist);
+       if (!data->player)
+               _ERR("player init failed");
+
+       data->control = control_init();
+       if (!data->control)
+               _ERR("control init failed");
+
+       data->volume = volume_init();
+       if (!data->volume)
+               _ERR("volume init failed");
+
+       data->slider = slider_init();
+       if (!data->slider)
+               _ERR("slider init failed");
+
+       return data;
+}
+
+void view_player_fini(struct viewdata *data)
+{
+       if (!data)
+               return;
+
+       if (data->ffrew_timer)
+               ecore_timer_del(data->ffrew_timer);
+
+       if (data->drawanim_timer)
+               ecore_timer_del(data->drawanim_timer);
+
+       mediadata_fini();
+
+       playermgr_fini(data->player);
+
+       volume_fini(data->volume);
+       slider_fini(data->slider);
+       control_fini(data->control);
+
+       timeout_handler_fini(data->timeout_handle);
+
+       free(data);
+}
+
+static void _update_info_bar_err(struct viewdata *data)
+{
+       Evas_Object *obj;
+
+       obj = data->base;
+
+       /* Title */
+       elm_object_part_text_set(obj, PART_TITLETEXT, _(TEXT_NOVIDEO));
+
+       /* Created Time */
+       elm_object_part_text_set(obj, PART_DATETEXT, _(TEXT_NODATE));
+
+       /* Source */
+       elm_object_part_text_set(obj, PART_SOURCETEXT, _(TEXT_NOSOURCE));
+
+       /* Resolution */
+       elm_object_part_text_set(obj, PART_RESOLUTIONTEXT, _(TEXT_NORES));
+}
+
+static int _update_info_bar(struct viewdata *data, struct mediadata *md)
+{
+       const char *name;
+       char buf[32];
+       time_t video_time;
+       struct tm tm;
+       const struct videodata *vd;
+
+       if (!md) {
+               _ERR("invalid parameter");
+               return -1;
+       }
+
+       /* Title */
+       name = mediadata_get_displayname(md);
+       if (name)
+               elm_object_part_text_set(data->base, PART_TITLETEXT, name);
+
+       /* Created Time */
+       video_time = mediadata_get_modifiedtime(md);
+
+       if (video_time > 0) {
+               localtime_r(&video_time, &tm);
+               strftime(buf, sizeof(buf), "%Y.%m.%d", &tm);
+       } else {
+               snprintf(buf, sizeof(buf), "%s", _(TEXT_NODATE));
+       }
+
+       elm_object_part_text_set(data->base, PART_DATETEXT, buf);
+
+       /* Source */
+       /* TODO: temporary, get actual values and set */
+       elm_object_part_text_set(data->base, PART_SOURCETEXT, _("TV"));
+
+       /* Playlist Count */
+       playermgr_get_play_count(data->player, buf, sizeof(buf));
+       elm_object_part_text_set(data->base, PART_CURRENTTEXT, buf);
+
+       /* Resolution */
+       vd = mediadata_get_video_info(md);
+       if (vd) {
+               snprintf(buf, sizeof(buf), "%dx%d",
+                               videodata_get_width(vd),
+                               videodata_get_height(vd));
+
+               data->duration = videodata_get_duration(vd);
+       } else {
+               snprintf(buf, sizeof(buf), "%s", _(TEXT_NORES));
+               data->duration = 0;
+       }
+
+       elm_object_part_text_set(data->base, PART_RESOLUTIONTEXT, buf);
+
+       return 0;
+}
+
+static int _play_video(struct viewdata *data)
+{
+       struct mediadata *md;
+       const char *path;
+       int r;
+
+       r = playermgr_play_video(data->player);
+       if (r < 0)
+               return r;
+
+       path = playermgr_get_video_path(data->player);
+
+       md = mediadata_create(path);
+       if (md) {
+               _update_info_bar(data, md);
+               mediadata_destroy(md);
+       }
+
+       slider_reset(data->slider, data->duration);
+       control_signal_emit(data->control, E_PLAYPAUSE_BTN,
+                       SIG_SET_PAUSE, "");
+
+       if (data->view_hidden) {
+               _show_view(data);
+               timeout_handler_reset(data->timeout_handle);
+       }
+
+       return 0;
+}
+
+static Eina_Bool _ffrew_timer_cb(void *dt)
+{
+       struct viewdata *data;
+       int pos;
+       int r;
+
+       if (!dt)
+               return ECORE_CALLBACK_CANCEL;
+
+       data = dt;
+
+       if (!data->player)
+               return ECORE_CALLBACK_CANCEL;
+
+       playermgr_get_position(data->player, &pos);
+
+       if (data->ff_speed) {
+               pos = pos + _speed[data->ff_speed];
+               if (pos > data->duration)
+                       pos = data->duration;
+       } else if (data->rew_speed) {
+               pos = pos - _speed[data->rew_speed];
+               if (pos < 0)
+                       pos = 0;
+       } else {
+               r = playermgr_resume(data->player);
+               if (r < 0)
+                       return ECORE_CALLBACK_RENEW;
+
+               slider_resume(data->slider);
+
+               return ECORE_CALLBACK_CANCEL;
+       }
+
+       playermgr_seek(data->player, pos, NULL, NULL);
+
+       if (data->rew_speed && pos <= 0) {
+               data->rew_speed = SPEED_MIN;
+               return ECORE_CALLBACK_CANCEL;
+       }
+
+       if (data->ff_speed && pos >= data->duration) {
+               data->ff_speed = SPEED_MIN;
+               return ECORE_CALLBACK_CANCEL;
+       }
+
+       if (ecore_timer_interval_get(data->ffrew_timer) != TIME_INTERVAL)
+               ecore_timer_interval_set(data->ffrew_timer, TIME_INTERVAL);
+
+       return ECORE_CALLBACK_RENEW;
+}
+
+static void _stop_ffrew_timer(struct viewdata *data)
+{
+       if (!data)
+               return;
+
+       data->ff_speed = SPEED_MIN;
+       data->rew_speed = SPEED_MIN;
+
+       if (data->ffrew_timer) {
+               ecore_timer_del(data->ffrew_timer);
+               data->ffrew_timer = NULL;
+       }
+}
+
+static void _start_ffrew_timer(struct viewdata *data)
+{
+       playermgr_pause(data->player);
+       slider_pause(data->slider);
+
+       if (!data->ffrew_timer) {
+               data->ffrew_timer = ecore_timer_add(0.0,
+                               _ffrew_timer_cb, data);
+               if (!data->ffrew_timer)
+                       return;
+       } else {
+               ecore_timer_interval_set(data->ffrew_timer, 0.0);
+               ecore_timer_reset(data->ffrew_timer);
+       }
+
+       control_signal_emit(data->control, E_PLAYPAUSE_BTN,
+                       SIG_SET_PLAY, "");
+}
+
+static void _rewind_btn_clicked(void *dt)
+{
+       struct viewdata *data;
+
+       if (!dt)
+               return;
+
+       data = dt;
+
+       data->ff_speed = SPEED_MIN;
+
+       if (data->rew_speed == SPEED_MAX)
+               return;
+
+       if (data->rew_speed == SPEED_MIN)
+               _start_ffrew_timer(data);
+
+       data->rew_speed++;
+}
+
+static void _forward_btn_clicked(void *dt)
+{
+       struct viewdata *data;
+
+       if (!dt)
+               return;
+
+       data = dt;
+
+       data->rew_speed = SPEED_MIN;
+
+       if (data->ff_speed == SPEED_MAX)
+               return;
+
+       if (data->ff_speed == SPEED_MIN)
+               _start_ffrew_timer(data);
+
+       data->ff_speed++;
+}
+
+static void _prev_btn_clicked(void *dt)
+{
+       struct viewdata *data;
+
+       if (!dt)
+               return;
+
+       data = dt;
+
+       _stop_ffrew_timer(data);
+
+       playermgr_set_prev_video(data->player);
+       _play_video(data);
+}
+
+static void _next_btn_clicked(void *dt)
+{
+       struct viewdata *data;
+
+       if (!dt)
+               return;
+
+       data = dt;
+
+       _stop_ffrew_timer(data);
+
+       playermgr_set_next_video(data->player, EINA_TRUE);
+       _play_video(data);
+}
+
+static void _repeat_btn_clicked(void *dt)
+{
+       struct viewdata *data = dt;
+
+       if (!data)
+               return;
+
+       switch (data->repeat) {
+       case E_REPEAT_ALL:
+               data->repeat = E_REPEAT_ONE;
+               break;
+       case E_REPEAT_ONE:
+               data->repeat = E_REPEAT_NONE;
+               break;
+       case E_REPEAT_NONE:
+               data->repeat = E_REPEAT_ALL;
+               break;
+       default:
+               break;
+       }
+}
+
+static void _settings_btn_clicked(void *dt)
+{
+       struct viewdata *data = dt;
+
+       if (!data)
+               return;
+}
+
+static void _playpause_btn_clicked(void *dt)
+{
+       struct viewdata *data;
+       player_state_e state;
+       int r;
+
+       if (!dt)
+               return;
+
+       data = dt;
+
+       if (data->ff_speed || data->rew_speed) {
+               data->ff_speed = SPEED_MIN;
+               data->rew_speed = SPEED_MIN;
+               return;
+       }
+
+       r = playermgr_get_state(data->player, &state);
+       if (r < 0)
+               return;
+
+       switch (state) {
+       case PLAYER_STATE_PLAYING:
+               playermgr_pause(data->player);
+               slider_pause(data->slider);
+               break;
+
+       case PLAYER_STATE_PAUSED:
+               playermgr_resume(data->player);
+               slider_resume(data->slider);
+               break;
+       default:
+               break;
+       }
+}
+
+static void _control_event(void *dt, const char *ev)
+{
+       struct viewdata *data;
+       btn_event_cb cbs[] = {
+               _prev_btn_clicked,
+               _rewind_btn_clicked,
+               _playpause_btn_clicked,
+               _forward_btn_clicked,
+               _next_btn_clicked,
+               _repeat_btn_clicked,
+               _settings_btn_clicked,
+       };
+       int i;
+
+       if (!dt || !ev)
+               return;
+
+       data = dt;
+
+       for (i = 0; i < CONTROL_BTNS; i++) {
+               if (!strcmp(_control_name[i], ev))
+                       cbs[i](data);
+       }
+}
+
+static void _player_completed(void *dt)
+{
+       struct viewdata *data;
+       Eina_Bool r;
+
+       if (!dt)
+               return;
+
+       data = dt;
+       r = EINA_TRUE;
+
+       if (data->repeat == E_REPEAT_NONE)
+               r = playermgr_set_next_video(data->player, EINA_FALSE);
+       else if (data->repeat == E_REPEAT_ALL)
+               r = playermgr_set_next_video(data->player, EINA_TRUE);
+
+       if (!r)
+               elm_exit();
+
+       _play_video(data);
+}
+
+static void _show_view_finish_cb(void *dt, Evas_Object *obj,
+               const char *emission, const char *source)
+{
+       struct viewdata *data;
+
+       if (!dt)
+               return;
+
+       data = dt;
+
+       control_show(data->control);
+}
+
+static void _show_view(struct viewdata *data)
+{
+       volume_hide_bar(data->volume);
+
+       if (data->view_hidden) {
+               elm_object_signal_emit(data->base, SIG_SHOW_VIEW, "");
+               data->view_hidden = false;
+               slider_resume(data->slider);
+       }
+}
+
+static void _hide_view(struct viewdata *data)
+{
+       elm_object_signal_emit(data->base, SIG_HIDE_VIEW, "");
+       data->view_hidden = true;
+       slider_pause(data->slider);
+
+       control_hide(data->control);
+}
+
+static void _timeout_event(void *dt, int type, void *ev)
+{
+       struct viewdata *data;
+
+       if (!dt)
+               return;
+
+       data = dt;
+
+       if (!data->error)
+               _hide_view(data);
+}
+
+static void _back_event(void *dt, Evas_Object *obj, void *ev)
+{
+       struct viewdata *data;
+
+       if (!dt)
+               return;
+
+       data = dt;
+
+       if (data->view_hidden)
+               _show_view(data);
+       else
+               elm_exit();
+}
+
+static void _handle_volume_key(struct viewdata *data, enum volume_val val)
+{
+       if (!data->view_hidden)
+               _hide_view(data);
+
+       volume_handle_key(data->volume, val);
+}
+
+static void _ecore_event(void *dt, int type, void *ei)
+{
+       struct viewdata *data;
+
+       if (!dt)
+               return;
+
+       data = dt;
+
+       if (type == ECORE_EVENT_KEY_UP) {
+               Evas_Event_Key_Up *ev;
+
+               ev = ei;
+               if (!ev)
+                       return;
+
+               if (!strcmp(ev->keyname, KEY_VOLUMEUP))
+                       _handle_volume_key(data, E_VOLUME_UP);
+               else if (!strcmp(ev->keyname, KEY_VOLUMEDOWN))
+                       _handle_volume_key(data, E_VOLUME_DOWN);
+               else if (!strcmp(ev->keyname, KEY_MUTE))
+                       _handle_volume_key(data, E_VOLUME_MUTE);
+               else
+                       _show_view(data);
+       } else if (type == ECORE_EVENT_MOUSE_MOVE) {
+               _show_view(data);
+       }
+}
+
+static int _add_controls(struct viewdata *data)
+{
+       if (!control_add_bar(data->control, data->base,
+                               _control_name, CONTROL_BTNS))
+               return -1;
+
+       data->rew_speed = 0;
+       data->ff_speed = 0;
+       data->repeat = E_REPEAT_ALL;
+
+       control_handler_init(data->control, _control_event, data);
+
+       if (!slider_add_bar(data->slider, data->base, data->player))
+               return -1;
+
+       if (!volume_add_bar(data->volume, data->win))
+               return -1;
+
+       data->timeout_handle = timeout_handler_init(TIMEOUT_VIDEOPLAYER,
+               _timeout_event, data, _ecore_event, data);
+
+       eext_object_event_callback_add(data->base,
+                       EEXT_CALLBACK_BACK, _back_event, data);
+
+       if (!data->timeout_handle)
+               return -1;
+
+       return 0;
+}
+
+static Eina_Bool _drawanim_timer_cb(void *dt)
+{
+       struct viewdata *data;
+
+       if (!dt)
+               return ECORE_CALLBACK_CANCEL;
+
+       data = dt;
+
+       elm_object_signal_emit(data->base, SIG_SHOW_VIEW, "");
+       control_focus_set(data->control, E_PLAYPAUSE_BTN, EINA_TRUE);
+
+       data->drawanim_timer = NULL;
+
+       return ECORE_CALLBACK_CANCEL;
+}
+
+int view_player_create(struct viewdata *data)
+{
+       Evas_Object *base;
+
+       if (!data) {
+               _ERR("invalid parameter");
+               return -1;
+       }
+
+       /* Create UI */
+       base = elm_layout_add(data->win);
+       if (!base)
+               goto error;
+
+       data->base = base;
+
+       if (!elm_layout_file_set(base, EDJEFILE, GRP_VIDEO_PLAYER))
+               goto error;
+
+       if (_add_controls(data) < 0)
+               goto error;
+
+       evas_object_size_hint_weight_set(base,
+                       EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+       elm_win_resize_object_add(data->win, base);
+
+       evas_object_show(base);
+
+       elm_object_focus_allow_set(base, EINA_FALSE);
+
+       if (_play_video(data) < 0) {
+               _ERR("failed to play video");
+               data->error = true;
+
+               _update_info_bar_err(data);
+               control_hide(data->control);
+               elm_object_signal_emit(data->base, SIG_SHOW_VIEW, "");
+               return 0;
+       }
+
+       playermgr_set_completed_cb(data->player, _player_completed, data);
+
+       elm_object_signal_callback_add(base, "show,view,finish", "",
+                       _show_view_finish_cb, data);
+
+       data->drawanim_timer = ecore_timer_add(0.8, _drawanim_timer_cb, data);
+       if (!data->drawanim_timer)
+               goto error;
+
+       return 0;
+
+error:
+       _ERR("Error in view player create");
+       return -1;
+}
+
+int view_player_pause(struct viewdata *data)
+{
+       elm_exit();
+
+       return 0;
+}
+
+int view_player_resume(struct viewdata *data)
+{
+       return 0;
+}
diff --git a/src/volume.c b/src/volume.c
new file mode 100644 (file)
index 0000000..fb21f81
--- /dev/null
@@ -0,0 +1,217 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#include <Elementary.h>
+#include <Eina.h>
+#include <media/sound_manager.h>
+#include <dbg.h>
+#include "define.h"
+#include "volume.h"
+
+#define TIME_INTERVAL 3.0
+
+struct volume_data {
+       Evas_Object *ly;
+       Evas_Object *bar;
+       Ecore_Timer *timer;
+       int volume;
+       Eina_Bool mute;
+};
+
+static void _set_mute(struct volume_data *data, Eina_Bool mute)
+{
+       int r;
+       int vol;
+
+       if (data->mute == mute)
+               return;
+
+       if (mute) {
+               r = sound_manager_get_volume(SOUND_TYPE_MEDIA, &vol);
+               if (r < 0)
+                       return;
+
+               data->volume = vol;
+               data->mute = EINA_TRUE;
+       } else {
+               sound_manager_set_volume(SOUND_TYPE_MEDIA, data->volume);
+               data->mute = EINA_FALSE;
+       }
+}
+
+static void _handle_volume(struct volume_data *data, enum volume_val val)
+{
+       int vol;
+       int r;
+
+       vol = 0;
+
+       switch (val) {
+       case E_VOLUME_UP:
+       case E_VOLUME_DOWN:
+               _set_mute(data, EINA_FALSE);
+
+               r = sound_manager_get_volume(SOUND_TYPE_MEDIA, &vol);
+               if (r != SOUND_MANAGER_ERROR_NONE) {
+                       _ERR("get volume error");
+                       return;
+               }
+
+               vol += val;
+
+               sound_manager_set_volume(SOUND_TYPE_MEDIA, vol);
+               break;
+       case E_VOLUME_MUTE:
+               _set_mute(data, !data->mute);
+               break;
+       default:
+               break;
+       }
+}
+
+static void _update_volume_bar(struct volume_data *data)
+{
+       double val;
+       int vol;
+       char buf[8];
+       int r;
+
+       if (!data->bar)
+               return;
+
+       r = sound_manager_get_volume(SOUND_TYPE_MEDIA, &vol);
+       if (r != SOUND_MANAGER_ERROR_NONE) {
+               _ERR("get volume error");
+               vol = 0;
+       }
+
+       if (vol == 0 || data->mute) {
+               elm_object_signal_emit(data->ly, SIG_VOLUME_MUTE, "base");
+               val = 0;
+       } else {
+               elm_object_signal_emit(data->ly, SIG_VOLUME_UNMUTE, "base");
+               val = vol * 0.01;
+       }
+
+       elm_progressbar_value_set(data->bar, val);
+
+       snprintf(buf, sizeof(buf), "%d", vol);
+       elm_object_part_text_set(data->ly, PART_VOLUME_VALUE, buf);
+}
+
+static Eina_Bool _volume_timer_cb(void *dt)
+{
+       struct volume_data *data;
+
+       if (!dt)
+               return ECORE_CALLBACK_CANCEL;
+
+       data = dt;
+
+       evas_object_hide(data->ly);
+       data->timer = NULL;
+
+       return ECORE_CALLBACK_CANCEL;
+}
+
+void volume_handle_key(struct volume_data *data, enum volume_val val)
+{
+       if (!data)
+               return;
+
+       if (!data->timer) {
+               data->timer = ecore_timer_add(TIME_INTERVAL,
+                               _volume_timer_cb, data);
+               evas_object_show(data->ly);
+       } else {
+               ecore_timer_reset(data->timer);
+       }
+
+       _handle_volume(data, val);
+       _update_volume_bar(data);
+}
+
+void volume_hide_bar(struct volume_data *data)
+{
+       if (!data->timer)
+               return;
+
+       evas_object_hide(data->ly);
+       ecore_timer_del(data->timer);
+       data->timer = NULL;
+}
+
+Eina_Bool volume_add_bar(struct volume_data *data, Evas_Object *base)
+{
+       Evas_Object *ly;
+       Evas_Object *bar;
+
+       if (!base) {
+               _ERR("failed to get base object");
+               return EINA_FALSE;
+       }
+
+       ly = elm_layout_add(base);
+       if (!ly) {
+               free(data);
+               return EINA_FALSE;
+       }
+
+       elm_layout_file_set(ly, EDJEFILE, GRP_VOLUME);
+       elm_win_resize_object_add(base, ly);
+       evas_object_hide(ly);
+
+       bar = elm_progressbar_add(ly);
+       if (!bar) {
+               _ERR("failed to create progressbar");
+               free(data);
+               evas_object_del(ly);
+               return EINA_FALSE;
+       }
+
+       evas_object_size_hint_weight_set(bar, EVAS_HINT_EXPAND,
+                       EVAS_HINT_EXPAND);
+       elm_progressbar_horizontal_set(bar, EINA_TRUE);
+       elm_object_style_set(bar, STYLE_VOLUME_BAR);
+       elm_object_part_content_set(ly, PART_VOLUME_BAR, bar);
+       evas_object_show(bar);
+
+       data->ly = ly;
+       data->bar = bar;
+
+       return EINA_TRUE;
+}
+
+void volume_fini(struct volume_data *data)
+{
+       ecore_timer_del(data->timer);
+       free(data);
+}
+
+struct volume_data *volume_init(void)
+{
+       struct volume_data *data;
+
+       data = calloc(1, sizeof(*data));
+       if (!data) {
+               _ERR("allocation fail");
+               return NULL;
+       }
+
+       sound_manager_set_session_type(SOUND_SESSION_TYPE_EXCLUSIVE);
+
+       return data;
+}