GitHost.io will be shut down on June 1, 2019. At that point this instance will be unreachable and all data will be irrevocably deleted. More details at https://about.gitlab.com/gitlab-hosted/#githost-is-shutting-down-on-june-1st-2019

Commit c3f99ca9 authored by Mike Sheldon's avatar Mike Sheldon

Update song progress bar in MeeGo client

parent ccc4b05a
......@@ -20,6 +20,10 @@ Page {
imgCover.source = imageurl
}
onPositionUpdate: {
songProgress.value = position;
}
}
......@@ -73,7 +77,7 @@ Page {
Slider {
id: songProgress
value: 0.5
value: 0
}
}
......
......@@ -19,6 +19,9 @@ ServerComm::ServerComm(QObject *parent) :
media = new Phonon::MediaObject(this);
Phonon::AudioOutput *audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
Phonon::createPath(media, audioOutput);
media->setTickInterval(100);
QObject::connect(media, SIGNAL(tick(qint64)), this, SLOT(updateProgress(qint64)));
// Check login details
qDebug() << "Checking settings...";
......@@ -272,3 +275,7 @@ void ServerComm::ban() {
ban_netman->post(QNetworkRequest(url), params);
}
void ServerComm::updateProgress(qint64 time) {
double progress = time / (double) media->totalTime();
positionUpdate(progress);
}
......@@ -34,12 +34,14 @@ signals:
void loginSuccessful();
void tuned(QString stationName);
void playing(QString artist, QString album, QString title, QString imageurl);
void positionUpdate(double position);
private slots:
void wsLoginReply(QNetworkReply *reply);
void scrobbleLoginReply(QNetworkReply *reply);
void tuneReply(QNetworkReply *reply);
void playlistReply(QNetworkReply *reply);
void updateProgress(qint64 time);
public slots:
void login(const QString &username, const QString &password);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment