aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/General
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/General')
-rw-r--r--src/plugins/General/mpris/playerobject.cpp10
-rw-r--r--src/plugins/General/notifier/notifier.cpp2
-rw-r--r--src/plugins/General/notifier/popupwidget.cpp4
-rw-r--r--src/plugins/General/scrobbler/scrobbler.cpp4
4 files changed, 10 insertions, 10 deletions
diff --git a/src/plugins/General/mpris/playerobject.cpp b/src/plugins/General/mpris/playerobject.cpp
index 160d32e56..c043a2e63 100644
--- a/src/plugins/General/mpris/playerobject.cpp
+++ b/src/plugins/General/mpris/playerobject.cpp
@@ -135,8 +135,8 @@ QVariantMap PlayerObject::GetMetadata()
map.insert("artist", m_core->metaData(Qmmp::ARTIST));
map.insert("album", m_core->metaData(Qmmp::ALBUM));
map.insert("tracknumber", m_core->metaData(Qmmp::TRACK));
- map.insert("time", m_core->length());
- map.insert("mtime", m_core->length() * 1000);
+ map.insert("time", m_core->totalTime()/1000);
+ map.insert("mtime", m_core->totalTime());
map.insert("genre", m_core->metaData(Qmmp::GENRE));
map.insert("comment", m_core->metaData(Qmmp::COMMENT));
map.insert("audio-bitrate", m_core->bitrate());
@@ -152,7 +152,7 @@ int PlayerObject::GetCaps()
caps |= CAN_PAUSE;
else
caps |= CAN_PLAY;
- if ((GetStatus().state < 2) && (m_core->length() > 0))
+ if ((GetStatus().state < 2) && (m_core->totalTime() > 0))
caps |= CAN_SEEK;
caps |= CAN_GO_NEXT;
caps |= CAN_GO_PREV;
@@ -174,12 +174,12 @@ int PlayerObject::VolumeGet()
void PlayerObject::PositionSet(int pos)
{
- m_core->seek(pos / 1000);
+ m_core->seek(pos);
}
int PlayerObject::PositionGet()
{
- return m_core->elapsed() * 1000;
+ return m_core->elapsed();
}
void PlayerObject::updateCaps()
diff --git a/src/plugins/General/notifier/notifier.cpp b/src/plugins/General/notifier/notifier.cpp
index d1254a78b..42b07eb2d 100644
--- a/src/plugins/General/notifier/notifier.cpp
+++ b/src/plugins/General/notifier/notifier.cpp
@@ -85,7 +85,7 @@ void Notifier::showMetaData()
file.write(m_core->metaData(Qmmp::ARTIST).toUtf8()+"\n");
file.write(m_core->metaData(Qmmp::ALBUM).toUtf8()+"\n");
file.write(m_core->metaData(Qmmp::TRACK).toUtf8()+"\n");
- file.write(QString("%1").arg(m_core->length()).toUtf8()+"\n");
+ file.write(QString("%1").arg(m_core->totalTime()/1000).toUtf8()+"\n");
file.close();
}
diff --git a/src/plugins/General/notifier/popupwidget.cpp b/src/plugins/General/notifier/popupwidget.cpp
index 9e7c3cc53..f6a7c7e73 100644
--- a/src/plugins/General/notifier/popupwidget.cpp
+++ b/src/plugins/General/notifier/popupwidget.cpp
@@ -83,10 +83,10 @@ void PopupWidget::showMetaData()
QString title = core->metaData(Qmmp::TITLE);
if (title.isEmpty())
title = core->metaData(Qmmp::URL).section('/',-1);
- if (core->length() > 0)
+ if (core->totalTime() > 0)
{
title.append(" ");
- title.append(QString("(%1:%2)").arg(core->length()/60).arg(core->length()%60, 2, 10, QChar('0')));
+ title.append(QString("(%1:%2)").arg(core->totalTime()/60000).arg(core->totalTime()%60000, 2, 10, QChar('0')));
}
m_label1->setText("<b>" + title + "</b>");
diff --git a/src/plugins/General/scrobbler/scrobbler.cpp b/src/plugins/General/scrobbler/scrobbler.cpp
index 8cf79d4c6..d73f85fea 100644
--- a/src/plugins/General/scrobbler/scrobbler.cpp
+++ b/src/plugins/General/scrobbler/scrobbler.cpp
@@ -132,7 +132,7 @@ void Scrobbler::updateMetaData()
if (m_state == Qmmp::Playing
&& !metadata.value(Qmmp::TITLE).isEmpty() //skip empty tags
&& !metadata.value(Qmmp::ARTIST).isEmpty()
- && m_core->length() //skip stream
+ && m_core->totalTime() //skip stream
&& !metadata.value(Qmmp::ARTIST).contains("&") //skip tags with special symbols
&& !metadata.value(Qmmp::TITLE).contains("&")
&& !metadata.value(Qmmp::ALBUM).contains("&")
@@ -140,7 +140,7 @@ void Scrobbler::updateMetaData()
&& !metadata.value(Qmmp::TITLE).contains("=")
&& !metadata.value(Qmmp::ALBUM).contains("="))
{
- m_song = SongInfo(metadata, m_core->length());
+ m_song = SongInfo(metadata, m_core->totalTime()/1000);
if (isReady() && m_notificationid == 0)
sendNotification(m_song);