aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/General/mpris
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2013-08-07 11:34:42 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2013-08-07 11:34:42 +0000
commit1fb94978d0f60a91d9712fad25bbc47797979688 (patch)
tree3cb28247f8a0fdff2e2a1a6da5a0325ec5e577a6 /src/plugins/General/mpris
parent1daf8cdc97096b6235a404acb563bec0f3f23c58 (diff)
downloadqmmp-1fb94978d0f60a91d9712fad25bbc47797979688.tar.gz
qmmp-1fb94978d0f60a91d9712fad25bbc47797979688.tar.bz2
qmmp-1fb94978d0f60a91d9712fad25bbc47797979688.zip
enabled most general plugins
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@3576 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/General/mpris')
-rw-r--r--src/plugins/General/mpris/mpris1/tracklistobject.cpp30
-rw-r--r--src/plugins/General/mpris/mpris2/player2object.cpp12
-rw-r--r--src/plugins/General/mpris/mpris2/player2object.h2
3 files changed, 22 insertions, 22 deletions
diff --git a/src/plugins/General/mpris/mpris1/tracklistobject.cpp b/src/plugins/General/mpris/mpris1/tracklistobject.cpp
index e75900439..0fb498788 100644
--- a/src/plugins/General/mpris/mpris1/tracklistobject.cpp
+++ b/src/plugins/General/mpris/mpris1/tracklistobject.cpp
@@ -66,7 +66,7 @@ int TrackListObject::AddTrack(const QString &in0, bool in1)
void TrackListObject::DelTrack(int in0)
{
- m_model->removeAt(in0);
+ m_model->removeTrack(in0);
}
int TrackListObject::GetCurrentTrack()
@@ -82,22 +82,22 @@ int TrackListObject::GetLength()
QVariantMap TrackListObject::GetMetadata(int in0)
{
QVariantMap map;
- PlayListTrack *item = m_model->item(in0);
- if (item)
+ PlayListTrack *track = m_model->track(in0);
+ if (track)
{
- if (QFile::exists(item->url()))
- map.insert("location", "file://" + item->url());
+ if (QFile::exists(track->url()))
+ map.insert("location", "file://" + track->url());
else
- map.insert("location", item->url());
- map.insert("title", item->value(Qmmp::TITLE));
- map.insert("artist", item->value(Qmmp::ARTIST));
- map.insert("album", item->value(Qmmp::ALBUM));
- map.insert("tracknumber", item->value(Qmmp::TRACK));
- map.insert("time", (quint32)item->length());
- map.insert("mtime", (quint32)item->length() * 1000);
- map.insert("genre", item->value(Qmmp::GENRE));
- map.insert("comment", item->value(Qmmp::COMMENT));
- map.insert("year", item->value(Qmmp::YEAR).toUInt());
+ map.insert("location", track->url());
+ map.insert("title", track->value(Qmmp::TITLE));
+ map.insert("artist", track->value(Qmmp::ARTIST));
+ map.insert("album", track->value(Qmmp::ALBUM));
+ map.insert("tracknumber", track->value(Qmmp::TRACK));
+ map.insert("time", (quint32)track->length());
+ map.insert("mtime", (quint32)track->length() * 1000);
+ map.insert("genre", track->value(Qmmp::GENRE));
+ map.insert("comment", track->value(Qmmp::COMMENT));
+ map.insert("year", track->value(Qmmp::YEAR).toUInt());
}
return map;
}
diff --git a/src/plugins/General/mpris/mpris2/player2object.cpp b/src/plugins/General/mpris/mpris2/player2object.cpp
index af22d1eb7..fe2885c7a 100644
--- a/src/plugins/General/mpris/mpris2/player2object.cpp
+++ b/src/plugins/General/mpris/mpris2/player2object.cpp
@@ -31,7 +31,7 @@
Player2Object::Player2Object(QObject *parent) : QDBusAbstractAdaptor(parent)
{
- m_prev_item = 0;
+ m_prev_track = 0;
m_previous_pos = 0;
m_core = SoundCore::instance();
m_player = MediaPlayer::instance();
@@ -62,7 +62,7 @@ bool Player2Object::canControl() const
bool Player2Object::canGoNext() const
{
- return m_pl_manager->currentPlayList()->nextItem() != 0;
+ return m_pl_manager->currentPlayList()->nextTrack() != 0;
}
bool Player2Object::canGoPrevious() const
@@ -119,8 +119,8 @@ double Player2Object::maximumRate() const
QVariantMap Player2Object::metadata() const
{
- PlayListTrack *item = m_pl_manager->currentPlayList()->currentItem();
- if(!item || m_core->metaData(Qmmp::URL).isEmpty())
+ PlayListTrack *track = m_pl_manager->currentPlayList()->currentTrack();
+ if(!track || m_core->metaData(Qmmp::URL).isEmpty())
return QVariantMap();
QVariantMap map;
map["mpris:length"] = qMax(m_core->totalTime() * 1000 , qint64(0));
@@ -318,10 +318,10 @@ void Player2Object::emitPropertiesChanged()
void Player2Object::updateId()
{
- if(m_prev_item != m_pl_manager->currentPlayList()->currentItem())
+ if(m_prev_track != m_pl_manager->currentPlayList()->currentTrack())
{
m_trackID = QDBusObjectPath(QString("%1/Track/%2").arg("/org/qmmp/MediaPlayer2").arg(qrand()));
- m_prev_item = m_pl_manager->currentPlayList()->currentItem();
+ m_prev_track = m_pl_manager->currentPlayList()->currentTrack();
}
}
diff --git a/src/plugins/General/mpris/mpris2/player2object.h b/src/plugins/General/mpris/mpris2/player2object.h
index b808f83e5..2e1696fee 100644
--- a/src/plugins/General/mpris/mpris2/player2object.h
+++ b/src/plugins/General/mpris/mpris2/player2object.h
@@ -109,7 +109,7 @@ private:
PlayListManager *m_pl_manager;
QMap<QString, QVariant> m_props;
QDBusObjectPath m_trackID;
- PlayListTrack *m_prev_item;
+ PlayListTrack *m_prev_track;
qint64 m_previous_pos;
};