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 { ...@@ -20,6 +20,10 @@ Page {
imgCover.source = imageurl imgCover.source = imageurl
} }
onPositionUpdate: {
songProgress.value = position;
}
} }
...@@ -73,7 +77,7 @@ Page { ...@@ -73,7 +77,7 @@ Page {
Slider { Slider {
id: songProgress id: songProgress
value: 0.5 value: 0
} }
} }
......
...@@ -19,6 +19,9 @@ ServerComm::ServerComm(QObject *parent) : ...@@ -19,6 +19,9 @@ ServerComm::ServerComm(QObject *parent) :
media = new Phonon::MediaObject(this); media = new Phonon::MediaObject(this);
Phonon::AudioOutput *audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this); Phonon::AudioOutput *audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
Phonon::createPath(media, audioOutput); Phonon::createPath(media, audioOutput);
media->setTickInterval(100);
QObject::connect(media, SIGNAL(tick(qint64)), this, SLOT(updateProgress(qint64)));
// Check login details // Check login details
qDebug() << "Checking settings..."; qDebug() << "Checking settings...";
...@@ -272,3 +275,7 @@ void ServerComm::ban() { ...@@ -272,3 +275,7 @@ void ServerComm::ban() {
ban_netman->post(QNetworkRequest(url), params); ban_netman->post(QNetworkRequest(url), params);
} }
void ServerComm::updateProgress(qint64 time) {
double progress = time / (double) media->totalTime();
positionUpdate(progress);
}
...@@ -34,12 +34,14 @@ signals: ...@@ -34,12 +34,14 @@ signals:
void loginSuccessful(); void loginSuccessful();
void tuned(QString stationName); void tuned(QString stationName);
void playing(QString artist, QString album, QString title, QString imageurl); void playing(QString artist, QString album, QString title, QString imageurl);
void positionUpdate(double position);
private slots: private slots:
void wsLoginReply(QNetworkReply *reply); void wsLoginReply(QNetworkReply *reply);
void scrobbleLoginReply(QNetworkReply *reply); void scrobbleLoginReply(QNetworkReply *reply);
void tuneReply(QNetworkReply *reply); void tuneReply(QNetworkReply *reply);
void playlistReply(QNetworkReply *reply); void playlistReply(QNetworkReply *reply);
void updateProgress(qint64 time);
public slots: public slots:
void login(const QString &username, const QString &password); 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