Revision: 4445 http://pd-gem.svn.sourceforge.net/pd-gem/?rev=4445&view=rev Author: zmoelnig Date: 2011-08-11 08:29:32 +0000 (Thu, 11 Aug 2011)
Log Message: ----------- added runningState UNKNOWN so the device won't start automatically whenever you send a device message (even if rendering has not been turned on) Modified Paths: -------------- trunk/Gem/src/Pixes/pix_video.cpp trunk/Gem/src/Pixes/pix_video.h Modified: trunk/Gem/src/Pixes/pix_video.cpp =================================================================== --- trunk/Gem/src/Pixes/pix_video.cpp 2011-08-10 07:19:39 UTC (rev 4444) +++ trunk/Gem/src/Pixes/pix_video.cpp 2011-08-11 08:29:32 UTC (rev 4445) @@ -35,7 +35,7 @@ // ///////////////////////////////////////////////////////// pix_video :: pix_video() : - m_videoHandle(NULL), m_driver(-1), m_running(true), m_infoOut(NULL) + m_videoHandle(NULL), m_driver(-1), m_running(UNKNOWN), m_infoOut(NULL) { gem::PluginFactory<gem::plugins::video>::loadPlugins("video"); std::vector<std::string>ids=gem::PluginFactory<gem::plugins::video>::getIDs(); @@ -90,6 +90,9 @@ // ///////////////////////////////////////////////////////// void pix_video :: startRendering(){ + if(UNKNOWN==m_running) + m_running=STARTED; + if(m_videoHandles.size()<1) { error("do video for this OS"); return; @@ -203,7 +206,7 @@ enumPropertyMess(); - if(m_running) { + if(STARTED==m_running) { m_videoHandle->start(); } return true; @@ -215,7 +218,8 @@ m_videoHandle=m_videoHandles[m_driver]; if(m_videoHandle->open(m_writeprops)) { enumPropertyMess(); - if(m_running)m_videoHandle->start(); + if(STARTED==m_running) + m_videoHandle->start(); return true; } } @@ -264,7 +268,8 @@ if(m_videoHandle){ if(m_videoHandle->open(m_writeprops)) { enumPropertyMess(); - if(m_running)m_videoHandle->start(); + if(STARTED==m_running) + m_videoHandle->start(); } } } else { @@ -718,9 +723,9 @@ // ///////////////////////////////////////////////////////// void pix_video :: runningMess(bool state) { - m_running=state; + m_running=state?STARTED:STOPPED; if(m_videoHandle) { - if(m_running) + if(STARTED==m_running) m_videoHandle->start(); else m_videoHandle->stop(); Modified: trunk/Gem/src/Pixes/pix_video.h =================================================================== --- trunk/Gem/src/Pixes/pix_video.h 2011-08-10 07:19:39 UTC (rev 4444) +++ trunk/Gem/src/Pixes/pix_video.h 2011-08-11 08:29:32 UTC (rev 4445) @@ -133,7 +133,11 @@ int m_driver; - bool m_running; + enum runningState { + UNKNOWN=-1, + STOPPED=0, + STARTED=1}; + runningState m_running; virtual void runningMess(bool); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Get a FREE DOWNLOAD! and learn more about uberSVN rich system, user administration capabilities and model configuration. Take the hassle out of deploying and managing Subversion and the tools developers use with it. http://p.sf.net/sfu/wandisco-dev2dev _______________________________________________ pd-gem-CVS mailing list pd-gem-CVS@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pd-gem-cvs