|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Wrapper for mpx framework utilities. |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "mpmpxframeworkwrapper.h" |
|
19 #include "mpmpxframeworkwrapper_p.h" |
|
20 |
|
21 /*! |
|
22 \class MpMpxFrameworkWrapper |
|
23 \brief Wrapper for mpx framework utilities. |
|
24 |
|
25 MPX framework wrapper provides Qt style interface to the MPX framework |
|
26 utilities. Its implementation is hidden using private class data pattern. |
|
27 */ |
|
28 |
|
29 /*! |
|
30 \fn void playlistOpened() |
|
31 |
|
32 This signal is emitted when |
|
33 |
|
34 \sa openCollectionItem() |
|
35 */ |
|
36 |
|
37 /*! |
|
38 Constructs the utility wrapper. |
|
39 */ |
|
40 MpMpxFrameworkWrapper::MpMpxFrameworkWrapper( MpCommon::MpViewMode viewMode, QObject *parent ) |
|
41 : QObject(parent) |
|
42 { |
|
43 d_ptr = new MpMpxFrameworkWrapperPrivate(this); |
|
44 d_ptr->init(viewMode); |
|
45 } |
|
46 |
|
47 /*! |
|
48 Destructs the utility wrapper. |
|
49 */ |
|
50 MpMpxFrameworkWrapper::~MpMpxFrameworkWrapper() |
|
51 { |
|
52 delete d_ptr; |
|
53 } |
|
54 |
|
55 /*! |
|
56 Opens the collection for the given \a context. |
|
57 |
|
58 \sa collectionOpened() |
|
59 */ |
|
60 void MpMpxFrameworkWrapper::openCollection( TCollectionContext context ) |
|
61 { |
|
62 d_ptr->openCollection(context); |
|
63 } |
|
64 |
|
65 /*! |
|
66 Opens the collection at a specific \a index. |
|
67 |
|
68 \sa collectionOpened(), playlistOpened() |
|
69 */ |
|
70 void MpMpxFrameworkWrapper::openCollectionItem( int index ) |
|
71 { |
|
72 d_ptr->openCollectionItem(index); |
|
73 } |
|
74 |
|
75 /*! |
|
76 Opens the collection in its current state. |
|
77 |
|
78 \sa collectionOpened() |
|
79 */ |
|
80 void MpMpxFrameworkWrapper::reopenCollection() |
|
81 { |
|
82 d_ptr->reopenCollection(); |
|
83 } |
|
84 |
|
85 /*! |
|
86 Navigates back to the container of the current items. |
|
87 |
|
88 \sa collectionOpened() |
|
89 */ |
|
90 void MpMpxFrameworkWrapper::back() |
|
91 { |
|
92 d_ptr->back(); |
|
93 } |
|
94 |
|
95 /*! |
|
96 Loads the user created \a playLists. |
|
97 |
|
98 */ |
|
99 void MpMpxFrameworkWrapper::findPlaylists( QStringList &playlists ) |
|
100 { |
|
101 d_ptr->findPlaylists(playlists); |
|
102 } |
|
103 |
|
104 /*! |
|
105 Creates a new playlist with name \a playlistName and adds \a selection. |
|
106 */ |
|
107 void MpMpxFrameworkWrapper::createPlaylist( QString playlistName, QList<int> selection ) |
|
108 { |
|
109 d_ptr->createPlaylist(playlistName, selection); |
|
110 } |
|
111 |
|
112 /*! |
|
113 Adds \a selection to the playlist specified in \a playlistIndex. |
|
114 */ |
|
115 void MpMpxFrameworkWrapper::saveToPlaylist( int playlistIndex, QList<int> selection ) |
|
116 { |
|
117 d_ptr->saveToPlaylist(playlistIndex, selection); |
|
118 } |
|
119 |
|
120 /*! |
|
121 Rename a playlist by \a index with \a name. |
|
122 */ |
|
123 void MpMpxFrameworkWrapper::renamePlaylist( QString newName, int index ) |
|
124 { |
|
125 d_ptr->renamePlaylist(newName, index); |
|
126 } |
|
127 |
|
128 /*! |
|
129 Rename a playlist with \a name. |
|
130 */ |
|
131 void MpMpxFrameworkWrapper::renamePlaylist( QString newName ) |
|
132 { |
|
133 d_ptr->renamePlaylist(newName); |
|
134 } |
|
135 |
|
136 /*! |
|
137 Deletes \a selection from the collection. |
|
138 */ |
|
139 void MpMpxFrameworkWrapper::deleteSongs( QList<int> selection ) |
|
140 { |
|
141 d_ptr->deleteSongs(selection); |
|
142 } |
|
143 |
|
144 /*! |
|
145 Sets the suffle according to \a active. |
|
146 */ |
|
147 void MpMpxFrameworkWrapper::setShuffle( bool active ) |
|
148 { |
|
149 d_ptr->setShuffle(active); |
|
150 } |
|
151 |
|
152 /*! |
|
153 Returns pointer to MpMpxCollectionData, which is the collection data. |
|
154 */ |
|
155 MpMpxCollectionData *MpMpxFrameworkWrapper::collectionData() |
|
156 { |
|
157 return d_ptr->collectionData(); |
|
158 } |
|
159 |
|
160 /*! |
|
161 Initiates collection scanning. |
|
162 */ |
|
163 void MpMpxFrameworkWrapper::scan() |
|
164 { |
|
165 d_ptr->scan(); |
|
166 } |
|
167 |
|
168 /*! |
|
169 Cancels ongoing collection scanning. |
|
170 */ |
|
171 void MpMpxFrameworkWrapper::cancelScan() |
|
172 { |
|
173 d_ptr->cancelScan(); |
|
174 } |
|
175 |
|
176 /*! |
|
177 Initiate a playback preview for the selected item. |
|
178 */ |
|
179 void MpMpxFrameworkWrapper::previewItem( int index ) |
|
180 { |
|
181 d_ptr->previewItem(index); |
|
182 } |