aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-05-13 18:16:03 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-05-13 18:16:03 +0000
commit8c484eeccfaafd2d5eaf7cd77842581004957a8a (patch)
tree831e06fb02c0d01214d65e1a692d834deadb0911 /src/playlist.c
parente7ae1b0ce96b41dc336210c6df575a4d1cb9d2be (diff)
downloadmpd-8c484eeccfaafd2d5eaf7cd77842581004957a8a.tar.gz
mpd-8c484eeccfaafd2d5eaf7cd77842581004957a8a.tar.xz
mpd-8c484eeccfaafd2d5eaf7cd77842581004957a8a.zip
add type element to Song struct, and change utf8file to utf8url
git-svn-id: https://svn.musicpd.org/mpd/trunk@999 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/playlist.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/playlist.c b/src/playlist.c
index e7a5c8438..1bc5147bb 100644
--- a/src/playlist.c
+++ b/src/playlist.c
@@ -161,7 +161,7 @@ int showPlaylist(FILE * fp) {
int i;
for(i=0;i<playlist.length;i++) {
- myfprintf(fp,"%i:%s\n",i,(playlist.songs[i])->utf8file);
+ myfprintf(fp,"%i:%s\n",i,(playlist.songs[i])->utf8url);
}
return 0;
@@ -357,7 +357,7 @@ int playlistInfo(FILE * fp,int song) {
}
for(i=begin;i<end;i++) {
- myfprintf(fp,"file: %s\n",(playlist.songs[i])->utf8file);
+ myfprintf(fp,"file: %s\n",(playlist.songs[i])->utf8url);
if((tag = (playlist.songs[i])->tag)) {
printMpdTag(fp,tag);
}
@@ -380,9 +380,9 @@ void queueNextSongInPlaylist() {
DEBUG("playlist: queue song %i:\"%s\"\n",
playlist.queued,
playlist.songs[playlist.order[
- playlist.queued]]->utf8file);
+ playlist.queued]]->utf8url);
if(queueSong(playlist.songs[playlist.order[
- playlist.queued]]->utf8file)<0) {
+ playlist.queued]]->utf8url)<0) {
playlist.queued = -1;
playlist_queueError = 1;
}
@@ -395,9 +395,9 @@ void queueNextSongInPlaylist() {
DEBUG("playlist: queue song %i:\"%s\"\n",
playlist.queued,
playlist.songs[playlist.order[
- playlist.queued]]->utf8file);
+ playlist.queued]]->utf8url);
if(queueSong(playlist.songs[playlist.order[
- playlist.queued]]->utf8file)<0) {
+ playlist.queued]]->utf8url)<0) {
playlist.queued = -1;
playlist_queueError = 1;
}
@@ -645,10 +645,10 @@ int playPlaylistOrderNumber(FILE * fp, int orderNum) {
playlist.current = orderNum;
DEBUG("playlist: play %i:\"%s\"\n",orderNum,
- (playlist.songs[playlist.order[orderNum]])->utf8file);
+ (playlist.songs[playlist.order[orderNum]])->utf8url);
if(playerPlay(fp,(playlist.songs[playlist.order[orderNum]])->
- utf8file)<0)
+ utf8url)<0)
{
stopPlaylist(fp);
return -1;
@@ -1052,12 +1052,14 @@ int savePlaylist(FILE * fp, char * utf8file) {
}
for(i=0;i<playlist.length;i++) {
- if(playlist_saveAbsolutePaths) {
+ if(playlist_saveAbsolutePaths &&
+ playlist.songs[i]->type==SONG_TYPE_FILE)
+ {
myfprintf(fileP,"%s\n",rmp2amp(utf8ToFsCharset((
- playlist.songs[i])->utf8file)));
+ playlist.songs[i])->utf8url)));
}
else myfprintf(fileP,"%s\n",
- utf8ToFsCharset((playlist.songs[i])->utf8file));
+ utf8ToFsCharset((playlist.songs[i])->utf8url));
}
while(fclose(fileP) && errno==EINTR);
@@ -1203,6 +1205,6 @@ int seekSongInPlaylist(FILE * fp, int song, float time) {
if(playPlaylistOrderNumber(fp,i)<0) return -1;
}
- return playerSeek(fp,playlist.songs[playlist.order[i]]->utf8file,time);
+ return playerSeek(fp,playlist.songs[playlist.order[i]]->utf8url,time);
}
/* vim:set shiftwidth=4 tabstop=8 expandtab: */