Browse Source

Replace ofxPiMapper::Mode with ofx::piMapper::Mode

master
Krisjanis Rijnieks 8 years ago
parent
commit
bf07dabdb0
  1. 22
      src/ofxPiMapper.cpp
  2. 12
      src/ofxPiMapper.h

22
src/ofxPiMapper.cpp

@ -146,29 +146,29 @@ void ofxPiMapper::toggleInfo(){
_application.toggleInfo(); _application.toggleInfo();
} }
void ofxPiMapper::setMode(ofxPiMapper::Mode m){ void ofxPiMapper::setMode(ofx::piMapper::Mode m){
if(m == PRESENTATION_MODE){ if(m == ofx::piMapper::PRESENTATION_MODE){
_application.setPresentationMode(); _application.setPresentationMode();
}else if(m == TEXTURE_MODE){ }else if(m == ofx::piMapper::TEXTURE_MODE){
_application.setTextureMode(); _application.setTextureMode();
}else if(m == MAPPING_MODE){ }else if(m == ofx::piMapper::MAPPING_MODE){
_application.setProjectionMode(); _application.setProjectionMode();
}else if(m == SOURCE_MODE){ }else if(m == ofx::piMapper::SOURCE_MODE){
_application.setSourceMode(); _application.setSourceMode();
}else{ }else{
ofLogWarning("ofxPiMapper::setMode", "Please specify valid mode"); ofLogWarning("ofxPiMapper::setMode", "Please specify valid mode");
} }
} }
ofxPiMapper::Mode ofxPiMapper::getMode(){ ofx::piMapper::Mode ofxPiMapper::getMode(){
if(_application.getState() == ofx::piMapper::PresentationMode::instance()){ if(_application.getState() == ofx::piMapper::PresentationMode::instance()){
return PRESENTATION_MODE; return ofx::piMapper::PRESENTATION_MODE;
}else if(_application.getState() == ofx::piMapper::TextureMappingMode::instance()){ }else if(_application.getState() == ofx::piMapper::TextureMappingMode::instance()){
return TEXTURE_MODE; return ofx::piMapper::TEXTURE_MODE;
}else if(_application.getState() == ofx::piMapper::ProjectionMappingMode::instance()){ }else if(_application.getState() == ofx::piMapper::ProjectionMappingMode::instance()){
return MAPPING_MODE; return ofx::piMapper::MAPPING_MODE;
}else{ }else{
return SOURCE_MODE; return ofx::piMapper::SOURCE_MODE;
} }
return PRESENTATION_MODE; return ofx::piMapper::PRESENTATION_MODE;
} }

12
src/ofxPiMapper.h

@ -5,16 +5,10 @@
#include "FboSource.h" #include "FboSource.h"
#include "Application.h" #include "Application.h"
#include "SurfaceType.h" #include "SurfaceType.h"
#include "Mode.h"
class ofxPiMapper { class ofxPiMapper {
public: public:
enum Mode {
PRESENTATION_MODE,
TEXTURE_MODE,
MAPPING_MODE,
SOURCE_MODE
};
ofxPiMapper(); ofxPiMapper();
void setup(); void setup();
@ -35,8 +29,8 @@ class ofxPiMapper {
void toggleInfo(); void toggleInfo();
// Modes // Modes
void setMode(ofxPiMapper::Mode m); void setMode(ofx::piMapper::Mode m);
ofxPiMapper::Mode getMode(); ofx::piMapper::Mode getMode();
// Project // Project
void saveProject(); void saveProject();

Loading…
Cancel
Save