Milestone in SourceCallbacks and Keyboard callback trigger

Updated SourceCallback class to accept cloning, reversing, and visitors for saving./loading. New mechanism in Source to listen to key triggers for launching SourceCallbacks. Saving and loading in SessionVisitor and SessionCreator.
This commit is contained in:
Bruno Herbelin
2022-01-30 00:25:08 +01:00
parent 3605ae14b5
commit 8404e0f670
17 changed files with 660 additions and 79 deletions

View File

@@ -76,6 +76,7 @@ using namespace std;
#include "Selection.h"
#include "FrameBuffer.h"
#include "MediaPlayer.h"
#include "SourceCallback.h"
#include "CloneSource.h"
#include "RenderSource.h"
#include "MediaSource.h"
@@ -389,6 +390,17 @@ void UserInterface::handleKeyboard()
// Space bar to toggle play / pause
sourcecontrol.Play();
// keys for source callbacks
else
{
ImGuiContext& g = *GImGui;
for( auto sit = Mixer::manager().session()->begin();
sit != Mixer::manager().session()->end(); ++sit) {
(*sit)->updateCallbacks(g.IO.KeysDown);
}
}
// normal keys in workspace // make sure no entry / window box is active
if ( !ImGui::IsAnyWindowFocused() )
{
@@ -1251,7 +1263,7 @@ void UserInterface::RenderMetrics(bool *p_open, int* p_corner, int *p_mode)
float v = s->alpha();
ImGui::SetNextItemWidth(rightalign);
if ( ImGui::DragFloat("Alpha", &v, 0.01f, 0.f, 1.f) )
s->call(new SetAlpha(v));
s->call(new GotoAlpha(v));
if ( ImGui::IsItemDeactivatedAfterEdit() ) {
info << "Alpha " << std::fixed << std::setprecision(3) << v;
Action::manager().store(info.str());