Timeline: inject sub-track into the header pane structure

This commit is contained in:
Fischlurch 2019-07-18 19:44:04 +02:00
parent eca09e3ab5
commit 3102de9d8a
4 changed files with 36 additions and 16 deletions

View file

@ -66,6 +66,7 @@ namespace timeline {
: Gtk::Grid{} : Gtk::Grid{}
, nameTODO_{"?"} , nameTODO_{"?"}
, treeTODO_{""} , treeTODO_{""}
, childCnt_{0}
{ {
this->attach (nameTODO_, 0,0, 2,1); this->attach (nameTODO_, 0,0, 2,1);
this->attach (treeTODO_, 0,1, 1,1); this->attach (treeTODO_, 0,1, 1,1);
@ -85,15 +86,29 @@ namespace timeline {
* video editing software does -- rather, each sequence holds a _fork of nested scopes._ * video editing software does -- rather, each sequence holds a _fork of nested scopes._
* This recursively nested structure is reflected in the patchbay area corresponding to * This recursively nested structure is reflected in the patchbay area corresponding to
* each track in the _header pane_ of the timeline display, located to the left. The * each track in the _header pane_ of the timeline display, located to the left. The
* patchbay for each track is a grid with four quadrants, and the 4th quadrant is the * patchbay for each track is a grid with initially four quadrants, and the 4th quadrant
* _content area,_ which is recursively extended to hold nested PatchbayWidget elements, * holds the _content area,_ which is again a TrackHeadWidget. Additional sub-Tracks
* corresponding to the child tracks of this track. To _fund_ this recursively extensible * are added as additional lines to the grid, while nested sub-Tracks will be handled
* structure, we need to set up the first four quadrants * recursively by the corresponding nested TrackHeadWidget.
* @note Child tracks are always appended. When tracks are reordered or deleted,
* the whole structure has to be re-built accordingly.
*/ */
void void
TrackHeadWidget::injectSubFork (TrackHeadWidget& subForkHead) TrackHeadWidget::injectSubFork (TrackHeadWidget& subForkHead)
{ {
UNIMPLEMENTED ("how actually to represent the track in the patchbay"); ++childCnt_;
this->attach (subForkHead, 0, childCnt_, 1,1);
}
void
TrackHeadWidget::clearSubFork()
{
while (childCnt_ > 0)
{
this->remove_row (childCnt_);
--childCnt_;
}
} }

View file

@ -34,9 +34,9 @@
** + video overlay parameters (additive, opaque, transparent) ** + video overlay parameters (additive, opaque, transparent)
** + video or audio _level_ (=fader) ** + video or audio _level_ (=fader)
** - how to locate this content in time (e.g. relative to some marker) ** - how to locate this content in time (e.g. relative to some marker)
** For each track, we show a patchbay in the timeline header pane, which serves to control ** For each track, we display a "patchbay"-like content control in the timeline header pane,
** such aspects relevant for all content contained within the scope of this track, including ** which serves to control such aspects relevant for all content contained within the scope
** the sub-tracks nested therein. ** of this track, including the sub-tracks nested therein.
** **
** @todo WIP-WIP-WIP as of 10/2018 ** @todo WIP-WIP-WIP as of 10/2018
** **
@ -74,6 +74,8 @@ namespace timeline {
Gtk::Label nameTODO_; Gtk::Label nameTODO_;
Gtk::Label treeTODO_; Gtk::Label treeTODO_;
uint childCnt_;
public: public:
TrackHeadWidget(); TrackHeadWidget();
~TrackHeadWidget(); ~TrackHeadWidget();
@ -82,6 +84,9 @@ namespace timeline {
/** Integrate the control area for a nested sub track fork. */ /** Integrate the control area for a nested sub track fork. */
void injectSubFork (TrackHeadWidget& subForkHead); void injectSubFork (TrackHeadWidget& subForkHead);
/** Discard all nested sub track display widgets. */
void clearSubFork();
private:/* ===== Internals ===== */ private:/* ===== Internals ===== */

View file

@ -104,17 +104,17 @@ namespace timeline {
}) })
.matchElement ([&](GenNode const& spec, PRuler const& elm) -> bool .matchElement ([&](GenNode const& spec, PRuler const& elm) -> bool
{ {
// return spec.idi == ID{*elm}; ////////////////////////////////////////////////////////////TICKET #1193 : shall RulerTrack be a Tangible? return spec.idi == ID{*elm};
}) })
.constructFrom ([&](GenNode const& spec) -> PRuler .constructFrom ([&](GenNode const& spec) -> PRuler
{ { // »Constructor« : how to attach a new ruler track
// return make_unique<RulerTrack> (spec.idi, this->uiBus_); ///////////////////////////////TICKET #1193 : how to construct a RulerTrack? return make_unique<RulerTrack> (spec.idi, this->uiBus_, *this);
}) })
.buildChildMutator ([&](PRuler& target, GenNode::ID const& subID, TreeMutator::Handle buff) -> bool .buildChildMutator ([&](PRuler& target, GenNode::ID const& subID, TreeMutator::Handle buff) -> bool
{ ///////////////////////////////TICKET #1193 : do we even want to "mutate" a ruler? {
// if (ID{*target} != subID) return false; if (ID{*target} != subID) return false;
// target->buildMutator (buff); target->buildMutator (buff);
// return true; return true;
})) }))
.attach (collection(markers_) .attach (collection(markers_)
.isApplicableIf ([&](GenNode const& spec) -> bool .isApplicableIf ([&](GenNode const& spec) -> bool

View file

@ -106,8 +106,8 @@ namespace timeline {
void void
injectSubTrack (TrackHeadWidget& subHead, TrackBody& subBody) injectSubTrack (TrackHeadWidget& subHead, TrackBody& subBody)
{ {
head.injectSubFork (subHead);
body.attachSubTrack (&subBody); body.attachSubTrack (&subBody);
UNIMPLEMENTED ("inject the widgets to represent a nested sub-track within this timeline track display frame");
} }
}; };