Lumiera  0.pre.03
»edityourfreedom«
InteractionDirector Class Reference

#include "gui/interact/interaction-director.hpp"

Description

Top-level controller to establish a link between the model and transient user interaction state (focus, current window)

Definition at line 100 of file interaction-director.hpp.

Public Member Functions

 InteractionDirector (ctrl::GlobalCtx &)
 Setup and initialise all representations of "global-ness". More...
 
 ~InteractionDirector ()
 
void editSetup ()
 Edit global configuration and setup. More...
 
void forkProject ()
 Continue evolution of the currently active project under a new identity. More...
 
void newProject ()
 setup a new editing project, possibly close the current one. More...
 
void newSequence ()
 Establish a pristine new sequence within the session. More...
 
void newTrack ()
 Establish a empty new track close to the current scope. More...
 
void openFile ()
 Select and open a file to perform a suitable operation. More...
 
void render ()
 Start a render process. More...
 
void saveSnapshot ()
 Save a snapshot of the current project's contents and the UI state. More...
 
- Public Member Functions inherited from Tangible
virtual ~Tangible ()
 this is an interface More...
 
void clearErr ()
 invoke the hook to clear error markers More...
 
void clearMsg ()
 invoke the hook to clear notification messages More...
 
void installExpander (Expander::ProbeFun, Expander::ChangeFun)
 Configure the (optional) functionality to expand or collapse the UI-Element. More...
 
void installRevealer (Revealer::RevealeItFun)
 Configure the (optional) functionality to bring the UI-Element into sight. More...
 
template<typename... ARGS>
void invoke (Symbol cmdID, ARGS &&...)
 
void invoke (Symbol cmdID, Rec &&arguments)
 Perform a command or action, once the execution context has been established. More...
 
template<typename... ARGS>
void invoke (Symbol cmdID, ARGS &&... args)
 convenience shortcut to issue a command with several arguments More...
 
void mark (GenNode const &)
 generic handler for all incoming "state mark" messages More...
 
void markErr (string error)
 push an error state tag to the element More...
 
void markFlash ()
 highlight the element visually to catch the user's attention More...
 
void markMsg (string message)
 push a notification (or warning) message to the element. More...
 
 operator ID () const
 
 operator LuidH () const
 
void reset ()
 invoke the generic reset hook More...
 
void slotCollapse ()
 Collapse or minimise this element and remember the collapsed state. More...
 
void slotExpand ()
 Expand this element and remember the expanded state. More...
 
void slotReveal ()
 Cause the element to be brought into sight. More...
 
- Public Member Functions inherited from DiffMutable
virtual ~DiffMutable ()
 this is an interface More...
 

Private Types

using Assets = unique_ptr< setting::AssetController >
 
using Service_LocationQuery = lib::DependInject< LocationQuery >::ServiceInstance< Navigator >
 
using State = unique_ptr< ctrl::UiState >
 
using Timelines = std::vector< unique_ptr< timeline::TimelineController > >
 

Private Member Functions

void buildMutator (lib::diff::TreeMutator::Handle) override
 set up a binding to allow some top-level UI state to be treated as part of the session model More...
 
workspace::WorkspaceWindowgetWorkspaceWindow ()
 
void populateContent_afterStart ()
 ask Session to push up structures for presentation More...
 

Private Attributes

Assets assets_
 
ctrl::GlobalCtxglobalCtx_
 
Service_LocationQuery navigator_
 
unique_ptr< SpotLocatorspotLocator_
 
Timelines timelines_
 
unique_ptr< FocusTrackertracker_
 
State uiState_
 
unique_ptr< ViewLocatorviewLocator_
 

Static Private Attributes

static constexpr auto DELAY_AFTER_GUI_START_in_ms
 

Additional Inherited Members

- Public Types inherited from Tangible
using ID = ctrl::BusTerm::ID
 
using LuidH = lib::hash::LuidH
 
- Protected Types inherited from Tangible
using GenNode = lib::diff::GenNode
 
using Rec = lib::diff::Rec
 
- Protected Member Functions inherited from Tangible
 Tangible (ID identity, ctrl::BusTerm &nexus)
 
virtual bool doExpand (bool yes)
 generic default implementation of the expand/collapse functionality. More...
 
virtual void doRevealYourself ()
 generic default implementation of the "reveal" functionality. More...
 
- Protected Attributes inherited from Tangible
Expander expand_
 
Revealer reveal_
 
ctrl::BusTerm uiBus_
 

Member Typedef Documentation

◆ Service_LocationQuery

using Service_LocationQuery = lib::DependInject<LocationQuery>::ServiceInstance<Navigator>
private

Definition at line 106 of file interaction-director.hpp.

◆ Timelines

using Timelines = std::vector<unique_ptr<timeline::TimelineController> >
private

Definition at line 116 of file interaction-director.hpp.

◆ Assets

using Assets = unique_ptr<setting::AssetController>
private

Definition at line 117 of file interaction-director.hpp.

◆ State

using State = unique_ptr<ctrl::UiState>
private

Definition at line 118 of file interaction-director.hpp.

Constructor & Destructor Documentation

◆ InteractionDirector()

Setup and initialise all representations of "global-ness".

Parameters
globalswiring to the circle of top-level UI managers (including ourselves)
Warning
this ctor is performed within the UI thread, yet prior to entering the GTK event loop. For this reason, all initialisation performed here must be wiring-only; any tasks requiring an actually operative UI will be scheduled, to run later when the UI is fully operative.

Definition at line 91 of file interaction-director.cpp.

References InteractionDirector::assets_, InteractionDirector::DELAY_AFTER_GUI_START_in_ms, Root::getAssetID(), InteractionDirector::navigator_, InteractionDirector::populateContent_afterStart(), InteractionDirector::spotLocator_, InteractionDirector::timelines_, InteractionDirector::tracker_, Tangible::uiBus_, InteractionDirector::uiState_, and InteractionDirector::viewLocator_.

+ Here is the call graph for this function:

◆ ~InteractionDirector()

Definition at line 80 of file interaction-director.cpp.

Member Function Documentation

◆ buildMutator()

void buildMutator ( lib::diff::TreeMutator::Handle  )
overrideprivatevirtual

set up a binding to allow some top-level UI state to be treated as part of the session model

See also
tree-mutator.hpp

Implements Tangible.

Definition at line 132 of file interaction-director.cpp.

◆ populateContent_afterStart()

void populateContent_afterStart ( )
private

ask Session to push up structures for presentation

Definition at line 110 of file interaction-director.cpp.

References Tangible::invoke(), and proc::cmd::test_meta_activateContentDiff.

Referenced by InteractionDirector::InteractionDirector().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ newProject()

void newProject ( )

setup a new editing project, possibly close the current one.

This action launches the project setup UI, for the user to define the storage location and further parameters of the new project. A currently opened project will be deactivated asynchronously, without saving a snapshot, while retaining the last actions in the project's command log.

Definition at line 150 of file interaction-director.cpp.

Referenced by Actions::populateMainActions().

+ Here is the caller graph for this function:

◆ saveSnapshot()

void saveSnapshot ( )

Save a snapshot of the current project's contents and the UI state.

Note
any command issued against a session will always be logged in the project's log. A snapshot is a marked reference point and additionally includes a capture of UI state into the project.

Definition at line 163 of file interaction-director.cpp.

References Tangible::invoke(), RealClock::now(), proc::cmd::session_saveSnapshot, and util::toString().

Referenced by Actions::populateMainActions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ forkProject()

void forkProject ( )

Continue evolution of the currently active project under a new identity.

From a user's point of view, this is the "save as..." action, but due to the nature of Lumiera's projects, it is in fact more complicated. Thus this action launches the project setup UI and preselects the "fork" option there. Optionally this allows to copy the project's history into the forked new project, or alternatively just to start with a snapshot. Another option there is to set up a new storage location, or to replace the existing project under a new name.

Note
any commands issued since saving the last snapshot will be retained at least in the existing project's log (unless the old project is replaced / rewritten)

Definition at line 183 of file interaction-director.cpp.

Referenced by Actions::populateMainActions().

+ Here is the caller graph for this function:

◆ editSetup()

void editSetup ( )

Edit global configuration and setup.

This action will launch the project setup UI, which allows to adjust configuration

  • for this installation of Lumiera
  • for the current project
  • for this user's session in this project
    Todo:
    4/2017 not yet implemented, delegate to the AssetControler, which represents all global aspects of the application, session and project

Definition at line 199 of file interaction-director.cpp.

References InteractionDirector::getWorkspaceWindow().

Referenced by Actions::populateMainActions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ openFile()

void openFile ( )

Select and open a file to perform a suitable operation.

This action will launch the fileOpen UI. Depending on the selected file's meaning, the actual operation will be either to integrate the data somehow into the current session, or to deactivate the current session and replace it with an other session persisted on storage.

Definition at line 216 of file interaction-director.cpp.

Referenced by Actions::populateMainActions().

+ Here is the caller graph for this function:

◆ render()

void render ( )

Start a render process.

This action will launch the render setup UI. Depending on the current Spot, a suitable object to render will be preselected, typically the current timeline.

Todo:
4/2017 not yet implemented, and it is not clear how to access the functionality. Do we send a command? Or do we access the Play-Out subsystem directly, to create some kind of dedicated player instance?

Definition at line 231 of file interaction-director.cpp.

References InteractionDirector::getWorkspaceWindow().

Referenced by Actions::populateMainActions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ newSequence()

void newSequence ( )

Establish a pristine new sequence within the session.

The goal is to create a new playground for the user to add content. Actually, not only a new sequence is created, but also a new fork (track tree) and a new timeline to hold that sequence. And finally, this new timeline is opened for editing. This action invokes a command into the session, which in turn is responsible for figuring out all the contextual details sensibly.

Todo:
4/2017 using the session-root (=this) as anchor for the moment, but should actually figure out the current context dynamically... //////////////////////////////TICKET #1082 : actually access the interaction state to get "current scope"

Definition at line 251 of file interaction-director.cpp.

References Tangible::invoke(), and proc::cmd::session_newSequence.

Referenced by Actions::populateMainActions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ newTrack()

void newTrack ( )

Establish a empty new track close to the current scope.

Like for newSequence, the goal is to create a new empty workspace. But since a track can be attached anywhere within the fork (track tree), the currently active element is used to establish a current scope, which in turn is used as anchor to attach the new track in a sensible way, with a preference to add the new track as a sibling to the current scope. The actual details of this decision are delegated to the session, but the command invoked by this action does need a current element as argument, and this current element thus needs to be figured out from the context of invocation (current focus and possibly selection)

Todo:

as of 3/2017 this is an initial draft: It is not clear yet, if this lookup of context will always be treated implicitly, or if it is better to have a public content discovery operation on InteractionDirector and pass the current element explicitly as argument

4/2017 using the session-root (=this) as anchor for the moment, but should actually figure out the current context dynamically... //////////////////////////////TICKET #1082 : actually access the interaction state to get "current scope"

Definition at line 275 of file interaction-director.cpp.

References Tangible::invoke(), and proc::cmd::sequence_newTrack.

Referenced by Actions::populateMainActions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getWorkspaceWindow()

workspace::WorkspaceWindow & getWorkspaceWindow ( )
private

Definition at line 284 of file interaction-director.cpp.

References WindowLocator::findActiveWindow(), InteractionDirector::globalCtx_, and GlobalCtx::windowLoc_.

Referenced by InteractionDirector::editSetup(), and InteractionDirector::render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ globalCtx_

ctrl::GlobalCtx& globalCtx_
private

Definition at line 103 of file interaction-director.hpp.

Referenced by InteractionDirector::getWorkspaceWindow().

◆ viewLocator_

unique_ptr<ViewLocator> viewLocator_
private

Definition at line 110 of file interaction-director.hpp.

Referenced by InteractionDirector::InteractionDirector().

◆ spotLocator_

unique_ptr<SpotLocator> spotLocator_
private

Definition at line 111 of file interaction-director.hpp.

Referenced by InteractionDirector::InteractionDirector().

◆ navigator_

Service_LocationQuery navigator_
private

Definition at line 112 of file interaction-director.hpp.

Referenced by InteractionDirector::InteractionDirector().

◆ tracker_

unique_ptr<FocusTracker> tracker_
private

Definition at line 113 of file interaction-director.hpp.

Referenced by InteractionDirector::InteractionDirector().

◆ uiState_

State uiState_
private

Definition at line 120 of file interaction-director.hpp.

Referenced by InteractionDirector::InteractionDirector().

◆ assets_

Assets assets_
private

Definition at line 121 of file interaction-director.hpp.

Referenced by InteractionDirector::InteractionDirector().

◆ timelines_

Timelines timelines_
private

Definition at line 122 of file interaction-director.hpp.

Referenced by InteractionDirector::InteractionDirector().

◆ DELAY_AFTER_GUI_START_in_ms

constexpr auto DELAY_AFTER_GUI_START_in_ms
staticprivate

Definition at line 134 of file interaction-director.hpp.

Referenced by InteractionDirector::InteractionDirector().

+ Inheritance diagram for InteractionDirector:
+ Collaboration diagram for InteractionDirector:

The documentation for this class was generated from the following files: