SContentInfo *ctxtinfo;
int press_status;
- CPlaybackView *parent;
CHandleVolume *pHandleVolume;
SPlaybackView() {
Eina_Bool CPlaybackView::sm_CbLongpressTimer(void *dt)
{
- SPlaybackView *m = (SPlaybackView *)dt;
-
- m->parent->m_HandleOnRepeated();
+ CPlaybackView *root = (CPlaybackView *)dt;
+ if (root)
+ root->m_OnLongpressTimer();
return ECORE_CALLBACK_RENEW;
}
+void CPlaybackView::m_OnLongpressTimer(void)
+{
+ m_HandleOnRepeated();
+}
+
+
Eina_Bool CPlaybackView::sm_CbWaitTimer(void *dt)
{
- SPlaybackView *m = (SPlaybackView *)dt;
+ CPlaybackView *root = (CPlaybackView *)dt;
+ if (root)
+ root->m_OnWaitTimer();
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+void CPlaybackView::m_OnWaitTimer(void)
+{
m->press_status = PRESS_LONG;
if (m->hMusicController->PlayState() == PLAY_STATUS_PLAY) {
/* Handle long press */
- m->parent->m_PlaybackPause();
- m->etLongPress = ecore_timer_add(LP_INTERVAL, sm_CbLongpressTimer, m);
+ m_PlaybackPause();
+ m->etLongPress = ecore_timer_add(LP_INTERVAL, sm_CbLongpressTimer, this);
}
else {
m->press_status = PRESS_LONG_PAUSE;
}
m->etWait = NULL;
- return ECORE_CALLBACK_CANCEL;
}
void CPlaybackView::sm_CbCtxtUpdate(void *dt, enum EActionType type, int lid)
{
- SPlaybackView *m = (SPlaybackView *)dt;
- SItemInfo *itinfo = NULL;
- Elm_Object_Item *focucedItem = NULL;
+ CPlaybackView *root = (CPlaybackView *)dt;
+ if (root)
+ root->m_OnCtxtUpdate(type, lid);
+}
- if (!m)
- return;
+
+void CPlaybackView::m_OnCtxtUpdate(EActionType type, int lid)
+{
+ SItemInfo *itinfo = NULL;
+ Elm_Object_Item *focusedItem = NULL;
if (!m->ctxtinfo || !m->ctxtinfo->context)
return;
- itinfo = m->parent->m_FindItemInfoFromSong(m->elInfo,
+ itinfo = m_FindItemInfoFromSong(m->elInfo,
(CSongInfo *)m->ctxtinfo->context);
if (!itinfo) {
_ERR(" Unable to find song in the list ");
if (type == ACTION_TYPE_DELETE) {
itinfo->check_status = true;
- m->parent->m_DeleteSelectedItems();
+ m_DeleteSelectedItems();
if (!m->mgr->PopView()) {
_ERR("CViewMgr::PopView failed");
return;
}
- focucedItem = m->cs_itinfo->item;
+ SParcel parcel;
+ memset(&parcel, 0, sizeof(SParcel));
+ parcel.updateType = E_PLAYLIST_UPDATE;
+ t_OnUpdate(&parcel);
+
+ focusedItem = m->cs_itinfo->item;
}
else { // ACTION_TYPE_PLAY
if (m->ctxtinfo->status == PLAY_STATUS_PLAY)
- m->parent->m_KeyPausePress();
+ m_KeyPausePress();
else {
if (itinfo == m->cs_itinfo)
- m->parent->m_KeyPlayPress();
+ m_KeyPlayPress();
else
- m->parent->m_HandleGenlistItemActivated(m->eoPlaylist, itinfo->item);
+ m_HandleGenlistItemActivated(m->eoPlaylist, itinfo->item);
}
if (!m->mgr->PopView()) {
return;
}
- focucedItem = m->focused_item;
+ focusedItem = m->focused_item;
}
- elm_object_item_focus_set(focucedItem, EINA_TRUE);
+ if (focusedItem) {
+ elm_genlist_item_show(focusedItem, ELM_GENLIST_ITEM_SCROLLTO_IN);
+ elm_object_item_focus_set(focusedItem, EINA_TRUE);
+ }
}
void CPlaybackView::sm_CbCtxtClose(void *dt)
{
- SPlaybackView *m = (SPlaybackView *)dt;
+ CPlaybackView *root = (CPlaybackView *)dt;
+ if (root)
+ root->m_OnCtxtClose();
+}
- if (!m)
- return;
+void CPlaybackView::m_OnCtxtClose(void)
+{
if (!m->mgr->PopView()) {
_ERR("CViewMgr::PopView failed");
return;
m->press_status = PRESS_SHORT;
m->eoPressedObj = obj;
- m->etWait = ecore_timer_add(WAIT_INTERVAL, sm_CbWaitTimer, m);
+ m->etWait = ecore_timer_add(WAIT_INTERVAL, sm_CbWaitTimer, this);
}
_WHEN_SUCCESS{
m->press_status = PRESS_SHORT;
- m->parent = this;
-
evas_object_data_set(m->eoBase, PLAYBACK_VIEW_DATA, m);
m_AddControlButtons();
m_UpdateCurrentSongInfo();
- if (m->cs_itinfo) {
- elm_genlist_item_show(m->cs_itinfo->item,
- ELM_GENLIST_ITEM_SCROLLTO_IN);
- elm_object_item_focus_set(m->cs_itinfo->item, EINA_TRUE);
- }
-
state = m->hMusicController->PlayState();
if (state == PLAY_STATUS_INITIAL || state == PLAY_STATUS_STOP) {
m_RemovePlaylist();
m_UpdateCurrentSongInfo();
}
+ if (m->cs_itinfo) {
+ elm_genlist_item_show(m->cs_itinfo->item,
+ ELM_GENLIST_ITEM_SCROLLTO_IN);
+ elm_object_item_focus_set(m->cs_itinfo->item, EINA_TRUE);
+ }
+
evas_object_show(m->eoBase);
}
else
ctxtinfo->status = PLAY_STATUS_PAUSE;
- ctxtinfo->cbdata = m;
+ ctxtinfo->cbdata = this;
ctxtinfo->update = sm_CbCtxtUpdate;
ctxtinfo->close = sm_CbCtxtClose;
ctxtinfo->type = CONTEXT_TYPE_PLAYSONG;