diff --git a/src/ofxPiMapper.cpp b/src/ofxPiMapper.cpp index 09772f2..8b804cc 100644 --- a/src/ofxPiMapper.cpp +++ b/src/ofxPiMapper.cpp @@ -40,6 +40,14 @@ void ofxPiMapper::eraseActivePreset(){ _application.getSurfaceManager()->eraseActivePreset(); } +void ofxPiMapper::togglePauseForSurface(unsigned int i){ + ofx::piMapper::BaseSource * s = + _application.getSurfaceManager()->getActivePreset()->getSurfaces().at(i)->getSource(); + if(s->getType() == ofx::piMapper::SourceType::SOURCE_TYPE_VIDEO){ + s->togglePause(); + } +} + bool ofxPiMapper::loadXmlSettings(string fileName){ return _application.loadXmlSettings(fileName); } @@ -52,6 +60,10 @@ unsigned int ofxPiMapper::getActivePresetIndex(){ return _application.getSurfaceManager()->getActivePresetIndex(); } +unsigned int ofxPiMapper::getNumSurfaces(){ + return _application.getSurfaceManager()->getActivePreset()->getSurfaces().size(); +} + void ofxPiMapper::setMode(ofxPiMapper::Mode m){ if(m == PRESENTATION_MODE){ _application.setPresentationMode(); diff --git a/src/ofxPiMapper.h b/src/ofxPiMapper.h index c514ecc..1f6da26 100644 --- a/src/ofxPiMapper.h +++ b/src/ofxPiMapper.h @@ -15,6 +15,9 @@ #include "ProjectionMappingMode.h" #include "SourceSelectionMode.h" +#include "BaseSource.h" +#include "SourceType.h" + namespace ofx { namespace piMapper { class Application; @@ -48,11 +51,17 @@ class ofxPiMapper { void setNextPreset(); void cloneActivePreset(); void eraseActivePreset(); + + // Toggle play/pause for a surface in the active preset. + void togglePauseForSurface(unsigned int i); bool loadXmlSettings(string fileName); unsigned int getNumPresets(); unsigned int getActivePresetIndex(); + + // Get number of surfaces in the active preset. + unsigned int getNumSurfaces(); private: ofx::piMapper::Application _application;