diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2018-07-02 21:20:53 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2018-07-02 21:20:53 +0000 |
| commit | 20035f2d26e693352328c703a382d0ba86f7708a (patch) | |
| tree | 675cf26b4427d9716da20da2a43bb43f4cad1fac /src/plugins | |
| parent | 83c44dc39f2ac0324107bfde328d7032e65343cc (diff) | |
| download | qmmp-20035f2d26e693352328c703a382d0ba86f7708a.tar.gz qmmp-20035f2d26e693352328c703a382d0ba86f7708a.tar.bz2 qmmp-20035f2d26e693352328c703a382d0ba86f7708a.zip | |
removed mpris1 support
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@8097 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins')
| -rw-r--r-- | src/plugins/General/mpris/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | src/plugins/General/mpris/mpris.cpp | 10 | ||||
| -rw-r--r-- | src/plugins/General/mpris/mpris.pro | 6 | ||||
| -rw-r--r-- | src/plugins/General/mpris/mpris1/playerobject.cpp | 202 | ||||
| -rw-r--r-- | src/plugins/General/mpris/mpris1/playerobject.h | 103 | ||||
| -rw-r--r-- | src/plugins/General/mpris/mpris1/rootobject.cpp | 75 | ||||
| -rw-r--r-- | src/plugins/General/mpris/mpris1/rootobject.h | 54 | ||||
| -rw-r--r-- | src/plugins/General/mpris/mpris1/tracklistobject.cpp | 135 | ||||
| -rw-r--r-- | src/plugins/General/mpris/mpris1/tracklistobject.h | 72 |
9 files changed, 1 insertions, 659 deletions
diff --git a/src/plugins/General/mpris/CMakeLists.txt b/src/plugins/General/mpris/CMakeLists.txt index 5d63a16df..e18c46b53 100644 --- a/src/plugins/General/mpris/CMakeLists.txt +++ b/src/plugins/General/mpris/CMakeLists.txt @@ -10,9 +10,6 @@ link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) SET(libmpris_SRCS mpris.cpp mprisfactory.cpp - mpris1/rootobject.cpp - mpris1/playerobject.cpp - mpris1/tracklistobject.cpp mpris2/root2object.cpp mpris2/player2object.cpp ) diff --git a/src/plugins/General/mpris/mpris.cpp b/src/plugins/General/mpris/mpris.cpp index c668c6856..bfea8d8d3 100644 --- a/src/plugins/General/mpris/mpris.cpp +++ b/src/plugins/General/mpris/mpris.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008-2012 by Ilya Kotov * + * Copyright (C) 2008-2018 by Ilya Kotov * * forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -19,9 +19,6 @@ ***************************************************************************/ #include <QtDBus> -#include "mpris1/playerobject.h" -#include "mpris1/rootobject.h" -#include "mpris1/tracklistobject.h" #include "mpris2/root2object.h" #include "mpris2/player2object.h" #include "mpris.h" @@ -29,15 +26,10 @@ MPRIS::MPRIS(QObject *parent) : QObject(parent) { QDBusConnection connection = QDBusConnection::sessionBus(); - //MPRISv1.0 - connection.registerObject("/TrackList", new TrackListObject(this), QDBusConnection::ExportAllContents); - connection.registerObject("/Player", new PlayerObject(this), QDBusConnection::ExportAllContents); - connection.registerObject("/", new RootObject(this), QDBusConnection::ExportAllContents); //MPRISv2.0 new Root2Object(this); new Player2Object(this); connection.registerObject("/org/mpris/MediaPlayer2", this); - connection.registerService("org.mpris.qmmp"); connection.registerService("org.mpris.MediaPlayer2.qmmp"); } diff --git a/src/plugins/General/mpris/mpris.pro b/src/plugins/General/mpris/mpris.pro index d08a7cb9b..b13250c34 100644 --- a/src/plugins/General/mpris/mpris.pro +++ b/src/plugins/General/mpris/mpris.pro @@ -6,17 +6,11 @@ QT += dbus HEADERS += mprisfactory.h \ mpris.h \ - mpris1/playerobject.h \ - mpris1/rootobject.h \ - mpris1/tracklistobject.h \ mpris2/root2object.h \ mpris2/player2object.h SOURCES += mprisfactory.cpp \ mpris.cpp \ - mpris1/playerobject.cpp \ - mpris1/rootobject.cpp \ - mpris1/tracklistobject.cpp \ mpris2/root2object.cpp \ mpris2/player2object.cpp diff --git a/src/plugins/General/mpris/mpris1/playerobject.cpp b/src/plugins/General/mpris/mpris1/playerobject.cpp deleted file mode 100644 index 77ea85d2a..000000000 --- a/src/plugins/General/mpris/mpris1/playerobject.cpp +++ /dev/null @@ -1,202 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2008-2018 by Ilya Kotov * - * forkotov02@ya.ru * - * * - * 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. * - * * - * 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. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#include <QFile> -#include <QDBusMetaType> -#include <QDBusArgument> -#include <qmmp/soundcore.h> -#include <qmmp/metadatamanager.h> -#include <qmmpui/mediaplayer.h> -#include <qmmpui/playlistmanager.h> -#include <qmmpui/qmmpuisettings.h> -#include "playerobject.h" - - -//register << operator -QDBusArgument &operator << (QDBusArgument &arg, const PlayerStatus &status) -{ - arg.beginStructure(); - arg << status.state; - arg << status.random; - arg << status.repeat; - arg << status.repeatPlayList; - arg.endStructure(); - return arg; -} - -//register >> operator -const QDBusArgument &operator >> (const QDBusArgument &arg, PlayerStatus &status) -{ - arg.beginStructure(); - arg >> status.state; - arg >> status.random; - arg >> status.repeat; - arg >> status.repeatPlayList; - arg.endStructure(); - return arg; -} - -PlayerObject::PlayerObject(QObject *parent) : QObject(parent) -{ - qDBusRegisterMetaType<PlayerStatus>(); - m_core = SoundCore::instance(); - m_player = MediaPlayer::instance(); - m_pl_manager = m_player->playListManager(); - m_ui_settings = QmmpUiSettings::instance(); - connect(m_core, SIGNAL(stateChanged (Qmmp::State)), SLOT(updateCaps())); - connect(m_core, SIGNAL(trackInfoChanged()), SLOT(updateTrack())); - connect(m_core, SIGNAL(stateChanged (Qmmp::State)), SLOT(updateStatus())); - connect(m_ui_settings, SIGNAL(repeatableListChanged(bool)), SLOT(updateStatus())); - connect(m_ui_settings, SIGNAL(shuffleChanged(bool)), SLOT(updateStatus())); - connect(m_ui_settings, SIGNAL(repeatableTrackChanged(bool)), SLOT(updateStatus())); -} - -PlayerObject::~PlayerObject() -{} - -void PlayerObject::Next() -{ - m_player->next(); -} - -void PlayerObject::Prev() -{ - m_player->previous(); -} - -void PlayerObject::Pause() -{ - m_core->pause(); -} - -void PlayerObject::Stop() -{ - m_player->stop(); -} - -void PlayerObject::Play() -{ - m_player->play(); -} - -void PlayerObject::Repeat(bool in0) -{ - m_ui_settings->setRepeatableTrack(in0); -} - -PlayerStatus PlayerObject::GetStatus() -{ - PlayerStatus st; - switch (m_core->state()) - { - case Qmmp::Stopped: - case Qmmp::NormalError: - case Qmmp::FatalError: - st.state = 2; - break; - case Qmmp::Playing: - case Qmmp::Buffering: - st.state = 0; - break; - case Qmmp::Paused: - st.state = 1; - }; - st.random = int(m_ui_settings->isShuffle()); - st.repeat = int(m_ui_settings->isRepeatableTrack()); - st.repeatPlayList = int(m_ui_settings->isRepeatableList()); - return st; -} - -QVariantMap PlayerObject::GetMetadata() -{ - TrackInfo info = m_core->trackInfo(); - QVariantMap map; - - if (info.path().contains("://")) - map.insert("location", info.path()); - else - map.insert("location", "file://" + info.path()); - map.insert("arturl", MetaDataManager::instance()->getCoverPath(info.path())); - map.insert("title", info.value(Qmmp::TITLE)); - map.insert("artist", info.value(Qmmp::ARTIST)); - map.insert("albumartist", info.value(Qmmp::ALBUMARTIST)); - map.insert("album", info.value(Qmmp::ALBUM)); - map.insert("tracknumber", info.value(Qmmp::TRACK)); - map.insert("time", (quint32)info.duration()/1000); - map.insert("mtime", (quint32)info.duration()); - map.insert("genre", info.value(Qmmp::GENRE)); - map.insert("comment", info.value(Qmmp::COMMENT)); - map.insert("audio-bitrate", (quint32)info.value(Qmmp::BITRATE).toInt()); - map.insert("audio-samplerate", (quint32)info.value(Qmmp::SAMPLERATE).toInt()); - map.insert("year", info.value(Qmmp::YEAR).toUInt()); - return map; -} - -int PlayerObject::GetCaps() -{ - int caps = NONE; - if (GetStatus().state == 0) - caps |= CAN_PAUSE; - else - caps |= CAN_PLAY; - if ((GetStatus().state < 2) && (m_core->duration() > 0)) - caps |= CAN_SEEK; - caps |= CAN_GO_NEXT; - caps |= CAN_GO_PREV; - caps |= CAN_PROVIDE_METADATA; - return caps; -} - -void PlayerObject::VolumeSet(int volume) -{ - int balance = (VolumeGet() > 0) ? (m_core->rightVolume() - m_core->leftVolume()) * 100/VolumeGet() : 0; - m_core->setVolume(volume - qMax(balance,0)*volume/100, - volume + qMin(balance,0)*volume/100); -} - -int PlayerObject::VolumeGet() -{ - return qMax(m_core->leftVolume(), m_core->rightVolume()); -} - -void PlayerObject::PositionSet(int pos) -{ - m_core->seek(pos); -} - -int PlayerObject::PositionGet() -{ - return m_core->elapsed(); -} - -void PlayerObject::updateCaps() -{ - emit CapsChange(GetCaps()); -} - -void PlayerObject::updateTrack() -{ - emit TrackChange(GetMetadata()); -} - -void PlayerObject::updateStatus() -{ - emit StatusChange(GetStatus()); -} diff --git a/src/plugins/General/mpris/mpris1/playerobject.h b/src/plugins/General/mpris/mpris1/playerobject.h deleted file mode 100644 index 96a824ce1..000000000 --- a/src/plugins/General/mpris/mpris1/playerobject.h +++ /dev/null @@ -1,103 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2008-2013 by Ilya Kotov * - * forkotov02@ya.ru * - * * - * 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. * - * * - * 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. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ -#ifndef PLAYEROBJECT_H -#define PLAYEROBJECT_H - -#include <QObject> -#include <QVariantMap> - -class SoundCore; -class MediaPlayer; -class PlayListManager; -class QmmpUiSettings; - -/** - @author Ilya Kotov <forkotov02@ya.ru> -*/ - -struct PlayerStatus -{ - int state; // 0 = Playing, 1 = Paused, 2 = Stopped. - int random; // 0 = Playing linearly, 1 = Playing randomly. - int repeat; // 0 = Go to the next element once the current has finished playing, 1 = Repeat the current element - int repeatPlayList; // 0 = Stop playing once the last element has been played, 1 = Never give up playing -}; - -Q_DECLARE_METATYPE(PlayerStatus) - -class PlayerObject : public QObject -{ - Q_OBJECT - Q_CLASSINFO("D-Bus Interface", "org.freedesktop.MediaPlayer") - -public: - PlayerObject(QObject *parent = 0); - - ~PlayerObject(); - - - enum PlayerCaps - { - - NONE = 0, - CAN_GO_NEXT = 1 << 0, - CAN_GO_PREV = 1 << 1, - CAN_PAUSE = 1 << 2, - CAN_PLAY = 1 << 3, - CAN_SEEK = 1 << 4, - CAN_PROVIDE_METADATA = 1 << 5, - CAN_HAS_TRACKLIST = 1 << 6 - }; - - -public slots: - void Next(); - void Prev(); - void Pause(); - void Stop(); - void Play(); - void Repeat(bool in0); - PlayerStatus GetStatus(); - QVariantMap GetMetadata(); - int GetCaps(); - void VolumeSet(int in0); - int VolumeGet(); - void PositionSet(int in0); - int PositionGet(); - -signals: - void CapsChange(int); - void TrackChange(QVariantMap); - void StatusChange(PlayerStatus); - -private slots: - void updateCaps(); - void updateTrack(); - void updateStatus(); - -private: - SoundCore *m_core; - MediaPlayer *m_player; - PlayListManager *m_pl_manager; - QmmpUiSettings *m_ui_settings; - -}; - -#endif diff --git a/src/plugins/General/mpris/mpris1/rootobject.cpp b/src/plugins/General/mpris/mpris1/rootobject.cpp deleted file mode 100644 index 6cfaad909..000000000 --- a/src/plugins/General/mpris/mpris1/rootobject.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2008 by Ilya Kotov * - * forkotov02@ya.ru * - * * - * 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. * - * * - * 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. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#include <QDBusMetaType> -#include <QDBusArgument> -#include <qmmpui/uihelper.h> -#include <qmmp/qmmp.h> -#include "rootobject.h" - -//register << operator -QDBusArgument &operator << (QDBusArgument &arg, const Version &v) -{ - arg.beginStructure(); - arg << v.major; - arg << v.minor; - arg.endStructure(); - return arg; -} - -//register >> operator -const QDBusArgument &operator >> (const QDBusArgument &arg, Version &v) -{ - arg.beginStructure(); - arg >> v.major; - arg >> v.minor; - arg.endStructure(); - return arg; -} - -RootObject::RootObject(QObject *parent) - : QObject(parent) -{ - qDBusRegisterMetaType<Version>(); -} - - -RootObject::~RootObject() -{ -} - -QString RootObject::Identity() -{ - QString name = "Qmmp " + Qmmp::strVersion(); - return name; -} - -Version RootObject::MprisVersion() -{ - struct Version v; - v.major = 1; - v.minor = 0; - return v; -} - -void RootObject::Quit() -{ - UiHelper::instance()->exit(); -} diff --git a/src/plugins/General/mpris/mpris1/rootobject.h b/src/plugins/General/mpris/mpris1/rootobject.h deleted file mode 100644 index e106c96f0..000000000 --- a/src/plugins/General/mpris/mpris1/rootobject.h +++ /dev/null @@ -1,54 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2008 by Ilya Kotov * - * forkotov02@ya.ru * - * * - * 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. * - * * - * 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. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ -#ifndef ROOTOBJECT_H -#define ROOTOBJECT_H - -#include <QObject> -#include <QVariantMap> - -/** - @author Ilya Kotov <forkotov02@ya.ru> -*/ - - -struct Version -{ - quint16 major; - quint16 minor; -}; - -Q_DECLARE_METATYPE(Version); - -class RootObject : public QObject -{ -Q_OBJECT -Q_CLASSINFO("D-Bus Interface", "org.freedesktop.MediaPlayer") -public: - RootObject(QObject *parent = 0); - - ~RootObject(); - -public slots: - QString Identity(); - Version MprisVersion(); - void Quit(); -}; - -#endif diff --git a/src/plugins/General/mpris/mpris1/tracklistobject.cpp b/src/plugins/General/mpris/mpris1/tracklistobject.cpp deleted file mode 100644 index 64b03bc51..000000000 --- a/src/plugins/General/mpris/mpris1/tracklistobject.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2008-2018 by Ilya Kotov * - * forkotov02@ya.ru * - * * - * 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. * - * * - * 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. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#include <QFile> -#include <QUrl> - -#include <qmmpui/playlistmanager.h> -#include <qmmpui/mediaplayer.h> -#include <qmmpui/playlistitem.h> -#include <qmmpui/qmmpuisettings.h> -#include "tracklistobject.h" - -TrackListObject::TrackListObject(QObject *parent) : QObject(parent) -{ - m_player = MediaPlayer::instance(); - m_ui_settings = QmmpUiSettings::instance(); - m_pl_manager = m_player->playListManager(); - m_model = m_pl_manager->currentPlayList(); - connect (m_model, SIGNAL(listChanged(int)), SLOT(updateTrackList(int))); - connect (m_pl_manager, SIGNAL(currentPlayListChanged(PlayListModel*,PlayListModel*)), - SLOT(switchPlayList(PlayListModel*,PlayListModel*))); - m_prev_count = 0; -} - -TrackListObject::~TrackListObject() -{ -} - -int TrackListObject::AddTrack(const QString &in0, bool in1) -{ - QString path = in0; - if(in0.startsWith("file://")) - { - path = QUrl(in0).toLocalFile (); - if(!QFile::exists(path)) - return 1; //error - } - if(in1) - { - m_pl_manager->selectPlayList(m_model); - m_player->stop(); - connect(m_model, SIGNAL(trackAdded(PlayListTrack*)), SLOT(playTrack(PlayListTrack*))); - } - m_model->add(path); - return 0; -} - -void TrackListObject::DelTrack(int in0) -{ - m_model->removeTrack(in0); -} - -int TrackListObject::GetCurrentTrack() -{ - return m_model->currentIndex(); -} - -int TrackListObject::GetLength() -{ - return m_model->trackCount(); -} - -QVariantMap TrackListObject::GetMetadata(int in0) -{ - QVariantMap map; - PlayListTrack *track = m_model->findTrack(in0); - - if (track) - { - if (track->path().contains("://")) - map.insert("location", track->path()); - else - map.insert("location", "file://" + track->path()); - map.insert("title", track->value(Qmmp::TITLE)); - map.insert("artist", track->value(Qmmp::ARTIST)); - map.insert("albumartist", track->value(Qmmp::ALBUMARTIST)); - map.insert("album", track->value(Qmmp::ALBUM)); - map.insert("tracknumber", track->value(Qmmp::TRACK)); - map.insert("time", (quint32)track->duration() / 1000); - map.insert("mtime", (quint32)track->duration()); - map.insert("genre", track->value(Qmmp::GENRE)); - map.insert("comment", track->value(Qmmp::COMMENT)); - map.insert("year", track->value(Qmmp::YEAR).toUInt()); - } - return map; -} - -void TrackListObject::SetLoop(bool in0) -{ - m_ui_settings->setRepeatableList(in0); -} - -void TrackListObject::SetRandom(bool in0) -{ - m_ui_settings->setShuffle(in0); -} - -void TrackListObject::playTrack(PlayListTrack *track) -{ - m_model->setCurrent(track); - m_player->play(); - disconnect(m_model,SIGNAL(trackAdded(PlayListTrack*)), this, SLOT(playTrack(PlayListTrack*))); -} - -void TrackListObject::updateTrackList(int flags) -{ - if(flags & PlayListModel::STRUCTURE) - emit TrackListChange(m_model->trackCount()); -} - -void TrackListObject::switchPlayList(PlayListModel *cur, PlayListModel *prev) -{ - m_model = cur; - connect (m_model, SIGNAL(listChanged(int)), SLOT(updateTrackList(int))); - if(prev) - disconnect(prev,0,this,0); - updateTrackList(PlayListModel::STRUCTURE); -} diff --git a/src/plugins/General/mpris/mpris1/tracklistobject.h b/src/plugins/General/mpris/mpris1/tracklistobject.h deleted file mode 100644 index 1da743c37..000000000 --- a/src/plugins/General/mpris/mpris1/tracklistobject.h +++ /dev/null @@ -1,72 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2008-2015 by Ilya Kotov * - * forkotov02@ya.ru * - * * - * 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. * - * * - * 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. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ -#ifndef TRACKLISTOBJECT_H -#define TRACKLISTOBJECT_H - -#include <QObject> -#include <QString> -#include <QVariantMap> - -class PlayListModel; -class PlayListManager; -class MediaPlayer; -class QmmpUiSettings; -class PlayListTrack; - -/** - @author Ilya Kotov <forkotov02@ya.ru> -*/ -class TrackListObject : public QObject -{ - Q_OBJECT - Q_CLASSINFO("D-Bus Interface", "org.freedesktop.MediaPlayer") - -public: - TrackListObject(QObject *parent = 0); - - ~TrackListObject(); - -public slots: - int AddTrack(const QString &in0, bool in1); - void DelTrack(int in0); - int GetCurrentTrack(); - int GetLength(); - QVariantMap GetMetadata(int in0); - void SetLoop(bool in0); - void SetRandom(bool in0); - -signals: - void TrackListChange(int in0); - -private slots: - void playTrack(PlayListTrack *track); - void updateTrackList(int flags); - void switchPlayList(PlayListModel *cur, PlayListModel *prev); - -private: - PlayListModel *m_model; - PlayListManager *m_pl_manager; - MediaPlayer *m_player; - QmmpUiSettings *m_ui_settings; - int m_prev_count; - -}; - -#endif |
