bd3558966d9c087638d52dfe1e5987c969717522
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

1) /* Blinker
2)    Copyright 2011 Stefan Schuermans <stefan@blinkenarea.org>
3)    Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html
4)    a blinkenarea.org project */
5) 
6) #ifndef PLAYER_H
7) #define PLAYER_H
8) 
9) #include <list>
10) #include <string>
11) 
12) #include <BlinkenLib/BlinkenMovie.h>
13) 
14) #include "CallMgr.h"
15) #include "Directory.h"
16) #include "File.h"
Stefan Schuermans implemented base class for...

Stefan Schuermans authored 13 years ago

17) #include "Module.h"
Stefan Schuermans implemented stream printer...

Stefan Schuermans authored 13 years ago

18) #include "SettingFile.h"
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

19) #include "StreamMgr.h"
20) #include "Time.h"
21) #include "TimeCallee.h"
22) 
23) namespace Blinker {
24) 
25) /// a movie player
Stefan Schuermans implemented base class for...

Stefan Schuermans authored 13 years ago

26) class Player: public Module, public TimeCallee
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

27) {
28) protected:
29)   /// playlist entry
30)   struct Entry {
31)     std::string     m_name;    ///< name of playlist entry
32)     File            m_file;    ///< file object (to check for updates)
33)     stBlinkenMovie *m_pMovie;  ///< movie object
34)     Entry(const std::string &name, const File &file); ///< constructor
35)     bool loadMovie(); ///< load movie from current file
36)     void freeMovie(); ///< free current movie
37)   };
38) 
39)   /// playlist
40)   typedef std::list<Entry> Playlist;
41) 
42) public:
43)   /**
44)    * @brief constructor
45)    * @param[in] callMgr callback manager
46)    * @param[in] streamMgr stream manager
47)    * @param[in] dirBase base directory
48)    */
49)   Player(CallMgr &callMgr, StreamMgr &streamMgr, const Directory &dirBase);
50) 
51)   /// virtual destructor
52)   virtual ~Player();
53) 
54) private:
55)   /// copy constructor disabled
56)   Player(const Player & that);
57) 
58)   /// assignment operator disabled
Stefan Schuermans implemented base class for...

Stefan Schuermans authored 13 years ago

59)   const Player & operator=(const Player &that);
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

60) 
61) public:
Stefan Schuermans implemented base class for...

Stefan Schuermans authored 13 years ago

62)   /// check for update of configuration
63)   virtual void updateConfig();
64) 
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

65)   /// callback when requsted time reached
66)   virtual void timeCall();
67) 
68) protected:
Stefan Schuermans implemented automatic check...

Stefan Schuermans authored 13 years ago

69)   /// light update of playlist, i.e. stat all files in current playlist
70)   void updatePlaylistLight();
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

71) 
Stefan Schuermans implemented automatic check...

Stefan Schuermans authored 13 years ago

72)   /// full update of playlist, i.e. scan files in playlist directory
73)   void updatePlaylistFull();
74) 
75)   /// get output stream
76)   void getOutStream();
77) 
78)   /// release output stream
79)   void releaseOutStream();
80) 
81)   /// process current frame
82)   void procFrame();
83) 
84)   /// send current frame to output stream
85)   void sendFrame();
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

86) 
87) protected:
Stefan Schuermans implemented stream printer...

Stefan Schuermans authored 13 years ago

88)   SettingFile              m_fileOutStream; ///< output stream name file
89)   Directory                m_dirPlaylist;   ///< playlist directory
90)   std::string              m_nameOutStream; ///< name of output stream
91)   Stream                   *m_pOutStream;   ///< output stream
92)   Playlist                 m_playlist;      ///< current playlist
Stefan Schuermans implemented automatic check...

Stefan Schuermans authored 13 years ago

93)   bool                     m_curValid;      ///< if there is a current frame
Stefan Schuermans implemented stream printer...

Stefan Schuermans authored 13 years ago

94)   Playlist::const_iterator m_curEntry;      ///< current playlist entry
95)   int                      m_curFrame;      ///< current frame in movie
Stefan Schuermans implemented automatic check...

Stefan Schuermans authored 13 years ago

96)   Time                     m_nextTime;      ///< when to show next frame