diff options
Diffstat (limited to 'playlist.c')
-rw-r--r-- | playlist.c | 45 |
1 files changed, 33 insertions, 12 deletions
@@ -1,19 +1,28 @@ /* - DeaDBeeF - ultimate music player for GNU/Linux systems with X11 - Copyright (C) 2009-2012 Alexey Yakovenko <waker@users.sourceforge.net> + This file is part of Deadbeef Player source code + http://deadbeef.sourceforge.net - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or - (at your option) any later version. + playlist management - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + Copyright (C) 2009-2012 Alexey Yakovenko - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Alexey Yakovenko waker@users.sourceforge.net */ #ifdef HAVE_CONFIG_H # include "config.h" @@ -1489,6 +1498,7 @@ pl_add_files_end (void) { } addfiles_playlist = NULL; pl_unlock (); + messagepump_push (DB_EV_PLAYLISTCHANGED, 0, 0, 0); } int @@ -3473,9 +3483,14 @@ plt_move_items (playlist_t *to, int iter, playlist_t *from, playItem_t *drop_bef drop_after = to->tail[iter]; } + playItem_t *playing = streamer_get_playing_track (); + for (playItem_t *it = from->head[iter]; it && processed < count; it = next, idx++) { next = it->next[iter]; if (idx == indexes[processed]) { + if (it == playing && to != from) { + streamer_set_streamer_playlist (to); + } pl_item_ref (it); if (drop_after == it) { drop_after = it->prev[PL_MAIN]; @@ -3487,6 +3502,12 @@ plt_move_items (playlist_t *to, int iter, playlist_t *from, playItem_t *drop_bef processed++; } } + + if (playing) { + pl_item_unref (playing); + } + + no_remove_notify = 0; UNLOCK; } |