Skip to content
Snippets Groups Projects
Select Git revision
3 results Searching

main.py

Blame
  • player.cpp 18.94 KiB
    /*
     * PeTrack - Software for tracking pedestrians movement in videos
     * Copyright (C) 2010-2020 Forschungszentrum Jülich GmbH,
     * Maik Boltes, Juliane Adrian, Ricardo Martin Brualla, Arne Graf, Paul Häger, Daniel Hillebrand,
     * Deniz Kilic, Paul Lieberenz, Daniel Salden, Tobias Schrödter, Ann Katrin Seemann
     *
     * This program is free software: you can redistribute it and/or modify
     * it under the terms of the GNU General Public License as published by
     * the Free Software Foundation, either version 3 of the License, or
     * (at your option) any later version.
     *
     * This program is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     * GNU General Public License for more details.
     *
     * You should have received a copy of the GNU General Public License
     * along with this program.  If not, see <https://www.gnu.org/licenses/>.
     */
    
    #include <QApplication>
    #include <QToolButton>
    #include <QVBoxLayout>
    #include <QPixmap>
    #include <QSlider>
    #include <QStyle>
    #include <QLineEdit>
    #include <QLabel>
    #include <QIntValidator>
    #include <QtConcurrent>
    
    #include "player.h"
    #include "animation.h"
    #include "petrack.h"
    #include "control.h"
    #include "pMessageBox.h"
    
    
    Player::Player(Animation *anim, QWidget *parent) : QWidget(parent)
    {
        int size = style()->pixelMetric(QStyle::PM_ToolBarIconSize);
        QSize iconSize(size, size);
    
        //play forward Button
        mPlayForwardButton = new QToolButton;
        mPlayForwardButton->setIcon(QPixmap(":/playF"));
        mPlayForwardButton->setIconSize(iconSize);
        connect(mPlayForwardButton, &QToolButton::clicked,this, [&](){this->play(PlayerState::FORWARD);});
    
        //play backward Button
        mPlayBackwardButton = new QToolButton;
        mPlayBackwardButton->setIcon(QPixmap(":/playB"));
        mPlayBackwardButton->setIconSize(iconSize);
        connect(mPlayBackwardButton, &QToolButton::clicked, this, [&](){this->play(PlayerState::BACKWARD);});
    
        //frame forward Button
        mFrameForwardButton = new QToolButton;
        mFrameForwardButton->setAutoRepeat(true);
        mFrameForwardButton->setAutoRepeatDelay(400);   // before repetition starts
        mFrameForwardButton->setAutoRepeatInterval(1000./DEFAULT_FPS); // war: 40 // for 1000 ms / 25 fps
        mFrameForwardButton->setIcon(QPixmap(":/skipF"));
        mFrameForwardButton->setIconSize(iconSize);
        connect(mFrameForwardButton,SIGNAL(clicked()),this,SLOT(frameForward()));
    
        //frame backward Button
        mFrameBackwardButton = new QToolButton;
        mFrameBackwardButton->setAutoRepeat(true);
        mFrameBackwardButton->setAutoRepeatDelay(400);   // before repetition starts
        mFrameBackwardButton->setAutoRepeatInterval(1000./DEFAULT_FPS); // war: 40 // for 1000 ms / 25 fps
        mFrameBackwardButton->setIcon(QPixmap(":/skipB"));