Clip-Drag: hook up the access point to the gesture definition

thus far my implementation concept seems to work as intended....


note: when populating the timeline with actual Clips,
the not-yet implemented linkSubject()-Function of the DragRelocateController
gets invoked (as it should), thereby killing Lumiera
This commit is contained in:
Fischlurch 2021-04-02 17:32:33 +02:00
parent 6578b3cf1c
commit 1187a81943
5 changed files with 86 additions and 23 deletions

View file

@ -58,7 +58,7 @@ namespace interact {
lib::Depend<GestureState> gestures;
inline InteractionState&
selectStateImplementation (string ctxID)
selectStateImplementation (Symbol ctxID)
{
if ( GESTURE_dragReolcate == ctxID)
return gestures().getStateFor (GestureState::DRAG, GestureState::ON_TIMELINE);
@ -74,15 +74,23 @@ namespace interact {
* @remarks the implementation of this function taps into the UI-Backbone
* to access the InteractionDirector for the context interaction state
*/
CmdContext&
CmdContext::of (Symbol cmdID, string ctxID)
CmdContext
CmdContext::of (Symbol cmdID, Symbol ctxID)
{
InteractionState& state = selectStateImplementation (ctxID);
UNIMPLEMENTED ("context-bound commands: build a suitable CmdContext builder for further outfitting this state");
return CmdContext {selectStateImplementation(ctxID), cmdID};
}
void
CmdContext::setupRelocateDrag()
{
REQUIRE (subject_);
iState_.linkTrigger (*subject_, cmdID_);
}
/**
* @remarks this service is used to resolve command arguments
* based on the current state of UI interaction. This can be used

View file

@ -62,7 +62,8 @@
#include "lib/symbol.hpp"
//#include "lib/util.hpp"
#include <string>
//#include <string>
#include <utility>
namespace stage {
@ -72,7 +73,9 @@ namespace interact {
using lib::hash::LuidH;
using lib::Symbol;
// using util::isnil;
using std::string;
// using std::string;
class InteractionState;
@ -97,20 +100,28 @@ namespace interact {
* @todo write type comment...
*/
class CmdContext
: util::NonCopyable
: util::MoveOnly
{
InteractionState& iState_;
Symbol cmdID_;
/* ===== Builder State ===== */
Subject* subject_{nullptr};
CmdContext (InteractionState& iState, Symbol cmdID)
: iState_{iState}
, cmdID_{cmdID}
{ }
public:
// using the default move-ctor
/* === access front-end === */
static CmdContext& of (Symbol cmdID, string ctxID);
static CmdContext of (Symbol cmdID, Symbol ctxID);
struct Resolver;
/** Builder operation: define the subject to use
* for the following interaction bindings.
*/
CmdContext& linkSubect (Subject&);
/** Builder operation: define the subject to use for the following interaction bindings. */
CmdContext&& linkSubject (Subject& subj) { this->subject_ = &subj; return std::move (*this); }
/** Terminal builder operation: establish the infrastructure
* for the already defined participants to be involved into a

View file

@ -53,7 +53,7 @@
#include "stage/interact/cmd-context.hpp"
//#include "lib/idi/entry-id.hpp"
//#include "lib/symbol.hpp"
//#include "lib/util.hpp"
#include "lib/util.hpp"
//#include <string>
@ -64,6 +64,7 @@ namespace interact {
// using lib::HashVal;
// using util::isnil;
// using std::string;
using util::isnil;
/**
@ -88,6 +89,7 @@ namespace interact {
void
linkTrigger (Subject& subject, Symbol cmdID) override
{
REQUIRE (not isnil (cmdID));
UNIMPLEMENTED ("use the Subject interface to hook up a trigger signal");
}

View file

@ -59,6 +59,7 @@
#include "stage/timeline/marker-widget.hpp"
#include "stage/interact/cmd-context.hpp"
#include "lib/time/timevalue.hpp"
#include "steam/cmd.hpp"
//#include "lib/util.hpp"
@ -74,10 +75,10 @@ namespace timeline {
using std::vector;
using std::optional;
using std::unique_ptr;
using std::make_unique;
using lib::time::TimeSpan;
using lib::diff::TreeMutator;
using lib::diff::collection;
using std::make_unique;
/**
@ -233,7 +234,9 @@ namespace timeline {
if (prevDelegate != widget_.get()
and newAppearance > ClipDelegate::DEGRADED)
{// a new dedicated clip widget has been created...
WARN (stage, "configure clip-dragging");
interact::CmdContext::of (steam::cmd::scope_moveRelocateClip, GESTURE_dragReolcate)
.linkSubject (*this)
.setupRelocateDrag();
}
}

View file

@ -32331,8 +32331,8 @@
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1616852178983" ID="ID_389047439" MODIFIED="1616859822702" TEXT="Strukturen gem&#xe4;&#xdf; Konzept anlegen">
<icon BUILTIN="pencil"/>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1616852190829" ID="ID_1663212368" MODIFIED="1616859815753" TEXT="CmdContext">
<icon BUILTIN="pencil"/>
<node COLOR="#338800" CREATED="1616852190829" ID="ID_1663212368" MODIFIED="1617377719039" TEXT="CmdContext">
<icon BUILTIN="button_ok"/>
<node COLOR="#338800" CREATED="1616859779196" ID="ID_848065191" MODIFIED="1616859786984" TEXT="Dependency-Injection nutzen">
<icon BUILTIN="button_ok"/>
</node>
@ -32360,6 +32360,7 @@
<node COLOR="#435e98" CREATED="1616943578428" ID="ID_115517003" MODIFIED="1616944103109" TEXT="wie allgemein / generisch mu&#xdf; das System sein?">
<icon BUILTIN="help"/>
<node BACKGROUND_COLOR="#ccb59b" COLOR="#6e2a38" CREATED="1616943995900" ID="ID_999660840" MODIFIED="1616944008942" TEXT="Antwort: anfangs so wenig wie m&#xf6;glich">
<linktarget COLOR="#2c9eb4" DESTINATION="ID_999660840" ENDARROW="Default" ENDINCLINATION="-136;9;" ID="Arrow_ID_453101984" SOURCE="ID_1611970353" STARTARROW="None" STARTINCLINATION="60;-184;"/>
<font ITALIC="true" NAME="SansSerif" SIZE="14"/>
<icon BUILTIN="yes"/>
</node>
@ -32372,12 +32373,16 @@
</node>
</node>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1616947165410" ID="ID_300128108" MODIFIED="1616947174719" TEXT="also: vorherst ferst verdrahten">
<icon BUILTIN="flag-yellow"/>
<node COLOR="#338800" CREATED="1616947165410" ID="ID_300128108" MODIFIED="1617377719039" TEXT="also: vorherst ferst verdrahten">
<icon BUILTIN="button_ok"/>
</node>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1616854202348" ID="ID_340156587" MODIFIED="1616854226249" TEXT="Auswahl und Zugriff auf den passenden InteractionState">
<icon BUILTIN="flag-yellow"/>
<node COLOR="#338800" CREATED="1616854202348" ID="ID_340156587" MODIFIED="1617377719039" TEXT="Auswahl und Zugriff auf den passenden InteractionState">
<icon BUILTIN="button_ok"/>
<node CREATED="1617377586150" ID="ID_1611970353" MODIFIED="1617377719039" TEXT="erst mal fest verdrahtet">
<arrowlink COLOR="#2c9eb4" DESTINATION="ID_999660840" ENDARROW="Default" ENDINCLINATION="-136;9;" ID="Arrow_ID_453101984" STARTARROW="None" STARTINCLINATION="60;-184;"/>
<icon BUILTIN="idea"/>
</node>
</node>
<node COLOR="#338800" CREATED="1616856060491" ID="ID_44406517" MODIFIED="1616859101168" TEXT="einen Manager f&#xfc;r den InteractionState schaffen">
<icon BUILTIN="button_ok"/>
@ -32391,9 +32396,43 @@
<icon BUILTIN="button_ok"/>
</node>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1616852275162" ID="ID_1272601084" MODIFIED="1616852283276" TEXT="DragRelocateController verwalten">
<node COLOR="#338800" CREATED="1616852275162" ID="ID_1272601084" MODIFIED="1617377719039" TEXT="DragRelocateController verwalten">
<icon BUILTIN="button_ok"/>
<node COLOR="#435e98" CREATED="1617377637909" ID="ID_1302268767" MODIFIED="1617377719039" TEXT="Entscheidung: erst mal direkt als PImpl in GestureController">
<icon BUILTIN="yes"/>
</node>
<node CREATED="1617377669085" ID="ID_1519120855" MODIFIED="1617377719039" TEXT="k&#xf6;nnte sp&#xe4;ter mal dynamsiche Auswahl nach Regeln sein (je nach Interaction-System)">
<richcontent TYPE="NOTE"><html>
<head>
</head>
<body>
<p>
Maus, Tastenk&#252;rzel, Stift, Hardware....
</p>
</body>
</html></richcontent>
<icon BUILTIN="idea"/>
</node>
<node COLOR="#338800" CREATED="1617377650756" ID="ID_735449737" MODIFIED="1617377719039" TEXT="TODO f&#xfc;r sp&#xe4;ter im Code hinterlassen">
<icon BUILTIN="button_ok"/>
</node>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1617377786842" ID="ID_1829220190" MODIFIED="1617377793038" TEXT="Interface Subject definieren">
<icon BUILTIN="flag-yellow"/>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1617377754742" ID="ID_1574394085" MODIFIED="1617377766937" TEXT="linkSubject im konkreten Controller">
<icon BUILTIN="flag-yellow"/>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1617377734341" ID="ID_1697355210" MODIFIED="1617377784921" TEXT="Widget-Signal-Binding anlegen">
<icon BUILTIN="flag-yellow"/>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1617377772355" ID="ID_1391847346" MODIFIED="1617377784091" TEXT="Subject im Signal-Binding binden">
<icon BUILTIN="flag-yellow"/>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1617377798336" ID="ID_1680080732" MODIFIED="1617377807908" TEXT="Signal-Callbacks anlegen">
<icon BUILTIN="flag-yellow"/>
</node>
</node>
</node>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1616684916746" ID="ID_571239713" MODIFIED="1616684947088">