|
1 /**************************************************************************** |
|
2 ** |
|
3 ** Trolltech hereby grants a license to use the Qt/Eclipse Integration |
|
4 ** plug-in (the software contained herein), in binary form, solely for the |
|
5 ** purpose of creating code to be used with Trolltech's Qt software. |
|
6 ** |
|
7 ** Qt Designer is licensed under the terms of the GNU General Public |
|
8 ** License versions 2.0 and 3.0 ("GPL License"). Trolltech offers users the |
|
9 ** right to use certain no GPL licensed software under the terms of its GPL |
|
10 ** Exception version 1.2 (http://trolltech.com/products/qt/gplexception). |
|
11 ** |
|
12 ** THIS SOFTWARE IS PROVIDED BY TROLLTECH AND ITS CONTRIBUTORS (IF ANY) "AS |
|
13 ** IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
|
14 ** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A |
|
15 ** PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER |
|
16 ** OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
|
17 ** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
|
18 ** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
|
19 ** PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
|
20 ** LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
|
21 ** NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
|
22 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." |
|
23 ** |
|
24 ** Since we now have the GPL exception I think that the "special exception |
|
25 ** is no longer needed. The license text proposed above (other than the |
|
26 ** special exception portion of it) is the BSD license and we have added |
|
27 ** the BSD license as a permissible license under the exception. |
|
28 ** |
|
29 ****************************************************************************/ |
|
30 |
|
31 #include <qdebug.h> |
|
32 #include <smfclient.h> |
|
33 #include <smfcontactfetcher.h> |
|
34 #include <smfmusic.h> |
|
35 #include <smfplaylist.h> |
|
36 |
|
37 #include "SmfTestMusicnActivity.h" |
|
38 |
|
39 SmfTestApp::SmfTestApp(QWidget *parent) |
|
40 : QWidget(parent) |
|
41 { |
|
42 ui.setupUi(this); |
|
43 m_contactFetcher = NULL; |
|
44 m_providerList = NULL; |
|
45 m_tracksofartist=NULL; |
|
46 m_tracksimilar=NULL; |
|
47 m_trackofAlbum=NULL; |
|
48 m_Playlist=NULL; |
|
49 m_Stores=NULL; |
|
50 } |
|
51 |
|
52 SmfTestApp::~SmfTestApp() |
|
53 { |
|
54 if(m_contactFetcher) |
|
55 delete m_contactFetcher; |
|
56 if(m_providerList) |
|
57 delete m_providerList; |
|
58 if(m_tracksofartist) |
|
59 delete m_tracksofartist; |
|
60 if(m_tracksimilar) |
|
61 delete m_tracksimilar; |
|
62 if(m_trackofAlbum) |
|
63 delete m_trackofAlbum; |
|
64 if(m_Playlist) |
|
65 delete m_Playlist; |
|
66 if(m_Stores) |
|
67 delete m_Stores; |
|
68 } |
|
69 |
|
70 |
|
71 void SmfTestApp::getTracksOfArtists() |
|
72 { |
|
73 SmfClient client; |
|
74 qDebug()<<"Inside SmfTestApp::tracksofartist()"; |
|
75 |
|
76 QString intfName("org.symbian.smf.client.music.search"); |
|
77 |
|
78 SmfProviderList *providerList = client.GetServices(intfName); |
|
79 qDebug()<<"client.GetServices returned a list with count = "<<providerList->count(); |
|
80 bool pluginFound = false; |
|
81 foreach(SmfProvider provider, *providerList) |
|
82 { |
|
83 if("last.fm" == provider.serviceName()) |
|
84 { |
|
85 pluginFound = true; |
|
86 qDebug()<<"Plugin for last.fm found"; |
|
87 m_tracksofartist = new SmfMusicSearch(&provider); |
|
88 SmfTrackInfo TInfo; |
|
89 TInfo.setTitle("Aja Nachle"); |
|
90 SmfArtists Artists; |
|
91 QStringList QList; |
|
92 QList.append("Adnan Sami");//A.R.Rehman"); |
|
93 Artists.setNames(QList); |
|
94 SmfError err=m_tracksofartist->tracksOfArtist(Artists,1,10);//artist,1,1); |
|
95 qDebug()<<"Return Value of tracksOfArtist :"<<err; |
|
96 |
|
97 bool connected = connect(m_tracksofartist, SIGNAL(trackSearchAvailable(SmfTrackInfoList *, SmfError ,SmfResultPage)), |
|
98 this,SLOT(trackSearchAvailableSlot(SmfTrackInfoList*, SmfError, SmfResultPage)));//SmfTrackInfoList * ,SmfError))); |
|
99 //trackSearchAvailable |
|
100 qDebug()<<"Signal-slot connected ? = "<<connected; |
|
101 |
|
102 } |
|
103 } |
|
104 if(!pluginFound) |
|
105 { |
|
106 qDebug()<<"Plugin for Last.fm not found!!!"; |
|
107 } |
|
108 |
|
109 qDebug()<<"Returning from SmfTestApp::getTracksOfArtists()"; |
|
110 |
|
111 } |
|
112 |
|
113 |
|
114 void SmfTestApp::getTracksSimilar() |
|
115 { |
|
116 SmfClient client; |
|
117 qDebug()<<"Inside SmfTestApp::getTracksSimilar()"; |
|
118 |
|
119 QString intfName("org.symbian.smf.client.music.search"); |
|
120 |
|
121 SmfProviderList *providerList = client.GetServices(intfName); |
|
122 qDebug()<<"client.GetServices returned a list with count = "<<providerList->count(); |
|
123 bool pluginFound = false; |
|
124 foreach(SmfProvider provider, *providerList) |
|
125 { |
|
126 if("last.fm" == provider.serviceName()) |
|
127 { |
|
128 pluginFound = true; |
|
129 qDebug()<<"Plugin for last.fm found"; |
|
130 m_tracksimilar = new SmfMusicSearch(&provider); |
|
131 SmfTrackInfo TInfo; |
|
132 |
|
133 TInfo.setTitle("Tera Chehra"); |
|
134 //TInfo.setTitle("Bambhole"); |
|
135 |
|
136 SmfArtists Artists; |
|
137 |
|
138 |
|
139 QStringList QList; |
|
140 |
|
141 QList.append("Adnan Sami"); |
|
142 Artists.setNames(QList); |
|
143 TInfo.setArtists(Artists); |
|
144 |
|
145 //SmfError err=m_tracksimilar->tracksSimilar(TInfo,1,1); |
|
146 SmfMusicFingerPrint signature; |
|
147 signature.setId("+1-q7D7-iHR9cQ"); |
|
148 SmfError err=m_tracksimilar->trackInfo(signature,1,1); |
|
149 bool connected = connect(m_tracksimilar, SIGNAL(trackSearchAvailable(SmfTrackInfoList *, SmfError ,SmfResultPage)), |
|
150 this,SLOT(trackSearchAvailableSlot(SmfTrackInfoList*, SmfError, SmfResultPage)));//SmfTrackInfoList * ,SmfError))); |
|
151 //trackSearchAvailable |
|
152 qDebug()<<"Signal-slot connected ? = "<<connected; |
|
153 |
|
154 } |
|
155 } |
|
156 if(!pluginFound) |
|
157 { |
|
158 qDebug()<<"Plugin for Last.fm not found!!!"; |
|
159 } |
|
160 |
|
161 qDebug()<<"Returning from SmfTestApp::getTracksSimilar()"; |
|
162 |
|
163 } |
|
164 //tracksOfAlbum |
|
165 |
|
166 void SmfTestApp::getTracksOfAlbom() |
|
167 { |
|
168 // Tujha Chehra |
|
169 SmfClient client; |
|
170 qDebug()<<"Inside SmfTestApp::getTracksOfAlbom()"; |
|
171 |
|
172 QString intfName("org.symbian.smf.client.music.search"); |
|
173 |
|
174 SmfProviderList *providerList = client.GetServices(intfName); |
|
175 qDebug()<<"client.GetServices returned a list with count = "<<providerList->count(); |
|
176 bool pluginFound = false; |
|
177 foreach(SmfProvider provider, *providerList) |
|
178 { |
|
179 if("last.fm" == provider.serviceName()) |
|
180 { |
|
181 pluginFound = true; |
|
182 qDebug()<<"Plugin for last.fm found"; |
|
183 m_trackofAlbum = new SmfMusicSearch(&provider); |
|
184 SmfTrackInfo TInfo; |
|
185 TInfo.setTitle("Summer of 69"); |
|
186 SmfAlbum album; |
|
187 SmfArtists art; |
|
188 QStringList strList; |
|
189 strList.append("Adnan Sami"); |
|
190 art.setNames(strList); |
|
191 album.setName("Tujha Chehra"); |
|
192 album.setArtists(art); |
|
193 SmfError err = m_trackofAlbum->tracksOfAlbum(album,1,2); |
|
194 qDebug()<<"Return Value of tracksOfAlbum :"<<err; |
|
195 bool connected = connect(m_trackofAlbum, SIGNAL(trackSearchAvailable(SmfTrackInfoList *, SmfError ,SmfResultPage)), |
|
196 this,SLOT(trackSearchAvailableSlot(SmfTrackInfoList*, SmfError, SmfResultPage)));//SmfTrackInfoList * ,SmfError))); |
|
197 //trackSearchAvailable |
|
198 qDebug()<<"Signal-slot connected ? = "<<connected; |
|
199 |
|
200 } |
|
201 } |
|
202 if(!pluginFound) |
|
203 { |
|
204 qDebug()<<"Plugin for Last.fm not found!!!"; |
|
205 } |
|
206 |
|
207 qDebug()<<"Returning from SmfTestApp::getTracksOfAlbom()"; |
|
208 |
|
209 } |
|
210 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
211 //////////////////////////////////addToPlaylist////////////////////////////////////////////////////////////////////////// |
|
212 /* |
|
213 playlistID (Required) : The ID of the playlist - this is available in user.getPlaylists. |
|
214 track (Required) : The track name to add to the playlist. |
|
215 artist (Required) : The artist name that corresponds to the track to be added. |
|
216 api_key (Required) : A Last.fm API key. |
|
217 api_sig (Required) : A Last.fm method signature. See authentication for more information. |
|
218 sk (Required) : A session key generated by authenticating a user via the authentication protocol. |
|
219 *///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
220 |
|
221 void SmfTestApp::addToPlaylist() |
|
222 { |
|
223 |
|
224 |
|
225 SmfClient client; |
|
226 qDebug()<<"Inside SmfTestApp::addToPlaylist()"; |
|
227 |
|
228 QString intfName("org.symbian.smf.plugin.music.playlist"); |
|
229 |
|
230 SmfProviderList *providerList = client.GetServices(intfName); |
|
231 qDebug()<<"client.GetServices returned a list with count = "<<providerList->count(); |
|
232 bool pluginFound = false; |
|
233 foreach(SmfProvider provider, *providerList) |
|
234 { |
|
235 if("last.fm" == provider.serviceName()) |
|
236 { |
|
237 pluginFound = true; |
|
238 qDebug()<<"Plugin for last.fm found"; |
|
239 m_Playlist = new SmfPlaylistService(&provider); |
|
240 SmfPlaylist pl_list; |
|
241 pl_list.setPlayListTitle("playlist_2"); |
|
242 pl_list.setId("4b2es_playlist_2"); |
|
243 SmfAlbum album; |
|
244 QList <SmfTrackInfo> list; |
|
245 SmfTrackInfo track; |
|
246 SmfArtists art; |
|
247 QStringList strList; |
|
248 strList.append("Adnan Sami"); |
|
249 art.setNames(strList); |
|
250 album.setName("Teri Kasam"); |
|
251 //album.setName("Tujha Chehra"); |
|
252 //album.setId(); |
|
253 album.setArtists(art); |
|
254 track.setArtists(art); |
|
255 track.setAlbum(album); |
|
256 track.setTitle("Kasam "); |
|
257 //track.setTitle("Hi Hawa Mand Wahe"); |
|
258 list.append(track); |
|
259 SmfError err=m_Playlist->addToPlaylist(pl_list,&list); |
|
260 qDebug()<<"Return Value of PlayLists is :"<<err; |
|
261 //playlistsListAvailable(SmfPlaylistList * _t1, SmfError _t2, SmfResultPage _t3) |
|
262 bool connected = connect(m_Playlist, SIGNAL(playlistsListAvailable(SmfPlaylistList *, SmfError ,SmfResultPage)), |
|
263 this,SLOT(playlistsListAvailableSlot(SmfPlaylistList *, SmfError, SmfResultPage)));//SmfTrackInfoList * ,SmfError))); |
|
264 |
|
265 qDebug()<<"Signal-slot connected ? = "<<connected; |
|
266 |
|
267 } |
|
268 } |
|
269 if(!pluginFound) |
|
270 { |
|
271 qDebug()<<"Plugin for Last.fm not found!!!"; |
|
272 } |
|
273 |
|
274 qDebug()<<"Returning from SmfTestApp::getPlaylist()"; |
|
275 |
|
276 } |
|
277 |
|
278 |
|
279 void SmfTestApp::getPlaylist() |
|
280 { |
|
281 SmfClient client; |
|
282 qDebug()<<"Inside SmfTestApp::getPlaylist()"; |
|
283 |
|
284 QString intfName("org.symbian.smf.plugin.music.playlist"); |
|
285 |
|
286 SmfProviderList *providerList = client.GetServices(intfName); |
|
287 qDebug()<<"client.GetServices returned a list with count = "<<providerList->count(); |
|
288 bool pluginFound = false; |
|
289 foreach(SmfProvider provider, *providerList) |
|
290 { |
|
291 if("last.fm" == provider.serviceName()) |
|
292 { |
|
293 pluginFound = true; |
|
294 qDebug()<<"Plugin for last.fm found"; |
|
295 m_Playlist = new SmfPlaylistService(&provider); |
|
296 /* SmfPlaylist pl_list; |
|
297 pl_list.setPlayListTitle("playlist_2"); |
|
298 pl_list.setId("4b2es_playlist_2"); |
|
299 SmfAlbum album; |
|
300 QList <SmfTrackInfo> *list; |
|
301 SmfTrackInfo track; |
|
302 SmfArtists art; |
|
303 QStringList strList; |
|
304 strList.append("Adnan Sami"); |
|
305 art.setNames(strList); |
|
306 album.setName("Tujha Chehra"); |
|
307 album.setArtists(art); |
|
308 track.setArtists(art); |
|
309 track.setAlbum(album); |
|
310 track.setTitle("Hi Hawa Mand Wahe"); |
|
311 list->append(track); |
|
312 */ //SmfError err=m_Stores->stores(track ,1,1); |
|
313 SmfError err=m_Playlist->playlists(1,5); |
|
314 // SmfError err=m_Playlist->addToPlaylist(pl_list,list); |
|
315 //SmfError err=m_Playlist->postCurrentPlayingPlaylist(pl_list); |
|
316 qDebug()<<"Return Value of PlayLists is :"<<err; |
|
317 //playlistsListAvailable(SmfPlaylistList * _t1, SmfError _t2, SmfResultPage _t3) |
|
318 bool connected = connect(m_Playlist, SIGNAL(playlistsListAvailable(SmfPlaylistList *, SmfError ,SmfResultPage)), |
|
319 this,SLOT(playlistsListAvailableSlot(SmfPlaylistList *, SmfError, SmfResultPage)));//SmfTrackInfoList * ,SmfError))); |
|
320 |
|
321 qDebug()<<"Signal-slot connected ? = "<<connected; |
|
322 |
|
323 } |
|
324 } |
|
325 if(!pluginFound) |
|
326 { |
|
327 qDebug()<<"Plugin for Last.fm not found!!!"; |
|
328 } |
|
329 |
|
330 qDebug()<<"Returning from SmfTestApp::getPlaylist()"; |
|
331 |
|
332 } |
|
333 |
|
334 void SmfTestApp::postCurrentPlayingPlaylist() |
|
335 { |
|
336 SmfClient client; |
|
337 qDebug()<<"Inside SmfTestApp::postCurrentPlayingPlaylist()"; |
|
338 |
|
339 QString intfName("org.symbian.smf.plugin.music.playlist"); |
|
340 |
|
341 SmfProviderList *providerList = client.GetServices(intfName); |
|
342 qDebug()<<"client.GetServices returned a list with count = "<<providerList->count(); |
|
343 bool pluginFound = false; |
|
344 foreach(SmfProvider provider, *providerList) |
|
345 { |
|
346 if("last.fm" == provider.serviceName()) |
|
347 { |
|
348 pluginFound = true; |
|
349 qDebug()<<"Plugin for last.fm found"; |
|
350 m_Playlist = new SmfPlaylistService(&provider); |
|
351 SmfPlaylist pl_list; |
|
352 pl_list.setPlayListTitle("playlist_2"); |
|
353 pl_list.setId("4b2es_playlist_2"); |
|
354 // SmfAlbum album; |
|
355 // QList <SmfTrackInfo> *list; |
|
356 // SmfTrackInfo track; |
|
357 // SmfArtists art; |
|
358 // QStringList strList; |
|
359 // strList.append("Adnan Sami"); |
|
360 // art.setNames(strList); |
|
361 // album.setName("Tujha Chehra"); |
|
362 // album.setArtists(art); |
|
363 // track.setArtists(art); |
|
364 // track.setAlbum(album); |
|
365 // track.setTitle("Hi Hawa Mand Wahe"); |
|
366 // list->append(track); |
|
367 //SmfError err=m_Playlist->addToPlaylist(pl_list,list); |
|
368 SmfError err=m_Playlist->postCurrentPlayingPlaylist(pl_list); |
|
369 qDebug()<<"Return Value of postCurrentPlayingPlaylist is :"<<err; |
|
370 //playlistsListAvailable(SmfPlaylistList * _t1, SmfError _t2, SmfResultPage _t3) |
|
371 bool connected = connect(m_Playlist, SIGNAL(playlistsListAvailable(SmfPlaylistList *, SmfError ,SmfResultPage)), |
|
372 this,SLOT(playlistsListAvailableSlot(SmfPlaylistList *, SmfError, SmfResultPage)));//SmfTrackInfoList * ,SmfError))); |
|
373 |
|
374 qDebug()<<"Signal-slot connected ? = "<<connected; |
|
375 |
|
376 } |
|
377 } |
|
378 if(!pluginFound) |
|
379 { |
|
380 qDebug()<<"Plugin for Last.fm not found!!!"; |
|
381 } |
|
382 |
|
383 qDebug()<<"Returning from SmfTestApp::postCurrentPlayingPlaylist()"; |
|
384 |
|
385 } |
|
386 |
|
387 |
|
388 |
|
389 void SmfTestApp::getStoresOfTrac() |
|
390 { |
|
391 // Tujha Chehra |
|
392 SmfClient client; |
|
393 qDebug()<<"Inside SmfTestApp::getStoresOfTrac()"; |
|
394 |
|
395 QString intfName("org.symbian.smf.client.music.search"); |
|
396 |
|
397 SmfProviderList *providerList = client.GetServices(intfName); |
|
398 qDebug()<<"client.GetServices returned a list with count = "<<providerList->count(); |
|
399 bool pluginFound = false; |
|
400 foreach(SmfProvider provider, *providerList) |
|
401 { |
|
402 if("last.fm" == provider.serviceName()) |
|
403 { |
|
404 pluginFound = true; |
|
405 qDebug()<<"Plugin for last.fm found"; |
|
406 |
|
407 /* m_trackofAlbum = new SmfMusicSearch(&provider); |
|
408 SmfTrackInfo TInfo; |
|
409 TInfo.setTitle("Summer of 69"); |
|
410 SmfAlbum album; |
|
411 SmfArtists art; |
|
412 QStringList strList; |
|
413 strList.append("Adnan Sami"); |
|
414 art.setNames(strList); |
|
415 album.setName("Tujha Chehra"); |
|
416 album.setArtists(art); |
|
417 SmfError err = m_trackofAlbum->tracksOfAlbum(album,1,2); |
|
418 qDebug()<<"Return Value of tracksOfAlbum :"<<err; |
|
419 |
|
420 */ |
|
421 |
|
422 m_Stores = new SmfMusicSearch(&provider); |
|
423 SmfTrackInfo TInfo; |
|
424 TInfo.setTitle("Kabhi Aisa Lagay"); |
|
425 SmfComment com; |
|
426 com.setText("Excellent"); |
|
427 SmfAlbum album; |
|
428 SmfTrackInfo track; |
|
429 SmfArtists art; |
|
430 QStringList strList; |
|
431 strList.append("Adnan Sami"); |
|
432 art.setNames(strList); |
|
433 |
|
434 album.setName("Tujha Chehra"); |
|
435 album.setArtists(art); |
|
436 track.setArtists(art); |
|
437 track.setAlbum(album); |
|
438 SmfError err=m_Stores->stores(track ,1,1); |
|
439 qDebug()<<"Return Value of Stores :"<<err; |
|
440 //SmfProviderList * _t1, SmfError _t2, SmfResultPage _t3 |
|
441 bool connected = connect(m_Stores, SIGNAL(storeSearchAvailable(SmfProviderList*,SmfError,SmfResultPage)), |
|
442 this,SLOT(storelistsListAvailable(SmfProviderList* ,SmfError ,SmfResultPage))); |
|
443 |
|
444 |
|
445 qDebug()<<"Signal-slot connected ? = "<<connected; |
|
446 |
|
447 } |
|
448 } |
|
449 if(!pluginFound) |
|
450 { |
|
451 qDebug()<<"Plugin for Last.fm not found!!!"; |
|
452 } |
|
453 |
|
454 qDebug()<<"Returning from SmfTestApp::getStoresOfTrac()"; |
|
455 |
|
456 } |
|
457 |
|
458 |
|
459 void SmfTestApp::storelistsListAvailable(SmfProviderList* list ,SmfError error,SmfResultPage resultPage) |
|
460 { |
|
461 |
|
462 Q_UNUSED(resultPage) |
|
463 qDebug()<<"Inside SmfTestApp::storelistsListAvailable()"; |
|
464 |
|
465 if(error) |
|
466 { |
|
467 SmfClient client; |
|
468 QString errStr = client.errorString(error); |
|
469 qDebug()<<"Error found, code = "<<error; |
|
470 qDebug()<<"Error string is = "<<errStr; |
|
471 |
|
472 return; |
|
473 } |
|
474 |
|
475 //display friends information |
|
476 int count = 0; |
|
477 qDebug()<<"Number of friends retrieved = "<<list->count(); |
|
478 if(0 == list->count()) |
|
479 { |
|
480 qDebug()<<"No of tracks available!!!"; |
|
481 return; |
|
482 } |
|
483 |
|
484 foreach(SmfProvider tracs, *list) |
|
485 { |
|
486 qDebug()<<"Authentication AppName = "<<tracs.authenticationAppName();//playListTitle(); |
|
487 qDebug()<<"App URL = "<<tracs.applicationUrl();//playListTitle(); |
|
488 qDebug()<<"Authentication AppName = "<<tracs.serviceName();//playListTitle(); |
|
489 |
|
490 } |
|
491 |
|
492 delete list; |
|
493 |
|
494 |
|
495 } |
|
496 |
|
497 void SmfTestApp::playlistsListAvailableSlot(SmfPlaylistList* playlist ,SmfError error,SmfResultPage page) |
|
498 { |
|
499 Q_UNUSED(page) |
|
500 |
|
501 for(int i = 0;i<playlist->count();i++) |
|
502 |
|
503 { |
|
504 |
|
505 |
|
506 //qDebug()<<"Data Author"<<playlist.at(i).author(); |
|
507 qDebug()<<"Data Author"<<playlist->at(i).author(); |
|
508 |
|
509 |
|
510 qDebug()<<"Data Creation Date"<<playlist->at(i).creationDate(); |
|
511 |
|
512 //qDebug()<<"Data Comments"<<playlist.at(i).comments.at(0); |
|
513 |
|
514 qDebug()<<"Data Id"<<playlist->at(i).id(); |
|
515 |
|
516 qDebug()<<"Data playListTitle"<<playlist->at(i).playListTitle(); |
|
517 |
|
518 qDebug()<<"Data location"<<playlist->at(i).location(); |
|
519 |
|
520 |
|
521 } |
|
522 |
|
523 } |
|
524 |
|
525 |
|
526 |
|
527 |
|
528 |
|
529 void SmfTestApp::trackSearchAvailableSlot(SmfTrackInfoList* list, SmfError error, SmfResultPage resultPage)//SmfTrackInfoList *s1 ,SmfError err) |
|
530 { |
|
531 qDebug()<<"tracks of artist"; |
|
532 |
|
533 Q_UNUSED(resultPage) |
|
534 qDebug()<<"Inside SmfTestApp::trackSearchAvailableSlot()"; |
|
535 |
|
536 if(error) |
|
537 { |
|
538 SmfClient client; |
|
539 QString errStr = client.errorString(error); |
|
540 qDebug()<<"Error found, code = "<<error; |
|
541 qDebug()<<"Error string is = "<<errStr; |
|
542 |
|
543 return; |
|
544 } |
|
545 |
|
546 //display friends information |
|
547 int count = 0; |
|
548 qDebug()<<"Number of friends retrieved = "<<list->count(); |
|
549 if(0 == list->count()) |
|
550 { |
|
551 qDebug()<<"No of tracks available!!!"; |
|
552 return; |
|
553 } |
|
554 |
|
555 foreach(SmfTrackInfo tracs, *list) |
|
556 { |
|
557 qDebug()<<"Track Title = "<<tracs.title();//playListTitle(); |
|
558 } |
|
559 |
|
560 delete list; |
|
561 } |
|
562 |
|
563 |
|
564 void SmfTestApp::getFacebookFriends() |
|
565 { |
|
566 qDebug()<<"Inside SmfTestApp::getFacebookFriends()"; |
|
567 |
|
568 // Get the list of providers |
|
569 SmfClient client; |
|
570 QString intfName("org.symbian.smf.plugin.contact.fetcher"); |
|
571 |
|
572 m_providerList = client.GetServices(intfName); |
|
573 qDebug()<<"client.GetServices returned a list with count = "<<m_providerList->count(); |
|
574 |
|
575 // flag to check if required plugin is there |
|
576 bool pluginFound = false; |
|
577 foreach(SmfProvider provider, *m_providerList) |
|
578 { |
|
579 if("Facebook" == provider.serviceName()) |
|
580 { |
|
581 qDebug()<<"Plugin for Facebook found"; |
|
582 pluginFound = true; |
|
583 m_contactFetcher = new SmfContactFetcher(&provider); |
|
584 SmfError err = m_contactFetcher->friends(1, 10); |
|
585 qDebug()<<"Ret value of friends() = "<<err; |
|
586 |
|
587 bool connected = connect(m_contactFetcher, SIGNAL(friendsListAvailable(SmfContactList*, SmfError , SmfResultPage)), |
|
588 this, SLOT(friendsListAvailable(SmfContactList*, SmfError , SmfResultPage))); |
|
589 qDebug()<<"Signal-slot connected ? = "<<connected; |
|
590 } |
|
591 } |
|
592 |
|
593 if(!pluginFound) |
|
594 { |
|
595 qDebug()<<"Plugin for Facebook not found!!!"; |
|
596 } |
|
597 |
|
598 qDebug()<<"Returning from SmfTestApp::getFacebookFriends()"; |
|
599 } |
|
600 |
|
601 |
|
602 void SmfTestApp::friendsListAvailable ( SmfContactList* list, SmfError error, SmfResultPage resultPage ) |
|
603 { |
|
604 Q_UNUSED(resultPage) |
|
605 qDebug()<<"Inside SmfTestApp::friendsListAvailable()"; |
|
606 |
|
607 if(error) |
|
608 { |
|
609 SmfClient client; |
|
610 QString errStr = client.errorString(error); |
|
611 qDebug()<<"Error found, code = "<<error; |
|
612 qDebug()<<"Error string is = "<<errStr; |
|
613 |
|
614 return; |
|
615 } |
|
616 |
|
617 //display friends information |
|
618 int count = 0; |
|
619 qDebug()<<"Number of friends retrieved = "<<list->count(); |
|
620 if(0 == list->count()) |
|
621 { |
|
622 qDebug()<<"No friends available!!!"; |
|
623 return; |
|
624 } |
|
625 |
|
626 foreach(SmfContact contact, *list) |
|
627 { |
|
628 qDebug()<<"Friends name = "<<contact.value("Name").value<QContactName>().firstName(); |
|
629 qDebug()<<"Friends status msg desc = "<<contact.value("Presence").value<QContactPresence>().customMessage(); |
|
630 qDebug()<<"Friends profile image URL = "<<contact.value("Avatar").value<QContactAvatar>().imageUrl(); |
|
631 qDebug()<<""; |
|
632 } |
|
633 |
|
634 delete list; |
|
635 } |