bool Create(CLayoutMgr *mgr);
virtual void Destroy(void);
+ void SetCurrentAlbum(CAlbumInfo *albumInfo);
+ CAlbumInfo*CurrentAlbum(void);
+
public:
virtual void OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev);
virtual void OnMouseMove(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev);
return;
}
- m->mhandle->SetCurrentAlbum(itinfo->alinfo);
-
+ m->layoutAlbumSongs->SetCurrentAlbum(itinfo->alinfo);
m_ShowAlbumSongs();
}
itinfo = m_FindItemInfoById(m->it_infolist,
atoi(m->album_id));
if (itinfo) {
- m->mhandle->SetCurrentAlbum(itinfo->alinfo);
+ m->layoutAlbumSongs->SetCurrentAlbum(itinfo->alinfo);
m_ShowAlbumSongs();
return;
}
return;
}
- alinfo = m->mhandle->CurrentAlbum();
+ alinfo = m->layoutAlbumSongs->CurrentAlbum();
if (alinfo) {
id = alinfo->AlbumId();
itinfo = m_FindItemInfoById(m->it_infolist, id);
if (itinfo) {
- m->mhandle->SetCurrentAlbum(NULL);
+ m->layoutAlbumSongs->SetCurrentAlbum(NULL);
+
elm_gengrid_item_show(itinfo->item,
ELM_GENGRID_ITEM_SCROLLTO_IN);
elm_object_item_focus_set(itinfo->item, EINA_TRUE);
CMusicController* mhandle;
CLayoutMgr *mgr;
CViewMgr *vmgr;
+ CAlbumInfo *alinfo;
SContentInfo *ctxtinfo;
Eina_List *slist;
Eina_List *it_infolist;
SAlbumSongsItemInfo *itinfo = NULL;
Elm_Object_Item *item = NULL;
int dur = 0;
- CAlbumInfo *alinfo = NULL;
if (!m->songlist || !m->item_class)
return;
/* Remove existing songlist and prepare afresh */
m_EmptySongList();
- alinfo = m->mhandle->CurrentAlbum();
- if (!m->mhandle->MediaGetList(LIST_TYPE_ALBUM_SONG, alinfo, &(m->slist))) {
+ if (!m->mhandle->MediaGetList(LIST_TYPE_ALBUM_SONG, m->alinfo, &(m->slist))) {
_ERR(" Fetching song list from media failed ");
return;
}
Evas_Object *img = NULL;
char *path = NULL;
char buf[MAX_LENGTH];
- CAlbumInfo *alinfo = NULL;
SBtnInfo btninfo[TOTAL_ADD_BTNS];
Evas_Object *layout = Layout();
}
elm_object_focus_set(btn[0], EINA_TRUE);
- alinfo = m->mhandle->CurrentAlbum();
- if (!alinfo)
- return;
- path = alinfo->ThumbnailPath();
+ path = m->alinfo->ThumbnailPath();
if (path) {
elm_image_file_set(thumb, path, NULL);
elm_image_aspect_fixed_set(thumb, EINA_FALSE);
elm_object_part_content_set(layout, MUSIC_PART_ALBUM_THUMB,
thumb);
elm_object_part_text_set(layout, MUSIC_PART_ALBUM_NAME,
- alinfo->Name());
+ m->alinfo->Name());
elm_object_part_text_set(layout, MUSIC_PART_ALBUM_ARTIST,
- alinfo->Artist());
+ m->alinfo->Artist());
snprintf(buf, sizeof(buf), "%d", eina_list_count(m->slist));
elm_object_part_text_set(layout, MUSIC_PART_ALBUM_SONGCOUNT, buf);
m->vmgr = vmgr;
m->mhandle = mhandle;
m->mgr = mgr;
+ m->alinfo = new CAlbumInfo;
Connect(layout, ALBUM_SONGS_LAYOUT, TYPE_KEY_DOWN);
{
ASSERT(m);
+ if (m->alinfo->FlagCreate())
+ m->alinfo->Destroy();
+ delete m->alinfo;
+
m_EmptySongList();
CExtBaseLayout::Destroy();
evas_object_del(Layout());
}
+void CAlbumSongsLayout::SetCurrentAlbum(CAlbumInfo *albumInfo)
+{
+ ASSERT(m);
+
+ if (m->alinfo->FlagCreate())
+ m->alinfo->Destroy();
+
+ m->alinfo->Create();
+
+ if (albumInfo)
+ m->alinfo->Duplicate(albumInfo);
+ else {
+ CAlbumInfo *emptyInfo = new CAlbumInfo;
+ emptyInfo->Create();
+ m->alinfo->Duplicate(emptyInfo);
+ emptyInfo->Destroy();
+ delete emptyInfo;
+ }
+}
+
+
+CAlbumInfo* CAlbumSongsLayout::CurrentAlbum(void)
+{
+ ASSERT(m);
+
+ return m->alinfo;
+}
+
+
void CAlbumSongsLayout::t_OnShow(void)
{
ASSERT(m);