diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2013-08-27 14:08:49 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2013-08-27 14:08:49 +0000 |
| commit | b94095cd8d42e6e75518ed9a0436da95e0fc7ec6 (patch) | |
| tree | 1bfbabed14580cd1d48ab409063b67e2de95951c /src/qmmpui/playlistmodel.cpp | |
| parent | 0b80094719507653ddaf29e76439d2ab018bba17 (diff) | |
| download | qmmp-b94095cd8d42e6e75518ed9a0436da95e0fc7ec6.tar.gz qmmp-b94095cd8d42e6e75518ed9a0436da95e0fc7ec6.tar.bz2 qmmp-b94095cd8d42e6e75518ed9a0436da95e0fc7ec6.zip | |
added some api functions
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@3670 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/qmmpui/playlistmodel.cpp')
| -rw-r--r-- | src/qmmpui/playlistmodel.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/qmmpui/playlistmodel.cpp b/src/qmmpui/playlistmodel.cpp index 828c914de..2646b71ed 100644 --- a/src/qmmpui/playlistmodel.cpp +++ b/src/qmmpui/playlistmodel.cpp @@ -179,6 +179,11 @@ PlayListTrack* PlayListModel::track(int index) const return m_container->track(index); } +PlayListGroup* PlayListModel::group(int index) const +{ + return m_container->group(index); +} + int PlayListModel::currentIndex() const { return m_current; @@ -190,7 +195,10 @@ bool PlayListModel::setCurrent(int index) return false; PlayListItem *item = m_container->item(index); if(item->isGroup()) - return false; + { + index++; + item = m_container->item(index); + } m_current = index; m_current_track = dynamic_cast<PlayListTrack*> (item); emit currentChanged(); @@ -212,6 +220,13 @@ bool PlayListModel::isTrack(int index) const return !m_container->item(index)->isGroup(); } +bool PlayListModel::isGroup(int index) const +{ + if (index > count()-1 || index < 0) + return false; + return !m_container->item(index)->isGroup(); +} + bool PlayListModel::next() { if(m_stop_track == currentTrack()) |
