diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-23 10:23:01 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-23 10:23:01 (GMT) |
commit | 91ed4f664008577a095f5554372456661865dede (patch) | |
tree | bae0cce0445433cf4fded4c107eb821b5a47da8c /demos | |
parent | 3db40b0be40c946f547f238ed3f0af813892115e (diff) | |
parent | 4325feb3b93a7676e0b2d0301b8a17f69ffa7c1e (diff) | |
download | Qt-91ed4f664008577a095f5554372456661865dede.zip Qt-91ed4f664008577a095f5554372456661865dede.tar.gz Qt-91ed4f664008577a095f5554372456661865dede.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-multimedia-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-multimedia-staging:
Remove active qDebugs.
Player demo updated with more user-friendly previous button behaviour.
Added QNetworkRequest constructor to QMediaContent.
Change qml.{h,cpp} -> multimediaqml.{h,cpp} in QtMultimedia.
Add private header warning.
Diffstat (limited to 'demos')
-rw-r--r-- | demos/multimedia/player/player.cpp | 12 | ||||
-rw-r--r-- | demos/multimedia/player/player.h | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/demos/multimedia/player/player.cpp b/demos/multimedia/player/player.cpp index 64b1f25..49d18cb 100644 --- a/demos/multimedia/player/player.cpp +++ b/demos/multimedia/player/player.cpp @@ -99,7 +99,7 @@ Player::Player(QWidget *parent) connect(controls, SIGNAL(pause()), player, SLOT(pause())); connect(controls, SIGNAL(stop()), player, SLOT(stop())); connect(controls, SIGNAL(next()), playlist, SLOT(next())); - connect(controls, SIGNAL(previous()), playlist, SLOT(previous())); + connect(controls, SIGNAL(previous()), this, SLOT(previousClicked())); connect(controls, SIGNAL(changeVolume(int)), player, SLOT(setVolume(int))); connect(controls, SIGNAL(changeMuting(bool)), player, SLOT(setMuted(bool))); connect(controls, SIGNAL(changeRate(qreal)), player, SLOT(setPlaybackRate(qreal))); @@ -200,6 +200,16 @@ void Player::metaDataChanged() } } +void Player::previousClicked() +{ + // Go to previous track if we are within the first 5 seconds of playback + // Otherwise, seek to the beginning. + if(player->position() <= 5000) + playlist->previous(); + else + player->setPosition(0); +} + void Player::jump(const QModelIndex &index) { if (index.isValid()) { diff --git a/demos/multimedia/player/player.h b/demos/multimedia/player/player.h index 0ad609b..1de8b1a 100644 --- a/demos/multimedia/player/player.h +++ b/demos/multimedia/player/player.h @@ -77,6 +77,8 @@ private slots: void positionChanged(qint64 progress); void metaDataChanged(); + void previousClicked(); + void seek(int seconds); void jump(const QModelIndex &index); void playlistPositionChanged(int); |