BlinkenArea - GitList
Repositories
Blog
Wiki
Blinker
Code
Commits
Branches
Tags
Search
Tree:
0fee1b0
Branches
Tags
master
Blinker
src
noarch
Player.h
implemented specialized setting files for different data types, simplified input/output stream handling in modules
Stefan Schuermans
commited
0fee1b0
at 2011-12-04 20:46:14
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 "OutStreamFile.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(); /// process current frame void procFrame(); /// send current frame to output stream void sendFrame(); protected: OutStreamFile m_fileOutStream; ///< output stream name file Directory m_dirPlaylist; ///< playlist directory 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