LUMIERA.clone/src/steam/asset/timeline.hpp
2025-06-07 23:59:57 +02:00

117 lines
3.9 KiB
C++
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
TIMELINE.hpp - independent top-level element of the Session
Copyright (C)
2009, Hermann Vosseler <Ichthyostega@web.de>
  **Lumiera** is free software; you can redistribute it and/or modify it
  under the terms of the GNU General Public License as published by the
  Free Software Foundation; either version 2 of the License, or (at your
  option) any later version. See the file COPYING for further details.
*/
/** @file timeline.hpp
** Top level structural element within the session.
** Each Lumiera session may contain multiple top level timeline containers,
** which at the same time act as structural asset and as part of the public
** session API exposed to clients for discovering the session contents.
** Actually, Timelines are facade objects, delegating the implementation to
** the BindingMO, the Axis and the Sequences/Tracks.
**
** Contrary to usual habits in video/sound editing software, in Lumiera the
** tracks are \em not part of the timeline, but rather attached directly to
** the sequence container. To be usable, a timeline needs a binding to refer
** to such a sequence, but this sequence may be bound into multiple timelines
** or even virtual clips simultaneously.
**
** Like every structural asset, the creation of timelines happens automatically
** on referral; Timelines can be queried from the StructFactory, providing additional
** requested capabilities. Commonly clients will retrieve a given timeline by query
** on the name-ID of the timeline: `Struct::retrieve (Query<Timeline>("id(theName)."))`
** Additionally, the binding to a specific sequence may be established alongside:
** `"timeline(theTimelineName), bindSequence(theTimelineName,sequenceID)."`
**
** @todo around 2010, the concept of Timeline and Session binding was defined,
** together with a rough preliminary implementation. Up to 2017, there
** was no opportunity to set this system really into motion; this is
** not necessarily a bad thing, since meanwhile we understand way
** better in which way the Session will actually be accessed...
** @todo looks like we'll represent a secondary, attached slave display of the
** same Timeline rather by materialising it into a TimelineClone within
** the session. This topic has been postponed as of 10/2018 //////////////////////////////////////TICKET #1083
** @see Session
** @see Sequence
** @see StructFactory
**
*/
#ifndef ASSET_TIMELINE_H
#define ASSET_TIMELINE_H
#include "steam/asset/struct.hpp"
//#include "steam/mobject/mobject.hpp"
//#include "steam/mobject/placement.hpp"
#include "steam/mobject/mobject-ref.hpp"
//#include "steam/mobject/session/binding.hpp" ////TODO avoidable??
#include "lib/p.hpp"
#include "lib/element-tracker.hpp"
//#include <vector>
//#include <string>
//using std::vector;
//using std::string;
namespace steam {
namespace mobject {
namespace session {
class Binding;
using RBinding = MORef<Binding>;
}}
namespace asset {
class Timeline;
using PTimeline = lib::P<Timeline>;
/**
* @todo this new Timeline API was invented about 2010
* and remained in half finished state ever since.
* @todo 2016 can confirm that we still want to go that route
* @todo we need some actual interface, beyond just creating timelines!
*/
class Timeline
: public Struct
, public lib::AutoRegistered<Timeline>
{
using RBinding = mobject::session::RBinding;
RBinding boundSequence_;
Timeline (Ident const&, RBinding const&);
public:
/** create and register a new Timeline instance */
static PTimeline create (Asset::Ident const& idi, RBinding const& sequenceBinding);
protected:
virtual void unlink ();
};
///////////////////////////TODO currently just fleshing the API
}} // namespace steam::asset
#endif