Example #1
0
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();
}
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();

}