#ifndef IMAGESWITCHER_H #define IMAGESWITCHER_H #include #include #include #include #include #include "imageselector.h" class MainWindow; class ImageSwitcher : public QObject { Q_OBJECT public: ImageSwitcher(MainWindow& w, unsigned int timeoutMsec, std::unique_ptr& selector); void start(); void scheduleImageUpdate(); void setConfigFileReloader(std::function reloadConfigIfNeededIn); void setRotationTime(unsigned int timeoutMsec); void setImageSelector(std::unique_ptr& selector); public slots: void updateImage(); private: MainWindow& window; unsigned int timeout; std::unique_ptr selector; QTimer timer; const unsigned int timeoutNoContent = 5 * 1000; // 5 sec QTimer timerNoContent; std::function reloadConfigIfNeeded; }; #endif // IMAGESWITCHER_H