BlinkenArea - GitList
Repositories
Blog
Wiki
Blinker
Code
Commits
Branches
Tags
Search
Tree:
bd35589
Branches
Tags
master
Blinker
src
noarch
Player.h
implemented automatic checks for config updates
Stefan Schuermans
commited
bd35589
at 2011-10-24 22:41:59
Player.h
Blame
History
Raw
/* Blinker Copyright 2011 Stefan Schuermans <stefan@blinkenarea.org> Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html a blinkenarea.org project */ #ifndef PLAYER_H #define PLAYER_H #include <list> #include <string> #include <BlinkenLib/BlinkenMovie.h> #include "CallMgr.h" #include "Directory.h" #include "File.h" #include "Module.h" #include "SettingFile.h" #include "StreamMgr.h" #include "Time.h" #include "TimeCallee.h" namespace Blinker { /// a movie player class Player: public Module, public TimeCallee { protected: /// playlist entry struct Entry { std::string m_name; ///< name of playlist entry File m_file; ///< file object (to check for updates) stBlinkenMovie *m_pMovie; ///< movie object Entry(const std::string &name, const File &file); ///< constructor bool loadMovie(); ///< load movie from current file void freeMovie(); ///< free current movie }; /// playlist typedef std::list<Entry> Playlist; public: /** * @brief constructor * @param[in] callMgr callback manager * @param[in] streamMgr stream manager * @param[in] dirBase base directory */ Player(CallMgr &callMgr, StreamMgr &streamMgr, const Directory &dirBase); /// virtual destructor virtual ~Player(); private: /// copy constructor disabled Player(const Player & that); /// assignment operator disabled const Player & operator=(const Player &that); public: /// check for update of configuration virtual void updateConfig(); /// callback when requsted time reached virtual void timeCall(); protected: /// light update of playlist, i.e. stat all files in current playlist void updatePlaylistLight(); /// full update of playlist, i.e. scan files in playlist directory void updatePlaylistFull(); /// get output stream void getOutStream(); /// release output stream void releaseOutStream(); /// process current frame void procFrame(); /// send current frame to output stream void sendFrame(); protected: SettingFile m_fileOutStream; ///< output stream name file Directory m_dirPlaylist; ///< playlist directory std::string m_nameOutStream; ///< name of output stream Stream *m_pOutStream; ///< output stream Playlist m_playlist; ///< current playlist bool m_curValid; ///< if there is a current frame Playlist::const_iterator m_curEntry; ///< current playlist entry int m_curFrame; ///< current frame in movie Time m_nextTime; ///< when to show next frame }; // class Player } // namespace Blinker #endif // #ifndef PLAYER_H