b0VIM 7.2;NddMstefanstefan~stefan/Blinker/src/noarch/Player.cpputf-8 3210#"! Utp0y1/ad$ 0rRQA/. rT@% o H ! p 4 v e O = ; ( q T R Q +  s o n 0  wV#XWML20/f; tUS8#  zihPNM3yE }hg if (wrapped) { // detect empty playlist or playlist with only empty movies m_curFrame = 0; m_curEntry = m_playlistTracker.m_list.begin(); while (m_curEntry == m_playlistTracker.m_list.end()) { // playlist finished -> re-start from beginning while (true) { bool wrapped = false; m_curValid = true; // use while loops to handle empty movies / empty playlist // movie finished -> next movie{void Player::procFrame()/// process current frame} } // if (m_curChange) procFrame(); m_nextTime = Time::now(); m_remainTime = Time::zero; m_curFrame = 0; // go to begin of new current movie and start playing now m_curChange = false; if (m_curChange) { // current movie changed{void Player::checkCurChanged()/// check if current movie changed and react} procFrame(); // process new current frame ++m_curFrame; // go to next frame } return; m_callMgr.requestTimeCall(this, m_nextTime); // request call at time for next frame if (Time::now() < m_nextTime) { // leave if time is not yet ready to next frame return; if (m_halted) // leave if halted{void Player::timeCall()/// callback when requested time reached} (void)stream; // unused // TODO // whenever a frame is available on this halt stream // this is coming from the halt stream, which will halt the player{void Player::setFrame(const std::string &stream, stBlinkenFrame *pFrame) */ * @param[in] pFrame current frame (NULL for none) * @param[in] stream stream name * @brief set current frame/**} checkCurChanged(); m_playlistTracker.updateConfig(); // playlist update m_fileHaltStream.update(); if (m_fileHaltStream.checkModified()) // halt stream name file was modified -> re-get halt stream } sendFrame(); m_fileOutStream.update(); if (m_fileOutStream.checkModified()) { // output stream name file was modified -> re-get output stream{void Player::updateConfig()/// check for update of configuration} m_playlistTracker.clear(); // free all movies m_callMgr.cancelTimeCall(this); // cancel time callback request{Player::~Player()/// virtual destructor} che m_fileHaltStream.setStreamRecv(this); // load playlist{ m_halted(false) m_curChange(false), m_curFrame(0), m_curEntry(m_playlistTracker.m_list.begin()), m_curValid(false), m_playlistTracker(*this, dirBase.getSubdir("playlist")), m_fileHaltStream(dirBase.getFile("haltstream"), streamMgr), m_fileOutStream(dirBase.getFile("outstream"), streamMgr), Module(callMgr, streamMgr, dirBase), const Directory &dirBase):Player::Player(CallMgr &callMgr, StreamMgr &streamMgr, */ * @param[in] dirBase base directory * @param[in] streamMgr stream manager * @param[in] callMgr callback manager * @brief constructor/**namespace Blinker {#include "TimeCallee.h"#include "Time.h"#include "StreamRecv.h"#include "StreamMgr.h"#include "PlayerMovie.h"#include "Player.h"#include "OutStreamFile.h"#include "Module.h"#include "ListTracker_impl.h"#include "ListTracker.h"#include "InStreamFile.h"#include "File.h"#include "Directory.h"#include "CallMgr.h"#include #include #include #include a blinkenarea.org project */ Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html Copyright 2011 Stefan Schuermans /* Blinkerad v /izf% h = * z ]  w v u } // namespace Blinker} m_fileOutStream.setFrame(NULL); else // no frame available -> send this information } m_fileOutStream.setFrame(pFrame); BlinkenMovieGetFrame(m_curEntry->m_pObj->m_pMovie, m_curFrame); stBlinkenFrame *pFrame = if (m_curValid) { // frame avalable -> send it{void Player::sendFrame()/// send current frame to output stream} } m_callMgr.requestTimeCall(this, m_nextTime); if (!m_halted) // request call at time for next frame m_nextTime += m_remainTime; m_remainTime.fromMs(BlinkenFrameGetDuration(pFrame)); BlinkenMovieGetFrame(m_curEntry->m_pObj->m_pMovie, m_curFrame); stBlinkenFrame *pFrame = // get frame time and calculate absolute time for next frame if (m_curValid) { // if a frame is there sendFrame(); // send new frame to stream } m_curFrame = 0; ++m_curEntry; // movie finished -> next movie break; if (m_curFrame < BlinkenMovieGetFrameCnt(m_curEntry->m_pObj->m_pMovie)) // movie not yet finished -> done break; if (!m_curValid) } wrapped = true; } break; m_curValid = false;ady]\G*yP2! ] H F E A %  =   l =  a K 5  k i h ? ' %  tC732  q\CBlSQ/~C if (wrapped) { // detect empty playlist or playlist with only empty movies m_curFrame = 0; m_curEntry = m_playlistTracker.m_list.begin(); while (m_curEntry == m_playlistTracker.m_list.end()) { // playlist finished -> re-start from beginning while (true) { bool wrapped = false; m_curValid = true; // use while loops to handle empty movies / empty playlist // movie finished -> next movie{void Player::procFrame()/// process current frame} } // if (m_curChange) procFrame(); m_nextTime = Time::now(); m_remainTime = Time::zero; m_curFrame = 0; // go to begin of new current movie and start playing now m_curChange = false; if (m_curChange) { // current movie changed{void Player::checkCurChanged()/// check if current movie changed and react} procFrame(); // process new current frame ++m_curFrame; // go to next frame } return; m_callMgr.requestTimeCall(this, m_nextTime); // request call at time for next frame if (Time::now() < m_nextTime) { // leave if time is not yet ready to next frame return; if (m_halted) // leave if halted{void Player::timeCall()/// callback when requested time reached} (void)stream; // unused } } m_callMgr.requestTimeCall(this, m_nextTime); // schedule time call m_nextTime = Time::now() + m_remainTime; // determine time for next frame if (m_curValid) { m_halted = false; else if (!pFrame && m_halted) { // halt stream ended -> continue playing } m_callMgr.cancelTimeCall(this); // cancel time call } m_remainTime = Time::zero; if (m_remainTime < Time::zero) m_remainTime = m_nextTime - Time::now(); // store remaining frame time if (m_curValid) { m_halted = true; if (pFrame && !m_halted) { // halt stream came to life -> halt player // whenever a frame is available on this halt stream // this is coming from the halt stream, which will halt the player{void Player::setFrame(const std::string &stream, stBlinkenFrame *pFrame) */ * @param[in] pFrame current frame (NULL for none) * @param[in] stream stream name * @brief set current frame/**} checkCurChanged(); m_playlistTracker.updateConfig(); // playlist update m_fileHaltStream.update(); if (m_fileHaltStream.checkModified()) // halt stream name file was modified -> re-get halt stream } sendFrame(); m_fileOutStream.update(); if (m_fileOutStream.checkModified()) { // output stream name file was modified -> re-get output stream{void Player::updateConfig()/// check for update of configuration} m_fileHaltStream.setStreamRecv(NULL); m_playlistTracker.clear(); // free all movies m_callMgr.cancelTimeCall(this); // cancel time callback request{Player::~Player()/// virtual destructor} checkCurChanged(); m_playlistTracker.init();