2 * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __MUSIC_CONTROLLER_IMPL_H__
18 #define __MUSIC_CONTROLLER_IMPL_H__
21 class CMusicControllerImpl :
23 public ICompleteListener {
25 struct SMusicControllerImpl *m;
39 static void sm_CbContentUpdated(void *dt);
40 void m_OnContentUpdated(void);
42 void m_InvokeErrorCallback(SMusicControllerImpl *m, int type);
45 bool t_PlayNext(int direction, int playnext_type);
48 CMusicControllerImpl() {}
49 virtual ~CMusicControllerImpl() {}
52 virtual void Destroy(void);
59 bool AddListener(IMusicControllerListener *listener);
60 bool RemoveListener(IMusicControllerListener *listener);
62 bool GetCurrentSongIndex(int *ind);
63 bool GetTotalSongs(int *ts);
64 bool GetSonginfoFromIndex(int index, CSongInfo **const csinfo);
66 bool SetPosition(int milsec);
67 bool GetPosition(int *const milseconds);
69 bool SetCurrentSong(char *mediaid);
70 bool GetCurrentSong(CSongInfo **const sinfo);
72 bool UpdatePlaylist(Eina_List *slist, int addmode);
73 bool EmptyPlaylist(void);
75 bool PlayPreviousSong(void);
76 bool PlayNextSong(void);
77 bool PlayIndexSong(int index);
79 bool RemoveSong(CSongInfo *sinfo, int index);
81 bool MediaGetList(int EListType, void *info, Eina_List **list);
82 bool MediaInsertPlaylist(const char *name, Eina_List *idlist);
83 bool MediaExistPlaylist(const char *name);
84 bool MediaDeletePlaylist(int id);
85 bool MediaRenamePlaylist(int id, const char *name);
86 bool MediaAddmediaPlaylist(int id, Eina_List *idlist);
87 bool MediaRemovemediaPlaylist(int id, Eina_List *idlist);
88 bool MediaAddsongsPlaylist(int lid, Eina_List *list);
90 CSongInfo *MediaSongByUri(char *uri);
92 bool SetPlayState(EPlayStatus state);
93 EPlayStatus PlayState(void);
95 bool SetShuffleState(EShuffleStatus state);
96 EShuffleStatus ShuffleState(void);
98 bool SetRepeatState(ERepeatStatus state);
99 ERepeatStatus RepeatState(void);
101 void ChangePlayerMode(EPlayerMode mode);
102 void HandlePlaylistEditButtons(EPlayerEditBtns btnId);
103 void HandleRemoteButtons(Evas_Object *eoBtn, EPlayerBtnsEvent ev);
106 virtual void OnStatusChanged(SUsbHostDeviceInfo *changedDevice,
107 SUsbHostDeviceStatus status);
109 virtual void t_OnPlayComplete(void);
113 #endif /* __MUSIC_CONTROLLER_IMPL_H__ */