1a3745b2ddf746c4dd884bd3c40b24d1db145d35
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp   1) /* Blinker
Stefan Schuermans update copyright years

Stefan Schuermans authored 10 years ago

src/noarch/Player.cpp   2)    Copyright 2011-2014 Stefan Schuermans <stefan@blinkenarea.org>
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp   3)    Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html
src/noarch/Player.cpp   4)    a blinkenarea.org project */
src/noarch/Player.cpp   5) 
src/noarch/Player.cpp   6) #include <list>
src/noarch/Player.cpp   7) #include <string>
src/noarch/Player.cpp   8) 
src/noarch/Player.cpp   9) #include <BlinkenLib/BlinkenFrame.h>
src/noarch/Player.cpp  10) #include <BlinkenLib/BlinkenMovie.h>
src/noarch/Player.cpp  11) 
src/noarch/Player.cpp  12) #include "Directory.h"
src/noarch/Player.cpp  13) #include "File.h"
Stefan Schuermans implemented halting player...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp  14) #include "InStreamFile.h"
Stefan Schuermans converted player module to...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp  15) #include "ListTracker.h"
src/noarch/Player.cpp  16) #include "ListTracker_impl.h"
Stefan Schuermans put all managers in one str...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp  17) #include "Mgrs.h"
Stefan Schuermans implemented halting player...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp  18) #include "Module.h"
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp  19) #include "OutStreamFile.h"
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp  20) #include "Player.h"
Stefan Schuermans converted player module to...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp  21) #include "PlayerMovie.h"
Stefan Schuermans implemented halting player...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp  22) #include "StreamRecv.h"
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp  23) #include "Time.h"
src/noarch/Player.cpp  24) #include "TimeCallee.h"
src/noarch/Player.cpp  25) 
src/noarch/Player.cpp  26) namespace Blinker {
src/noarch/Player.cpp  27) 
src/noarch/Player.cpp  28) /**
src/noarch/Player.cpp  29)  * @brief constructor
Stefan Schuermans make modules know their name

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp  30)  * @param[in] name module name
Stefan Schuermans put all managers in one str...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp  31)  * @param[in] mgrs managers
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp  32)  * @param[in] dirBase base directory
src/noarch/Player.cpp  33)  */
Stefan Schuermans make modules know their name

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp  34) Player::Player(const std::string &name, Mgrs &mgrs,
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp  35)                const Directory &dirBase):
Stefan Schuermans make modules know their name

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp  36)   Module(name, mgrs, dirBase),
Stefan Schuermans put all managers in one str...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp  37)   m_fileOutStream(dirBase.getFile("outstream"), mgrs.m_streamMgr),
src/noarch/Player.cpp  38)   m_fileHaltStream(dirBase.getFile("haltstream"), mgrs.m_streamMgr),
Stefan Schuermans implement synchronization f...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp  39)   m_fileInSync(dirBase.getFile("insync"), mgrs.m_syncMgr),
Stefan Schuermans converted player module to...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp  40)   m_playlistTracker(*this, dirBase.getSubdir("playlist")),
Stefan Schuermans implemented automatic check...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp  41)   m_curValid(false),
Stefan Schuermans output no frame if sync pro...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp  42)   m_unknownMovie(false),
Stefan Schuermans converted player module to...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp  43)   m_curEntry(m_playlistTracker.m_list.begin()),
src/noarch/Player.cpp  44)   m_curFrame(0),
Stefan Schuermans implement synchronization f...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp  45)   m_curFrameStart(0),
src/common/Player.cpp  46)   m_curFrameEnd(0),
Stefan Schuermans implemented halting player...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp  47)   m_curChange(false),
src/noarch/Player.cpp  48)   m_halted(false)
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp  49) {
Stefan Schuermans implement synchronization f...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp  50)   m_maxDeviation.fromMs(30);
src/common/Player.cpp  51) 
src/common/Player.cpp  52)   // init and load playlist
Stefan Schuermans implemented halting player...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp  53)   m_fileHaltStream.setStreamRecv(this);
Stefan Schuermans implement synchronization f...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp  54)   m_fileInSync.setSyncRecv(this);
Stefan Schuermans converted player module to...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp  55)   m_playlistTracker.init();
src/noarch/Player.cpp  56)   checkCurChanged();
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp  57) }
src/noarch/Player.cpp  58) 
src/noarch/Player.cpp  59) /// virtual destructor
src/noarch/Player.cpp  60) Player::~Player()
src/noarch/Player.cpp  61) {
Stefan Schuermans cancel time callback reques...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp  62)   // cancel time callback request
Stefan Schuermans put all managers in one str...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp  63)   m_mgrs.m_callMgr.cancelTimeCall(this);
Stefan Schuermans cancel time callback reques...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp  64) 
Stefan Schuermans implement synchronization f...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp  65)   // free all movies, detach from stream sources
Stefan Schuermans converted player module to...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp  66)   m_playlistTracker.clear();
Stefan Schuermans implemented halting player...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp  67)   m_fileHaltStream.setStreamRecv(NULL);
Stefan Schuermans implement synchronization f...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp  68)   m_fileInSync.setSyncRecv(NULL);
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp  69) }
src/noarch/Player.cpp  70) 
Stefan Schuermans implemented base class for...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp  71) /// check for update of configuration
src/noarch/Player.cpp  72) void Player::updateConfig()
src/noarch/Player.cpp  73) {
Stefan Schuermans implemented automatic check...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp  74)   // output stream name file was modified -> re-get output stream
src/noarch/Player.cpp  75)   if (m_fileOutStream.checkModified()) {
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp  76)     m_fileOutStream.update();
src/noarch/Player.cpp  77)     sendFrame();
Stefan Schuermans implemented automatic check...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp  78)   }
src/noarch/Player.cpp  79) 
Stefan Schuermans implemented halting player...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp  80)   // halt stream name file was modified -> re-get halt stream
src/noarch/Player.cpp  81)   if (m_fileHaltStream.checkModified())
src/noarch/Player.cpp  82)     m_fileHaltStream.update();
src/noarch/Player.cpp  83) 
Stefan Schuermans implement synchronization f...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp  84)   // input sync stream name file was modified -> re-get input sync stream
src/common/Player.cpp  85)   if (m_fileInSync.checkModified())
src/common/Player.cpp  86)     m_fileInSync.update();
src/common/Player.cpp  87) 
Stefan Schuermans converted player module to...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp  88)   // playlist update
src/noarch/Player.cpp  89)   m_playlistTracker.updateConfig();
src/noarch/Player.cpp  90)   checkCurChanged();
Stefan Schuermans implemented base class for...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp  91) }
src/noarch/Player.cpp  92) 
Stefan Schuermans implemented halting player...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp  93) /**
src/noarch/Player.cpp  94)  * @brief set current frame
src/noarch/Player.cpp  95)  * @param[in] stream stream name
src/noarch/Player.cpp  96)  * @param[in] pFrame current frame (NULL for none)
src/noarch/Player.cpp  97)  */
src/noarch/Player.cpp  98) void Player::setFrame(const std::string &stream, stBlinkenFrame *pFrame)
src/noarch/Player.cpp  99) {
src/noarch/Player.cpp 100)   // this is coming from the halt stream, which will halt the player
src/noarch/Player.cpp 101)   // whenever a frame is available on this halt stream
src/noarch/Player.cpp 102) 
Stefan Schuermans implement synchronization f...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 103)   // halt stream active -> halt player
src/common/Player.cpp 104)   if (pFrame)
src/common/Player.cpp 105)     halt();
src/common/Player.cpp 106) 
src/common/Player.cpp 107)   // halt stream inactive -> continue playing
src/common/Player.cpp 108)   else
src/common/Player.cpp 109)     cont();
src/common/Player.cpp 110) 
src/common/Player.cpp 111)   (void)stream; // unused
src/common/Player.cpp 112) }
src/common/Player.cpp 113) 
src/common/Player.cpp 114) /**
src/common/Player.cpp 115)  * @brief send synchronization information
src/common/Player.cpp 116)  * @param[in] sync sync stream name
src/common/Player.cpp 117)  * @param[in] pInfo synchronization information
src/common/Player.cpp 118)  */
src/common/Player.cpp 119) void Player::sendInfo(const std::string &sync, Info &info)
src/common/Player.cpp 120) {
Stefan Schuermans output no frame if sync pro...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 121)   bool change = false;
Stefan Schuermans implement synchronization f...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 122) 
src/common/Player.cpp 123)   // halt player if pause flag is set
src/common/Player.cpp 124)   if (info.pause)
src/common/Player.cpp 125)     halt();
src/common/Player.cpp 126) 
src/common/Player.cpp 127)   // seek to other movie if not correct one
Stefan Schuermans code cleanup of synchroniza...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 128)   if (m_curEntry == m_playlistTracker.m_list.end() ||
Stefan Schuermans implement synchronization f...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 129)       !checkName(m_curEntry->m_name, info.name)) {
Stefan Schuermans output no frame if sync pro...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 130)     // movie found -> seek to it
src/common/Player.cpp 131)     seekToMovie(info.name);
src/common/Player.cpp 132)     change = true;
Stefan Schuermans implement synchronization f...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 133)   }
src/common/Player.cpp 134) 
Stefan Schuermans code cleanup of synchroniza...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 135)   // seek to requested position in movie
Stefan Schuermans output no frame if sync pro...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 136)   if (m_curValid) {
Stefan Schuermans code cleanup of synchroniza...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 137)     if (seekToPos(info.pos))
Stefan Schuermans implement synchronization f...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 138)       change = true;
Stefan Schuermans code cleanup of synchroniza...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 139)   }
Stefan Schuermans implement synchronization f...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 140) 
src/common/Player.cpp 141)   // send frame and update timed callback if something changed
src/common/Player.cpp 142)   if (change) {
src/common/Player.cpp 143)     sendFrame();
src/common/Player.cpp 144)     if (m_curValid && !m_halted) {
Stefan Schuermans code cleanup of synchroniza...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 145)       m_nextTime = Time::now() + m_remainTime; // remainTime changed -> update
Stefan Schuermans put all managers in one str...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp 146)       m_mgrs.m_callMgr.requestTimeCall(this, m_nextTime);
Stefan Schuermans implemented halting player...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp 147)     }
src/noarch/Player.cpp 148)   }
src/noarch/Player.cpp 149) 
Stefan Schuermans implement synchronization f...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 150)   // continue playing if pause flag is not set
src/common/Player.cpp 151)   if (!info.pause)
src/common/Player.cpp 152)     cont();
src/common/Player.cpp 153) 
src/common/Player.cpp 154)   (void)sync; // unused
Stefan Schuermans implemented halting player...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp 155) }
src/noarch/Player.cpp 156) 
Stefan Schuermans fixed comment typo

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp 157) /// callback when requested time reached
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 158) void Player::timeCall()
src/noarch/Player.cpp 159) {
Stefan Schuermans implemented halting player...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp 160)   // leave if halted
src/noarch/Player.cpp 161)   if (m_halted)
src/noarch/Player.cpp 162)     return;
src/noarch/Player.cpp 163) 
Stefan Schuermans implement synchronization f...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 164)   // leave if time is not yet ready for next frame
Stefan Schuermans implemented automatic check...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 165)   if (Time::now() < m_nextTime) {
src/noarch/Player.cpp 166)     // request call at time for next frame
Stefan Schuermans put all managers in one str...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp 167)     m_mgrs.m_callMgr.requestTimeCall(this, m_nextTime);
Stefan Schuermans implemented automatic check...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 168)     return;
src/noarch/Player.cpp 169)   }
src/noarch/Player.cpp 170) 
src/noarch/Player.cpp 171)   // go to next frame
src/noarch/Player.cpp 172)   ++m_curFrame;
Stefan Schuermans implement synchronization f...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 173)   m_curFrameStart = m_curFrameEnd;
Stefan Schuermans implemented automatic check...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 174) 
src/noarch/Player.cpp 175)   // process new current frame
src/noarch/Player.cpp 176)   procFrame();
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 177) }
src/noarch/Player.cpp 178) 
Stefan Schuermans implement synchronization f...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 179) /// halt player
src/common/Player.cpp 180) void Player::halt()
src/common/Player.cpp 181) {
src/common/Player.cpp 182)   // player already halted -> leave
src/common/Player.cpp 183)   if (m_halted)
src/common/Player.cpp 184)     return;
src/common/Player.cpp 185) 
src/common/Player.cpp 186)   m_halted = true;
src/common/Player.cpp 187) 
src/common/Player.cpp 188)   if (m_curValid) {
src/common/Player.cpp 189)     // store remaining frame time
src/common/Player.cpp 190)     m_remainTime = m_nextTime - Time::now();
src/common/Player.cpp 191)     if (m_remainTime < Time::zero)
src/common/Player.cpp 192)       m_remainTime = Time::zero;
src/common/Player.cpp 193)   }
src/common/Player.cpp 194) 
src/common/Player.cpp 195)   // cancel time call
src/common/Player.cpp 196)   m_mgrs.m_callMgr.cancelTimeCall(this);
src/common/Player.cpp 197) }
src/common/Player.cpp 198) 
src/common/Player.cpp 199) /// continue playing
src/common/Player.cpp 200) void Player::cont()
src/common/Player.cpp 201) {
src/common/Player.cpp 202)   // player not halted -> leave
src/common/Player.cpp 203)   if (!m_halted)
src/common/Player.cpp 204)     return;
src/common/Player.cpp 205) 
src/common/Player.cpp 206)   m_halted = false;
src/common/Player.cpp 207) 
src/common/Player.cpp 208)   if (m_curValid) {
src/common/Player.cpp 209)     // determine time for next frame
src/common/Player.cpp 210)     m_nextTime = Time::now() + m_remainTime;
src/common/Player.cpp 211)     // schedule time call
src/common/Player.cpp 212)     m_mgrs.m_callMgr.requestTimeCall(this, m_nextTime);
src/common/Player.cpp 213)   }
src/common/Player.cpp 214) }
src/common/Player.cpp 215) 
Stefan Schuermans converted player module to...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp 216) /// check if current movie changed and react
src/noarch/Player.cpp 217) void Player::checkCurChanged()
Stefan Schuermans implemented automatic check...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 218) {
Stefan Schuermans converted player module to...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp 219)   // current movie changed
src/noarch/Player.cpp 220)   if (m_curChange) {
src/noarch/Player.cpp 221)     m_curChange = false;
Stefan Schuermans implemented automatic check...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 222) 
src/noarch/Player.cpp 223)     // go to begin of new current movie and start playing now
src/noarch/Player.cpp 224)     m_curFrame = 0;
Stefan Schuermans implement synchronization f...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 225)     m_curFrameStart = 0;
src/common/Player.cpp 226)     m_curFrameEnd = 0;
Stefan Schuermans implemented halting player...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp 227)     m_remainTime = Time::zero;
Stefan Schuermans implemented automatic check...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 228)     m_nextTime = Time::now();
src/noarch/Player.cpp 229)     procFrame();
src/noarch/Player.cpp 230) 
Stefan Schuermans converted player module to...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp 231)   } // if (m_curChange)
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 232) }
src/noarch/Player.cpp 233) 
Stefan Schuermans implemented automatic check...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 234) /// process current frame
src/noarch/Player.cpp 235) void Player::procFrame()
src/noarch/Player.cpp 236) {
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 237)   // movie finished -> next movie
src/noarch/Player.cpp 238)   //   use while loops to handle empty movies / empty playlist
Stefan Schuermans implemented automatic check...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 239)   m_curValid = true;
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 240)   bool wrapped = false;
src/noarch/Player.cpp 241)   while (true) {
src/noarch/Player.cpp 242)     // playlist finished -> re-start from beginning
Stefan Schuermans converted player module to...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp 243)     while (m_curEntry == m_playlistTracker.m_list.end()) {
Stefan Schuermans output no frame if sync pro...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 244)       if (!m_unknownMovie) // do not go to first movie if "playing" unkn. movie
src/common/Player.cpp 245)         m_curEntry = m_playlistTracker.m_list.begin();
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 246)       m_curFrame = 0;
Stefan Schuermans implement synchronization f...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 247)       m_curFrameStart = 0;
src/common/Player.cpp 248)       m_curFrameEnd = 0;
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 249)       // detect empty playlist or playlist with only empty movies
Stefan Schuermans output no frame if sync pro...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 250)       //   also leave here in case of "playing" unknown movie
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 251)       if (wrapped) {
Stefan Schuermans implemented automatic check...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 252)         m_curValid = false;
src/noarch/Player.cpp 253)         break;
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 254)       }
src/noarch/Player.cpp 255)       wrapped = true;
src/noarch/Player.cpp 256)     }
Stefan Schuermans implemented automatic check...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 257)     if (!m_curValid)
src/noarch/Player.cpp 258)       break;
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 259)     // movie not yet finished -> done
Stefan Schuermans fix bug in player module: c...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp 260)     if (m_curEntry->m_pObj->m_pMovie &&
src/noarch/Player.cpp 261)         m_curFrame < BlinkenMovieGetFrameCnt(m_curEntry->m_pObj->m_pMovie))
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 262)       break;
src/noarch/Player.cpp 263)     // movie finished -> next movie
src/noarch/Player.cpp 264)     ++m_curEntry;
src/noarch/Player.cpp 265)     m_curFrame = 0;
Stefan Schuermans implement synchronization f...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 266)     m_curFrame = 0;
src/common/Player.cpp 267)     m_curFrameStart = 0;
src/common/Player.cpp 268)   } // while (true)
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 269) 
Stefan Schuermans implemented automatic check...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 270)   // send new frame to stream
src/noarch/Player.cpp 271)   sendFrame();
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 272) 
Stefan Schuermans implemented automatic check...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 273)   // if a frame is there
src/noarch/Player.cpp 274)   if (m_curValid) {
Stefan Schuermans implemented halting player...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp 275)     // get frame time and calculate absolute time for next frame
Stefan Schuermans implemented automatic check...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 276)     stBlinkenFrame *pFrame =
Stefan Schuermans converted player module to...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp 277)       BlinkenMovieGetFrame(m_curEntry->m_pObj->m_pMovie, m_curFrame);
Stefan Schuermans implemented halting player...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp 278)     m_remainTime.fromMs(BlinkenFrameGetDuration(pFrame));
src/noarch/Player.cpp 279)     m_nextTime += m_remainTime;
Stefan Schuermans implement synchronization f...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 280)     m_curFrameEnd = m_curFrameStart + m_remainTime;
Stefan Schuermans implemented automatic check...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 281)     // request call at time for next frame
Stefan Schuermans implemented halting player...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp 282)     if (!m_halted)
Stefan Schuermans put all managers in one str...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp 283)       m_mgrs.m_callMgr.requestTimeCall(this, m_nextTime);
Stefan Schuermans implemented automatic check...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 284)   }
src/noarch/Player.cpp 285) }
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 286) 
Stefan Schuermans implemented automatic check...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 287) /// send current frame to output stream
src/noarch/Player.cpp 288) void Player::sendFrame()
src/noarch/Player.cpp 289) {
Stefan Schuermans typo

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp 290)   // frame available -> send it
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp 291)   if (m_curValid) {
src/noarch/Player.cpp 292)     stBlinkenFrame *pFrame =
Stefan Schuermans converted player module to...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp 293)       BlinkenMovieGetFrame(m_curEntry->m_pObj->m_pMovie, m_curFrame);
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp 294)     m_fileOutStream.setFrame(pFrame);
Stefan Schuermans implemented automatic check...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 295)   }
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/Player.cpp 296)   // no frame available -> send this information
src/noarch/Player.cpp 297)   else
src/noarch/Player.cpp 298)     m_fileOutStream.setFrame(NULL);
Stefan Schuermans first version, plays videos...

Stefan Schuermans authored 13 years ago

src/noarch/Player.cpp 299) }
src/noarch/Player.cpp 300) 
Stefan Schuermans code cleanup of synchroniza...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 301) /**
src/common/Player.cpp 302)  * @brief seek to movie by name
src/common/Player.cpp 303)  * @param[in] name name of movie to seek to (name cmp according to SyncRecv)
src/common/Player.cpp 304)  */
Stefan Schuermans output no frame if sync pro...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 305) void Player::seekToMovie(const std::string &name)
Stefan Schuermans code cleanup of synchroniza...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 306) {
src/common/Player.cpp 307)   // find movie by name
src/common/Player.cpp 308)   PlaylistIt it = m_playlistTracker.m_list.begin();
src/common/Player.cpp 309)   while (it != m_playlistTracker.m_list.end()) {
src/common/Player.cpp 310)     if (checkName(it->m_name, name))
src/common/Player.cpp 311)       break;
src/common/Player.cpp 312)     ++it;
src/common/Player.cpp 313)   }
src/common/Player.cpp 314) 
Stefan Schuermans output no frame if sync pro...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 315)   // movie not found -> invalidate current movie, "play unkown movie"
src/common/Player.cpp 316)   if (it == m_playlistTracker.m_list.end()) {
src/common/Player.cpp 317)     m_curValid = false;
src/common/Player.cpp 318)     m_unknownMovie = true;
src/common/Player.cpp 319)     m_curEntry = m_playlistTracker.m_list.end();
src/common/Player.cpp 320)     return;
src/common/Player.cpp 321)   }
Stefan Schuermans code cleanup of synchroniza...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 322) 
src/common/Player.cpp 323)   // seek to movie
src/common/Player.cpp 324)   m_curValid = false;
Stefan Schuermans output no frame if sync pro...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 325)   m_unknownMovie = false;
Stefan Schuermans code cleanup of synchroniza...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 326)   m_curEntry = it;
src/common/Player.cpp 327)   m_curFrame = 0;
src/common/Player.cpp 328)   m_remainTime = Time::zero;
src/common/Player.cpp 329)   if (m_curEntry->m_pObj->m_pMovie) {
src/common/Player.cpp 330)     stBlinkenFrame *pFrame =
src/common/Player.cpp 331)       BlinkenMovieGetFrame(m_curEntry->m_pObj->m_pMovie, m_curFrame);
src/common/Player.cpp 332)     if (pFrame) {
src/common/Player.cpp 333)       m_remainTime.fromMs(BlinkenFrameGetDuration(pFrame));
src/common/Player.cpp 334)       m_curValid = true;
src/common/Player.cpp 335)     }
src/common/Player.cpp 336)   }
src/common/Player.cpp 337)   m_curFrameStart = Time::zero;
src/common/Player.cpp 338)   m_curFrameEnd = m_remainTime;
src/common/Player.cpp 339)   m_nextTime = Time::now() + m_remainTime;
src/common/Player.cpp 340) }
src/common/Player.cpp 341) 
src/common/Player.cpp 342) /**
src/common/Player.cpp 343)  * @brief seek to position in current movie
src/common/Player.cpp 344)  * @param[in] tgtPos target position in current movie to seek to
src/common/Player.cpp 345)  * @return true if movie position has been changed, false otherwise
src/common/Player.cpp 346)  */
src/common/Player.cpp 347) bool Player::seekToPos(const Time &tgtPos)
src/common/Player.cpp 348) {
src/common/Player.cpp 349)   bool change = false;
src/common/Player.cpp 350) 
src/common/Player.cpp 351)   // get remaining frame time and current position in movie
src/common/Player.cpp 352)   if (!m_halted) { // remaining frame time always up-to-date in halted mode
src/common/Player.cpp 353)     m_remainTime = m_nextTime - Time::now();
src/common/Player.cpp 354)     if (m_remainTime < Time::zero)
src/common/Player.cpp 355)       m_remainTime = Time::zero;
src/common/Player.cpp 356)   }
src/common/Player.cpp 357)   Time pos = m_curFrameEnd - m_remainTime;
src/common/Player.cpp 358) 
src/common/Player.cpp 359)   // seek to earlier position in movie if needed
src/common/Player.cpp 360)   if (pos > tgtPos + m_maxDeviation) {
src/common/Player.cpp 361)     Time goback = pos - tgtPos;
Stefan Schuermans output no frame if sync pro...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 362)     seekBackwards(goback);
src/common/Player.cpp 363)     change = true;
Stefan Schuermans code cleanup of synchroniza...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 364)   } // if (pos > tgtPos + m_maxDeviation)
src/common/Player.cpp 365) 
src/common/Player.cpp 366)   // seek to later position in movie if needed
src/common/Player.cpp 367)   if (pos + m_maxDeviation < tgtPos) {
src/common/Player.cpp 368)     Time go = tgtPos - pos;
Stefan Schuermans output no frame if sync pro...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 369)     seekForwards(go);
src/common/Player.cpp 370)     change = true;
Stefan Schuermans code cleanup of synchroniza...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 371)   } // if (pos + m_maxDeviation < tgtPos)
src/common/Player.cpp 372) 
src/common/Player.cpp 373)   return change;
src/common/Player.cpp 374) }
src/common/Player.cpp 375) 
src/common/Player.cpp 376) /**
src/common/Player.cpp 377)  * @brief seek backwards in current movie
src/common/Player.cpp 378)  * @param[in] goback time to seek backwards in current movie
src/common/Player.cpp 379)  */
Stefan Schuermans output no frame if sync pro...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 380) void Player::seekBackwards(Time goback)
Stefan Schuermans code cleanup of synchroniza...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 381) {
src/common/Player.cpp 382)   // time of current frame
src/common/Player.cpp 383)   Time frame = m_curFrameEnd - m_curFrameStart;
src/common/Player.cpp 384) 
src/common/Player.cpp 385)   // time the current frame has already been shown
src/common/Player.cpp 386)   Time shown = frame - m_remainTime;
src/common/Player.cpp 387) 
src/common/Player.cpp 388)   while (goback > Time::zero) {
src/common/Player.cpp 389) 
src/common/Player.cpp 390)     // correct by just showing current frame some time longer
src/common/Player.cpp 391)     if (goback <= shown) {
src/common/Player.cpp 392)       m_remainTime += goback;
src/common/Player.cpp 393)       break;
src/common/Player.cpp 394)     }
src/common/Player.cpp 395) 
src/common/Player.cpp 396)     // go back to begin of current frame
src/common/Player.cpp 397)     goback -= shown;
src/common/Player.cpp 398)     m_remainTime = frame;
src/common/Player.cpp 399) 
src/common/Player.cpp 400)     // go back to end of previous frame
src/common/Player.cpp 401)     if (m_curFrame <= 0)
src/common/Player.cpp 402)       break;
src/common/Player.cpp 403)     m_curFrame--;
src/common/Player.cpp 404)     m_curFrameEnd = m_curFrameStart;
src/common/Player.cpp 405)     frame = Time::zero;
src/common/Player.cpp 406)     stBlinkenFrame *pFrame =
src/common/Player.cpp 407)       BlinkenMovieGetFrame(m_curEntry->m_pObj->m_pMovie, m_curFrame);
src/common/Player.cpp 408)     if (pFrame)
src/common/Player.cpp 409)       frame.fromMs(BlinkenFrameGetDuration(pFrame));
src/common/Player.cpp 410)     m_curFrameStart = m_curFrameEnd - frame;
src/common/Player.cpp 411)     m_remainTime = Time::zero;
src/common/Player.cpp 412)     shown = frame;
src/common/Player.cpp 413) 
src/common/Player.cpp 414)   } // while (goback > Time::zero)
src/common/Player.cpp 415) }
src/common/Player.cpp 416) 
src/common/Player.cpp 417) /**
src/common/Player.cpp 418)  * @brief seek forwards in current movie
src/common/Player.cpp 419)  * @param[in] go time to seek forwards in current movie
src/common/Player.cpp 420)  */
Stefan Schuermans output no frame if sync pro...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 421) void Player::seekForwards(Time go)
Stefan Schuermans code cleanup of synchroniza...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 422) {
src/common/Player.cpp 423)   // frame count of current movie
src/common/Player.cpp 424)   int frameCnt = BlinkenMovieGetFrameCnt(m_curEntry->m_pObj->m_pMovie);
src/common/Player.cpp 425) 
src/common/Player.cpp 426)   // time of current frame
src/common/Player.cpp 427)   Time frame = m_curFrameEnd - m_curFrameStart;
src/common/Player.cpp 428) 
src/common/Player.cpp 429)   while (go > Time::zero) {
src/common/Player.cpp 430) 
src/common/Player.cpp 431)     // correct by just showing current frame some time shorter
src/common/Player.cpp 432)     if (go <= m_remainTime) {
src/common/Player.cpp 433)       m_remainTime -= go;
src/common/Player.cpp 434)       break;
src/common/Player.cpp 435)     }
src/common/Player.cpp 436) 
src/common/Player.cpp 437)     // go to end of current frame
src/common/Player.cpp 438)     go -= m_remainTime;
src/common/Player.cpp 439)     m_remainTime = Time::zero;
src/common/Player.cpp 440) 
src/common/Player.cpp 441)     // go to begin of next frame
Stefan Schuermans output no frame if sync pro...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 442)     //   end of movie -> // stay at last frame (go to begin of last frame)
src/common/Player.cpp 443)     if (m_curFrame + 1 < frameCnt) {
src/common/Player.cpp 444)       m_curFrame++;
src/common/Player.cpp 445)       m_curFrameStart = m_curFrameEnd;
src/common/Player.cpp 446)     }
Stefan Schuermans code cleanup of synchroniza...

Stefan Schuermans authored 10 years ago

src/common/Player.cpp 447)     frame = Time::zero;
src/common/Player.cpp 448)     stBlinkenFrame *pFrame =
src/common/Player.cpp 449)       BlinkenMovieGetFrame(m_curEntry->m_pObj->m_pMovie, m_curFrame);
src/common/Player.cpp 450)     if (pFrame)
src/common/Player.cpp 451)       frame.fromMs(BlinkenFrameGetDuration(pFrame));
src/common/Player.cpp 452)     m_curFrameEnd = m_curFrameStart + frame;
src/common/Player.cpp 453)     m_remainTime = frame;
src/common/Player.cpp 454) 
src/common/Player.cpp 455)   } // while (go > Time::zero)
src/common/Player.cpp 456) }
src/common/Player.cpp 457)