|
Re: How to get the song info(songname ,artist,etc) from the nowplayinglibrary?
|
04/07/2010 5:25 AM
post51251
|
Re: How to get the song info(songname ,artist,etc) from the nowplayinglibrary?
thanks for your reply,Allen!
the problems are as follow:
The main code is:
----------
if( -1 == mme_play( mme, 0) ) {
perror( "mme_play()" );
} else {
printf( "mme_play(): success\n" );
}
mme_trksessionview_update(mme);
mme_play_get_info(mme,&info) ;
if( -1==qdb_statement(qdb,"SELECT filename, artist, album, genre, composer"
" FROM nowplaying"))
perror( "qdb_statement()");
else {
printf( "qdb_statement(): success\n" ); }
res = qdb_getresult(qdb);
columns=qdb_columns(res);
rows=qdb_rows(res);
printf( "\n" );
printf( "rows is %d",rows );
printf( "\n" );
printf( "columns is %d",columns );
printf( "\n" );
strcpy(file_name,qdb_cell(res, 0, 0));
//strcpy(album,qdb_cell(res, 0, 1));
strcpy(artist,qdb_cell(res,0,1));
qdb_freeresult( res );
#ifdef DEBUG
printf("The file name is %s\n",file_name);
printf("The artist is %s\n",artist);
// printf("The album is %s\n",album);
#endif
When I run the application,the result of print is :
mme_device /dev/mme/default
Connected to '/dev/mme/default'
trk session created: id = 11
mme_setrandom( MME_RANDOM_OFF )
Normal mme_play(): success
qdb_statement(): success
rows is 1
columns is 5
The file name is Can You Feel the Love Tonight.mp3
The artist is Unknown Artist
I can not get the artist from the nowplaying,please give me the idle,thanks!
|
|
|