aboutsummaryrefslogtreecommitdiff
path: root/src/qmmpui/playlistmanager.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2009-11-13 14:47:33 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2009-11-13 14:47:33 +0000
commit3d06313cd8ed2c8843f0c512c349296326f5a9e4 (patch)
tree739d28d5a782f366ef28e3807d459db7cc2de66b /src/qmmpui/playlistmanager.cpp
parent90d3aeb642ba4d6445932343010294a39b33efe2 (diff)
downloadqmmp-3d06313cd8ed2c8843f0c512c349296326f5a9e4.tar.gz
qmmp-3d06313cd8ed2c8843f0c512c349296326f5a9e4.tar.bz2
qmmp-3d06313cd8ed2c8843f0c512c349296326f5a9e4.zip
added playlist browser
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1364 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/qmmpui/playlistmanager.cpp')
-rw-r--r--src/qmmpui/playlistmanager.cpp30
1 files changed, 28 insertions, 2 deletions
diff --git a/src/qmmpui/playlistmanager.cpp b/src/qmmpui/playlistmanager.cpp
index f49d72749..bb4f10ebe 100644
--- a/src/qmmpui/playlistmanager.cpp
+++ b/src/qmmpui/playlistmanager.cpp
@@ -72,6 +72,7 @@ void PlayListManager::selectPlayList(PlayListModel *model)
PlayListModel *prev = m_selected;
m_selected = model;
emit selectedPlayListChanged(model, prev);
+ emit playListsChanged();
}
}
@@ -82,6 +83,22 @@ void PlayListManager::selectPlayList(int i)
selectPlayList(playListAt(i));
}
+void PlayListManager::selectNextPlayList()
+{
+ int i = m_models.indexOf(m_selected);
+ i++;
+ if( i >= 0 && i < m_models.size())
+ selectPlayList(i);
+}
+
+void PlayListManager::selectPreviousPlayList()
+{
+ int i = m_models.indexOf(m_selected);
+ i--;
+ if( i >= 0 && i < m_models.size())
+ selectPlayList(i);
+}
+
void PlayListManager::activatePlayList(PlayListModel *model)
{
if(model != m_current && m_models.contains(model))
@@ -89,6 +106,7 @@ void PlayListManager::activatePlayList(PlayListModel *model)
PlayListModel *prev = m_current;
m_current = model;
emit currentPlayListChanged(model, prev);
+ emit playListsChanged();
}
}
@@ -100,6 +118,7 @@ PlayListModel *PlayListManager::createPlayList(const QString &name)
model->prepareForRepeatablePlaying(m_repeatable);
model->prepareForShufflePlaying(m_shuffle);
emit playListAdded(i);
+ emit playListsChanged();
return model;
}
@@ -111,12 +130,19 @@ void PlayListManager::removePlayList(PlayListModel *model)
int i = m_models.indexOf(model);
if(m_current == model)
- activatePlayList(m_models.at(i + (i > 0) ? -1 : 1));
+ {
+ m_current = m_models.at((i > 0) ? (i - 1) : (i + 1));
+ emit currentPlayListChanged(m_current, model);
+ }
if(m_selected == model)
- selectPlayList(m_models.at(i + (i > 0) ? -1 : 1));
+ {
+ m_selected = m_models.at((i > 0) ? (i - 1) : (i + 1));
+ emit selectedPlayListChanged(m_selected, model);
+ }
m_models.removeAt(i);
model->deleteLater();
emit playListRemoved(i);
+ emit playListsChanged();
}
void PlayListManager::setRepeatableList(bool r)