2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.tizenopensource.org/license
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #ifndef __DEF_music_H_
19 #define __DEF_music_H_
21 #include <Elementary.h>
28 #include <Ecore_IMF.h>
34 #include <ui-gadget.h>
36 #include <sys/times.h>
38 #include "mp-define.h"
39 #include "mp-player-debug.h"
40 #include "mp-player-drm.h"
42 #include "mp-define.h"
43 #include "mp-playlist-mgr.h"
45 #include "mp-http-mgr.h"
47 #include "mp-language-mgr.h"
48 #include "mp-media-info.h"
50 #include "mp-lyric-view.h"
51 #include "mp-lyric-mgr.h"
52 #include "mp-play-view.h"
55 #ifdef MP_SOUND_PLAYER
56 #include "sp-view-manager.h"
59 E_DBus_Connection *EDBusHandle;
64 /* controlbar tab item */
65 Elm_Object_Item *ctltab_songs;
66 Elm_Object_Item *ctltab_plist;
67 Elm_Object_Item *ctltab_album;
68 Elm_Object_Item *ctltab_artist;
69 Elm_Object_Item *ctltab_genres;
70 Elm_Object_Item *ctltab_year;
71 Elm_Object_Item *ctltab_composer;
72 Elm_Object_Item *ctltab_folder;
82 #define MP_VIEW_DATA_MAGIC 0x801211aa
83 #define MP_SET_VIEW_DATA_MAGIC(view_data) ((view_data_t *)view_data)->magic = MP_VIEW_DATA_MAGIC
84 #define MP_CHECK_VIEW_DATA(view_data) \
86 if (((view_data_t *)view_data)->magic != MP_VIEW_DATA_MAGIC) { \
87 ERROR_TRACE("\n########### ERROR CHECK #############\nPARAM is not view_data\n########### ERROR CHECK #############\n"); \
97 Evas_Object *dali_obj;
99 Ecore_Timer *mouse_up_timer;
100 Ecore_Timer *now_playing_timer;
102 Evas_Object *track_list;
103 Evas_Object *track_genlist;
104 bool show_track_list;
108 Evas_Object *now_playing;
109 Evas_Object *now_playing_icon;
110 Evas_Object *all_tracks;
111 bool all_tracks_click;
112 Evas_Object* ctxpopup;
115 Evas_Object *back_button;
117 int now_playing_album_seq;
122 Ecore_Job *refresh_job;
139 char *thumbnail_path;
149 MP_CREATE_PLAYLIST_MODE_NONE,
150 MP_CREATE_PLAYLIST_MODE_NEW,
151 MP_CREATE_PLAYLIST_MODE_WITHMUSICS,
152 MP_CREATE_PLAYLIST_MODE_SAVEAS,
153 MP_CREATE_PLAYLIST_MODE_SWEEP
158 MP_LAUNCH_DEFAULT = 0, //normal case
159 MP_LAUNCH_BY_PATH, //ug case
160 MP_LAUNCH_ADD_TO_HOME, //add to home
161 MP_LAUNCH_PLAY_RECENT,
170 LOAD_TRACK, //load by path
171 LOAD_GROUP, //load by shortcut
172 LOAD_PLAYLIST, //load by shortcut
179 MP_SPLIT_VIEW_TYPE_NORMAL = 0,
180 MP_SPLIT_VIEW_TYPE_FULL,
181 } mp_split_view_type;
183 typedef struct mp_split_view
186 Evas_Object *left_layout;
187 Evas_Object *right_layout;
189 Evas_Object *fast_index;
190 mp_split_view_type current_split_view_type;
191 Ecore_Timer *idle_timer;
192 Ecore_Idler *idle_idler;
202 MP_POPUP_NOTIFY, // NOT destroyed by mp_popup_destroy()
210 PLAY_STATE_PREPARING,
217 MP_SEND_TYPE_MESSAGE,
219 MP_SEND_TYPE_BLUETOOTH,
226 MP_MORE_BUTTON_TYPE_DEFAULT,
227 MP_MORE_BUTTON_TYPE_TRACK_LIST,
228 MP_MORE_BUTTON_TYPE_MAX,
229 } mp_more_button_type_e;
235 Evas_Object *win_main;
237 Evas_Object *popup[MP_POPUP_MAX];
238 Ecore_Idler *popup_del_idler;
243 #ifdef MP_FEATURE_EXIT_ON_BACK
244 Ecore_Event_Handler *callerWinEventHandler;
245 unsigned int caller_win_id;
247 /* Layout for each view */
248 Evas_Object *conformant;
249 Evas_Object *base_layout_main; //layout for transparent indicator area
250 Evas_Object *naviframe;
251 Evas_Object *controlbar_layout; //layout for show hide controlbar.
253 bool show_optional_menu;
257 Ecore_Timer *progressbar_timer;
259 mp_playing_view *playing_view;
262 // for Plalying Control
263 bool can_play_drm_contents;
264 bool show_now_playing;
266 mp_player_state player_state;
268 Evas_Object *bgimage;
271 mp_constraints_info_s drm_constraints_info;
272 char * latest_playing_key_id;
274 mp_plst_mgr *playlist_mgr;
276 mp_launch_type launch_type; // Support Play from outside
277 mp_load_type loadtype; // Support Add to home
278 mp_track_type_e track_type; // Support voice ui
279 mp_group_type_e group_type; // Support voice ui
281 char *request_group_name;
282 char *request_playing_path;
283 mp_group_type_e request_group_type;
285 // update default view layout if this flag set. set true when album/artist/genre short cut pressed.
286 bool update_default_view;
288 Ecore_IMF_Context *imf_context;
289 #ifdef MP_SOUND_PLAYER
290 Sp_View_Manager *view_mgr;
296 Evas_Object *genlist_edit;
298 Evas_Object *editfiled_new_playlist;
299 Evas_Object *editfiled_entry;
300 char *new_playlist_name;
313 Evas_Object *radio_group;
315 Evas_Object *popup_delete;
316 Evas_Object *notify_delete;
319 Evas_Object *isf_entry;
320 Evas_Object *editfield;
322 bool freeze_indicator_icon; //set it true to prevent flickering play icon of indicator.
324 int ear_key_press_cnt;
325 Ecore_Timer *ear_key_timer;
327 Evas_Object *win_minicon;
328 Evas_Object *minicontroller_layout;
329 Evas_Object *minicon_icon;
330 Ecore_Timer *minicon_timer;
331 Ecore_Timer *minicon_progress_timer;
332 bool b_minicontroller_show;
333 bool minicon_visible;
335 mp_playing_view *backup_playing_view;
336 Evas_Object *backup_layout_play_view; //Used to swap the Playing layout from Landscape and Portrait.
337 mp_split_view *split_view;
338 double latest_moved_left_size;
340 int current_appcore_rm;
341 mp_screen_mode screen_mode;
343 int screen_height; //current screen height
344 int screen_width; //current screen width
346 Evas_Object *edit_ctrl_bar;
348 Ecore_Pipe *inotify_pipe;
350 // for add to playlist
352 mp_media_info_h group_item_handler;
357 mp_http_mgr_t *http_mgr;
359 bool navi_effect_in_progress; // Use this not to excute button callbacks while transition effect
361 bool app_is_foreground; // relaunch only available when music is in pause state
364 bool is_focus_out; // update minicontroller in bgm mode.
366 mp_snd_path snd_path; // indicate sound path;
368 Ecore_Event_Handler *key_down;
369 Ecore_Event_Handler *key_up;
370 Ecore_Event_Handler *mouse_button_down;
371 Ecore_Event_Handler *focus_in;
372 Ecore_Event_Handler *focus_out;
373 Ecore_Event_Handler *visibility_change;
374 Ecore_Event_Handler *client_msg;
375 Ecore_Event_Handler *mouse_button_up;
376 Ecore_Event_Handler *mouse_move;
377 Ecore_Event_Handler *property;
381 Evas_Object *buffering_popup;
384 ui_gadget_h setting_ug;
385 ui_gadget_h info_ug; //info ug handle - Do not destory info ug.
386 Evas_Object *info_ug_base; //if thist is not null, info ug is visible. use this to determine info view is exist or not.
387 Evas_Object *info_ug_layout; //do not del this object. if it is deleted, info ug layout will not be displayed properly.
388 bool info_click_flag; //flag for click info button in play view
389 bool info_back_play_view_flag; //flag for info view back play view
391 bool edit_in_progress; // don't update view in inotify callback while delete operation.
393 Ecore_Timer *volume_down_timer;
394 Ecore_Timer *mute_popup_show_timer; //timer for showing mute popup
395 bool volume_long_pressed;
396 bool mute_flag; //flag for mute
398 double ff_rew; // for ff and rew when there is no play view
400 bool music_setting_change_flag; //true for change music setting data, false for not
402 bool load_play_view; /*set it true if play view must be displayed directly when app is launching*/
407 Ecore_Idler *mss_startup_idler;
408 Ecore_Idler *bt_pause_idler;
409 Ecore_Idler *setting_idler;
410 Ecore_Idler *app_init_idler;
411 Ecore_Idler *playview_show_idler;
413 Ecore_Timer *longpress_timer;
416 mp_lyric_mgr_t *lyric_mgr;
417 mp_lyric_view_t *lyric_view;
419 bool vertical_scroll;
421 char *shortcut_descrition;
423 Ecore_Animator *minfo_ani;
425 Evas_Object *minfo_genlist;
427 bool direct_win_minimize;
432 bool paused_by_other_player;
434 mp_track_info_t *current_track_info;
439 #ifdef MP_FEATURE_AUTO_OFF
440 Ecore_Timer *auto_off_timer;
441 Ecore_Timer *pause_off_timer;
445 Evas_Object *more_btn_popup;
446 mp_more_button_type_e more_btn_type;
451 typedef void (*mpOptCallBack) (void *, Evas_Object *, void *);
461 MpOptItemType *l_opt;
462 MpOptItemType *m_opt;
463 MpOptItemType *r_opt;
466 #endif /* __DEF_music_H__ */