andre@2: #ifndef PNGPLAYER_H andre@2: #define PNGPLAYER_H andre@25: /* Copyright (C) 2015 by ETH Zürich andre@25: * Software engineering by Intevation GmbH andre@2: * andre@2: * This file is Free Software under the GNU GPL (v>=2) andre@2: * and comes with ABSOLUTELY NO WARRANTY! andre@2: * See LICENSE.txt for details. andre@2: */ andre@2: #include andre@2: #include andre@2: #include andre@2: andre@3: class QSlider; andre@2: class QLabel; andre@3: class QPushButton; andre@3: class ImageLabel; andre@2: andre@66: /** andre@66: * @class PNGPlayer andre@66: * @brief Player window of the application. andre@66: */ andre@2: class PNGPlayer: public QWidget andre@2: { andre@2: Q_OBJECT andre@2: andre@2: public: andre@2: PNGPlayer (QWidget * parent = 0, Qt::WindowFlags f = 0); andre@2: andre@38: /**@brief close the player andre@38: * andre@38: * This function makes sure that the png label is also andre@38: * closed when detached. andre@38: **/ andre@38: void close(); andre@2: protected: andre@2: void setupGUI(); andre@2: andre@3: protected slots: andre@3: /**@brief the view slider was changed manually */ andre@3: void sliderChanged(); andre@3: /**@brief the view slider was pressed */ andre@3: void sliderPressed(); andre@3: /**@brief the view slider was released */ andre@3: void sliderReleased(); andre@3: andre@3: /**@brief jump to the first frame */ andre@3: void firstClicked(); andre@3: andre@3: /**@brief jump to the last frame */ andre@3: void lastClicked(); andre@3: andre@2: public slots: andre@2: /**@brief show a PNG in the viewer. andre@2: * andre@2: * @param fileName: The picture file to show. andre@3: * @param current: The row index of the currently shown image. andre@3: * @param max: The row count. andre@3: * @param timestamp: The timestamp of the image. andre@37: * @param number: The index number of the picture to show. andre@2: */ andre@3: void showPicture(const QString& fileName, int current, int max, andre@44: const QString& timestamp, int number); andre@2: andre@3: /**@brief set the base dir to which filenames will be relative. */ andre@2: void setBaseDir(const QString& dirName) { mBaseDir.setPath(dirName); } andre@2: andre@3: /**@brief update positional information / slider current / max info. */ andre@44: void updatePositions(int current, int max, const QString& timestamp, int number); andre@3: andre@3: /**@brief set the replay speed */ andre@3: void setSpeed(int mSecsPerPicture); andre@3: andre@3: /**@brief start or pause the replay */ andre@3: void togglePlay(); andre@5: andre@5: /**@brief the speed bar was changed */ andre@5: void speedChanged(); andre@5: andre@38: /**@brief detach the actual picture as fullscreen */ andre@38: void togglePicFullscreen(); andre@38: andre@2: Q_SIGNALS: andre@2: /** @brief Emited if something went wrong. e.g. file not readable */ andre@2: void error(const QString& msg); andre@2: andre@2: /** @brief Emited if the player wants to advance to the next picture */ andre@2: void advance(); andre@2: andre@3: /** @brief Emited if the player wants to go back to the last picture */ andre@3: void back(); andre@3: andre@3: /** @brief Emited it the player wants to advance to a specific frame. */ andre@3: void jumpToFrame(int frame); andre@3: andre@2: protected: andre@3: ImageLabel *mPNGLabel; andre@3: QLabel *mPositionLabel, andre@3: *mCurSpeedLabel; andre@3: int mCurSpeed; andre@3: int mMax; andre@2: QDir mBaseDir; andre@2: QTimer mAdvanceTimer; andre@3: QSlider *mSlider, andre@3: *mSpeedSlider; andre@3: QPushButton *mPlayBtn; andre@2: }; andre@2: andre@2: andre@2: andre@2: #endif // PNGPLAYER_H