Browse Source

Add `ToggleAnimatedSourceCmd` for toggling video source pause

master
Krisjanis Rijnieks 9 years ago
parent
commit
c67e4e73fb
  1. 22
      src/Commands/ToggleAnimatedSourceCmd.cpp
  2. 29
      src/Commands/ToggleAnimatedSourceCmd.h

22
src/Commands/ToggleAnimatedSourceCmd.cpp

@ -0,0 +1,22 @@
#include "ToggleAnimatedSourceCmd.h"
namespace ofx {
namespace piMapper {
ToggleAnimatedSourceCmd::ToggleAnimatedSourceCmd(BaseSurface * surface){
_surface = surface;
}
void ToggleAnimatedSourceCmd::exec(){
ofLogNotice("ToggleAnimatedSourceCmd", "exec");
_surface->getSource()->togglePause();
}
void ToggleAnimatedSourceCmd::undo(){
ofLogNotice("ToggleAnimatedSourceCmd", "undo");
_surface->getSource()->togglePause();
}
} // namespace piMapper
} // namespace ofx

29
src/Commands/ToggleAnimatedSourceCmd.h

@ -0,0 +1,29 @@
// ToggleAnimatedSourceCmd
// Toggles playing of animated (video, gif) sources
// Created by Krisjanis Rijnieks 2016-06-10
#pragma once
#include "BaseCmd.h"
#include "BaseSurface.h"
#include "SourceType.h"
#include "VideoSource.h"
namespace ofx {
namespace piMapper {
class ToggleAnimatedSourceCmd : public BaseUndoCmd {
public:
ToggleAnimatedSourceCmd(BaseSurface * surface);
void exec();
void undo();
private:
BaseSurface * _surface;
};
} // namespace piMapper
} // namespace ofx
Loading…
Cancel
Save