Clean the source code 12/38212/3 submit/tizen/20150419.212422
authorKim Tae Soo <taesoo46.kim@samsung.com>
Tue, 14 Apr 2015 13:38:45 +0000 (22:38 +0900)
committerKim Tae Soo <taesoo46.kim@samsung.com>
Tue, 14 Apr 2015 22:40:33 +0000 (07:40 +0900)
Change-Id: I4972e6b7c9ce8d974dc869f37ea14fac64731d2d
Signed-off-by: Kim Tae Soo <taesoo46.kim@samsung.com>
res/edc/views/message-layout.edc
src/playback/MusicControllerImpl.cpp
src/views/PlayListCtxPopup.cpp
src/views/category-layout.cpp
src/views/playback-view.cpp

index b6e4603..1fb91ad 100644 (file)
@@ -13,6 +13,7 @@ group {
                                rel2.relative: 0.0 0.0;
                                min: 960 1080-127;
                                align: 0 0;
+                               fixed: 1 1;
                                visible: 0;
                        }
                }
index b09863d..e1f4e51 100644 (file)
@@ -242,14 +242,12 @@ bool CMusicControllerImpl::Start(void)
                _CHECK(pPlayback->SetUri(songpath))
                _CHECK(pPlayback->Prepare())
                _CHECK(pPlayback->Start())
-
                _COMMAND{ m->statePlay = PLAY_STATUS_PLAY; }
-
                _CHECK(m->pPlaylist->GetSonginfoFromIndex(index, &sinfo))
-                       _CHECK(media_id = sinfo->Id())
-                       _CHECK(m->pMediadata->SetPlayedTime(media_id))
+               _CHECK(media_id = sinfo->Id())
+               _CHECK(m->pMediadata->SetPlayedTime(media_id))
 
-                       _WHEN_SUCCESS{
+               _WHEN_SUCCESS{
                        bus_send_signal();
                }
 
index 07f9b5a..e292200 100644 (file)
@@ -120,9 +120,6 @@ void CPlayListCtxPopup::m_DeleteBtnString(void)
 
 bool CPlayListCtxPopup::Create(Evas_Object* base, const SCallback* callback, Eina_List *playList)
 {
-       //Eina_List *l = NULL;
-       //SCtxtPlaylistItem *item = NULL;
-
        _CREATE_BEGIN{
                _CHECK(m = new SPlayListCtxPopup)
                _CHECK(m->listSize = eina_list_count(playList))
index b70ee58..1c7f311 100644 (file)
@@ -181,34 +181,26 @@ void CCategoryLayout::sm_CbEntrynameSet(void *dt, const char *name)
 void CCategoryLayout::m_OnEntrynameSet(const char *name)
 {
        Eina_List *idlist = NULL;
-       char *str = NULL;
-
-       if (!name)
-               return;
+       ASSERT(name);
 
        idlist = m_GetSelectedList(m->layoutCatSongs->CategorySongItemInfoList(), (int)ID_TYPE_MEDIA);
-       str = strdup(name);
        t.epopup->Destroy();
 
-       if (!strcmp(str, MUSIC_STR_EMPTY)) {
+       if (!strcmp(name, MUSIC_STR_EMPTY)) {
                CCommonUI::CreateMsgBox(Layout(), MUSIC_TEXT_EMPTY_NAME);
-               free(str);
                return;
        }
 
-       if (m->pController->MediaExistPlaylist(str)) {
+       if (m->pController->MediaExistPlaylist(name)) {
                CCommonUI::CreateMsgBox(Layout(), MUSIC_TEXT_INUSE_MSG);
-               free(str);
                return;
        }
 
-       if (!m->pController->MediaInsertPlaylist(str, idlist)) {
+       if (!m->pController->MediaInsertPlaylist(name, idlist)) {
                _ERR("Playlist creation failed ");
-               free(str);
                return;
        }
 
-       free(str);
        t.depth = E_DEPTH_CATEGORY;
        t_UpdateLayoutWithFocus();
 
index 444ba46..5946798 100644 (file)
 #include "Info.h"
 
 
-#define ARRAY_SIZE(array)      (sizeof(array) / sizeof(array[0]))
-#define TITLE_FONT_SIZE                50
-#define ARTIST_FONT_SIZE       30
-#define TOTAL_CONTROL_BTNS     6
-#define TOTAL_EDIT_BTNS                3
-#define S_INTERVAL             1       /* seconds */
-#define LP_INTERVAL            0.5     /* seconds */
-#define WAIT_INTERVAL          0.5     /* seconds */
-#define SLIDER_STEP            5000    /* milli seconds */
-#define LP_CHANGE              10000   /* milli seconds */
-#define S_INCREMENT            1000    /* milli seconds */
-
-
-////////////////////////////////////////////////////////////////////////////////
-//
+#define TOTAL_CONTROL_BTNS 6
+#define TOTAL_EDIT_BTNS    3
+#define S_INTERVAL         1     /* seconds */
+#define LP_INTERVAL        0.5   /* seconds */
+#define WAIT_INTERVAL      0.5   /* seconds */
+#define SLIDER_STEP        5000  /* milli seconds */
+#define LP_CHANGE          10000 /* milli seconds */
+#define S_INCREMENT        1000  /* milli seconds */
+
+
+// SSliderWidget
 struct SSliderWidget {
        Evas_Object *eoSlider;
        Evas_Object *eoBase;
@@ -312,10 +308,9 @@ void CSliderWidget::OnMouseMove(int id, Evas *e, Evas_Object *obj, Evas_Event_Mo
        if (!elm_object_focus_get(obj))
                elm_object_focus_set(obj, EINA_TRUE);
 }
-//
-////////////////////////////////////////////////////////////////////////////////
 
 
+// STimer
 struct STimer {
        int count;
        int s, e;
@@ -394,15 +389,10 @@ bool CTimer::SetTimer(int id, int ms)
 void CTimer::KillTimer(int id)
 {
        ASSERT(m);
-
-       
 }
 
 
-
-
-
-
+// CPlaybackView
 enum EEvasObject {
        EO_BASE,
 
@@ -423,14 +413,31 @@ enum EEvasObject {
 };
 
 
-struct SItemInfo {
-       Elm_Object_Item *item;
-       CSongInfo *sinfo;
-       bool edit_mode;
-       bool check_status;
-       bool select_status;
+enum EControlBtns {
+       BTN_SETTINGS,
+       BTN_SHUFFLE,
+       BTN_REPEAT,
+       BTN_REWIND,
+       BTN_PLAY,
+       BTN_FORWARD
 };
 
+enum ESettingBtns {
+       BTN_EDIT,
+       BTN_CLEAR
+};
+
+enum EEditBtns {
+       BTN_CANCEL,
+       BTN_DESELECT,
+       BTN_DELETE
+};
+
+enum ETimers {
+       TIMER_WAIT,
+       TIMER_LONGPRESS,
+       TIMER_VOLUME
+};
 
 enum EPressTypes {
        PRESS_SHORT,
@@ -439,6 +446,13 @@ enum EPressTypes {
        PRESS_LONG_PAUSE,
 };
 
+struct SItemInfo {
+       Elm_Object_Item *item;
+       CSongInfo *sinfo;
+       bool edit_mode;
+       bool check_status;
+       bool select_status;
+};
 
 struct SPlaybackView {
        Evas_Object *eoWin;
@@ -472,8 +486,6 @@ struct SPlaybackView {
        SPlaybackView() {
                memset(this, 0, sizeof(SPlaybackView));
        }
-       ~SPlaybackView() {
-       }
 };
 
 struct SBtnInfo {
@@ -483,34 +495,6 @@ struct SBtnInfo {
 };
 
 
-enum EControlBtns {
-       BTN_SETTINGS,
-       BTN_SHUFFLE,
-       BTN_REPEAT,
-       BTN_REWIND,
-       BTN_PLAY,
-       BTN_FORWARD
-};
-
-enum ESettingBtns {
-       BTN_EDIT,
-       BTN_CLEAR
-};
-
-enum EEditBtns {
-       BTN_CANCEL,
-       BTN_DESELECT,
-       BTN_DELETE
-};
-
-enum ETimers {
-       TIMER_WAIT,
-       TIMER_LONGPRESS,
-       TIMER_VOLUME
-};
-
-
-
 Eina_Bool CPlaybackView::sm_CbLongpressTimer(void *dt)
 {
        CPlaybackView *root = (CPlaybackView *)dt;
@@ -2101,52 +2085,51 @@ void CPlaybackView::OnKeyDown(int id, Evas *e, Evas_Object *obj, Evas_Event_Key_
                        Elm_Object_Item *it = NULL;
                        SContentInfo *ctxtinfo = NULL;
                        SItemInfo *itinfo = NULL;
+                       SParcel parcel;
 
-                       if (strcmp(ev->keyname, KEY_MENU) &&
-                               strcmp(ev->keyname, KEY_MENU_REMOTE))
-                               return;
-
-                       it = elm_object_focused_item_get(obj);
-                       if (!it) {
-                               _ERR(" unable to get focused item ");
-                               return;
-                       }
-                       m->focused_item = it;
+                       if (!strcmp(ev->keyname, KEY_MENU) ||
+                               !strcmp(ev->keyname, KEY_MENU_REMOTE)) {
+                               it = elm_object_focused_item_get(obj);
+                               if (!it) {
+                                       _ERR(" unable to get focused item ");
+                                       return;
+                               }
+                               m->focused_item = it;
 
-                       if (m->ctxtinfo) {
-                               free(m->ctxtinfo);
-                               m->ctxtinfo = NULL;
-                       }
+                               if (m->ctxtinfo) {
+                                       free(m->ctxtinfo);
+                                       m->ctxtinfo = NULL;
+                               }
 
-                       ctxtinfo = (SContentInfo *)calloc(1, sizeof(*ctxtinfo));
-                       if (!ctxtinfo)
-                               return;
+                               ctxtinfo = (SContentInfo *)calloc(1, sizeof(*ctxtinfo));
+                               if (!ctxtinfo)
+                                       return;
 
-                       itinfo = m_FindItemInfoFromItem(m->elInfo, it);
-                       if (!itinfo) {
-                               free(ctxtinfo);
-                               return;
-                       }
+                               itinfo = m_FindItemInfoFromItem(m->elInfo, it);
+                               if (!itinfo) {
+                                       free(ctxtinfo);
+                                       return;
+                               }
 
-                       if (m->pController->PlayState() == PLAY_STATUS_PLAY &&
-                               itinfo == m->cs_itinfo)
-                               ctxtinfo->status = PLAY_STATUS_PLAY;
-                       else
-                               ctxtinfo->status = PLAY_STATUS_PAUSE;
+                               if (m->pController->PlayState() == PLAY_STATUS_PLAY &&
+                                       itinfo == m->cs_itinfo)
+                                       ctxtinfo->status = PLAY_STATUS_PLAY;
+                               else
+                                       ctxtinfo->status = PLAY_STATUS_PAUSE;
 
-                       ctxtinfo->cbdata = this;
-                       ctxtinfo->update = sm_CbCtxtUpdate;
-                       ctxtinfo->close = sm_CbCtxtClose;
-                       ctxtinfo->type = CONTEXT_TYPE_PLAYSONG;
-                       ctxtinfo->context = itinfo->sinfo;
+                               ctxtinfo->cbdata = this;
+                               ctxtinfo->update = sm_CbCtxtUpdate;
+                               ctxtinfo->close = sm_CbCtxtClose;
+                               ctxtinfo->type = CONTEXT_TYPE_PLAYSONG;
+                               ctxtinfo->context = itinfo->sinfo;
 
-                       m->ctxtinfo = ctxtinfo;
+                               m->ctxtinfo = ctxtinfo;
 
-                       SParcel parcel;
-                       memset(&parcel, 0, sizeof(SParcel));
-                       parcel.ctxtInfo = ctxtinfo;
-                       if (!m->mgr->PushView(MUSIC_CONTEXT_VIEW, &parcel))
-                               _ERR("viewmgr push view MUSIC_CONTEXT_VIEW failed");
+                               memset(&parcel, 0, sizeof(SParcel));
+                               parcel.ctxtInfo = ctxtinfo;
+                               if (!m->mgr->PushView(MUSIC_CONTEXT_VIEW, &parcel))
+                                       _ERR("viewmgr push view MUSIC_CONTEXT_VIEW failed");
+                       }
                }
 
        default: