make function 'clear' in playlist editor clear selected playlist
This commit is contained in:
@@ -238,6 +238,7 @@ void Help::GetKeybindings()
|
|||||||
# endif // ! HAVE_TAGLIB_H
|
# endif // ! HAVE_TAGLIB_H
|
||||||
*w << DisplayKeys(Key.MvSongUp) << "Move item(s) up\n";
|
*w << DisplayKeys(Key.MvSongUp) << "Move item(s) up\n";
|
||||||
*w << DisplayKeys(Key.MvSongDown) << "Move item(s) down\n";
|
*w << DisplayKeys(Key.MvSongDown) << "Move item(s) down\n";
|
||||||
|
*w << DisplayKeys(Key.Clear) << "Clear current playlist\n";
|
||||||
|
|
||||||
*w << "\n\n " << fmtBold << "Keys - Lyrics\n -----------------------------------------\n" << fmtBoldEnd;
|
*w << "\n\n " << fmtBold << "Keys - Lyrics\n -----------------------------------------\n" << fmtBoldEnd;
|
||||||
*w << DisplayKeys(Key.Space) << "Switch for following lyrics of now playing song\n";
|
*w << DisplayKeys(Key.Space) << "Switch for following lyrics of now playing song\n";
|
||||||
|
|||||||
@@ -2026,7 +2026,7 @@ void mpd_sendListPlaylistCommand(mpd_Connection *connection, char *path)
|
|||||||
free(query);
|
free(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
void mpd_sendPlaylistClearCommand(mpd_Connection *connection, char *path)
|
void mpd_sendPlaylistClearCommand(mpd_Connection *connection, const char *path)
|
||||||
{
|
{
|
||||||
char *sPath = mpd_sanitizeArg(path);
|
char *sPath = mpd_sanitizeArg(path);
|
||||||
int len = strlen("playlistclear")+2+strlen(sPath)+3;
|
int len = strlen("playlistclear")+2+strlen(sPath)+3;
|
||||||
|
|||||||
@@ -664,7 +664,7 @@ void mpd_startPlaylistSearch(mpd_Connection *connection, int exact);
|
|||||||
|
|
||||||
void mpd_startStatsSearch(mpd_Connection *connection);
|
void mpd_startStatsSearch(mpd_Connection *connection);
|
||||||
|
|
||||||
void mpd_sendPlaylistClearCommand(mpd_Connection *connection, char *path);
|
void mpd_sendPlaylistClearCommand(mpd_Connection *connection, const char *path);
|
||||||
|
|
||||||
void mpd_sendPlaylistAddCommand(mpd_Connection *connection,
|
void mpd_sendPlaylistAddCommand(mpd_Connection *connection,
|
||||||
const char *playlist, const char *path);
|
const char *playlist, const char *path);
|
||||||
|
|||||||
@@ -338,6 +338,16 @@ void Connection::ClearPlaylist() const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Connection::ClearPlaylist(const string &playlist) const
|
||||||
|
{
|
||||||
|
if (isConnected)
|
||||||
|
{
|
||||||
|
mpd_sendPlaylistClearCommand(itsConnection, playlist.c_str());
|
||||||
|
if (!isCommandsListEnabled)
|
||||||
|
mpd_finishCommand(itsConnection);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Connection::AddToPlaylist(const string &path, const Song &s) const
|
void Connection::AddToPlaylist(const string &path, const Song &s) const
|
||||||
{
|
{
|
||||||
if (!s.Empty())
|
if (!s.Empty())
|
||||||
|
|||||||
@@ -1512,8 +1512,18 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (myScreen == myPlaylistEditor && myPlaylistEditor->Playlists->Empty())
|
||||||
|
continue;
|
||||||
ShowMessage("Clearing playlist...");
|
ShowMessage("Clearing playlist...");
|
||||||
|
if (myScreen == myPlaylistEditor)
|
||||||
|
{
|
||||||
|
Mpd->ClearPlaylist(locale_to_utf_cpy(myPlaylistEditor->Playlists->Current()));
|
||||||
|
myPlaylistEditor->Content->Clear(0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
Mpd->ClearPlaylist();
|
Mpd->ClearPlaylist();
|
||||||
|
}
|
||||||
ShowMessage("Cleared playlist!");
|
ShowMessage("Cleared playlist!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user