add support for asx/cue/m3u/pls/xspf playlists
This commit is contained in:
@@ -132,11 +132,22 @@ void Browser::EnterPressed()
|
||||
}
|
||||
case itPlaylist:
|
||||
{
|
||||
MPD::SongList list;
|
||||
Mpd.GetPlaylistContent(locale_to_utf_cpy(item.name), list);
|
||||
if (myPlaylist->Add(list, 1))
|
||||
ShowMessage("Loading and playing playlist %s...", item.name.c_str());
|
||||
FreeSongList(list);
|
||||
if (itsBrowsedDir == "/")
|
||||
{
|
||||
MPD::SongList list;
|
||||
Mpd.GetPlaylistContent(locale_to_utf_cpy(item.name), list);
|
||||
if (myPlaylist->Add(list, 1))
|
||||
ShowMessage("Loading and playing playlist %s...", item.name.c_str());
|
||||
FreeSongList(list);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string name = itsBrowsedDir + "/" + item.name;
|
||||
ShowMessage("Loading playlist %s...", name.c_str());
|
||||
locale_to_utf(name);
|
||||
if (Mpd.LoadPlaylist(name))
|
||||
ShowMessage("Playlist loaded.");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -193,11 +204,11 @@ void Browser::SpacePressed()
|
||||
}
|
||||
case itPlaylist:
|
||||
{
|
||||
MPD::SongList list;
|
||||
Mpd.GetPlaylistContent(locale_to_utf_cpy(item.name), list);
|
||||
if (myPlaylist->Add(list, 0))
|
||||
ShowMessage("Loading playlist %s...", item.name.c_str());
|
||||
FreeSongList(list);
|
||||
std::string name = itsBrowsedDir == "/" ? item.name : itsBrowsedDir + "/" + item.name;
|
||||
ShowMessage("Loading playlist %s...", name.c_str());
|
||||
locale_to_utf(name);
|
||||
if (Mpd.LoadPlaylist(name))
|
||||
ShowMessage("Playlist loaded.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1286,7 +1286,11 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
static const char lastfm_url[] = "lastfm://";
|
||||
if (path.compare(0, static_strlen(lastfm_url), lastfm_url) == 0
|
||||
|| path.find(".pls", path.length()-4) != std::string::npos)
|
||||
|| path.find(".asx", path.length()-4) != std::string::npos
|
||||
|| path.find(".cue", path.length()-4) != std::string::npos
|
||||
|| path.find(".m3u", path.length()-4) != std::string::npos
|
||||
|| path.find(".pls", path.length()-4) != std::string::npos
|
||||
|| path.find(".xspf", path.length()-5) != std::string::npos)
|
||||
Mpd.LoadPlaylist(path);
|
||||
else
|
||||
Mpd.Add(path);
|
||||
|
||||
Reference in New Issue
Block a user