diff --git a/src/Commands/ToggleAnimatedSourceCmd.cpp b/src/Commands/ToggleAnimatedSourceCmd.cpp new file mode 100644 index 0000000..b096a3e --- /dev/null +++ b/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 + diff --git a/src/Commands/ToggleAnimatedSourceCmd.h b/src/Commands/ToggleAnimatedSourceCmd.h new file mode 100644 index 0000000..09d35e9 --- /dev/null +++ b/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 +