Code

release v0.29
[ncmpc.git] / src / player_command.c
index f38147a7c7c7985c3c5c5aee6cbe37209219fbfd..1a06bfabcb1b9b1bf465f883b9a02fd927bffba4 100644 (file)
@@ -1,5 +1,5 @@
 /* ncmpc (Ncurses MPD Client)
- * (c) 2004-2010 The Music Player Daemon Project
+ * (c) 2004-2017 The Music Player Daemon Project
  * Project homepage: http://musicpd.org
  *
  * This program is free software; you can redistribute it and/or modify
@@ -32,12 +32,10 @@ static guint seek_source_id;
 static void
 commit_seek(struct mpdclient *c)
 {
-       struct mpd_connection *connection;
-
        if (seek_id < 0)
                return;
 
-       connection = mpdclient_get_connection(c);
+       struct mpd_connection *connection = mpdclient_get_connection(c);
        if (connection == NULL) {
                seek_id = -1;
                return;
@@ -61,7 +59,6 @@ seek_timer(gpointer data)
 
        seek_source_id = 0;
        commit_seek(c);
-       mpdclient_put_connection(c);
        return false;
 }
 
@@ -101,14 +98,14 @@ setup_seek(struct mpdclient *c)
 bool
 handle_player_command(struct mpdclient *c, command_t cmd)
 {
-       struct mpd_connection *connection;
-
        if (!mpdclient_is_connected(c) || c->status == NULL)
                return false;
 
        cancel_seek_timer();
 
        switch(cmd) {
+               struct mpd_connection *connection;
+
                /*
        case CMD_PLAY:
                mpdclient_cmd_play(c, MPD_PLAY_AT_BEGINNING);
@@ -174,7 +171,7 @@ handle_player_command(struct mpdclient *c, command_t cmd)
                        break;
 
                if (mpd_run_shuffle(connection))
-                       screen_status_message(_("Shuffled playlist"));
+                       screen_status_message(_("Shuffled queue"));
                else
                        mpdclient_handle_error(c);
                break;
@@ -184,7 +181,7 @@ handle_player_command(struct mpdclient *c, command_t cmd)
                        break;
 
                if (mpdclient_cmd_clear(c))
-                       screen_status_message(_("Cleared playlist"));
+                       screen_status_message(_("Cleared queue"));
                break;
        case CMD_REPEAT:
                connection = mpdclient_get_connection(c);