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