File src/command.cpp changed (mode: 100644) (index 4596280..763a39c) |
... |
... |
Control::create_playlist(string name) |
1599 |
1599 |
{ |
{ |
1600 |
1600 |
EXIT_IDLE; |
EXIT_IDLE; |
1601 |
1601 |
|
|
1602 |
|
pms->log(MSG_DEBUG, 0, "Creating a new playlist '%s'\n", name.c_str()); |
|
|
1602 |
|
pms->log(MSG_DEBUG, 0, "Creating playlist '%s'\n", name.c_str()); |
|
1603 |
|
|
|
1604 |
|
/* Apparently, it is enough to run "playlistclear" in order to create a |
|
1605 |
|
* new playlist. However, we do not get protection against clearing an |
|
1606 |
|
* existing playlist. This is worked around by calling mpd_run_save() |
|
1607 |
|
* first, which will complain with a suitable error message. */ |
|
1608 |
|
if (mpd_run_save(conn->h(), name.c_str())) { |
|
1609 |
|
mpd_run_playlist_clear(conn->h(), name.c_str()); |
|
1610 |
|
} |
|
1611 |
|
|
|
1612 |
|
return get_error_bool(); |
|
1613 |
|
} |
|
1614 |
|
|
|
1615 |
|
/* |
|
1616 |
|
* Save the queue contents into a stored playlist. |
|
1617 |
|
* |
|
1618 |
|
* Returns true on success, false on failure. |
|
1619 |
|
*/ |
|
1620 |
|
bool |
|
1621 |
|
Control::save_playlist(string name) |
|
1622 |
|
{ |
|
1623 |
|
EXIT_IDLE; |
|
1624 |
|
|
|
1625 |
|
pms->log(MSG_DEBUG, 0, "Saving the queue into playlist '%s'\n", name.c_str()); |
1603 |
1626 |
|
|
1604 |
1627 |
return mpd_run_save(conn->h(), name.c_str()); |
return mpd_run_save(conn->h(), name.c_str()); |
1605 |
1628 |
} |
} |
File src/command.h changed (mode: 100644) (index 64785a5..8b1c55c) |
... |
... |
public: |
306 |
306 |
/* List management */ |
/* List management */ |
307 |
307 |
Playlist * find_playlist(string filename); |
Playlist * find_playlist(string filename); |
308 |
308 |
bool create_playlist(string name); |
bool create_playlist(string name); |
|
309 |
|
bool save_playlist(string name); |
309 |
310 |
bool delete_playlist(string name); |
bool delete_playlist(string name); |
310 |
311 |
Songlist * activelist(); |
Songlist * activelist(); |
311 |
312 |
bool activatelist(Songlist *); |
bool activatelist(Songlist *); |