Browse Source

Add ofxPiMapper::togglePauseForSurface and getNumSurfaces methods

For toggling video play/pause from code... close #76
master
Krisjanis Rijnieks 9 years ago
parent
commit
007c80d7a4
  1. 12
      src/ofxPiMapper.cpp
  2. 9
      src/ofxPiMapper.h

12
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();

9
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;

Loading…
Cancel
Save