src/views/HandleVolume.cpp
src/views/common-ui.cpp
src/views/ExtBaseLayout.cpp
+ src/views/Info.cpp
+ src/views/SourceCtxPopup.cpp
+ src/views/SortCtxPopup.cpp
src/playback/playlist-mgr.cpp
src/playback/music-controller.cpp
src/playback/playback-mgr.cpp
--- /dev/null
+#ifndef __INFO_H__
+#define __INFO_H__
+
+
+class CInfo {
+public:
+
+ static void SetSourceType(int source_type);
+ static int SourceType(void);
+
+ static void SetSortType(int type);
+ static int SortType(void);
+};
+
+
+#endif /* __INFO_H__ */
\ No newline at end of file
#define __MUSIC_BASE_VIEW_H__
+#include <CtxPopup.h>
+
+
struct SArgList {
char *album_id;
char *uri;
static void sm_CbHandleEmptyStatus(void *cookie, bool emptyStatus);
void m_OnHandleEmptyStatus(bool emptyStatus);
- static void sm_CbCtxPopupBtnClicked(void *dt, Evas_Object *obj, void *ev);
- void m_CbCtxPopupBtnClicked(Evas_Object *obj, void *ev);
-
- static void sm_CbCtxPopupBtnKeyPressed(void *dt, Evas *e, Evas_Object *obj, void *ei);
- void m_OnCtxPopupBtnKeyPressed(Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev);
+ static void sm_CbCtxPopupBtnSelected(void* cookie, CCtxPopup* instance, const char* text);
+ void m_CbCtxPopupBtnSelected(CCtxPopup* instance, const char* text);
private:
void m_UpdateFocusSequence(void);
void m_ShowCurrentLayout(void);
void m_GotoPlayback(void);
- static bool sm_FindIndex(const char **arr, int arrsize, const char *text, int *index);
-
void m_CreateCtxPopup(int btnType);
void m_DestroyCtxPopup(void);
#define MUSIC_SWALLOW_ICON "elm.swallow.icon"
#define MUSIC_PART_POPUP_BUTTON "button1"
+/* CTXPOPUP POSITION */
+#define POSITION_SORT_POPUP_X 1344
+#define POSITION_SORT_POPUP_Y 155
+#define POSITION_SOURCE_POPUP_X 1654
+#define POSITION_SOURCE_POPUP_Y 155
+
#endif /* __DEFINE_H__ */
int RepeatState(void);
bool SetRepeatState(int state);
- int SourceType(void);
- int SortType(void);
-
- bool SetSourceType(int type);
- bool SetSortType(int type);
bool SetPosition(int milsec);
bool GetPosition(int *const milseconds);
#include "mediadata.h"
#include "common.h"
#include "bus.h"
+#include "Info.h"
struct SMusicController {
int playstate;
int shufflestate;
int repeatstate;
- int source_type;
- int sort_type;
struct SCbInfo *cbinfo;
SMusicController() {
mhandle->shufflestate = SHUFFLE_STATUS_OFF;
mhandle->repeatstate = REPEAT_STATUS_ALL;
mhandle->initial_index = 0;
- mhandle->sort_type = E_SORT_TITLE_A_Z;
- mhandle->source_type = SOURCE_TYPE_ALL;
+ CInfo::SetSortType(E_SORT_TITLE_A_Z);
+ CInfo::SetSourceType(SOURCE_TYPE_ALL);
mhandle->alinfo = new CAlbumInfo;
if (!mhandle->alinfo->Create()) {
Eina_List *mlist;
- mlist = m->pMediadata->Medialist(m->source_type, EListType, info);
+ mlist = m->pMediadata->Medialist(CInfo::SourceType(), EListType, info);
if (!mlist)
return false;
}
-int CMusicController::SourceType(void)
-{
- if (!m)
- return -1;
-
- return m->source_type;
-}
-
-
-int CMusicController::SortType(void)
-{
- if (!m)
- return -1;
-
- return m->sort_type;
-}
-
-
-bool CMusicController::SetSourceType(int type)
-{
- if (!m)
- return false;
-
- m->source_type = type;
-
- return true;
-}
-
-
-bool CMusicController::SetSortType(int type)
-{
- if (!m)
- return false;
-
- m->sort_type = type;
-
- return true;
-}
-
-
void CMusicController::OnConnect(void)
{
if (!m)
struct SCbInfo *cbinfo;
void *obj;
- if (SourceType() == SOURCE_TYPE_USB) {
+ if (CInfo::SourceType() == SOURCE_TYPE_USB) {
if (!FlagConnected())
- SetSourceType(SOURCE_TYPE_ALL);
+ CInfo::SetSourceType(SOURCE_TYPE_ALL);
}
EINA_LIST_FOREACH(m->elListener, l, obj) {
if (!m->player)
return false;
- r = player_set_play_position(m->player, milsec, false, _on_seek_completion, m);
+ /*r = player_set_play_position(m->player, milsec, false, _on_seek_completion, m);
if (r != PLAYER_ERROR_NONE) {
_ERR("Player set position failed");
return false;
- }
+ }*/
return true;
}
if (!m->player)
return false;
- r = player_get_play_position(m->player, milsec);
+ /*r = player_get_play_position(m->player, milsec);
if (r != PLAYER_ERROR_NONE) {
_ERR("Player set position failed");
return false;
- }
+ }*/
+ *milsec = 0;
return true;
}
\ No newline at end of file
--- /dev/null
+/*
+* Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an AS IS BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include <Elementary.h>
+#include <Eina.h>
+#include <Ecore.h>
+#include <utilX.h>
+#include "i18n.h"
+#include "define.h"
+#include "common.h"
+#include "ExtNameInfo.h"
+#include "Info.h"
+
+
+struct SInfo {
+ int source_type;
+ int sort_type;
+};
+
+static SInfo g_info;
+
+void CInfo::SetSourceType(int source_type)
+{
+ g_info.source_type = source_type;
+}
+
+int CInfo::SourceType(void)
+{
+ return g_info.source_type;
+}
+
+void CInfo::SetSortType(int type)
+{
+ g_info.sort_type = type;
+}
+
+int CInfo::SortType(void)
+{
+ return g_info.sort_type;
+}
--- /dev/null
+/*
+* Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an AS IS BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include <Elementary.h>
+#include <Eina.h>
+#include <Ecore.h>
+#include "i18n.h"
+#include "define.h"
+#include <AppCommon.h>
+#include "dbg.h"
+
+#include "Info.h"
+#include "CtxPopup.h"
+#include <app-res-defines.h>
+#include "SortCtxPopup.h"
+
+const char *sortTextSong[] = {
+ N_("Title A-Z"),
+ N_("Title Z-A"),
+ N_("Artist A-Z"),
+ N_("Artist Z-A"),
+ N_("Album A-Z"),
+ N_("Album Z-A")
+};
+
+const char *sortBtnIdsSong[] = {
+ "Title A-Z",
+ "Title Z-A",
+ "Artist A-Z",
+ "Artist Z-A",
+ "Album A-Z",
+ "Album Z-A"
+};
+
+const char *sortTextAlbum[] = {
+ N_("Album A-Z"),
+ N_("Album Z-A")
+};
+
+const char *sortBtnIdsAlbum[] = {
+ "Album A-Z",
+ "Album Z-A"
+};
+
+const char *sortTextArtist[] = {
+ N_("Artist A-Z"),
+ N_("Artist Z-A")
+};
+
+const char *sortBtnIdsArtist[] = {
+ "Artist A-Z",
+ "Artist Z-A",
+};
+
+const char *sortTextGenre[] = {
+ N_("Genre A-Z"),
+ N_("Genre Z-A")
+};
+
+const char *sortBtnIdsGenre[] = {
+ "Genre A-Z",
+ "Genre Z-A",
+};
+
+const char *sortTextFolder[] = {
+ N_("Title A-Z"),
+ N_("Title Z-A")
+};
+
+const char *sortBtnIdsFolder[] = {
+ "Title A-Z",
+ "Title Z-A",
+};
+
+const char *sortTextPlaylists[] = {
+ N_("Playlist A-Z"),
+ N_("Playlist Z-A")
+};
+
+const char *sortBtnIdsPlaylists[] = {
+ "Playlist A-Z",
+ "Playlist Z-A",
+};
+
+
+const char **sortText;
+const char **sortBtnIds;
+static int arraySize = 0;
+
+void CSortCtxPopup::t_OnConfiguration(void)
+{
+ t_SetList(sortText, arraySize, (int)CInfo::SortType(),
+ CCtxPopup::TOPBTN_SORT, sortBtnIds,
+ POSITION_SORT_POPUP_X, POSITION_SORT_POPUP_Y,
+ MUSIC_STYLE_HOVER_CTXPOPUP,
+ MUSIC_STYLE_HOVER_ENTRY, MUSIC_STYLE_HOVER_ENTRY, MUSIC_STYLE_HOVER_ENTRY);
+}
+
+void CSortCtxPopup::t_OnBtnClicked(Evas_Object* obj, void* ev)
+{
+ if (!obj)
+ return;
+
+ int index = -1;
+ const char *id = (const char*)evas_object_data_get(obj, BTN_ID);
+
+ if (!id)
+ return;
+
+ // Find Index
+ int i;
+ for (i = 0; i < arraySize; i++) {
+ if (sortBtnIds[i] && !strcmp(sortBtnIds[i], id)) {
+ index = i;
+ break;
+ }
+ }
+
+ if (index == -1 || index == CInfo::SortType())
+ return;
+
+ CInfo::SetSortType(index);
+ CCtxPopup::t_OnBtnClicked(obj, ev);
+
+ Destroy();
+}
+
+
+bool CSortCtxPopup::Create(Evas_Object* base, const SCallback* callback, ESortBtnType type)
+{
+ switch (type) {
+ case TYPE_SONG:
+ sortText = sortTextSong;
+ sortBtnIds = sortBtnIdsSong;
+ arraySize = sizeof(sortTextSong) / sizeof(sortTextSong[0]);
+ break;
+
+ case TYPE_ALBUM:
+ sortText = sortTextAlbum;
+ sortBtnIds = sortBtnIdsAlbum;
+ arraySize = sizeof(sortTextAlbum) / sizeof(sortTextAlbum[0]);
+ break;
+
+ case TYPE_ARTIST:
+ sortText = sortTextArtist;
+ sortBtnIds = sortBtnIdsArtist;
+ arraySize = sizeof(sortTextArtist) / sizeof(sortTextArtist[0]);
+ break;
+
+ case TYPE_GENRE:
+ sortText = sortTextGenre;
+ sortBtnIds = sortBtnIdsGenre;
+ arraySize = sizeof(sortTextGenre) / sizeof(sortTextGenre[0]);
+ break;
+
+ case TYPE_FOLDER:
+ sortText = sortTextFolder;
+ sortBtnIds = sortBtnIdsFolder;
+ arraySize = sizeof(sortTextFolder) / sizeof(sortTextFolder[0]);
+ break;
+
+ case TYPE_PLAYLIST:
+ sortText = sortTextPlaylists;
+ sortBtnIds = sortBtnIdsPlaylists;
+ arraySize = sizeof(sortTextPlaylists) / sizeof(sortTextPlaylists[0]);
+ break;
+
+ default:
+ _ERR("Invalid Type!!");
+ ASSERT(0);
+ break;
+ }
+
+ bool r = CCtxPopup::Create(base, callback);
+ if (r == false) {
+ _ERR("CCtxPopup::Create failed");
+ return false;
+ }
+
+ return true;
+}
+
+
+const char* CSortCtxPopup::SortText(int index)
+{
+ return sortText[index];
+}
--- /dev/null
+#ifndef __SORT_CTX_POPUP_H__
+#define __SORT_CTX_POPUP_H__
+
+
+class CSortCtxPopup : public CCtxPopup {
+public:
+
+ enum ESortBtnType {
+ TYPE_SONG,
+ TYPE_ALBUM,
+ TYPE_ARTIST,
+ TYPE_GENRE,
+ TYPE_FOLDER,
+ TYPE_PLAYLIST
+ };
+
+protected:
+
+ virtual void t_OnConfiguration(void);
+ virtual void t_OnBtnClicked(Evas_Object* obj, void* ev);
+
+public:
+ bool Create(Evas_Object* base, const SCallback* callback, ESortBtnType type);
+ static const char* SortText(int index);
+};
+
+
+#endif /* __SORT_CTX_POPUP_H__ */
--- /dev/null
+/*
+* Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an AS IS BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include <Elementary.h>
+#include <Eina.h>
+#include <Ecore.h>
+#include "i18n.h"
+#include "define.h"
+#include "common.h"
+#include "Info.h"
+#include "CtxPopup.h"
+#include <MediaContentDbListener.h>
+#include <UsbConnectionListener.h>
+#include <app-res-defines.h>
+#include "SourceCtxPopup.h"
+
+const char *sourceText[] = {
+ N_("All Source"),
+ N_("TV"),
+ N_("USB"),
+};
+
+const char *srcBtnIds[] = {
+ "ALL",
+ "TV",
+ "USB"
+};
+
+void CSourceCtxPopup::t_OnConfiguration(void)
+{
+ int size = (sizeof(sourceText) / sizeof(sourceText[0]));
+
+ t_SetList(sourceText, size, (int)CInfo::SourceType(),
+ CCtxPopup::TOPBTN_SOURCE, srcBtnIds,
+ POSITION_SOURCE_POPUP_X, POSITION_SOURCE_POPUP_Y,
+ MUSIC_STYLE_HOVER_CTXPOPUP,
+ MUSIC_STYLE_HOVER_ENTRY, MUSIC_STYLE_HOVER_ENTRY, MUSIC_STYLE_HOVER_ENTRY);
+}
+
+
+void CSourceCtxPopup::t_OnBtnClicked(Evas_Object* obj, void* ev)
+{
+ if (!obj)
+ return;
+
+ int index = -1;
+ const char *id = (const char*)evas_object_data_get(obj, BTN_ID);
+
+ if (!id)
+ return;
+
+ // Find Index
+ int i;
+ int arrsize = (sizeof(srcBtnIds) / sizeof(srcBtnIds[0]));
+ for (i = 0; i < arrsize; i++) {
+ if (srcBtnIds[i] && !strcmp(srcBtnIds[i], id)) {
+ index = i;
+ break;
+ }
+ }
+ if (index == -1 || index == CInfo::SourceType())
+ return;
+
+ CInfo::SetSourceType(index);
+ CCtxPopup::t_OnBtnClicked(obj, ev);
+
+ Destroy();
+}
+
+const char* CSourceCtxPopup::SourceText(int index)
+{
+ return sourceText[index];
+}
--- /dev/null
+#ifndef __SOURCE_CTX_POPUP_H__
+#define __SOURCE_CTX_POPUP_H__
+
+
+class CSourceCtxPopup : public CCtxPopup {
+protected:
+
+ virtual void t_OnConfiguration(void);
+ virtual void t_OnBtnClicked(Evas_Object* obj, void* ev);
+
+public:
+
+ static const char* SourceText(int index);
+};
+
+
+#endif /* __SOURCE_CTX_POPUP_H__ */
#include "album-layout.h"
#include "album-songs-layout.h"
#include "base-view.h"
+#include "Info.h"
#define GENGRID_ITEM_SIZE_W (263+20)
#define GENGRID_ITEM_SIZE_H (359+20)
SORT_BY_NAME_ZA,
};
- sortType = m->mhandle->SortType();
+ sortType = CInfo::SortType();
m->alblist = CSort::Sort(m->alblist, sortFuncId[sortType]);
}
#include "BaseLayout.h"
#include "ExtBaseLayout.h"
#include "ViewMgr.h"
+#include <CtxPopup.h>
+#include "Info.h"
+#include "SourceCtxPopup.h"
+#include "SortCtxPopup.h"
#include "base-view.h"
#include "common-ui.h"
#include "volume-control.h"
Evas_Object *group_btn[TOTAL_GROUP_BTNS];
Evas_Object *srcbtn;
Evas_Object *sortbtn;
- Evas_Object *ctxpopup;
+ CCtxPopup *ctxpopup;
Evas_Object *popup;
Elm_Transit *transit;
Evas_Object *c_grpbtn;
}
-bool CMusicBaseView::sm_FindIndex(const char **arr, int arrsize, const char *text, int *index)
-{
- int i;
-
- if (!arr || !arrsize || !text)
- return false;
-
- for (i = 0; i < arrsize; i++) {
- if (arr[i] && !strcmp(arr[i], text)) {
- *index = i;
- return true;
- }
- }
-
- return false;
-}
-
-
void CMusicBaseView::m_CreateCtxPopup(int btnType)
{
- Evas_Object *ctxpopup = NULL, *box = NULL, *btn = NULL;
- Evas_Object *firstbtn = NULL;
- int i, size, selected_index;
- const char **arr;
+ CCtxPopup *ctxPopup = NULL;
const char *layout_id = NULL;
- const char *part = NULL;
-
- if (!m->base)
- return;
-
- ctxpopup = elm_ctxpopup_add(m->base);
- if (!ctxpopup)
- return;
-
- box = elm_box_add(ctxpopup);
- if (!box) {
- evas_object_del(ctxpopup);
- return;
- }
- evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, 0);
- evas_object_size_hint_align_set(box, EVAS_HINT_FILL, 0);
+ CCtxPopup::SCallback cb;
+ cb.onSelected = sm_CbCtxPopupBtnSelected;
+ cb.cookie = this;
if (btnType == BTN_SOURCE) {
- arr = g_sourceText;
- size = ARRAY_SIZE(g_sourceText);
- selected_index = m->mhandle->SourceType();
+ CSourceCtxPopup *srcCtxPopup = NULL;
m->btntype = btnType;
- part = MUSIC_PART_SOURCE_POPUP;
+ srcCtxPopup = new CSourceCtxPopup;
+ srcCtxPopup->Create(m->base, &cb);
+ ctxPopup = srcCtxPopup;
}
else if (btnType == BTN_SORT) {
- arr = g_sortText;
- size = ARRAY_SIZE(g_sortText);
+ CSortCtxPopup *sortCtxPopup = NULL;
+ CSortCtxPopup::ESortBtnType sortBtnType;
+ m->btntype = btnType;
layout_id = m->lmgr->Layout()->LayoutId();
+ sortCtxPopup = new CSortCtxPopup;
if (layout_id) {
if (!strcmp(layout_id, MUSIC_ALBUM_LAYOUT)) {
- arr = g_sortTextAlbum;
- size = ARRAY_SIZE(g_sortTextAlbum);
+ sortBtnType = CSortCtxPopup::TYPE_ALBUM;
}
else if (!strcmp(layout_id, MUSIC_FOLDER_LAYOUT)) {
- arr = g_sortTextFolder;
- size = ARRAY_SIZE(g_sortTextFolder);
+ sortBtnType = CSortCtxPopup::TYPE_FOLDER;
}
else if (!strcmp(layout_id, MUSIC_CATEGORY_PLAYLISTS_LAYOUT)) {
- arr = g_sortTextPlaylists;
- size = ARRAY_SIZE(g_sortTextPlaylists);
+ sortBtnType = CSortCtxPopup::TYPE_PLAYLIST;
}
else if (!strcmp(layout_id, MUSIC_CATEGORY_ARTIST_LAYOUT)) {
- arr = g_sortTextArtist;
- size = ARRAY_SIZE(g_sortTextArtist);
+ sortBtnType = CSortCtxPopup::TYPE_ARTIST;
}
else if (!strcmp(layout_id, MUSIC_CATEGORY_GENRE_LAYOUT)) {
- arr = g_sortTextGenre;
- size = ARRAY_SIZE(g_sortTextGenre);
+ sortBtnType = CSortCtxPopup::TYPE_GENRE;
}
}
- part = MUSIC_PART_SORT_POPUP;
- selected_index = m->mhandle->SortType();
- m->btntype = btnType;
+
+ sortCtxPopup->Create(m->base, &cb, sortBtnType);
+ ctxPopup = sortCtxPopup;
}
else {
- evas_object_del(ctxpopup);
+ _ERR("MUST NOT BE HERE!!");
+ ASSERT(0);
return;
}
- for (i = 0; i < size; i++) {
- if (btnType == BTN_SOURCE && i == SOURCE_TYPE_USB &&
- !m->mhandle->FlagConnected())
- continue;
-
- btn = s_AddButton(box);
- if (!btn) {
- evas_object_del(ctxpopup);
- return;
- }
- elm_object_style_set(btn, MUSIC_STYLE_HOVER_ENTRY);
- elm_object_text_set(btn, _(arr[i]));
- elm_box_pack_end(box, btn);
-
- if (i == 0)
- firstbtn = btn; /* to set focus later */
-
- if (i == selected_index)
- elm_object_signal_emit(btn,
- "elm,action,highlight", "elm");
-
- if (i == size - 1) {
- elm_object_signal_emit(btn,
- "elm,action,hideline", "elm");
- _ERR("hiding last line");
- }
-
- evas_object_smart_callback_add(btn, MUSIC_SIGNAL_CLICKED, sm_CbCtxPopupBtnClicked, this);
- evas_object_event_callback_add(btn, EVAS_CALLBACK_MOUSE_MOVE, _object_mouse_moved, m);
- evas_object_event_callback_add(btn, EVAS_CALLBACK_KEY_DOWN, sm_CbCtxPopupBtnKeyPressed, this);
- }
-
- elm_object_content_set(ctxpopup, box);
- elm_object_style_set(ctxpopup, MUSIC_STYLE_HOVER_CTXPOPUP);
- elm_ctxpopup_direction_priority_set(ctxpopup,
- ELM_CTXPOPUP_DIRECTION_DOWN, ELM_CTXPOPUP_DIRECTION_DOWN, ELM_CTXPOPUP_DIRECTION_DOWN, ELM_CTXPOPUP_DIRECTION_DOWN);
- elm_object_part_content_set(m->base, part, ctxpopup);
-
- m->ctxpopup = ctxpopup;
-
- if (firstbtn && btn) {
- elm_object_focus_set(firstbtn, EINA_TRUE);
- elm_object_focus_next_object_set(firstbtn,
- btn, ELM_FOCUS_UP);
- elm_object_focus_next_object_set(btn,
- firstbtn, ELM_FOCUS_DOWN);
- }
+ m->ctxpopup = ctxPopup;
}
if (!m->ctxpopup)
return;
- evas_object_hide(m->ctxpopup);
- evas_object_del(m->ctxpopup);
+ if (m->ctxpopup->FlagCreate())
+ m->ctxpopup->Destroy();
+
+ delete m->ctxpopup;
m->ctxpopup = NULL;
}
-void CMusicBaseView::sm_CbCtxPopupBtnClicked(void *dt, Evas_Object *obj, void *ev)
+void CMusicBaseView::sm_CbCtxPopupBtnSelected(void* cookie, CCtxPopup* instance, const char* text)
{
- CMusicBaseView *root = (CMusicBaseView*)dt;
+ CMusicBaseView *root = (CMusicBaseView*)cookie;
if (root)
- root->m_CbCtxPopupBtnClicked(obj, ev);
+ root->m_CbCtxPopupBtnSelected(instance, text);
}
-void CMusicBaseView::m_CbCtxPopupBtnClicked(Evas_Object *obj, void *ev)
+void CMusicBaseView::m_CbCtxPopupBtnSelected(CCtxPopup* instance, const char* text)
{
- const char *text = NULL;
- const char *layout_id = NULL;
- int size = 0;
- int type = 0;
-
- text = elm_object_text_get(obj);
-
if (m->btntype == BTN_SOURCE) {
- size = ARRAY_SIZE(g_sourceText);
- sm_FindIndex(g_sourceText, size, text, &type);
- m_DestroyCtxPopup();
- if (type == m->mhandle->SourceType())
- return;
-
- m->mhandle->SetSourceType(type);
elm_object_text_set(m->srcbtn, _(text));
- }
- else {
- layout_id = m->lmgr->Layout()->LayoutId();
- if (!strcmp(layout_id, MUSIC_FOLDER_LAYOUT)) {
- size = ARRAY_SIZE(g_sortTextFolder);
- sm_FindIndex(g_sortTextFolder, size, text, &type);
- }
- else if (!strcmp(layout_id, MUSIC_ALBUM_LAYOUT)) {
- size = ARRAY_SIZE(g_sortTextAlbum);
- sm_FindIndex(g_sortTextAlbum, size, text, &type);
- }
- else if (!strcmp(layout_id, MUSIC_CATEGORY_PLAYLISTS_LAYOUT)) {
- size = ARRAY_SIZE(g_sortTextPlaylists);
- sm_FindIndex(g_sortTextPlaylists, size, text, &type);
- }
- else if (!strcmp(layout_id, MUSIC_CATEGORY_ARTIST_LAYOUT)) {
- size = ARRAY_SIZE(g_sortTextArtist);
- sm_FindIndex(g_sortTextArtist, size, text, &type);
- }
- else if (!strcmp(layout_id, MUSIC_CATEGORY_GENRE_LAYOUT)) {
- size = ARRAY_SIZE(g_sortTextGenre);
- sm_FindIndex(g_sortTextGenre, size, text, &type);
- }
- else {
- size = ARRAY_SIZE(g_sortText);
- sm_FindIndex(g_sortText, size, text, &type);
- }
- m_DestroyCtxPopup();
- if (type == m->mhandle->SortType())
- return;
-
- m->mhandle->SetSortType(type);
- elm_object_text_set(m->sortbtn, _(text));
- }
-
- if (m->btntype == BTN_SOURCE) {
if (m->c_grpbtn != m->group_btn[GROUP_BTN_PLAYLIST])
m_ShowCurrentLayout();
}
else {
+ elm_object_text_set(m->sortbtn, _(text));
m_UpdateCurrentLayout(false);
}
}
-void CMusicBaseView::sm_CbCtxPopupBtnKeyPressed(void *dt, Evas *e, Evas_Object *obj, void *ei)
-{
- CMusicBaseView *root = (CMusicBaseView*)dt;
- if (root)
- root->m_OnCtxPopupBtnKeyPressed(e, obj, (Evas_Event_Key_Down*)ei);
-}
-
-
-void CMusicBaseView::m_OnCtxPopupBtnKeyPressed(Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev)
-{
- if (strcmp(ev->keyname, KEY_BACK) == 0)
- m_DestroyCtxPopup();
-}
-
-
Evas_Object *CMusicBaseView::m_CreateLoadingPopup(void)
{
Evas_Object *popup = NULL, *label = NULL, *icon = NULL;
m->sortbtn = btn;
}
- type = m->mhandle->SourceType();
+ type = CInfo::SourceType();
elm_object_text_set(m->srcbtn, _(g_sourceText[type]));
- type = m->mhandle->SortType();
+ type = CInfo::SortType();
elm_object_text_set(m->sortbtn, _(g_sortText[type]));
}
return;
if (!strcmp(g_sourceArg[SOURCE_TYPE_USB], m->arglist->source))
- m->mhandle->SetSourceType(SOURCE_TYPE_USB);
+ CInfo::SetSourceType(SOURCE_TYPE_USB);
else if (!strcmp(g_sourceArg[SOURCE_TYPE_TV], m->arglist->source))
- m->mhandle->SetSourceType(SOURCE_TYPE_TV);
+ CInfo::SetSourceType(SOURCE_TYPE_TV);
else
- m->mhandle->SetSourceType(SOURCE_TYPE_ALL);
+ CInfo::SetSourceType(SOURCE_TYPE_ALL);
}
else
elm_object_text_set(m->sortbtn, _(g_sortText[0]));
- m->mhandle->SetSortType(0);
+ CInfo::SetSortType(0);
m_ShowCurrentLayout();
}
m_DestroyPopup();
m_DestroyCtxPopup();
- source = m->mhandle->SourceType();
+ source = CInfo::SourceType();
elm_object_text_set(m->srcbtn, _(g_sourceText[source]));
if (source != SOURCE_TYPE_TV)
#include "ViewMgr.h"
#include "category-layout.h"
#include "base-view.h"
+#include "Info.h"
#define TOTAL_ADD_BTNS 3
#define TOTAL_SELECT_BTNS 3
int sortType;
- sortType = m->pMusicController->SortType();
+ sortType = CInfo::SortType();
+
m->catlist = CSort::Sort(m->catlist, sortFuncType[sortType]);
}
#include "ViewMgr.h"
#include "folder-layout.h"
#include "base-view.h"
+#include "Info.h"
#define TOTAL_ADD_BTNS 3
#define GENGRID_ITEM_SIZE_W (263+20)
if (!m->flist)
return;
- sortType = m->mhandle->SortType();
+ sortType = CInfo::SortType();
+
m->flist = CSort::Sort(m->flist, sortFuncId[sortType]);
}
itinfo->item = item;
m->it_infolist = eina_list_append(m->it_infolist,
itinfo);
- source_type = m->mhandle->SourceType();
+ source_type = CInfo::SourceType();
elm_object_part_text_set(Layout(),
MUSIC_PART_FOLDER_NAME,
_(g_sourceTexts[source_type]));
#include "ViewMgr.h"
#include "song-layout.h"
#include "base-view.h"
+#include "Info.h"
enum EObjectType {
SORT_BY_ALBUM_ZA
};
- sortType = m->mhandle->SortType();
+ sortType = CInfo::SortType();
m->slist = CSort::Sort(m->slist, sortFuncId[sortType]);
}