BlinkenArea - GitList
Repositories
Blog
Wiki
Blinker
Code
Commits
Branches
Tags
Search
Tree:
3032550
Branches
Tags
master
Blinker
src
noarch
Stream.cpp
first version, plays videos to stdout
Stefan Schuermans
commited
3032550
at 2011-10-23 11:37:40
Stream.cpp
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 */ #include <iostream> // DEBUG #include <set> #include <stdlib.h> // DEBUG #include <BlinkenLib/BlinkenFrame.h> #include "Stream.h" #include "StreamRecv.h" namespace Blinker { /// constructor Stream::Stream() { } /// virtual destructor Stream::~Stream() { } /** * @brief attach a stream receiver * @param[in] recv stream receiver to attach */ void Stream::attach(StreamRecv *recv) { m_recvs.insert(recv); } /** * @brief detach a stream receiver * @param[in] recv stream receiver to detach */ void Stream::detach(StreamRecv *recv) { m_recvs.erase(recv); } /** * @brief set current frame * @param[in] pFrame current frame */ void Stream::setFrame(stBlinkenFrame *pFrame) { // DEBUG char *str = BlinkenFrameToString(pFrame); std::cout << str; free(str); // pass frame to all receivers Recvs::iterator it; for (it = m_recvs.begin(); it != m_recvs.end(); ++it) (*it)->setFrame(pFrame); } /// set current frame to none void Stream::setNoFrame() { // DEBUG std::cout << "no frame" << std::endl; // pass "no frame" to all receivers Recvs::iterator it; for (it = m_recvs.begin(); it != m_recvs.end(); ++it) (*it)->setNoFrame(); } } // namespace Blinker