struct SPlaybackView* m;
private:
- //static Eina_Bool sm_CbUpdateSlider(void *dt);
-
static Eina_Bool sm_CbLongpressTimer(void *dt);
void m_OnLongpressTimer(void);
_CREATE_BEGIN{
Evas_Object *layout = NULL;
- CAlbumSongsLayout *layoutAlbumSongs = NULL;
SParcel parcel;
_CHECK(m = new SAlbumLayout)
_CHECK(CExtBaseLayout::Create(layout))
_CHECK(m->layoutAlbumSongs = new CAlbumSongsLayout(MUSIC_ALBUM_SONGS_LAYOUT))
_CHECK(m->layoutAlbumSongs->Create(mgr))
- _CHECK(mgr->AddLayout(layoutAlbumSongs))
+ _CHECK(mgr->AddLayout(m->layoutAlbumSongs))
_WHEN_SUCCESS{
if (albumId) {
m->vmgr->UpdateView((const char *)MUSIC_BASE_VIEW, &parcel);
}
- _CHECK_FAIL{ mgr->RemoveLayout(layoutAlbumSongs); }
+ _CHECK_FAIL{ mgr->RemoveLayout(m->layoutAlbumSongs); }
_CHECK_FAIL{ m->layoutAlbumSongs->Destroy(); }
_CHECK_FAIL{ delete m->layoutAlbumSongs; }
_CHECK_FAIL{ CExtBaseLayout::Destroy(); }
ASSERT(!m);
_CREATE_BEGIN{
- Evas_Object *win = NULL;
- Evas_Object *base = NULL;
- CMusicController *pController = NULL;
- CLayoutMgr *lmgr = NULL;
- CSongLayout *layoutSong = NULL;
- CAlbumLayout *layoutAlbum = NULL;
- CArtistLayout*layoutArtist = NULL;
- CGenreLayout *layoutGenre = NULL;
- CPlaylistLayout *layoutPlaylists = NULL;
- CFolderLayout *layoutFolder = NULL;
- CHandleVolume *handleVolume = NULL;
-
_CHECK(m = new SMusicBaseView)
- _CHECK(win = CViewMgr::GetInstance()->Window())
+ _CHECK(m->win = CViewMgr::GetInstance()->Window())
_CHECK(m->pController = new CMusicController)
_CHECK(m->pController->Create())
- _CHECK(base = CCommonUI::AddBase(win, MUSIC_BASE_VIEW))
- _CHECK(lmgr = new CLayoutMgr)
- _CHECK(lmgr->Create(base, NULL))
+ _CHECK(m->base = CCommonUI::AddBase(m->win, MUSIC_BASE_VIEW))
+ _CHECK(m->lmgr = new CLayoutMgr)
+ _CHECK(m->lmgr->Create(m->base, NULL))
_CHECK(CBaseView::Create(data))
- _CHECK(layoutSong = new CSongLayout(MUSIC_SONG_LAYOUT))
- _CHECK(layoutSong->Create(lmgr, m_Argument(data)))
- _CHECK(lmgr->AddLayout(layoutSong))
- _CHECK(layoutAlbum = new CAlbumLayout(MUSIC_ALBUM_LAYOUT))
- _CHECK(layoutAlbum->Create(lmgr, m_Argument(data)))
- _CHECK(lmgr->AddLayout(layoutAlbum))
- _CHECK(layoutArtist = new CArtistLayout(MUSIC_CATEGORY_ARTIST_LAYOUT))
- _CHECK(layoutArtist->Create(lmgr))
- _CHECK(lmgr->AddLayout(layoutArtist))
- _CHECK(layoutGenre = new CGenreLayout(MUSIC_CATEGORY_GENRE_LAYOUT))
- _CHECK(layoutGenre->Create(lmgr))
- _CHECK(lmgr->AddLayout(layoutGenre))
- _CHECK(layoutPlaylists = new CPlaylistLayout(MUSIC_CATEGORY_PLAYLISTS_LAYOUT))
- _CHECK(layoutPlaylists->Create(lmgr))
- _CHECK(lmgr->AddLayout(layoutPlaylists))
- _CHECK(layoutFolder = new CFolderLayout(MUSIC_FOLDER_LAYOUT))
- _CHECK(layoutFolder->Create(lmgr))
- _CHECK(lmgr->AddLayout(layoutFolder))
- _CHECK(handleVolume = new CHandleVolume)
- _CHECK(handleVolume->Create(base))
- _CHECK(pController->AddListener(this))
+ _CHECK(m->layoutSong = new CSongLayout(MUSIC_SONG_LAYOUT))
+ _CHECK(m->layoutSong->Create(m->lmgr, m_Argument(data)))
+ _CHECK(m->lmgr->AddLayout(m->layoutSong))
+ _CHECK(m->layoutAlbum = new CAlbumLayout(MUSIC_ALBUM_LAYOUT))
+ _CHECK(m->layoutAlbum->Create(m->lmgr, m_Argument(data)))
+ _CHECK(m->lmgr->AddLayout(m->layoutAlbum))
+ _CHECK(m->layoutArtist = new CArtistLayout(MUSIC_CATEGORY_ARTIST_LAYOUT))
+ _CHECK(m->layoutArtist->Create(m->lmgr))
+ _CHECK(m->lmgr->AddLayout(m->layoutArtist))
+ _CHECK(m->layoutGenre = new CGenreLayout(MUSIC_CATEGORY_GENRE_LAYOUT))
+ _CHECK(m->layoutGenre->Create(m->lmgr))
+ _CHECK(m->lmgr->AddLayout(m->layoutGenre))
+ _CHECK(m->layoutPlaylists = new CPlaylistLayout(MUSIC_CATEGORY_PLAYLISTS_LAYOUT))
+ _CHECK(m->layoutPlaylists->Create(m->lmgr))
+ _CHECK(m->lmgr->AddLayout(m->layoutPlaylists))
+ _CHECK(m->layoutFolder = new CFolderLayout(MUSIC_FOLDER_LAYOUT))
+ _CHECK(m->layoutFolder->Create(m->lmgr))
+ _CHECK(m->lmgr->AddLayout(m->layoutFolder))
+ _CHECK(m->pHandleVolume = new CHandleVolume)
+ _CHECK(m->pHandleVolume->Create(m->base))
+ _CHECK(m->pController->AddListener(this))
_WHEN_SUCCESS{
- m->base = base;
- m->win = win;
- m->pController = pController;
- m->lmgr = lmgr;
m->fresh_view = true;
m->arglist = (SArgList *)data;
- m->layoutSong = layoutSong;
- m->layoutAlbum = layoutAlbum;
- m->layoutArtist = layoutArtist;
- m->layoutGenre = layoutGenre;
- m->layoutPlaylists = layoutPlaylists;
- m->layoutFolder = layoutFolder;
-
m->layoutAlbum->SetEmptyStatusHandleCallback(sm_CbHandleEmptyStatus, this);
m->layoutArtist->SetEmptyStatusHandleCallback(sm_CbHandleEmptyStatus, this);
m->layoutGenre->SetEmptyStatusHandleCallback(sm_CbHandleEmptyStatus, this);
m->layoutPlaylists->SetEmptyStatusHandleCallback(sm_CbHandleEmptyStatus, this);
- m->pHandleVolume = handleVolume;
-
elm_object_part_content_unset(m->base, MUSIC_PART_CONTENT);
m_SetSourceType();
evas_object_data_set(m->base, BASE_VIEW_DATA, m);
}
_CHECK_FAIL{ m->pController->RemoveListener(this); }
- _CHECK_FAIL{ handleVolume->Destroy(); }
- _CHECK_FAIL{ delete handleVolume; }
- _CHECK_FAIL{ lmgr->RemoveLayout(layoutFolder); }
- _CHECK_FAIL{ layoutFolder->Destroy(); }
- _CHECK_FAIL{ delete layoutFolder; }
- _CHECK_FAIL{ lmgr->RemoveLayout(layoutPlaylists); }
- _CHECK_FAIL{ layoutPlaylists->Destroy(); }
- _CHECK_FAIL{ delete layoutPlaylists; }
- _CHECK_FAIL{ lmgr->RemoveLayout(layoutGenre); }
- _CHECK_FAIL{ layoutGenre->Destroy(); }
- _CHECK_FAIL{ delete layoutGenre; }
- _CHECK_FAIL{ lmgr->RemoveLayout(layoutArtist); }
- _CHECK_FAIL{ layoutArtist->Destroy(); }
- _CHECK_FAIL{ delete layoutArtist; }
- _CHECK_FAIL{ lmgr->RemoveLayout(layoutAlbum); }
- _CHECK_FAIL{ layoutAlbum->Destroy(); }
- _CHECK_FAIL{ delete layoutAlbum; }
- _CHECK_FAIL{ lmgr->RemoveLayout(layoutSong); }
- _CHECK_FAIL{ layoutSong->Destroy(); }
- _CHECK_FAIL{ delete layoutSong; }
+ _CHECK_FAIL{ m->pHandleVolume->Destroy(); }
+ _CHECK_FAIL{ delete m->pHandleVolume; }
+ _CHECK_FAIL{ m->lmgr->RemoveLayout(m->layoutFolder); }
+ _CHECK_FAIL{ m->layoutFolder->Destroy(); }
+ _CHECK_FAIL{ delete m->layoutFolder; }
+ _CHECK_FAIL{ m->lmgr->RemoveLayout(m->layoutPlaylists); }
+ _CHECK_FAIL{ m->layoutPlaylists->Destroy(); }
+ _CHECK_FAIL{ delete m->layoutPlaylists; }
+ _CHECK_FAIL{ m->lmgr->RemoveLayout(m->layoutGenre); }
+ _CHECK_FAIL{ m->layoutGenre->Destroy(); }
+ _CHECK_FAIL{ delete m->layoutGenre; }
+ _CHECK_FAIL{ m->lmgr->RemoveLayout(m->layoutArtist); }
+ _CHECK_FAIL{ m->layoutArtist->Destroy(); }
+ _CHECK_FAIL{ delete m->layoutArtist; }
+ _CHECK_FAIL{ m->lmgr->RemoveLayout(m->layoutAlbum); }
+ _CHECK_FAIL{ m->layoutAlbum->Destroy(); }
+ _CHECK_FAIL{ delete m->layoutAlbum; }
+ _CHECK_FAIL{ m->lmgr->RemoveLayout(m->layoutSong); }
+ _CHECK_FAIL{ m->layoutSong->Destroy(); }
+ _CHECK_FAIL{ delete m->layoutSong; }
_CHECK_FAIL{ CBaseView::Destroy(); }
- _CHECK_FAIL{ lmgr->Destroy(); }
- _CHECK_FAIL{ delete lmgr; }
+ _CHECK_FAIL{ m->lmgr->Destroy(); }
+ _CHECK_FAIL{ delete m->lmgr; }
_CHECK_FAIL{ evas_object_del(m->base); }
_CHECK_FAIL{ m->pController->Destroy(); }
_CHECK_FAIL{ delete m->pController; }
_CREATE_BEGIN{
_CHECK(m = new SSliderWidget)
+ _COMMAND{ m->eoBase = eoBase; }
_CHECK(m->controller.Create())
_CHECK(m->controller.AddListener(this))
_CHECK(m_AddSlider())
Evas_Object *eoBtnEdit[TOTAL_EDIT_BTNS];
Evas_Object *eoAlbumCover;
- //Evas_Object *eoSlider;
CSliderWidget *pSliderWidget;
Evas_Object *eoPressedObj;
};
enum ETimers {
- //TIMER_SLIDER,
TIMER_WAIT,
TIMER_LONGPRESS,
TIMER_VOLUME
int state;
state = m->pController->PlayState();
- if (state != PLAY_STATUS_STOP) {
- elm_object_disabled_set(m->eoBtnControl[BTN_FORWARD], EINA_FALSE);
- elm_object_disabled_set(m->eoBtnControl[BTN_REWIND], EINA_FALSE);
- }
- else {
+ switch (state) {
+ case PLAY_STATUS_INITIAL:
+ // Initial State, Do nothing
+ break;
+
+ case PLAY_STATUS_STOP:
if (!m->eoErrPopup)
- elm_object_focus_set(m->eoBtnControl[BTN_PLAY], EINA_TRUE);
+ elm_object_focus_set(m->eoBtnControl[BTN_PLAY], EINA_TRUE);
elm_object_disabled_set(m->eoBtnControl[BTN_FORWARD], EINA_TRUE);
- elm_object_disabled_set(m->eoBtnControl[BTN_REWIND], EINA_TRUE);
- }
+ elm_object_disabled_set(m->eoBtnControl[BTN_REWIND], EINA_TRUE);
+ break;
- if (state == PLAY_STATUS_PLAY) {
- elm_object_signal_emit(m->eoBtnControl[BTN_PLAY], MUSIC_SIGNAL_PLAY, MUSIC_PLAYBACK_VIEW);
- }
- else {
- elm_object_signal_emit(m->eoBtnControl[BTN_PLAY], MUSIC_SIGNAL_PAUSE, MUSIC_PLAYBACK_VIEW);
+ case PLAY_STATUS_PLAY:
+ elm_object_disabled_set(m->eoBtnControl[BTN_FORWARD], EINA_FALSE);
+ elm_object_disabled_set(m->eoBtnControl[BTN_REWIND], EINA_FALSE);
+ elm_object_signal_emit(m->eoBtnControl[BTN_PLAY],
+ MUSIC_SIGNAL_PLAY, MUSIC_PLAYBACK_VIEW);
+ break;
+
+ case PLAY_STATUS_PAUSE:
+ elm_object_disabled_set(m->eoBtnControl[BTN_FORWARD], EINA_FALSE);
+ elm_object_disabled_set(m->eoBtnControl[BTN_REWIND], EINA_FALSE);
+ elm_object_signal_emit(m->eoBtnControl[BTN_PLAY],
+ MUSIC_SIGNAL_PAUSE, MUSIC_PLAYBACK_VIEW);
+ break;
+
+ default:
+ ASSERT(!"Invalid State");
+ break;
}
state = m->pController->ShuffleState();
- if (state == SHUFFLE_STATUS_OFF) {
- elm_object_signal_emit(m->eoBtnControl[BTN_SHUFFLE], MUSIC_SIGNAL_SHUFFLE_OFF, MUSIC_PLAYBACK_VIEW);
- }
- else {
- elm_object_signal_emit(m->eoBtnControl[BTN_SHUFFLE], MUSIC_SIGNAL_SHUFFLE_ON, MUSIC_PLAYBACK_VIEW);
+ switch (state) {
+ case SHUFFLE_STATUS_OFF:
+ elm_object_signal_emit(m->eoBtnControl[BTN_SHUFFLE],
+ MUSIC_SIGNAL_SHUFFLE_OFF, MUSIC_PLAYBACK_VIEW);
+ break;
+
+ case SHUFFLE_STATUS_ON:
+ elm_object_signal_emit(m->eoBtnControl[BTN_SHUFFLE],
+ MUSIC_SIGNAL_SHUFFLE_ON, MUSIC_PLAYBACK_VIEW);
+ break;
+
+ default:
+ ASSERT(!"Invalid State");
+ break;
}
state = m->pController->RepeatState();
- if (state == REPEAT_STATUS_NONE) {
- elm_object_signal_emit(m->eoBtnControl[BTN_REPEAT], MUSIC_SIGNAL_REPEAT_OFF, MUSIC_PLAYBACK_VIEW);
- }
- else if (state == REPEAT_STATUS_ALL) {
- elm_object_signal_emit(m->eoBtnControl[BTN_REPEAT], MUSIC_SIGNAL_REPEAT_ALL, MUSIC_PLAYBACK_VIEW);
- }
- else {
- elm_object_signal_emit(m->eoBtnControl[BTN_REPEAT], MUSIC_SIGNAL_REPEAT_ONE, MUSIC_PLAYBACK_VIEW);
+ switch (state) {
+ case REPEAT_STATUS_NONE:
+ elm_object_signal_emit(m->eoBtnControl[BTN_REPEAT],
+ MUSIC_SIGNAL_REPEAT_OFF, MUSIC_PLAYBACK_VIEW);
+ break;
+
+ case REPEAT_STATUS_ALL:
+ elm_object_signal_emit(m->eoBtnControl[BTN_REPEAT],
+ MUSIC_SIGNAL_REPEAT_ALL, MUSIC_PLAYBACK_VIEW);
+ break;
+
+ case REPEAT_STATUS_ONE:
+ elm_object_signal_emit(m->eoBtnControl[BTN_REPEAT],
+ MUSIC_SIGNAL_REPEAT_ONE, MUSIC_PLAYBACK_VIEW);
+ break;
+
+ default:
+ ASSERT(!"Invalid State");
+ break;
}
}
{
elm_object_focus_next_object_set(m->pSliderWidget->Base(), m->eoPlaylist, ELM_FOCUS_UP);
elm_object_focus_next_object_set(m->pSliderWidget->Base(), m->eoBtnControl[BTN_PLAY], ELM_FOCUS_DOWN);
- if (m->pController->PlayState() == PLAY_STATUS_STOP) {
+ switch (m->pController->PlayState()) {
+ case PLAY_STATUS_INITIAL:
+ // Do nothing
+ break;
+
+ case PLAY_STATUS_STOP:
elm_object_focus_next_object_set(m->eoPlaylist, m->eoBtnControl[BTN_PLAY], ELM_FOCUS_LEFT);
elm_object_focus_next_object_set(m->eoBtnControl[BTN_PLAY], m->eoPlaylist, ELM_FOCUS_RIGHT);
- }
- else {
+ elm_object_focus_next_object_set(m->eoBtnControl[BTN_PLAY], m->eoBtnControl[BTN_REPEAT], ELM_FOCUS_LEFT);
+ elm_object_focus_next_object_set(m->eoBtnControl[BTN_REPEAT], m->eoBtnControl[BTN_PLAY], ELM_FOCUS_RIGHT);
+ elm_object_signal_emit(m->eoBtnControl[BTN_PLAY], MUSIC_SIGNAL_PAUSE, MUSIC_PLAYBACK_VIEW);
+ break;
+
+ case PLAY_STATUS_PLAY:
+ case PLAY_STATUS_PAUSE:
elm_object_focus_next_object_set(m->eoPlaylist,
m->eoBtnControl[BTN_FORWARD], ELM_FOCUS_LEFT);
elm_object_focus_next_object_set(m->eoBtnControl[BTN_FORWARD],
m->eoPlaylist, ELM_FOCUS_RIGHT);
elm_object_focus_next_object_set(m->eoBtnControl[BTN_PLAY],
m->eoBtnControl[BTN_FORWARD], ELM_FOCUS_RIGHT);
+ break;
+
+ default:
+ ASSERT(!"Invalid State");
+ break;
}
}
m_UpdateCurrentSongItem(index);
m_UpdateCurrentSongLabels();
m_UpdateCurrentSongThumbnail();
- //m_UpdateCurrentSongProgressbar();
m_UpdateControlBtns();
m_UpdatePlaymodeFocusSequence();
}
obj = m->eoPressedObj;
- m->pController->GetPosition(&value); //value = elm_slider_value_get(m->eoSlider);
+ m->pController->GetPosition(&value);
duration = m->cs_itinfo->sinfo->Duration();
if (obj == m->eoBtnControl[BTN_REWIND]) {
Eina_List *l = NULL, *l_next = NULL;
SItemInfo *pItemInfo = NULL;
void *obj = NULL;
+ bool updateFlag = false;
int index;
m_DisableEditButtons(true);
pItemInfo = (SItemInfo *)obj;
if (pItemInfo->check_status) {
if (m->cs_itinfo == pItemInfo) {
+ updateFlag = true;
m_UnselectItem(m->cs_itinfo);
m->cs_itinfo = NULL;
m->pController->SetPlayState(PLAY_STATUS_STOP);
return;
}
+ if (updateFlag)
+ m_UpdateCurrentSongInfo();
+
elm_genlist_realized_items_update(m->eoPlaylist);
elm_object_focus_set(m->eoBtnEdit[BTN_CANCEL], EINA_TRUE);
}
{
if (m->eoCtxPopup) {
m_DestroySettingsPopup();
- //elm_object_focus_set(m->eoBtnControl[BTN_SETTINGS], EINA_FALSE);
elm_object_focus_set(m->eoBtnControl[BTN_SETTINGS], EINA_TRUE);
return;
}
m->pSliderWidget = new CSliderWidget;
m->pSliderWidget->Create(m->eoBase);
- //m_AddSlider();
}
void CPlaybackView::OnStopPlayback(void)
{
- m_UpdateCurrentSongInfo();
}