本文整理汇总了C++中QMediaPlayer::setPlaybackRate方法的典型用法代码示例。如果您正苦于以下问题:C++ QMediaPlayer::setPlaybackRate方法的具体用法?C++ QMediaPlayer::setPlaybackRate怎么用?C++ QMediaPlayer::setPlaybackRate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QMediaPlayer
的用法示例。
在下文中一共展示了QMediaPlayer::setPlaybackRate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QMediaPlayer player;
PSMoveRotationReaderThread thread(&player);
QString filename = QDir().absoluteFilePath(INPUT_FILENAME);
QUrl url = QUrl::fromLocalFile(filename);
player.setMedia(QMediaContent(url));
/* Start with a really slow playback rate */
player.setPlaybackRate(.01);
player.play();
thread.start();
return app.exec();
}
示例2: QWidget
HomePage::HomePage(QWidget *parent) :
QWidget(parent),
ui(new Ui::HomePage)
{
ui->setupUi(this);
//Initialize the splash screen and allow user to exit if they click on it
QMovie *splashImg = new QMovie(":/icons/resources_icons/ProjectLogo_LoopOnce.gif");
ui->label->setMovie(splashImg);
ui->label->setFixedSize(900,450);
QMediaPlayer *player = new QMediaPlayer;
player->setMedia(QUrl("qrc:/audio/resources_icons/ProjectLogoSound.mp3"));
player->setVolume(100);
player->setPlaybackRate(0.85);
player->play();
//Connect the signal on every frame change to check for last frame since it loops infinitely
connect(splashImg, SIGNAL(finished()), this, SLOT(EmitFinished()));
splashImg->start();
}