Browse Source

Add mode reporting at the top level of ofxPiMapper

master
Krisjanis Rijnieks 9 years ago
parent
commit
731e979af3
  1. 13
      src/ofxPiMapper.cpp
  2. 15
      src/ofxPiMapper.h

13
src/ofxPiMapper.cpp

@ -41,3 +41,16 @@ unsigned int ofxPiMapper::getNumPresets(){
unsigned int ofxPiMapper::getActivePresetIndex(){
return _application.getSurfaceManager()->getActivePresetIndex();
}
ofxPiMapper::Mode ofxPiMapper::getMode(){
if(_application.getState() == ofx::piMapper::PresentationMode::instance()){
return PRESENTATION_MODE;
}else if(_application.getState() == ofx::piMapper::TextureMappingMode::instance()){
return TEXTURE_MODE;
}else if(_application.getState() == ofx::piMapper::ProjectionMappingMode::instance()){
return PROJECTION_MODE;
}else{
return SOURCE_MODE;
}
return PRESENTATION_MODE;
}

15
src/ofxPiMapper.h

@ -10,6 +10,11 @@
#include "Application.h"
#include "Info.h"
#include "PresentationMode.h"
#include "TextureMappingMode.h"
#include "ProjectionMappingMode.h"
#include "SourceSelectionMode.h"
namespace ofx {
namespace piMapper {
class Application;
@ -17,8 +22,14 @@ namespace piMapper {
}
class ofxPiMapper {
public:
enum Mode {
PRESENTATION_MODE,
TEXTURE_MODE,
PROJECTION_MODE,
SOURCE_MODE
};
ofxPiMapper();
void setup();
@ -34,6 +45,8 @@ class ofxPiMapper {
unsigned int getNumPresets();
unsigned int getActivePresetIndex();
Mode getMode();
private:
ofx::piMapper::Application _application;

Loading…
Cancel
Save