Browse Source

Add Application::togglePause()

master
Krisjanis Rijnieks 8 years ago
parent
commit
c3ebebd9f9
  1. 13
      src/Application/Application.cpp
  2. 2
      src/Application/Application.h
  3. 11
      src/Application/Modes/ProjectionMappingMode.cpp
  4. 1
      src/Application/Modes/ProjectionMappingMode.h
  5. 11
      src/Application/Modes/TextureMappingMode.cpp
  6. 1
      src/Application/Modes/TextureMappingMode.h
  7. 4
      src/ofxPiMapper.cpp
  8. 1
      src/ofxPiMapper.h

13
src/Application/Application.cpp

@ -530,5 +530,18 @@ void Application::removeGridColumn(){
}
}
void Application::togglePause(){
if(getSurfaceManager()->getSelectedSurface() == 0){
return;
}
if(getSurfaceManager()->getSelectedSurface()->getSource()->getType() ==
SourceType::SOURCE_TYPE_VIDEO){
getCmdManager()->exec(
new ToggleAnimatedSourceCmd(
getSurfaceManager()->getSelectedSurface()));
}
}
} // namespace piMapper
} // namespace ofx

2
src/Application/Application.h

@ -34,6 +34,7 @@
#include "SelVertexCmd.h"
#include "SelSurfaceCmd.h"
#include "MvSelectionCmd.h"
#include "ToggleAnimatedSourceCmd.h"
// Modes
#include "ApplicationBaseMode.h"
@ -120,6 +121,7 @@ class Application : public KeyListener {
void addGridColumn();
void removeGridRow();
void removeGridColumn();
void togglePause();
void setPreset(unsigned int i);
void setNextPreset();

11
src/Application/Modes/ProjectionMappingMode.cpp

@ -141,16 +141,7 @@ void ProjectionMappingMode::onKeyPressed(Application * app, ofKeyEventArgs & arg
break;
case ' ':
if(app->getSurfaceManager()->getSelectedSurface() == 0){
return;
}
if(app->getSurfaceManager()->getSelectedSurface()->getSource()->getType() ==
SourceType::SOURCE_TYPE_VIDEO){
app->getCmdManager()->exec(
new ToggleAnimatedSourceCmd(
app->getSurfaceManager()->getSelectedSurface()));
}
app->togglePause();
break;
case OF_KEY_TAB:

1
src/Application/Modes/ProjectionMappingMode.h

@ -5,7 +5,6 @@
#include "ofGraphics.h"
#include "StartDragSurfaceCmd.h"
#include "DeselectSurfaceCmd.h"
#include "ToggleAnimatedSourceCmd.h"
#include "MvSurfaceVertCmd.h"
#include "SurfaceType.h"
#include "Gui.h"

11
src/Application/Modes/TextureMappingMode.cpp

@ -117,16 +117,7 @@ void TextureMappingMode::onKeyPressed(Application * app, ofKeyEventArgs & args){
break;
case ' ':
if(app->getSurfaceManager()->getSelectedSurface() == 0){
return;
}
if(app->getSurfaceManager()->getSelectedSurface()->getSource()->getType() ==
SourceType::SOURCE_TYPE_VIDEO){
app->getCmdManager()->exec(
new ToggleAnimatedSourceCmd(
app->getSurfaceManager()->getSelectedSurface()));
}
app->togglePause();
break;
case OF_KEY_TAB:

1
src/Application/Modes/TextureMappingMode.h

@ -8,7 +8,6 @@
#include "SelPrevTexCoordCmd.h"
#include "DeselectTexCoordCmd.h"
#include "SelNextSurfaceCmd.h"
#include "ToggleAnimatedSourceCmd.h"
#include "TranslateCanvasCmd.h"
#include "SetTexMapDrawModeCmd.h"
#include "MvTexCoordCmd.h"

4
src/ofxPiMapper.cpp

@ -131,6 +131,10 @@ void ofxPiMapper::togglePauseForSurface(unsigned int i){
}
}
void ofxPiMapper::togglePause(){
_application.togglePause();
}
void ofxPiMapper::moveSelection(ofVec2f by){
_application.moveSelection(by);
}

1
src/ofxPiMapper.h

@ -59,6 +59,7 @@ class ofxPiMapper {
void scaleUp();
void scaleDown();
void togglePauseForSurface(unsigned int i);
void togglePause();
void moveSelection(ofVec2f by);
void createSurface(ofx::piMapper::SurfaceType type);
void eraseSurface(int i);

Loading…
Cancel
Save