#define __CATEGORY_LAYOUT_H__
-class CCategoryLayout : public CExtBaseLayout, public CListenerMgr, public IKeyDownListener {
+class CCategoryLayout : public CExtBaseLayout, public CListenerMgr,
+ public IKeyDownListener, public IMouseMoveListener, public IMouseClickedListener,
+ public IRealizedListener, public IUnrealizedListener {
private:
struct SCategoryLayout *m;
SContentInfo *ctxtinfo;
ESelectType sel_type;
Evas_Object *grid;
- Evas_Object *epopup;
+ class CEntryPopup *epopup;
Evas_Object *base;
Elm_Object_Item *focused_item;
} t;
static void sm_CbEntrynameSet(void *dt, const char *name);
void m_OnEntrynameSet(const char *name);
- static void sm_CbSelectAllClicked(void *dt, Evas_Object *obj, void *ev);
- void m_OnSelectAllClicked(Evas_Object *obj, void *ev);
-
- static void sm_CbDoneBtnClicked(void *dt, Evas_Object *obj, void *ev);
- void m_OnDoneBtnClicked(Evas_Object *obj, void *ev);
-
- static void sm_CbCancelBtnClicked(void *dt, Evas_Object *obj, void *ev);
- void m_OnCancelBtnClicked(Evas_Object *obj, void *ev);
-
- static void sm_CbPlayBtnClicked(void *dt, Evas_Object *obj, void *ev);
- void m_OnPlayBtnClicked(Evas_Object *obj, void *ev);
-
- static void sm_CbNextBtnClicked(void *dt, Evas_Object *obj, void *ev);
- void m_OnNextBtnClicked(Evas_Object *obj, void *ev);
-
- static void sm_CbLastBtnClicked(void *dt, Evas_Object *obj, void *ev);
- void m_OnLastBtnClicked(Evas_Object *obj, void *ev);
-
static char *sm_CbGetSelectlistItemText(void *data, Evas_Object *obj, const char *part);
static char *sm_CbGetListItemText(void *data, Evas_Object *obj, const char *part);
static void sm_CbRemoveListItem(void *data, Evas_Object *obj);
static void sm_CbItemSelect(void *data, Elm_Object_Item *it, const char *emission, const char *source);
void m_OnItemSelect(Elm_Object_Item *it, const char *emission, const char *source);
- static void sm_CbGengridRealized(void *data, Evas_Object *obj, void *event_info);
- static void sm_CbGengridUnrealized(void *data, Evas_Object *obj, void *event_info);
-
- static void sm_CbKeyDown(void *dt, Evas *e, Evas_Object *obj, void *ei);
- void m_OnKeyDown(Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev);
-
- static void sm_CbKeyPressed(void *dt, Evas *e, Evas_Object *obj, void *ei);
- void m_OnKeyPressed(Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev);
-
private:
inline int m_ConvertToMin(int milsec);
void m_RemoveFocusIdler(void);
virtual ECategoryType t_CategoryType(void) = 0;
public:
- CCategoryLayout(const char *pLayoutId) : CExtBaseLayout(pLayoutId), IKeyDownListener(this), m(0) {
+ CCategoryLayout(const char *pLayoutId) :
+ CExtBaseLayout(pLayoutId),
+ IKeyDownListener(this),
+ IMouseMoveListener(this),
+ IMouseClickedListener(this),
+ IRealizedListener(this),
+ IUnrealizedListener(this),
+ m(0) {
memset(&t, 0, sizeof(t));
}
virtual ~CCategoryLayout() {}
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);
+ virtual void OnMouseClicked(int id, Evas_Object *obj);
+ virtual void OnRealized(int id, Evas_Object *obj, Elm_Object_Item *item);
+ virtual void OnUnrealized(int id, Evas_Object *obj, Elm_Object_Item *item);
};
int id;
};
-enum {
- GRP_SONG,
- GRP_ALBUM,
- GRP_ARTIST,
- GRP_GENRE,
- GRP_FOLDER,
- GRP_PLAYLISTS
-};
-
enum ESourceType {
SOURCE_TYPE_NONE = -1,
SOURCE_TYPE_ALL,
ADD_TYPE_END
};
-
-enum ETopBtnType {
- TOP_BTN_TYPE_PLAYBACK,
- TOP_BTN_TYPE_SOURCE,
- TOP_BTN_TYPE_SORT,
-};
-
enum EPlayStatus {
PLAY_STATUS_INITIAL = -1,
PLAY_STATUS_STOP,
#ifndef __ENTRY_POPUP_H__
#define __ENTRY_POPUP_H__
-Evas_Object *create_entry_popup(Evas_Object *base, const char *text,
- void (*)(void *, const char *), void *data);
-void destroy_entry_popup(Evas_Object *layout);
+class CEntryPopup : public CListenerMgr, public IKeyDownListener {
+private:
+ struct SEntryPopup *m;
+
+private:
+ static Eina_Bool sm_CbFocusIdler(void *dt);
+ void m_OnFocusIdler(void);
+
+public:
+ CEntryPopup() : IKeyDownListener(this), m(0) {}
+ virtual ~CEntryPopup() {}
+
+ bool Create(Evas_Object *base, const char *text, void(*cbEntryName)(void *, const char *), void *data);
+ virtual void Destroy(void);
+
+ bool FlagCreate(void);
+
+ virtual void OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev);
+};
#endif /* __ENTRY_POPUP_H__ */
enum EObjectType {
+ ALBUM_SONGS_LAYOUT,
+ ALBUM_SONGS_GENLIST,
ALBUM_SONGS_PLAY_BUTTON,
ALBUM_SONGS_NEXT_BUTTON,
ALBUM_SONGS_LAST_BUTTON,
- ALBUM_SONGS_LAYOUT,
- ALBUM_SONGS_GENLIST,
+};
+
+enum EBtnType {
+ BTN_PLAY,
+ BTN_NEXT,
+ BTN_LAST
};
struct SAlbumSongsItemInfo {
const char *part;
const char *style;
const char *icon;
+ EObjectType type;
};
SBtnInfo btninfo[TOTAL_ADD_BTNS];
Evas_Object *layout = Layout();
- btninfo[ALBUM_SONGS_PLAY_BUTTON].name = MUSIC_STR_PLAY;
- btninfo[ALBUM_SONGS_PLAY_BUTTON].part = MUSIC_PART_ALBUM_PLAYBTN;
- btninfo[ALBUM_SONGS_PLAY_BUTTON].style = MUSIC_STYLE_ADD_PLAY_BTN;
- btninfo[ALBUM_SONGS_PLAY_BUTTON].icon = MUSIC_IMAGE_ADD_PLAY;
+ btninfo[BTN_PLAY].name = MUSIC_STR_PLAY;
+ btninfo[BTN_PLAY].part = MUSIC_PART_ALBUM_PLAYBTN;
+ btninfo[BTN_PLAY].style = MUSIC_STYLE_ADD_PLAY_BTN;
+ btninfo[BTN_PLAY].icon = MUSIC_IMAGE_ADD_PLAY;
+ btninfo[BTN_PLAY].type = ALBUM_SONGS_PLAY_BUTTON;
- btninfo[ALBUM_SONGS_NEXT_BUTTON].name = MUSIC_STR_ADDNEXT;
- btninfo[ALBUM_SONGS_NEXT_BUTTON].part = MUSIC_PART_ALBUM_NEXTBTN;
- btninfo[ALBUM_SONGS_NEXT_BUTTON].style = MUSIC_STYLE_ADD_NEXT_BTN;
- btninfo[ALBUM_SONGS_NEXT_BUTTON].icon = MUSIC_IMAGE_ADD_NEXT;
+ btninfo[BTN_NEXT].name = MUSIC_STR_ADDNEXT;
+ btninfo[BTN_NEXT].part = MUSIC_PART_ALBUM_NEXTBTN;
+ btninfo[BTN_NEXT].style = MUSIC_STYLE_ADD_NEXT_BTN;
+ btninfo[BTN_NEXT].icon = MUSIC_IMAGE_ADD_NEXT;
+ btninfo[BTN_NEXT].type = ALBUM_SONGS_NEXT_BUTTON;
- btninfo[ALBUM_SONGS_LAST_BUTTON].name = MUSIC_STR_ADDLAST;
- btninfo[ALBUM_SONGS_LAST_BUTTON].part = MUSIC_PART_ALBUM_LASTBTN;
- btninfo[ALBUM_SONGS_LAST_BUTTON].style = MUSIC_STYLE_ADD_LAST_BTN;
- btninfo[ALBUM_SONGS_LAST_BUTTON].icon = MUSIC_IMAGE_ADD_LAST;
+ btninfo[BTN_LAST].name = MUSIC_STR_ADDLAST;
+ btninfo[BTN_LAST].part = MUSIC_PART_ALBUM_LASTBTN;
+ btninfo[BTN_LAST].style = MUSIC_STYLE_ADD_LAST_BTN;
+ btninfo[BTN_LAST].icon = MUSIC_IMAGE_ADD_LAST;
+ btninfo[BTN_LAST].type = ALBUM_SONGS_LAST_BUTTON;
thumb = m_AddAlbumCover();
if (!thumb)
elm_object_text_set(btn[i], _(btninfo[i].name));
elm_object_style_set(btn[i], btninfo[i].style);
- Connect(btn[i], i, TYPE_MOUSE_MOVE | TYPE_CLICKED);
+ Connect(btn[i], btninfo[i].type, TYPE_MOUSE_MOVE | TYPE_CLICKED);
img = elm_image_add(btn[i]);
if (img) {
"usb" // SOURCE_TYPE_USB
};
-
-Evas_Object *s_AddButton(Evas_Object *box)
-{
- Evas_Object *button;
-
- if (!box)
- return NULL;
-
- button = elm_button_add(box);
- if (!button)
- return NULL;
-
- evas_object_size_hint_weight_set(button,
- EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_show(button);
-
- return button;
-}
-
-
enum EObjectType {
BASE_VIEW,
+
BASE_VIEW_PLAY_BUTTON,
BASE_VIEW_SOURCE_BUTTON,
BASE_VIEW_SORT_BUTTON,
+
BASE_VIEW_GROUP_SONG,
BASE_VIEW_GROUP_ALBUM,
BASE_VIEW_GROUP_ARTIST,
BASE_VIEW_GROUP_PLAYLIST,
};
+enum EBtnType {
+ BTN_PLAY,
+ BTN_SOURCE,
+ BTN_SORT
+};
+
+enum EGroupBtnType {
+ GROUP_BTN_SONG,
+ GROUP_BTN_ALBUM,
+ GROUP_BTN_ARTIST,
+ GROUP_BTN_GENRE,
+ GROUP_BTN_FOLDER,
+ GROUP_BTN_PLAYLIST
+};
struct SMusicBaseView {
Evas_Object *win;
const char *part;
const char *style;
const char *icon_path;
+ EObjectType type;
};
+Evas_Object *s_AddButton(Evas_Object *box)
+{
+ Evas_Object *button;
+
+ if (!box)
+ return NULL;
+
+ button = elm_button_add(box);
+ if (!button)
+ return NULL;
+
+ evas_object_size_hint_weight_set(button,
+ EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_show(button);
+
+ return button;
+}
+
void CMusicBaseView::sm_CbHandleEmptyStatus(void *cookie, bool emptyStatus)
{
CMusicBaseView *root = (CMusicBaseView*)cookie;
elm_object_focus_next_object_set(m->group_btn[i],
m->content, ELM_FOCUS_RIGHT);
- elm_object_focus_next_object_set(m->group_btn[GRP_SONG], m->plbackbtn, ELM_FOCUS_UP);
- elm_object_focus_next_object_set(m->plbackbtn, m->group_btn[GRP_SONG], ELM_FOCUS_LEFT);
+ elm_object_focus_next_object_set(m->group_btn[GROUP_BTN_SONG], m->plbackbtn, ELM_FOCUS_UP);
+ elm_object_focus_next_object_set(m->plbackbtn, m->group_btn[GROUP_BTN_SONG], ELM_FOCUS_LEFT);
elm_object_focus_next_object_set(m->plbackbtn, m->content, ELM_FOCUS_DOWN);
elm_object_focus_next_object_set(m->srcbtn, m->content, ELM_FOCUS_DOWN);
elm_object_focus_next_object_set(m->sortbtn, m->content, ELM_FOCUS_DOWN);
elm_object_focus_next_object_set(m->group_btn[i],
m->plbackbtn, ELM_FOCUS_RIGHT);
- elm_object_focus_next_object_set(m->group_btn[GRP_SONG], m->plbackbtn, ELM_FOCUS_UP);
- elm_object_focus_next_object_set(m->plbackbtn, m->group_btn[GRP_SONG], ELM_FOCUS_LEFT);
- elm_object_focus_next_object_set(m->plbackbtn, m->group_btn[GRP_SONG], ELM_FOCUS_DOWN);
- elm_object_focus_next_object_set(m->srcbtn, m->group_btn[GRP_SONG], ELM_FOCUS_DOWN);
- elm_object_focus_next_object_set(m->sortbtn, m->group_btn[GRP_SONG], ELM_FOCUS_DOWN);
+ elm_object_focus_next_object_set(m->group_btn[GROUP_BTN_SONG], m->plbackbtn, ELM_FOCUS_UP);
+ elm_object_focus_next_object_set(m->plbackbtn, m->group_btn[GROUP_BTN_SONG], ELM_FOCUS_LEFT);
+ elm_object_focus_next_object_set(m->plbackbtn, m->group_btn[GROUP_BTN_SONG], ELM_FOCUS_DOWN);
+ elm_object_focus_next_object_set(m->srcbtn, m->group_btn[GROUP_BTN_SONG], ELM_FOCUS_DOWN);
+ elm_object_focus_next_object_set(m->sortbtn, m->group_btn[GROUP_BTN_SONG], ELM_FOCUS_DOWN);
elm_object_part_text_set(m->base, MUSIC_PART_NO_CONTENT, _(NO_MUSIC_MESSAGE));
elm_object_part_text_set(m->base, MUSIC_PART_NO_CONTENT_SUB, _(NO_MUSIC_MESSAGE_SUB));
elm_object_part_content_unset(m->base, MUSIC_PART_CONTENT);
- if (m->c_grpbtn == m->group_btn[GRP_SONG]) {
+ if (m->c_grpbtn == m->group_btn[GROUP_BTN_SONG]) {
layoutId = MUSIC_SONG_LAYOUT;
evasLayout = m->layoutSong->Layout();
}
- else if (m->c_grpbtn == m->group_btn[GRP_ALBUM]) {
+ else if (m->c_grpbtn == m->group_btn[GROUP_BTN_ALBUM]) {
layoutId = MUSIC_ALBUM_LAYOUT;
evasLayout = m->layoutAlbum->Layout();
}
- else if (m->c_grpbtn == m->group_btn[GRP_ARTIST]) {
+ else if (m->c_grpbtn == m->group_btn[GROUP_BTN_ARTIST]) {
layoutId = MUSIC_CATEGORY_ARTIST_LAYOUT;
evasLayout = m->layoutArtist->Layout();
}
- else if (m->c_grpbtn == m->group_btn[GRP_GENRE]) {
+ else if (m->c_grpbtn == m->group_btn[GROUP_BTN_GENRE]) {
layoutId = MUSIC_CATEGORY_GENRE_LAYOUT;
evasLayout = m->layoutGenre->Layout();
}
- else if (m->c_grpbtn == m->group_btn[GRP_PLAYLISTS]) {
+ else if (m->c_grpbtn == m->group_btn[GROUP_BTN_PLAYLIST]) {
layoutId = MUSIC_CATEGORY_PLAYLISTS_LAYOUT;
evasLayout = m->layoutPlaylists->Layout();
}
- else if (m->c_grpbtn == m->group_btn[GRP_FOLDER]) {
+ else if (m->c_grpbtn == m->group_btn[GROUP_BTN_FOLDER]) {
layoutId = MUSIC_FOLDER_LAYOUT;
evasLayout = m->layoutFolder->Layout();
}
evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, 0);
evas_object_size_hint_align_set(box, EVAS_HINT_FILL, 0);
- if (btnType == TOP_BTN_TYPE_SOURCE) {
+ if (btnType == BTN_SOURCE) {
arr = g_sourceText;
size = ARRAY_SIZE(g_sourceText);
selected_index = m->mhandle->SourceType();
m->btntype = btnType;
part = MUSIC_PART_SOURCE_POPUP;
}
- else if (btnType == TOP_BTN_TYPE_SORT) {
+ else if (btnType == BTN_SORT) {
arr = g_sortText;
size = ARRAY_SIZE(g_sortText);
layout_id = m->lmgr->Layout()->LayoutId();
}
for (i = 0; i < size; i++) {
- if (btnType == TOP_BTN_TYPE_SOURCE && i == SOURCE_TYPE_USB &&
+ if (btnType == BTN_SOURCE && i == SOURCE_TYPE_USB &&
!m->mhandle->CheckUsb())
continue;
text = elm_object_text_get(obj);
- if (m->btntype == TOP_BTN_TYPE_SOURCE) {
+ if (m->btntype == BTN_SOURCE) {
size = ARRAY_SIZE(g_sourceText);
sm_FindIndex(g_sourceText, size, text, &type);
m_DestroyCtxPopup();
elm_object_text_set(m->sortbtn, _(text));
}
- if (m->btntype == TOP_BTN_TYPE_SOURCE) {
- if (m->c_grpbtn != m->group_btn[GRP_PLAYLISTS])
+ if (m->btntype == BTN_SOURCE) {
+ if (m->c_grpbtn != m->group_btn[GROUP_BTN_PLAYLIST])
m_ShowCurrentLayout();
}
else {
Evas_Object *btn = NULL;
SBtnInfo btninfo[TOTAL_TOP_BTNS];
- btninfo[TOP_BTN_TYPE_PLAYBACK].part = MUSIC_PART_PLAYBACK_BTN;
- btninfo[TOP_BTN_TYPE_PLAYBACK].style = MUSIC_STYLE_PLAYBACK_BTN;
+ btninfo[BTN_PLAY].part = MUSIC_PART_PLAYBACK_BTN;
+ btninfo[BTN_PLAY].style = MUSIC_STYLE_PLAYBACK_BTN;
+ btninfo[BTN_PLAY].type = BASE_VIEW_PLAY_BUTTON;
- btninfo[TOP_BTN_TYPE_SOURCE].part = MUSIC_PART_SOURCE_HOVERSEL;
- btninfo[TOP_BTN_TYPE_SOURCE].style = MUSIC_STYLE_SOURCE_BTN;
+ btninfo[BTN_SOURCE].part = MUSIC_PART_SOURCE_HOVERSEL;
+ btninfo[BTN_SOURCE].style = MUSIC_STYLE_SOURCE_BTN;
+ btninfo[BTN_SOURCE].type = BASE_VIEW_SOURCE_BUTTON;
- btninfo[TOP_BTN_TYPE_SORT].part = MUSIC_PART_SORT_HOVERSEL;
- btninfo[TOP_BTN_TYPE_SORT].style = MUSIC_STYLE_SORT_BTN;
+ btninfo[BTN_SORT].part = MUSIC_PART_SORT_HOVERSEL;
+ btninfo[BTN_SORT].style = MUSIC_STYLE_SORT_BTN;
+ btninfo[BTN_SORT].type = BASE_VIEW_SORT_BUTTON;
elm_object_part_text_set(m->base, MUSIC_PART_TITLE,
_(MUSIC_TEXT_TITLE));
elm_object_style_set(btn, btninfo[i].style);
elm_object_part_content_set(m->base, btninfo[i].part, btn);
- Connect(btn, BASE_VIEW_PLAY_BUTTON + i, TYPE_KEY_DOWN | TYPE_MOUSE_MOVE | TYPE_CLICKED);
+ Connect(btn, btninfo[i].type, TYPE_KEY_DOWN | TYPE_MOUSE_MOVE | TYPE_CLICKED);
- if (i == TOP_BTN_TYPE_PLAYBACK)
+ if (i == BTN_PLAY)
m->plbackbtn = btn;
- else if (i == TOP_BTN_TYPE_SOURCE)
+ else if (i == BTN_SOURCE)
m->srcbtn = btn;
- else if (i == TOP_BTN_TYPE_SORT)
+ else if (i == BTN_SORT)
m->sortbtn = btn;
}
char buf[MAX_LENGTH];
static struct SBtnInfo btninfo[TOTAL_GROUP_BTNS];
- btninfo[GRP_SONG].txt = MUSIC_TEXT_SONG;
- btninfo[GRP_SONG].icon_path = MUSIC_IMAGE_GRPBTN_SONG;
+ btninfo[GROUP_BTN_SONG].txt = MUSIC_TEXT_SONG;
+ btninfo[GROUP_BTN_SONG].icon_path = MUSIC_IMAGE_GRPBTN_SONG;
+ btninfo[GROUP_BTN_SONG].type = BASE_VIEW_GROUP_SONG;
- btninfo[GRP_ALBUM].txt = MUSIC_TEXT_ALBUM;
- btninfo[GRP_ALBUM].icon_path = MUSIC_IMAGE_GRPBTN_ALBUM;
+ btninfo[GROUP_BTN_ALBUM].txt = MUSIC_TEXT_ALBUM;
+ btninfo[GROUP_BTN_ALBUM].icon_path = MUSIC_IMAGE_GRPBTN_ALBUM;
+ btninfo[GROUP_BTN_ALBUM].type = BASE_VIEW_GROUP_ALBUM;
- btninfo[GRP_ARTIST].txt = MUSIC_TEXT_ARTIST;
- btninfo[GRP_ARTIST].icon_path = MUSIC_IMAGE_GRPBTN_ARTIST;
+ btninfo[GROUP_BTN_ARTIST].txt = MUSIC_TEXT_ARTIST;
+ btninfo[GROUP_BTN_ARTIST].icon_path = MUSIC_IMAGE_GRPBTN_ARTIST;
+ btninfo[GROUP_BTN_ARTIST].type = BASE_VIEW_GROUP_ARTIST;
- btninfo[GRP_GENRE].txt = MUSIC_TEXT_GENRE;
- btninfo[GRP_GENRE].icon_path = MUSIC_IMAGE_GRPBTN_GENRE;
+ btninfo[GROUP_BTN_GENRE].txt = MUSIC_TEXT_GENRE;
+ btninfo[GROUP_BTN_GENRE].icon_path = MUSIC_IMAGE_GRPBTN_GENRE;
+ btninfo[GROUP_BTN_GENRE].type = BASE_VIEW_GROUP_GENRE;
- btninfo[GRP_FOLDER].txt = MUSIC_TEXT_FOLDER;
- btninfo[GRP_FOLDER].icon_path = MUSIC_IMAGE_GRPBTN_FOLDER;
+ btninfo[GROUP_BTN_FOLDER].txt = MUSIC_TEXT_FOLDER;
+ btninfo[GROUP_BTN_FOLDER].icon_path = MUSIC_IMAGE_GRPBTN_FOLDER;
+ btninfo[GROUP_BTN_FOLDER].type = BASE_VIEW_GROUP_FOLDER;
- btninfo[GRP_PLAYLISTS].txt = MUSIC_TEXT_PLAYLIST;
- btninfo[GRP_PLAYLISTS].icon_path = MUSIC_IMAGE_GRPBTN_PLAYLISTS;
+ btninfo[GROUP_BTN_PLAYLIST].txt = MUSIC_TEXT_PLAYLIST;
+ btninfo[GROUP_BTN_PLAYLIST].icon_path = MUSIC_IMAGE_GRPBTN_PLAYLISTS;
+ btninfo[GROUP_BTN_PLAYLIST].type = BASE_VIEW_GROUP_PLAYLIST;
box = _add_box(m->base);
if (!box)
elm_object_style_set(m->group_btn[i], MUSIC_STYLE_GROUPBTN);
elm_object_text_set(m->group_btn[i], _(btninfo[i].txt));
- Connect(m->group_btn[i], BASE_VIEW_GROUP_SONG + i, TYPE_KEY_DOWN | TYPE_MOUSE_MOVE | TYPE_CLICKED);
+ Connect(m->group_btn[i], btninfo[i].type, TYPE_KEY_DOWN | TYPE_MOUSE_MOVE | TYPE_CLICKED);
ic = elm_image_add(m->group_btn[i]);
if (ic) {
}
if (m->arglist && m->arglist->album_id)
- m->c_grpbtn = m->group_btn[GRP_ALBUM];
+ m->c_grpbtn = m->group_btn[GROUP_BTN_ALBUM];
else
- m->c_grpbtn = m->group_btn[GRP_SONG];
+ m->c_grpbtn = m->group_btn[GROUP_BTN_SONG];
elm_object_signal_emit(m->c_grpbtn,
MUSIC_SIGNAL_GROUP_SELECTED, MUSIC_BASE_VIEW);
break;
case BASE_VIEW_SOURCE_BUTTON:
- m_CreateCtxPopup(TOP_BTN_TYPE_SOURCE);
+ m_CreateCtxPopup(BTN_SOURCE);
break;
case BASE_VIEW_SORT_BUTTON:
- m_CreateCtxPopup(TOP_BTN_TYPE_SORT);
+ m_CreateCtxPopup(BTN_SORT);
break;
case BASE_VIEW_GROUP_SONG:
elm_object_signal_emit(m->c_grpbtn,
MUSIC_SIGNAL_GROUP_SELECTED, MUSIC_BASE_VIEW);
- if (obj == m->group_btn[GRP_FOLDER])
+ if (obj == m->group_btn[GROUP_BTN_FOLDER])
elm_object_text_set(m->sortbtn, _(g_sortTextFolder[0]));
- else if (obj == m->group_btn[GRP_PLAYLISTS])
+ else if (obj == m->group_btn[GROUP_BTN_PLAYLIST])
elm_object_text_set(m->sortbtn, _(g_sortTextPlaylists[0]));
- else if (obj == m->group_btn[GRP_ALBUM])
+ else if (obj == m->group_btn[GROUP_BTN_ALBUM])
elm_object_text_set(m->sortbtn, _(g_sortTextAlbum[0]));
- else if (obj == m->group_btn[GRP_ARTIST])
+ else if (obj == m->group_btn[GROUP_BTN_ARTIST])
elm_object_text_set(m->sortbtn, _(g_sortTextArtist[0]));
- else if (obj == m->group_btn[GRP_GENRE])
+ else if (obj == m->group_btn[GROUP_BTN_GENRE])
elm_object_text_set(m->sortbtn, _(g_sortTextGenre[0]));
else
elm_object_text_set(m->sortbtn, _(g_sortText[0]));
#define GENGRID_ITEM_SIZE_H (359+20)
+enum EObjectType {
+ CATEGORY_LAYOUT,
+ CATEGORY_LAYOUT_GENGRID,
+ CATEGORY_LAYOUT_GENLIST,
+ CATEGORY_LAYOUT_PLAY_BUTTON,
+ CATEGORY_LAYOUT_NEXT_BUTTON,
+ CATEGORY_LAYOUT_LAST_BUTTON,
+ CATEGORY_LAYOUT_SELECT_ALL_BUTTON,
+ CATEGORY_LAYOUT_DONE_BUTTON,
+ CATEGORY_LAYOUT_CANCEL_BUTTON
+};
+
enum EAddBtns {
ABTN_PLAY,
ABTN_NEXT,
const char *part;
const char *style;
const char *icon;
- Evas_Smart_Cb cb;
+ EObjectType type;
};
struct SCategoryLayout {
idlist = m_GetSelectedList(m->it_infolist, (int)ID_TYPE_MEDIA);
str = strdup(name);
- destroy_entry_popup(t.epopup);
- t.epopup = NULL;
+ t.epopup->Destroy();
if (!strcmp(str, MUSIC_STR_EMPTY)) {
_create_message_box(Layout(), MUSIC_TEXT_EMPTY_NAME);
}
-void CCategoryLayout::sm_CbSelectAllClicked(void *dt, Evas_Object *obj, void *ev)
-{
- CCategoryLayout *root = (CCategoryLayout *)dt;
- if (root)
- root->m_OnSelectAllClicked(obj, ev);
-}
-
-
-void CCategoryLayout::m_OnSelectAllClicked(Evas_Object *obj, void *ev)
-{
- Eina_List *l = NULL;
- SCatItemInfo *itinfo = NULL;
- void *list_obj = NULL;
- int tc;
-
- tc = eina_list_count(m->it_infolist);
-
- if (m->count == tc) {
- elm_object_text_set(m->select_btn[SBTN_SELECT_ALL],
- _(MUSIC_TEXT_SELECT_ALL));
- m->count = 0;
- EINA_LIST_FOREACH(m->it_infolist, l, list_obj) {
- itinfo = (SCatItemInfo *)list_obj;
- itinfo->check_status = false;
- }
- elm_genlist_realized_items_update(m->glist);
-
- return;
- }
-
- elm_object_text_set(m->select_btn[SBTN_SELECT_ALL],
- _(MUSIC_TEXT_DESELECT_ALL));
- m->count = tc;
- EINA_LIST_FOREACH(m->it_infolist, l, list_obj) {
- itinfo = (SCatItemInfo *)list_obj;
- itinfo->check_status = true;
- }
- elm_genlist_realized_items_update(m->glist);
-}
-
-
-void CCategoryLayout::sm_CbDoneBtnClicked(void *dt, Evas_Object *obj, void *ev)
-{
- CCategoryLayout *root = (CCategoryLayout *)dt;
- if (root)
- root->m_OnDoneBtnClicked(obj, ev);
-}
-
-
-void CCategoryLayout::m_OnDoneBtnClicked(Evas_Object *obj, void *ev)
-{
- if (t.sel_type == SELECT_ADD) {
- m_AddSelectedSongs();
- return;
- }
- else if (t.sel_type == SELECT_REMOVE) {
- m_RemoveSelectedSongs();
- return;
- }
-
- if (t.epopup)
- destroy_entry_popup(t.epopup);
-
- t.epopup = create_entry_popup(t.base, MUSIC_STR_EMPTY,
- sm_CbEntrynameSet, this);
-}
-
-
-void CCategoryLayout::sm_CbCancelBtnClicked(void *dt, Evas_Object *obj, void *ev)
-{
- CCategoryLayout *root = (CCategoryLayout *)dt;
- if (root)
- root->m_OnCancelBtnClicked(obj, ev);
-}
-
-
-void CCategoryLayout::m_OnCancelBtnClicked(Evas_Object *obj, void *ev)
-{
- t.depth = E_DEPTH_CATEGORY;
- t_UpdateLayoutWithFocus();
-}
-
-
-void CCategoryLayout::sm_CbPlayBtnClicked(void *dt, Evas_Object *obj, void *ev)
-{
- CCategoryLayout *root = (CCategoryLayout *)dt;
- if (root)
- root->m_OnPlayBtnClicked(obj, ev);
-}
-
-
-void CCategoryLayout::m_OnPlayBtnClicked(Evas_Object *obj, void *ev)
-{
- m_GotoPlayback(ADD_TYPE_FRESH, NULL);
-}
-
-
-void CCategoryLayout::sm_CbNextBtnClicked(void *dt, Evas_Object *obj, void *ev)
-{
- CCategoryLayout *root = (CCategoryLayout *)dt;
- if (root)
- root->m_OnNextBtnClicked(obj, ev);
-}
-
-
-void CCategoryLayout::m_OnNextBtnClicked(Evas_Object *obj, void *ev)
-{
- m_GotoPlayback(ADD_TYPE_NEXT, NULL);
-}
-
-
-void CCategoryLayout::sm_CbLastBtnClicked(void *dt, Evas_Object *obj, void *ev)
-{
- CCategoryLayout *root = (CCategoryLayout *)dt;
- if (root)
- root->m_OnLastBtnClicked(obj, ev);
-}
-
-
-void CCategoryLayout::m_OnLastBtnClicked(Evas_Object *obj, void *ev)
-{
- m_GotoPlayback(ADD_TYPE_END, NULL);
-}
-
-
char *CCategoryLayout::sm_CbGetSelectlistItemText(void *data, Evas_Object *obj, const char *part)
{
SCatItemInfo *itinfo = (SCatItemInfo *)data;
}
-void CCategoryLayout::sm_CbGengridRealized(void *data, Evas_Object *obj, void *event_info)
-{
- if (!data || !obj || !event_info)
- return;
-
- elm_object_item_signal_callback_add((Elm_Object_Item *)event_info,
- MUSIC_SIGNAL_BTN_CLICKED, MUSIC_BASE_VIEW,
- sm_CbItemSelect, data);
-}
-
-
-void CCategoryLayout::sm_CbGengridUnrealized(void *data, Evas_Object *obj, void *event_info)
-{
- if (!data || !obj || !event_info)
- return;
-
- elm_object_item_signal_callback_del((Elm_Object_Item *)event_info,
- MUSIC_SIGNAL_BTN_CLICKED, MUSIC_BASE_VIEW,
- sm_CbItemSelect);
-}
-
-
-void CCategoryLayout::sm_CbKeyDown(void *dt, Evas *e, Evas_Object *obj, void *ei)
-{
- CCategoryLayout *root = (CCategoryLayout *)dt;
-
- if (root)
- root->m_OnKeyDown(e, obj, (Evas_Event_Key_Down*)ei);
-}
-
-
-void CCategoryLayout::m_OnKeyDown(Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev)
-{
- Elm_Object_Item *it = NULL;
- SContentInfo *ctxtinfo = NULL;
- SCatItemInfo *itinfo = NULL;
-
- if (!obj)
- return;
-
- if (strcmp(ev->keyname, KEY_MENU) || t.depth ==
- E_DEPTH_SELECT_LIST || t.depth ==
- E_DEPTH_SHOW_LIST)
- return;
-
- it = elm_object_focused_item_get(obj);
- if (!it) {
- _ERR(" unable to get focused item ");
- return;
- }
- t.focused_item = it;
-
- if (t.ctxtinfo) {
- free(t.ctxtinfo);
- t.ctxtinfo = NULL;
- }
-
- ctxtinfo = (SContentInfo *)calloc(1, sizeof(*ctxtinfo));
- if (!ctxtinfo)
- return;
-
- itinfo = m_FindItemInfo(m->it_infolist, it);
- if (!itinfo || itinfo->type == CAT_TYPE_PLAYLIST_NEW) {
- free(ctxtinfo);
- return;
- }
-
- ctxtinfo->cbdata = this;
- ctxtinfo->update = sm_CbCtxtUpdate;
- ctxtinfo->close = sm_CbCtxtClose;
- if (t.depth == E_DEPTH_SONG) {
- ctxtinfo->type = CONTEXT_TYPE_SONG;
- ctxtinfo->context = itinfo->sinfo;
- }
- else if (t.depth == E_DEPTH_ALBUM) {
- ctxtinfo->type = CONTEXT_TYPE_ALBUM;
- ctxtinfo->context = itinfo->alinfo;
- }
- else {
- ctxtinfo->type = t_ContextType();
- ctxtinfo->context = itinfo->catinfo;
- }
-
- t.ctxtinfo = ctxtinfo;
-
- SParcel parcel;
- parcel.ctxtInfo = ctxtinfo;
- if (!m->vmgr->PushView(MUSIC_CONTEXT_VIEW, &parcel))
- _ERR("viewmgr push view MUSIC_CONTEXT_VIEW failed");
-}
-
-
int CCategoryLayout::m_ConvertToMin(int milsec)
{
int min;
evas_object_size_hint_weight_set(grid,
EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_gengrid_align_set(grid, 0, 0);
- evas_object_event_callback_add(grid, EVAS_CALLBACK_MOUSE_MOVE, _gengrid_mouse_moved, this);
- evas_object_smart_callback_add(grid, MUSIC_SIGNAL_REALIZED, sm_CbGengridRealized, this);
- evas_object_smart_callback_add(grid, MUSIC_SIGNAL_UNREALIZED, sm_CbGengridUnrealized, this);
- evas_object_event_callback_add(grid, EVAS_CALLBACK_KEY_DOWN, sm_CbKeyDown, this);
+
+ Connect(grid, CATEGORY_LAYOUT_GENGRID, TYPE_MOUSE_MOVE | TYPE_KEY_DOWN | TYPE_REALIZED | TYPE_UNREALIZED);
+
elm_gengrid_item_size_set(grid,
elm_config_scale_get() * GENGRID_ITEM_SIZE_W,
elm_config_scale_get() * GENGRID_ITEM_SIZE_H);
btninfo[ABTN_PLAY].part = MUSIC_PART_CATEGORY_PLAYBTN;
btninfo[ABTN_PLAY].style = MUSIC_STYLE_ADD_PLAY_BTN;
btninfo[ABTN_PLAY].icon = MUSIC_IMAGE_ADD_PLAY;
- btninfo[ABTN_PLAY].cb = sm_CbPlayBtnClicked;
+ btninfo[ABTN_PLAY].type = CATEGORY_LAYOUT_PLAY_BUTTON;
btninfo[ABTN_NEXT].name = MUSIC_STR_ADDNEXT;
btninfo[ABTN_NEXT].part = MUSIC_PART_CATEGORY_NEXTBTN;
btninfo[ABTN_NEXT].style = MUSIC_STYLE_ADD_NEXT_BTN;
btninfo[ABTN_NEXT].icon = MUSIC_IMAGE_ADD_NEXT;
- btninfo[ABTN_NEXT].cb = sm_CbNextBtnClicked;
+ btninfo[ABTN_NEXT].type = CATEGORY_LAYOUT_NEXT_BUTTON;
btninfo[ABTN_LAST].name = MUSIC_STR_ADDLAST;
btninfo[ABTN_LAST].part = MUSIC_PART_CATEGORY_LASTBTN;
btninfo[ABTN_LAST].style = MUSIC_STYLE_ADD_LAST_BTN;
btninfo[ABTN_LAST].icon = MUSIC_IMAGE_ADD_LAST;
- btninfo[ABTN_LAST].cb = sm_CbLastBtnClicked;
+ btninfo[ABTN_LAST].type = CATEGORY_LAYOUT_LAST_BUTTON;
if (t.depth == E_DEPTH_SHOW_LIST) {
btninfo[ABTN_PLAY].part = MUSIC_PART_ALBUM_PLAYBTN;
EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_object_text_set(m->add_btn[i], _(btninfo[i].name));
elm_object_style_set(m->add_btn[i], btninfo[i].style);
- evas_object_smart_callback_add(m->add_btn[i],
- MUSIC_SIGNAL_CLICKED, btninfo[i].cb, this);
- evas_object_event_callback_add(m->add_btn[i],
- EVAS_CALLBACK_MOUSE_MOVE, _object_mouse_moved, this);
+
+ Connect(m->add_btn[i], btninfo[ABTN_LAST].type, TYPE_CLICKED | TYPE_MOUSE_MOVE);
img = elm_image_add(m->add_btn[i]);
if (img) {
btninfo[SBTN_SELECT_ALL].name = MUSIC_TEXT_SELECT_ALL;
btninfo[SBTN_SELECT_ALL].part = MUSIC_PART_LIST_SELECT_ALL;
btninfo[SBTN_SELECT_ALL].style = MUSIC_STYLE_LIST_BTN;
- btninfo[SBTN_SELECT_ALL].cb = sm_CbSelectAllClicked;
+ btninfo[SBTN_SELECT_ALL].type = CATEGORY_LAYOUT_SELECT_ALL_BUTTON;
btninfo[SBTN_DONE].name = MUSIC_TEXT_LIST_DONE;
btninfo[SBTN_DONE].part = MUSIC_PART_LIST_DONE_BTN;
btninfo[SBTN_DONE].style = MUSIC_STYLE_LIST_BTN;
- btninfo[SBTN_DONE].cb = sm_CbDoneBtnClicked;
+ btninfo[SBTN_DONE].type = CATEGORY_LAYOUT_DONE_BUTTON;
btninfo[SBTN_CANCEL].name = MUSIC_TEXT_LIST_CANCEL;
btninfo[SBTN_CANCEL].part = MUSIC_PART_LIST_CANCEL_BTN;
btninfo[SBTN_CANCEL].style = MUSIC_STYLE_LIST_BTN;
- btninfo[SBTN_CANCEL].cb = sm_CbCancelBtnClicked;
+ btninfo[SBTN_CANCEL].type = CATEGORY_LAYOUT_CANCEL_BUTTON;
if (t.sel_type == SELECT_CREATE) {
elm_object_part_text_set(Layout(), MUSIC_PART_LIST_MSG,
EVAS_HINT_EXPAND);
elm_object_text_set(btn, _(btninfo[i].name));
elm_object_style_set(btn, btninfo[i].style);
- evas_object_smart_callback_add(btn, MUSIC_SIGNAL_CLICKED,
- btninfo[i].cb, this);
- evas_object_event_callback_add(btn, EVAS_CALLBACK_MOUSE_MOVE,
- _object_mouse_moved, this);
+
+ Connect(btn, btninfo[i].type, TYPE_MOUSE_MOVE | TYPE_CLICKED);
elm_object_part_content_set(Layout(), btninfo[i].part, btn);
m->select_btn[i] = btn;
evas_object_size_hint_weight_set(genlist,
EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_object_part_content_set(Layout(), MUSIC_PART_SONGLIST, genlist);
- evas_object_event_callback_add(genlist, EVAS_CALLBACK_MOUSE_MOVE, _genlist_mouse_moved, this);
- evas_object_event_callback_add(genlist, EVAS_CALLBACK_KEY_DOWN, sm_CbKeyDown, this);
+
+ Connect(genlist, CATEGORY_LAYOUT_GENLIST, TYPE_MOUSE_MOVE | TYPE_KEY_DOWN);
+
m->glist = genlist;
list_item = elm_genlist_item_class_new();
return false;
}
+ t.epopup = new CEntryPopup;
+ if (!t.epopup) {
+ _ERR(" CEntryPopup creation failed ");
+ CExtBaseLayout::Destroy();
+ evas_object_del(layout);
+ delete m;
+ m = NULL;
+ return false;
+ }
+
m->win = win;
t.base = base;
m->vmgr = vmgr;
t.depth = E_DEPTH_CATEGORY;
t_UpdateLayout(false);
- Connect(Layout());
+
+ Connect(Layout(), CATEGORY_LAYOUT, TYPE_KEY_DOWN);
return true;
}
ASSERT(m);
Disconnect(Layout());
- if (t.epopup)
- destroy_entry_popup(t.epopup);
+ if (t.epopup->FlagCreate())
+ t.epopup->Destroy();
m_RemoveFocusIdler();
m_EmptyLayout(false);
category_info_destroy(t.c_catinfo);
album_info_destroy(t.c_alinfo);
song_info_destroy(m->c_sinfo);
+ delete t.epopup;
CExtBaseLayout::Destroy();
evas_object_del(Layout());
if (t.depth != E_DEPTH_CATEGORY)
return;
t_UpdateLayout(true);
+ elm_object_part_content_set(t.base, MUSIC_PART_CONTENT, Layout());
+ evas_object_show(Layout());
return;
}
void CCategoryLayout::OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev)
{
- int count;
- Eina_List *alist = NULL;
+ switch (id) {
+ case CATEGORY_LAYOUT:
+ {
+ int count;
+ Eina_List *alist = NULL;
+
+ if (!strcmp(ev->keyname, KEY_BACK)) {
+ if (t.depth == E_DEPTH_CATEGORY) {
+ SParcel parcel;
+ parcel.ctxtInfo = NULL;
+ parcel.updateType = E_FOCUS_UPDATE;
+ parcel.layoutId = NULL;
+ parcel.keyEvent = NULL;
+ m->vmgr->UpdateView((const char *)MUSIC_BASE_VIEW, &parcel);
+ return;
+ }
+ else if (t.depth == E_DEPTH_ALBUM) {
+ t.depth = E_DEPTH_CATEGORY;
+ }
+ else if (t.depth == E_DEPTH_SELECT_LIST) {
+ t.depth = E_DEPTH_CATEGORY;
+ }
+ else if (t.depth == E_DEPTH_SHOW_LIST) {
+ t.depth = E_DEPTH_CATEGORY;
+ }
+ else if (t.depth == E_DEPTH_SONG) {
+ count = 0;
+ alist = category_info_get_albumlist(t.c_catinfo);
+ if (alist)
+ count = eina_list_count(alist);
+ if (count == 1)
+ t.depth = E_DEPTH_CATEGORY;
+ else
+ t.depth = E_DEPTH_ALBUM;
+ }
+
+ t_UpdateLayoutWithFocus();
+ }
+ }
+ break;
+
+ case CATEGORY_LAYOUT_GENGRID:
+ case CATEGORY_LAYOUT_GENLIST:
+ {
+ Elm_Object_Item *it = NULL;
+ SContentInfo *ctxtinfo = NULL;
+ SCatItemInfo *itinfo = NULL;
+
+ if (!obj)
+ return;
+
+ if (strcmp(ev->keyname, KEY_MENU) || t.depth ==
+ E_DEPTH_SELECT_LIST || t.depth ==
+ E_DEPTH_SHOW_LIST)
+ return;
+
+ it = elm_object_focused_item_get(obj);
+ if (!it) {
+ _ERR(" unable to get focused item ");
+ return;
+ }
+ t.focused_item = it;
+
+ if (t.ctxtinfo) {
+ free(t.ctxtinfo);
+ t.ctxtinfo = NULL;
+ }
+
+ ctxtinfo = (SContentInfo *)calloc(1, sizeof(*ctxtinfo));
+ if (!ctxtinfo)
+ return;
+
+ itinfo = m_FindItemInfo(m->it_infolist, it);
+ if (!itinfo || itinfo->type == CAT_TYPE_PLAYLIST_NEW) {
+ free(ctxtinfo);
+ return;
+ }
+
+ ctxtinfo->cbdata = this;
+ ctxtinfo->update = sm_CbCtxtUpdate;
+ ctxtinfo->close = sm_CbCtxtClose;
+ if (t.depth == E_DEPTH_SONG) {
+ ctxtinfo->type = CONTEXT_TYPE_SONG;
+ ctxtinfo->context = itinfo->sinfo;
+ }
+ else if (t.depth == E_DEPTH_ALBUM) {
+ ctxtinfo->type = CONTEXT_TYPE_ALBUM;
+ ctxtinfo->context = itinfo->alinfo;
+ }
+ else {
+ ctxtinfo->type = t_ContextType();
+ ctxtinfo->context = itinfo->catinfo;
+ }
+
+ t.ctxtinfo = ctxtinfo;
- if (!strcmp(ev->keyname, KEY_BACK)) {
- if (t.depth == E_DEPTH_CATEGORY) {
SParcel parcel;
- parcel.ctxtInfo = NULL;
- parcel.updateType = E_FOCUS_UPDATE;
- parcel.layoutId = NULL;
- parcel.keyEvent = NULL;
- m->vmgr->UpdateView((const char *)MUSIC_BASE_VIEW, &parcel);
- return;
+ parcel.ctxtInfo = ctxtinfo;
+ if (!m->vmgr->PushView(MUSIC_CONTEXT_VIEW, &parcel))
+ _ERR("viewmgr push view MUSIC_CONTEXT_VIEW failed");
}
- else if (t.depth == E_DEPTH_ALBUM) {
- t.depth = E_DEPTH_CATEGORY;
+ break;
+
+ default:
+ break;
+ }
+}
+
+
+void CCategoryLayout::OnMouseMove(int id, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev)
+{
+ switch (id) {
+ case CATEGORY_LAYOUT_GENGRID:
+ {
+ Elm_Object_Item *item;
+
+ if (!obj)
+ return;
+
+ item = elm_gengrid_at_xy_item_get(obj, ev->cur.canvas.x,
+ ev->cur.canvas.y, NULL, NULL);
+ if (!item)
+ return;
+
+ if (!elm_object_item_focus_get(item))
+ elm_object_item_focus_set(item, EINA_TRUE);
}
- else if (t.depth == E_DEPTH_SELECT_LIST) {
- t.depth = E_DEPTH_CATEGORY;
+ break;
+
+ case CATEGORY_LAYOUT_GENLIST:
+ {
+ Elm_Object_Item *item;
+
+ if (!obj)
+ return;
+
+ item = elm_genlist_at_xy_item_get(obj, ev->cur.canvas.x,
+ ev->cur.canvas.y, NULL);
+
+ if (!elm_object_item_focus_get(item))
+ elm_object_item_focus_set(item, EINA_TRUE);
}
- else if (t.depth == E_DEPTH_SHOW_LIST) {
- t.depth = E_DEPTH_CATEGORY;
+ break;
+
+ case CATEGORY_LAYOUT_PLAY_BUTTON:
+ case CATEGORY_LAYOUT_NEXT_BUTTON:
+ case CATEGORY_LAYOUT_LAST_BUTTON:
+ case CATEGORY_LAYOUT_SELECT_ALL_BUTTON:
+ case CATEGORY_LAYOUT_DONE_BUTTON:
+ case CATEGORY_LAYOUT_CANCEL_BUTTON:
+ if (!elm_object_focus_get(obj))
+ elm_object_focus_set(obj, EINA_TRUE);
+ break;
+
+ default:
+ break;
+ }
+}
+
+
+void CCategoryLayout::OnMouseClicked(int id, Evas_Object *obj)
+{
+ switch (id) {
+ case CATEGORY_LAYOUT_PLAY_BUTTON:
+ m_GotoPlayback(ADD_TYPE_FRESH, NULL);
+ break;
+
+ case CATEGORY_LAYOUT_NEXT_BUTTON:
+ m_GotoPlayback(ADD_TYPE_NEXT, NULL);
+ break;
+
+ case CATEGORY_LAYOUT_LAST_BUTTON:
+ m_GotoPlayback(ADD_TYPE_END, NULL);
+ break;
+
+ case CATEGORY_LAYOUT_SELECT_ALL_BUTTON:
+ {
+ Eina_List *l = NULL;
+ SCatItemInfo *itinfo = NULL;
+ void *list_obj = NULL;
+ int tc;
+
+ tc = eina_list_count(m->it_infolist);
+
+ if (m->count == tc) {
+ elm_object_text_set(m->select_btn[SBTN_SELECT_ALL],
+ _(MUSIC_TEXT_SELECT_ALL));
+ m->count = 0;
+ EINA_LIST_FOREACH(m->it_infolist, l, list_obj) {
+ itinfo = (SCatItemInfo *)list_obj;
+ itinfo->check_status = false;
+ }
+ elm_genlist_realized_items_update(m->glist);
+
+ return;
+ }
+
+ elm_object_text_set(m->select_btn[SBTN_SELECT_ALL],
+ _(MUSIC_TEXT_DESELECT_ALL));
+ m->count = tc;
+ EINA_LIST_FOREACH(m->it_infolist, l, list_obj) {
+ itinfo = (SCatItemInfo *)list_obj;
+ itinfo->check_status = true;
+ }
+ elm_genlist_realized_items_update(m->glist);
}
- else if (t.depth == E_DEPTH_SONG) {
- count = 0;
- alist = category_info_get_albumlist(t.c_catinfo);
- if (alist)
- count = eina_list_count(alist);
- if (count == 1)
- t.depth = E_DEPTH_CATEGORY;
- else
- t.depth = E_DEPTH_ALBUM;
+ break;
+
+ case CATEGORY_LAYOUT_DONE_BUTTON:
+ {
+ if (t.sel_type == SELECT_ADD) {
+ m_AddSelectedSongs();
+ return;
+ }
+ else if (t.sel_type == SELECT_REMOVE) {
+ m_RemoveSelectedSongs();
+ return;
+ }
+
+ if (t.epopup->FlagCreate())
+ t.epopup->Destroy();
+
+ t.epopup->Create(t.base, MUSIC_STR_EMPTY, sm_CbEntrynameSet, this);
}
+ break;
+
+ case CATEGORY_LAYOUT_CANCEL_BUTTON:
+ {
+ t.depth = E_DEPTH_CATEGORY;
+ t_UpdateLayoutWithFocus();
+ }
+ break;
+
+ default:
+ break;
+ }
+}
+
+
+void CCategoryLayout::OnRealized(int id, Evas_Object *obj, Elm_Object_Item *item)
+{
+ switch (id) {
+ case CATEGORY_LAYOUT_GENGRID:
+ elm_object_item_signal_callback_add(item,
+ MUSIC_SIGNAL_BTN_CLICKED, MUSIC_BASE_VIEW,
+ sm_CbItemSelect, this);
+ break;
+
+ default:
+ break;
+ }
+}
+
+
+void CCategoryLayout::OnUnrealized(int id, Evas_Object *obj, Elm_Object_Item *item)
+{
+ switch (id) {
+ case CATEGORY_LAYOUT_GENGRID:
+ elm_object_item_signal_callback_del(item,
+ MUSIC_SIGNAL_BTN_CLICKED, MUSIC_BASE_VIEW,
+ sm_CbItemSelect);
+ break;
- t_UpdateLayoutWithFocus();
+ default:
+ break;
}
}
#include "define.h"
#include "common.h"
#include "common-ui.h"
+#include "dbg.h"
+#include <AppCommon.h>
+#include <InputHandler.h>
#include "entry-popup.h"
//#define KEY_SELECT "Select"
#define KEY_POPUP_ENTER "Return"
-struct entrypopup_data {
+
+struct SEntryPopup {
Evas_Object *layout;
Evas_Object *entry;
- void (*entryname_cb)(void *, const char *);
+ void(*cbEntryName)(void *, const char *);
void *data;
Ecore_Idler *idler;
};
-static void _entry_key_pressed(void *dt, Evas *e, Evas_Object *obj, void *ei)
-{
- struct entrypopup_data *epd;
- Evas_Event_Key_Down *ev;
- const char *str;
-
- if (!obj || !e || !ei || !dt)
- return;
-
- epd = (entrypopup_data *)dt;
- ev = (Evas_Event_Key_Down *)ei;
- if (!ev->keyname)
- return;
-
- if (strcmp(ev->keyname, KEY_BACK) == 0)
- destroy_entry_popup(epd->layout);
- // Keyname should be checked!!!
- else if (strcmp(ev->keyname, KEY_POPUP_ENTER/*KEY_SELECT*/) == 0) {
- str = elm_entry_entry_get(obj);
- if (epd->entryname_cb && str)
- epd->entryname_cb(epd->data, str);
- }
-}
-
-static Eina_Bool _focus_idler_cb(void *dt)
+Eina_Bool CEntryPopup::sm_CbFocusIdler(void *dt)
{
- struct entrypopup_data *epd;
-
- if (!dt)
- return ECORE_CALLBACK_CANCEL;
-
- epd = (entrypopup_data *)dt;
- epd->idler = NULL;
- elm_object_focus_set(epd->entry, EINA_TRUE);
-
+ CEntryPopup *root = (CEntryPopup *)dt;
+ if (root)
+ root->m_OnFocusIdler();
return ECORE_CALLBACK_CANCEL;
}
-void destroy_entry_popup(Evas_Object *layout)
-{
- struct entrypopup_data *epd;
-
- if (!layout)
- return;
-
- epd = (entrypopup_data *)evas_object_data_get(layout, MUSIC_ENTRY_POPUP_DATA);
- if (epd) {
- if (epd->idler)
- ecore_idler_del(epd->idler);
- free(epd);
- }
- evas_object_del(layout);
+void CEntryPopup::m_OnFocusIdler(void)
+{
+ m->idler = NULL;
+ elm_object_focus_set(m->entry, EINA_TRUE);
}
-Evas_Object *create_entry_popup(Evas_Object *base, const char *text,
- void (*entryname_cb)(void *, const char *), void *data)
+
+bool CEntryPopup::Create(Evas_Object *base, const char *text, void(*cbEntryName)(void *, const char *), void *data)
{
+ ASSERT(!m);
+
Evas_Object *layout, *entry;
- struct entrypopup_data *epd;
if (!base)
return NULL;
+ m = new SEntryPopup;
+ if (!m) {
+ return NULL;
+ }
+
layout = elm_layout_add(base);
- if (!layout)
+ if (!layout) {
+ delete m;
return NULL;
+ }
elm_layout_file_set(layout, EDJEFILE, MUSIC_ENTRY_POPUP_LAYOUT);
evas_object_size_hint_weight_set(layout,
- EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(layout,
- EVAS_HINT_FILL, EVAS_HINT_FILL);
+ EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(layout);
entry = elm_entry_add(layout);
if (!entry) {
evas_object_del(layout);
+ delete m;
return NULL;
}
elm_object_style_set(entry, MUSIC_STYLE_ENTRY);
elm_entry_single_line_set(entry, EINA_TRUE);
elm_entry_input_panel_language_set(entry,
- ELM_INPUT_PANEL_LANG_ALPHABET);
+ ELM_INPUT_PANEL_LANG_ALPHABET);
evas_object_size_hint_weight_set(entry,
- EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(entry,
- EVAS_HINT_FILL, EVAS_HINT_FILL);
+ EVAS_HINT_FILL, EVAS_HINT_FILL);
if (text)
elm_entry_entry_set(entry, text);
elm_entry_cursor_end_set(entry);
elm_object_part_content_set(layout, MUSIC_PART_ENTRY, entry);
- epd = (entrypopup_data *)calloc(1, sizeof(*epd));
- if (!epd) {
- evas_object_del(layout);
- return NULL;
- }
+ m->layout = layout;
+ m->entry = entry;
+ m->cbEntryName = cbEntryName;
+ m->data = data;
+ m->idler = ecore_idler_add(sm_CbFocusIdler, this);
+
+ Connect(entry);
+}
- epd->layout = layout;
- epd->entry = entry;
- epd->entryname_cb = entryname_cb;
- epd->data = data;
- epd->idler = ecore_idler_add(_focus_idler_cb, epd);
- evas_object_event_callback_add(entry, EVAS_CALLBACK_KEY_DOWN,
- _entry_key_pressed, epd);
- evas_object_data_set(layout, MUSIC_ENTRY_POPUP_DATA, epd);
+void CEntryPopup::Destroy(void)
+{
+ ASSERT(m);
+
+ if (m->idler)
+ ecore_idler_del(m->idler);
+
+ evas_object_del(m->layout);
+ delete m;
+}
+
+
+bool CEntryPopup::FlagCreate(void)
+{
+ return !!m;
+}
- return layout;
+
+void CEntryPopup::OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev)
+{
+ const char *str;
+
+ if (!obj || !e)
+ return;
+
+ if (!ev->keyname)
+ return;
+
+ if (strcmp(ev->keyname, KEY_BACK) == 0)
+ Destroy();
+ // Keyname should be checked!!!
+ else if (strcmp(ev->keyname, KEY_POPUP_ENTER/*KEY_SELECT*/) == 0) {
+ str = elm_entry_entry_get(obj);
+ if (m->cbEntryName && str)
+ m->cbEntryName(m->data, str);
+ }
}
enum EObjectType {
+ FOLDER_LAYOUT,
+ FOLDER_LAYOUT_GENGRID,
FOLDER_LAYOUT_PLAY_BUTTON,
FOLDER_LAYOUT_NEXT_BUTTON,
FOLDER_LAYOUT_LAST_BUTTON,
- FOLDER_LAYOUT,
- FOLDER_LAYOUT_GENGRID,
+};
+
+enum EBtnType {
+ BTN_PLAY,
+ BTN_NEXT,
+ BTN_LAST
};
struct SFolderItemInfo {
const char *part;
const char *style;
const char *icon;
+ EObjectType type;
};
struct SFolderLayout {
Evas_Object *img;
SBtnInfo btninfo[TOTAL_ADD_BTNS];
- btninfo[FOLDER_LAYOUT_PLAY_BUTTON].name = MUSIC_STR_PLAY;
- btninfo[FOLDER_LAYOUT_PLAY_BUTTON].part = MUSIC_PART_FOLDER_PLAYBTN;
- btninfo[FOLDER_LAYOUT_PLAY_BUTTON].style = MUSIC_STYLE_ADD_PLAY_BTN;
- btninfo[FOLDER_LAYOUT_PLAY_BUTTON].icon = MUSIC_IMAGE_ADD_PLAY;
+ btninfo[BTN_PLAY].name = MUSIC_STR_PLAY;
+ btninfo[BTN_PLAY].part = MUSIC_PART_FOLDER_PLAYBTN;
+ btninfo[BTN_PLAY].style = MUSIC_STYLE_ADD_PLAY_BTN;
+ btninfo[BTN_PLAY].icon = MUSIC_IMAGE_ADD_PLAY;
+ btninfo[BTN_PLAY].type = FOLDER_LAYOUT_PLAY_BUTTON;
- btninfo[FOLDER_LAYOUT_NEXT_BUTTON].name = MUSIC_STR_ADDNEXT;
- btninfo[FOLDER_LAYOUT_NEXT_BUTTON].part = MUSIC_PART_FOLDER_NEXTBTN;
- btninfo[FOLDER_LAYOUT_NEXT_BUTTON].style = MUSIC_STYLE_ADD_NEXT_BTN;
- btninfo[FOLDER_LAYOUT_NEXT_BUTTON].icon = MUSIC_IMAGE_ADD_NEXT;
+ btninfo[BTN_NEXT].name = MUSIC_STR_ADDNEXT;
+ btninfo[BTN_NEXT].part = MUSIC_PART_FOLDER_NEXTBTN;
+ btninfo[BTN_NEXT].style = MUSIC_STYLE_ADD_NEXT_BTN;
+ btninfo[BTN_NEXT].icon = MUSIC_IMAGE_ADD_NEXT;
+ btninfo[BTN_NEXT].type = FOLDER_LAYOUT_NEXT_BUTTON;
- btninfo[FOLDER_LAYOUT_LAST_BUTTON].name = MUSIC_STR_ADDLAST;
- btninfo[FOLDER_LAYOUT_LAST_BUTTON].part = MUSIC_PART_FOLDER_LASTBTN;
- btninfo[FOLDER_LAYOUT_LAST_BUTTON].style = MUSIC_STYLE_ADD_LAST_BTN;
- btninfo[FOLDER_LAYOUT_LAST_BUTTON].icon = MUSIC_IMAGE_ADD_LAST;
+ btninfo[BTN_LAST].name = MUSIC_STR_ADDLAST;
+ btninfo[BTN_LAST].part = MUSIC_PART_FOLDER_LASTBTN;
+ btninfo[BTN_LAST].style = MUSIC_STYLE_ADD_LAST_BTN;
+ btninfo[BTN_LAST].icon = MUSIC_IMAGE_ADD_LAST;
+ btninfo[BTN_LAST].type = FOLDER_LAYOUT_LAST_BUTTON;
for (i = 0; i < TOTAL_ADD_BTNS; i++) {
btn = elm_button_add(Layout());
elm_object_text_set(btn, _(btninfo[i].name));
elm_object_style_set(btn, btninfo[i].style);
- Connect(btn, i, TYPE_MOUSE_MOVE | TYPE_CLICKED);
+ Connect(btn, btninfo[i].type, TYPE_MOUSE_MOVE | TYPE_CLICKED);
img = elm_image_add(btn);
if (img) {
const char *txt;
const char *part;
EEvasObject type;
- //Evas_Smart_Cb cb;
};
enum EPressTypes {
m->eoErrPopup = popup;
Connect(btn, EO_ERROR_POPUP_BUTTON, TYPE_CLICKED | TYPE_KEY_DOWN);
- //evas_object_smart_callback_add(btn, MUSIC_SIGNAL_CLICKED, sm_CbPopupOkBtnClicked, m);
- //evas_object_event_callback_add(btn, EVAS_CALLBACK_KEY_DOWN, sm_CbPopupOkKeyPressed, m);
+
elm_object_focus_set(btn, EINA_TRUE);
return;
SBtnInfo btninfo[TOTAL_SETTING_BTNS];
btninfo[BTN_EDIT].txt = MUSIC_TEXT_EDIT_PLAYLIST;
- //btninfo[BTN_EDIT].cb = sm_CbEditBtnClicked;
btninfo[BTN_EDIT].type = EO_EDIT_PLAYLIST;
btninfo[BTN_CLEAR].txt = MUSIC_TEXT_CLEAR_PLAYLIST;
- //btninfo[BTN_CLEAR].cb = sm_CbClearBtnClicked;
btninfo[BTN_CLEAR].type = EO_CLEAR_PLAYLIST;
eoCtxPopup = elm_ctxpopup_add(m->eoWin);
elm_object_text_set(m->eoBtnSetting[i], _(btninfo[i].txt));
Connect(m->eoBtnSetting[i], btninfo[i].type, TYPE_CLICKED | TYPE_MOUSE_MOVE);
- //evas_object_smart_callback_add(m->eoBtnSetting[i], MUSIC_SIGNAL_CLICKED, btninfo[i].cb, m);
- //evas_object_event_callback_add(m->eoBtnSetting[i], EVAS_CALLBACK_MOUSE_MOVE, _object_mouse_moved, m);
evas_object_show(m->eoBtnSetting[i]);
}
scale = elm_config_scale_get();
Connect(box, EO_BOX, TYPE_KEY_DOWN);
- //evas_object_event_callback_add(box, EVAS_CALLBACK_KEY_DOWN, sm_CbPopupKeyPressed, m);
elm_object_part_content_set(m->eoBase, MUSIC_PART_SETTINGS_POPUP, eoCtxPopup);
/* If list empty disable these options */
return;
m_HandleOnUnpressed(m->eoBtnControl[BTN_FORWARD]);
- //sm_CbOnUnpressed(m, m->eoBtnControl[BTN_FORWARD], NULL);
}
return;
m_HandleOnUnpressed(m->eoBtnControl[BTN_REWIND]);
- //sm_CbOnUnpressed(m, m->eoBtnControl[BTN_REWIND], NULL);
}
else if (strcmp(keyname, (char*)KEY_PREVIOUS) == 0)
m_KeyPreviousPress();
else if (strcmp(keyname, (char*)KEY_VOLUMEUP) == 0)
- m->pHandleVolume->Up(); //m_KeyVolumeupPress();
+ m->pHandleVolume->Up();
else if (strcmp(keyname, (char*)KEY_VOLUMEDOWN) == 0)
- m->pHandleVolume->Down();// m_KeyVolumedownPress();
+ m->pHandleVolume->Down();
else if (strcmp(keyname, (char*)KEY_MUTE) == 0)
- m->pHandleVolume->Mute(); // m_KeyMutePress();
+ m->pHandleVolume->Mute();
}
elm_object_part_content_set(m->eoBase, MUSIC_PART_PROGRESSBAR, eoSlider);
Connect(eoSlider, EO_SLIDER, TYPE_CHANGED | TYPE_MOUSE_MOVE);
- //evas_object_smart_callback_add(eoSlider, MUSIC_SIGNAL_CHANGED, sm_CbSliderValueChanged, m);
- //evas_object_event_callback_add(eoSlider, EVAS_CALLBACK_MOUSE_MOVE, _object_mouse_moved, m);
+
evas_object_show(eoSlider);
m->eoSlider = eoSlider;
}
SBtnInfo btninfo[TOTAL_EDIT_BTNS];
btninfo[BTN_CANCEL].txt = MUSIC_TEXT_CANCEL;
- //btninfo[BTN_CANCEL].cb = sm_CbCancelBtnClicked;
btninfo[BTN_CANCEL].type = EO_CANCEL;
btninfo[BTN_DESELECT].txt = MUSIC_TEXT_DESELECT;
- //btninfo[BTN_DESELECT].cb = sm_CbDeselectBtnClicked;
btninfo[BTN_DESELECT].type = EO_DESELECT;
btninfo[BTN_DELETE].txt = MUSIC_TEXT_DELETE;
- //btninfo[BTN_DELETE].cb = sm_CbDeleteBtnClicked;
btninfo[BTN_DELETE].type = EO_DELETE;
box = _add_box(m->eoBase);
elm_box_pack_end(box, m->eoBtnEdit[i]);
elm_object_text_set(m->eoBtnEdit[i], _(btninfo[i].txt));
- //evas_object_smart_callback_add(m->eoBtnEdit[i], MUSIC_SIGNAL_CLICKED, btninfo[i].cb, m);
- //evas_object_event_callback_add(m->eoBtnEdit[i], EVAS_CALLBACK_MOUSE_MOVE, _object_mouse_moved, m);
+ Connect(m->eoBtnEdit[i], btninfo[i].type, TYPE_CLICKED | TYPE_MOUSE_MOVE);
evas_object_show(m->eoBtnEdit[i]);
}
SBtnInfo btninfo[TOTAL_CONTROL_BTNS];
btninfo[BTN_SETTINGS].txt = MUSIC_STYLE_BTN_SETTINGS;
- //btninfo[BTN_SETTINGS].cb = sm_CbSettingsBtnClicked;
btninfo[BTN_SETTINGS].type = EO_BTN_SETTINGS;
btninfo[BTN_SHUFFLE].txt = MUSIC_STYLE_BTN_SHUFFLE;
- //btninfo[BTN_SHUFFLE].cb = sm_CbShuffleBtnClicked;
btninfo[BTN_SHUFFLE].type = EO_BTN_SHUFFLE;
btninfo[BTN_REPEAT].txt = MUSIC_STYLE_BTN_REPEAT;
- //btninfo[BTN_REPEAT].cb = sm_CbRepeatBtnClicked;
btninfo[BTN_REPEAT].type = EO_BTN_REPEAT;
btninfo[BTN_REWIND].txt = MUSIC_STYLE_BTN_REWIND;
btninfo[BTN_REWIND].type = EO_BTN_REWIND;
btninfo[BTN_PLAY].txt = MUSIC_STYLE_BTN_PLAY;
- //btninfo[BTN_PLAY].cb = sm_CbPlayBtnClicked;
btninfo[BTN_PLAY].type = EO_BTN_PLAY;
btninfo[BTN_FORWARD].txt = MUSIC_STYLE_BTN_FORWARD;
if (i == BTN_REWIND || i == BTN_FORWARD) {
Connect(m->eoBtnControl[i], btninfo[i].type, TYPE_PRESSED | TYPE_UNPRESSED | TYPE_MOUSE_MOVE);
- //evas_object_smart_callback_add(m->eoBtnControl[i], MUSIC_SIGNAL_PRESSED, sm_CbOnPressed, m);
- //evas_object_smart_callback_add(m->eoBtnControl[i], MUSIC_SIGNAL_UNPRESSED, sm_CbOnUnpressed, m);
}
else {
Connect(m->eoBtnControl[i], btninfo[i].type, TYPE_CLICKED | TYPE_MOUSE_MOVE);
- //evas_object_smart_callback_add(m->eoBtnControl[i], MUSIC_SIGNAL_CLICKED, btninfo[i].cb, m);
}
- //evas_object_event_callback_add(m->eoBtnControl[i], EVAS_CALLBACK_MOUSE_MOVE, _object_mouse_moved, m);
evas_object_show(m->eoBtnControl[i]);
}
elm_genlist_multi_select_set(genlist, EINA_FALSE);
Connect(genlist, EO_PLAYLIST, TYPE_REALIZED | TYPE_UNREALIZED | TYPE_MOUSE_MOVE | TYPE_KEY_DOWN | TYPE_ACTIVATED);
- //evas_object_smart_callback_add(genlist, MUSIC_SIGNAL_ACTIVATED, sm_CbGenlistItemActivated, m);
- //evas_object_smart_callback_add(genlist, MUSIC_SIGNAL_REALIZED, sm_CbGenlistRealized, m);
- //evas_object_smart_callback_add(genlist, MUSIC_SIGNAL_UNREALIZED, sm_CbGenlistUnrealized, m);
- //evas_object_event_callback_add(genlist, EVAS_CALLBACK_MOUSE_MOVE, _genlist_mouse_moved, m);
- //evas_object_event_callback_add(genlist, EVAS_CALLBACK_KEY_DOWN, sm_CbKeyDown, m);
+
evas_object_show(genlist);
m->eoPlaylist = genlist;
}
m_UpdatePlaymodeFocusSequence();
Connect(m->eoBase, EO_BASE, TYPE_KEY_DOWN | TYPE_KEY_UP);
- //evas_object_event_callback_add(eoBase, EVAS_CALLBACK_KEY_DOWN, sm_CbKeyPressed, m);
- //evas_object_event_callback_add(eoBase, EVAS_CALLBACK_KEY_UP, sm_CbKeyReleased, m);
m->hMusicController->AddListener(this);
- //m->cbInfo[E_SONG_COMPLETE] = m->hMusicController->AddCallback(E_SONG_COMPLETE, sm_CbUpdateCurrentSongInfo, m);
- //m->cbInfo[E_PLAYBACK_ERROR] = m->hMusicController->AddCallback(E_PLAYBACK_ERROR, sm_CbPlaybackError, m);
return true;
}
ASSERT(m);
m->hMusicController->RemoveListener(this);
- //m->hMusicController->RemoveCallback(m->cbInfo[E_SONG_COMPLETE]);
- //m->hMusicController->RemoveCallback(m->cbInfo[E_PLAYBACK_ERROR]);
m_DestroyErrorPopup();
id = category_info_get_category_id(t.c_catinfo);
str = strdup(name);
- destroy_entry_popup(t.epopup);
- t.epopup = NULL;
+ t.epopup->Destroy();
if (CMusicController::GetInstance()->MediaExistPlaylist(str)) {
_create_message_box(Layout(), MUSIC_TEXT_INUSE_MSG);
}
else if (type == ACTION_TYPE_RENAME) {
text = category_info_get_name(catinfo);
- if (t.epopup)
- destroy_entry_popup(t.epopup);
+ if (t.epopup->FlagCreate())
+ t.epopup->Destroy();
- t.epopup = create_entry_popup(t.base, text, sm_CbEntryRename, this);
+ t.epopup->Create(t.base, text, sm_CbEntryRename, this);
}
else if (type == ACTION_TYPE_ADDSONG) {