Clip: pondering about the representation of clip timings
This commit is contained in:
parent
ea3ea811bf
commit
28adf9a642
8 changed files with 51 additions and 16 deletions
|
|
@ -43,7 +43,7 @@ namespace stage {
|
|||
const Symbol ATTR_name{"name"};
|
||||
const Symbol ATTR_fork{"fork"};
|
||||
const Symbol ATTR_assets{"assets"};
|
||||
const Symbol ATTR_start{"start"};
|
||||
const Symbol ATTR_timing{"timing"};
|
||||
|
||||
|
||||
/* ======== UI-Element protocol ======== */
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ namespace stage {
|
|||
extern const Symbol ATTR_name;
|
||||
extern const Symbol ATTR_fork;
|
||||
extern const Symbol ATTR_assets;
|
||||
extern const Symbol ATTR_start;
|
||||
extern const Symbol ATTR_timing;
|
||||
|
||||
|
||||
/* ======== UI-Element protocol ======== */
|
||||
|
|
|
|||
|
|
@ -71,14 +71,14 @@ namespace timeline {
|
|||
* @param startTime (optional) start time point of the clip.
|
||||
* @note Clip can not be displayed unless startTime is given
|
||||
*/
|
||||
ClipPresenter::ClipPresenter (ID identity, ctrl::BusTerm& nexus, WidgetHook& view, optional<Time> startTime)
|
||||
ClipPresenter::ClipPresenter (ID identity, ctrl::BusTerm& nexus, WidgetHook& view, optional<TimeSpan> timing)
|
||||
: Controller{identity, nexus}
|
||||
, channels_{}
|
||||
, effects_{}
|
||||
, markers_{}
|
||||
, widget_{}
|
||||
{
|
||||
ClipDelegate::buildDelegate (widget_, view, startTime);
|
||||
ClipDelegate::buildDelegate (widget_, view, timing);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ namespace timeline {
|
|||
using std::vector;
|
||||
using std::optional;
|
||||
using std::unique_ptr;
|
||||
using lib::time::Time;
|
||||
using lib::time::TimeSpan;
|
||||
|
||||
class MarkerWidget;
|
||||
|
||||
|
|
@ -97,7 +97,7 @@ namespace timeline {
|
|||
|
||||
|
||||
public:
|
||||
ClipPresenter (ID, ctrl::BusTerm&, WidgetHook&, optional<Time> startTime);
|
||||
ClipPresenter (ID, ctrl::BusTerm&, WidgetHook&, optional<TimeSpan>);
|
||||
|
||||
~ClipPresenter();
|
||||
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ namespace timeline {
|
|||
|
||||
|
||||
public:
|
||||
ClipWidget(WidgetHook::Pos hookPoint, uString clipName)
|
||||
ClipWidget(WidgetHook::Pos hookPoint, Duration dur, uString clipName)
|
||||
: HookedWidget{hookPoint, clipName}
|
||||
, ClipDelegate{}
|
||||
{ }
|
||||
|
|
@ -239,15 +239,15 @@ namespace timeline {
|
|||
|
||||
|
||||
ClipDelegate::Appearance
|
||||
ClipDelegate::buildDelegate (PDelegate& manager, WidgetHook& view, optional<Time> startTime)
|
||||
ClipDelegate::buildDelegate (PDelegate& manager, WidgetHook& view, optional<TimeSpan> timing)
|
||||
{
|
||||
if (startTime)
|
||||
manager.reset (new ClipWidget{view.hookedAt(*startTime, defaultOffsetY), defaultName});
|
||||
if (timing)
|
||||
manager.reset (new ClipWidget{view.hookedAt(*timing, defaultOffsetY), timing->duration(), defaultName});
|
||||
else
|
||||
manager.reset (new ClipData{view});
|
||||
|
||||
return startTime? Appearance::COMPACT
|
||||
: Appearance::PENDING;
|
||||
return timing? Appearance::COMPACT
|
||||
: Appearance::PENDING;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -119,6 +119,8 @@ namespace timeline {
|
|||
|
||||
using std::string;
|
||||
using lib::time::Time;
|
||||
using lib::time::Duration;
|
||||
using lib::time::TimeSpan;
|
||||
|
||||
using WidgetHook = model::CanvasHook<Gtk::Widget>;
|
||||
|
||||
|
|
@ -131,6 +133,8 @@ namespace timeline {
|
|||
*/
|
||||
class ClipDelegate
|
||||
{
|
||||
TimeSpan timing_;
|
||||
|
||||
public:
|
||||
virtual ~ClipDelegate(); ///< this is an interface
|
||||
ClipDelegate();
|
||||
|
|
@ -196,7 +200,7 @@ namespace timeline {
|
|||
* viable appearance style. This is the first incantation of #switchAppearance.
|
||||
*/
|
||||
static Appearance buildDelegate (PDelegate& manager, WidgetHook& view,
|
||||
std::optional<Time> startTime);
|
||||
std::optional<TimeSpan> timing);
|
||||
|
||||
private:/* ===== Internals ===== */
|
||||
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ namespace timeline {
|
|||
using std::unique_ptr;
|
||||
using std::make_unique;
|
||||
|
||||
using lib::time::Time;
|
||||
using lib::time::TimeSpan;
|
||||
using lib::diff::TreeMutator;
|
||||
using lib::diff::collection;
|
||||
using lib::explore;
|
||||
|
|
@ -314,8 +314,8 @@ namespace timeline {
|
|||
})
|
||||
.constructFrom ([&](GenNode const& spec) -> PClip
|
||||
{
|
||||
std::optional<Time> startTime = spec.retrieveAttribute<Time> (string{ATTR_start});
|
||||
return make_unique<ClipPresenter> (spec.idi, this->uiBus_, display_.getClipHook(), startTime);
|
||||
std::optional<TimeSpan> timing = spec.retrieveAttribute<TimeSpan> (string{ATTR_timing});
|
||||
return make_unique<ClipPresenter> (spec.idi, this->uiBus_, display_.getClipHook(), timing);
|
||||
})
|
||||
.buildChildMutator ([&](PClip& target, GenNode::ID const& subID, TreeMutator::Handle buff) -> bool
|
||||
{
|
||||
|
|
|
|||
|
|
@ -28306,6 +28306,37 @@
|
|||
</html></richcontent>
|
||||
<arrowlink COLOR="#9a5670" DESTINATION="ID_1054753498" ENDARROW="Default" ENDINCLINATION="-3030;165;" ID="Arrow_ID_948617682" STARTARROW="None" STARTINCLINATION="991;88;"/>
|
||||
</node>
|
||||
<node CREATED="1586383134447" ID="ID_415124968" MODIFIED="1586383138432" TEXT="Clip-Timings">
|
||||
<node CREATED="1586383139624" ID="ID_683488370" MODIFIED="1586383149522" TEXT="gegeben als TimeSpan"/>
|
||||
<node CREATED="1586383150821" ID="ID_51987562" MODIFIED="1586383287858" TEXT="Übersetzung in Pixel ist rein Client-seitig">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
Zoomen, Scrollen, Scroll-Window und View-Path sind reine Gui-Bildungen und werden instantan ohne Round-Trip realisiert
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
<icon BUILTIN="yes"/>
|
||||
</node>
|
||||
<node COLOR="#821a26" CREATED="1586383188716" ID="ID_1268226317" MODIFIED="1586383420749" TEXT="muß daher komplett im Clip gespeichert werden">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
<font color="#e12e2e"><b>Vorsicht Falle</b></font>: es reicht nicht, nur die auf Pixel quantisierte Position zu speichern, denn diese wird bei geringem Zoom relativ ungenau. Es wäre leicht möglich, durch Heraus- und wieder Hereinscrollen die sichtbare Position eines Clip massiv zu verschieben.
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
<icon BUILTIN="messagebox_warning"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node CREATED="1583678040736" ID="ID_1805643410" MODIFIED="1583678050738" TEXT="Umsetzung">
|
||||
<node CREATED="1583677631958" ID="ID_811510338" MODIFIED="1583678064711" TEXT="vorläufige Clip-Repräsentation">
|
||||
|
|
|
|||
Loading…
Reference in a new issue