diff --git a/ControlManager.cpp b/ControlManager.cpp index cbe3f8f..b46ed57 100644 --- a/ControlManager.cpp +++ b/ControlManager.cpp @@ -37,6 +37,7 @@ #include "SystemToolkit.h" #include "tinyxml2Toolkit.h" #include "Metronome.h" +#include "TransitionView.h" #include "UserInterfaceManager.h" #include "RenderingManager.h" @@ -858,14 +859,38 @@ bool Control::receiveSessionAttribute(const std::string &attribute, } send_feedback = true; } - else if ( attribute.compare(OSC_SESSION_FADE) == 0) { - float v = 0.f, t = 0.f; - arguments >> v; - if (arguments.Eos()) + else if ( attribute.compare(OSC_SESSION_OPEN) == 0) { + const char *filename; + arguments >> filename; + if (arguments.Eos()) { arguments >> osc::EndMessage; - else + Mixer::manager().open(filename); + } + else { + float t = 0.f; arguments >> t >> osc::EndMessage; - Mixer::manager().session()->setFadingTarget(v, t); + Settings::application.transition.duration = t; + Mixer::manager().open(filename, true); + TransitionView *tv = dynamic_cast( Mixer::manager().view(View::TRANSITION) ); + tv->play(true); + } + } + else if ( attribute.compare(OSC_SESSION_SAVE) == 0) { + Mixer::manager().save(); + } + else if ( attribute.compare(OSC_SESSION_CLOSE) == 0) { + if (arguments.Eos()) { + arguments >> osc::EndMessage; + Mixer::manager().close(); + } + else { + float t = 0.f; + arguments >> t >> osc::EndMessage; + Settings::application.transition.duration = t; + Mixer::manager().close(true); + TransitionView *tv = dynamic_cast( Mixer::manager().view(View::TRANSITION) ); + tv->play(true); + } } #ifdef CONTROL_DEBUG else { diff --git a/ControlManager.h b/ControlManager.h index 2fc54d8..c5ceb07 100644 --- a/ControlManager.h +++ b/ControlManager.h @@ -59,7 +59,9 @@ #define OSC_SESSION "/session" #define OSC_SESSION_VERSION "/version" -#define OSC_SESSION_FADE "/fade" +#define OSC_SESSION_OPEN "/open" +#define OSC_SESSION_SAVE "/save" +#define OSC_SESSION_CLOSE "/close" #define OSC_MULTITOUCH "/multitouch"