diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-12-23 21:13:34 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-12-23 21:13:34 +0000 |
| commit | fedd13511bbf91914a0250b43c440f43e6d1e8c5 (patch) | |
| tree | 03cca77aab98ce8c8c2b261f345655d64ae8e172 /src/plugins/General/mpris/tracklistobject.cpp | |
| parent | ac7a7dffc31afe8a20a51db4ab7749bf4fdea67c (diff) | |
| download | qmmp-fedd13511bbf91914a0250b43c440f43e6d1e8c5.tar.gz qmmp-fedd13511bbf91914a0250b43c440f43e6d1e8c5.tar.bz2 qmmp-fedd13511bbf91914a0250b43c440f43e6d1e8c5.zip | |
full mpris support; new options: "repeat track", "show protocol"
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@698 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/General/mpris/tracklistobject.cpp')
| -rw-r--r-- | src/plugins/General/mpris/tracklistobject.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/plugins/General/mpris/tracklistobject.cpp b/src/plugins/General/mpris/tracklistobject.cpp index dfce2d8af..6b3699a0c 100644 --- a/src/plugins/General/mpris/tracklistobject.cpp +++ b/src/plugins/General/mpris/tracklistobject.cpp @@ -19,6 +19,7 @@ ***************************************************************************/ #include <QFile> +#include <QUrl> #include <qmmpui/playlistmodel.h> #include <qmmpui/mediaplayer.h> @@ -39,15 +40,29 @@ TrackListObject::~TrackListObject() { } -/*int TrackListObject::AddTrack(const QString &in0, bool in1) +int TrackListObject::AddTrack(const QString &in0, bool in1) { - m_model->addFile(in0); + int old_count = m_model->count(); + if(in0.startsWith("file://")) + m_model->addFile(QUrl(in0).toLocalFile ()); //converts url to local file path + else + m_model->addFile(in0); + int new_count = m_model->count(); + if(new_count == old_count) + return 0; if(in1) { - m_model->set + m_model->setCurrent(new_count-1); + m_player->stop(); + m_player->play(); } return 1; -}*/ +} + +void TrackListObject::DelTrack(int in0) +{ + m_model->removeAt(in0); +} int TrackListObject::GetCurrentTrack() { |
