2 * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef __PLAYBACK_CONTROLLER_H__
18 #define __PLAYBACK_CONTROLLER_H__
20 class CPlaybackController :
22 public IMusicControllerListener,
23 public IPressedListener,
24 public IUnpressedListener,
25 public IMouseMoveListener,
26 public IMouseClickedListener {
30 int(*OnCurrentSongCount)(void *cookie);
34 struct SPlaybackController *m;
37 static void sm_CbCtxPopupBtnSelected(void* cookie, CContextPopup* instance, const char* text);
38 void m_OnCtxPopupBtnSelected(CContextPopup* instance, const char* text);
40 static void sm_CbErrorPopupBtnSelected(void* cookie, CMessagePopup *instance);
41 void m_OnErrorPopupBtnSelected(CMessagePopup *instance);
43 static Eina_Bool sm_CbWaitTimer(void *dt);
44 void m_OnWaitTimer(void);
46 static Eina_Bool sm_CbLongpressTimer(void *dt);
47 void m_OnLongpressTimer(void);
50 void m_AddControlButtons(void);
51 void m_AddEditPlaylistButtons(void);
52 void m_CreateErrorPopup(void);
53 void m_DestroyErrorPopup(void);
54 void m_CreateSettingsPopup(void);
55 void m_DestroySettingsPopup(void);
56 void m_UpdateForEmptySong(void);
58 void m_HandleForwardBtnClicked(Evas_Object *obj);
59 void m_HandleRewindBtnClicked(Evas_Object *obj);
60 void m_HandleOnRepeated(void);
61 void m_HandleOnPressed(Evas_Object *obj);
62 void m_HandleOnUnpressed(Evas_Object *obj);
64 void m_RemoveTimer(int timer_code);
65 void m_UpdateSongInfo(void);
70 CPlaybackController() :
71 IPressedListener(this),
72 IUnpressedListener(this),
73 IMouseMoveListener(this),
74 IMouseClickedListener(this),
76 virtual ~CPlaybackController() {}
78 bool Create(Evas_Object *eoBase, SCallback *cb);
79 virtual void Destroy(void);
81 Evas_Object *ControlBtnsObject(EPlayerControlBtns id);
82 Evas_Object *EditBtnsObject(EPlayerEditBtns id);
85 //! This function is invoked when new song is played.
86 virtual void OnStartPlayback(void);
87 //! This function is invoked when error is occured.
88 virtual void OnError(void);
89 //! This function is invoked when playlist is empty.
90 virtual void OnEmptyPlaylist(void);
91 //! This function is invoked when remote button is pressed.
92 virtual void OnRemoteButtonEvent(Evas_Object *eoBtn, EPlayerBtnsEvent ev);
93 //! This function is invoked when player UI need to be updated.
94 virtual void OnUpdatePlayerUI(void);
96 virtual void OnPressed(int id, Evas_Object *obj);
97 virtual void OnUnpressed(int id, Evas_Object *obj);
98 virtual void OnMouseMove(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev);
99 virtual void OnMouseClicked(int id, Evas_Object *obj);
102 #endif // __PLAYBACK_CONTROLLER_H__