Enlightenment CVS committal Author : lok Project : e17 Module : proto
Dir : e17/proto/emphasis/src/bin Modified Files: emphasis_mpc.c emphasis_mpc.h Log Message: make it works =================================================================== RCS file: /cvs/e/e17/proto/emphasis/src/bin/emphasis_mpc.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- emphasis_mpc.c 20 Aug 2006 22:48:49 -0000 1.7 +++ emphasis_mpc.c 21 Aug 2006 01:04:41 -0000 1.8 @@ -500,7 +500,7 @@ MpdData *data; Evas_List *list; - data = mpd_database_get_playlist_content (mo, playlist_name); + data = mpd_database_get_pls_content (mo, playlist_name); list = convert_mpd_data(data); mpd_data_free(data); @@ -572,3 +572,58 @@ return mpd_data_get_first(data); } +MpdData *mpd_database_get_pls_content(MpdObj *mi,char *playlist) +{ + MpdData *data = NULL; + mpd_InfoEntity *ent = NULL; + if(!mpd_check_connected(mi)) + { + return NULL; + } + if(!mpd_server_check_version(mi, 0,12,0)) + { + return NULL; + } + if(mpd_server_check_command_allowed(mi, "listplaylistinfo") != MPD_SERVER_COMMAND_ALLOWED) + { + return NULL; + } + if(mpd_lock_conn(mi)) + { + return NULL; + } + mpd_sendListPlaylistInfoCommand(mi->connection, playlist); + while (( ent = mpd_getNextInfoEntity(mi->connection)) != NULL) + { + data = mpd_new_data_struct_append( data ); + if(ent->type == MPD_INFO_ENTITY_TYPE_DIRECTORY) + { + data->type = MPD_DATA_TYPE_DIRECTORY; + data->directory = ent->info.directory->path; + ent->info.directory->path = NULL; + } + else if (ent->type == MPD_INFO_ENTITY_TYPE_SONG) + { + data->type = MPD_DATA_TYPE_SONG; + data->song = ent->info.song; + ent->info.song = NULL; + } + else if (ent->type == MPD_INFO_ENTITY_TYPE_PLAYLISTFILE) + { + data->type = MPD_DATA_TYPE_PLAYLIST; + data->playlist = ent->info.playlistFile->path; + ent->info.playlistFile->path = NULL; + } + + mpd_freeInfoEntity(ent); + } + mpd_finishCommand(mi->connection); + + /* unlock */ + mpd_unlock_conn(mi); + if(data == NULL) + { + return NULL; + } + return mpd_data_get_first(data); +} =================================================================== RCS file: /cvs/e/e17/proto/emphasis/src/bin/emphasis_mpc.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- emphasis_mpc.h 20 Aug 2006 22:48:49 -0000 1.5 +++ emphasis_mpc.h 21 Aug 2006 01:04:41 -0000 1.6 @@ -53,7 +53,9 @@ void mpc_load_playlist(char *playlist_name); void mpc_delete_playlist(char *playlist_name); +/* TEMP */ MpdData *mpd_database_list_playlist(); +MpdData *mpd_database_get_pls_content(MpdObj *mi,char *playlist); /** @} */ #endif /* EMPHASIS_MPC_H_ */ ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs