Ticket #155: rename Track -> Fork (II)

actual renaming of types and variables in the entire code base
This commit is contained in:
Fischlurch 2015-05-31 02:03:24 +02:00
parent 7c7a07b54f
commit 8e16149a25
35 changed files with 265 additions and 271 deletions

View file

@ -86,13 +86,13 @@ namespace lumiera {
// resolve(O, Cap) :- make(O), capabilities(Cap).
// capabilities(Q) :- call(Q).
//
// stream(T, mpeg) :- type(T, track), type(P, pipe), resolve(P, stream(P,mpeg)), placed_to(P, T).
// stream(T, mpeg) :- type(T, fork), type(P, pipe), resolve(P, stream(P,mpeg)), placed_to(P, T).
//
// The type guard is inserted automatically, while the predicate implementations for
// find/1, make/1, stream/2, and placed_to/2 are to be provided by the target types.
//
// As a example, the goal ":-retrieve(T, stream(T,mpeg))." would search a Track object, try to
// retrieve a pipe object with stream-type=mpeg and associate the track with this Pipe. The
// As a example, the goal ":-retrieve(T, stream(T,mpeg))." would search a Fork object (a "track"), try to
// retrieve a pipe object with stream-type=mpeg and associate the Fork with this Pipe. The
// predicate "stream(P,mpeg)" needs to be implemented (natively) for the pipe object.
class Resolver
@ -173,7 +173,7 @@ namespace lumiera {
// TODO: the Idea is to provide specialisations for the concrete types
// we want to participate in the ConfigRules system....
// Thus we get the possibility to create a specific return type,
// e.g. return a P<Pipe> but a Placement<Track>, using the appropriate factory.
// e.g. return a P<Pipe> but a Placement<Fork>, using the appropriate factory.
// Of course then the definitions need to be split up in separate headers.

View file

@ -125,7 +125,7 @@ namespace lumiera {
typedef lib::IterSource<proc::mobject::OutputDesignation>::iterator Pipes;
typedef proc::play::POutputManager Output;
typedef proc::mobject::session::PClipMO Clip;
typedef proc::mobject::PTrack Track;
typedef proc::mobject::PFork Fork;
typedef proc::asset::PTimeline Timeline;
typedef proc::asset::PViewer Viewer;
@ -135,7 +135,7 @@ namespace lumiera {
Controller perform(Pipes, Output);
Controller perform(Timeline);
Controller perform(Viewer);
Controller perform(Track);
Controller perform(Fork);
Controller perform(Clip);
protected:

View file

@ -136,7 +136,7 @@ namespace asset {
* - asset::Meta representing metadata, parametrisation, customisation.
*
* And of course there are various concrete Asset subclasses, like asset::Clip,
* asset::Effect, asset::Codec, asset::Track, asset::Dataset.
* asset::Effect, asset::Codec, asset::Dataset.
* @note Assets objects have a strict unique identity and because of this are non-copyable.
* You can not create an Asset derived object without registering it with the AssetManager
* automatically. It is possible to copy the PAsset (smart pointer) though.

View file

@ -183,7 +183,7 @@ namespace asset {
* @todo As a temporary workaround, we hash the symbolic ID twice, but we should look
* into using a better hash function ////////////TICKET #865
*
* @see mobject::session::Track
* @see mobject::session::Fork
*/
template<class TY>
struct EntryID

View file

@ -1,5 +1,5 @@
/*
Sequence - Compound of MObjects placed on a track tree. Building block of the Session
Sequence - Compound of MObjects placed within a tree of tracks. Building block of the Session
Copyright (C) Lumiera.org
2009, Hermann Vosseler <Ichthyostega@web.de>
@ -57,7 +57,7 @@ namespace asset {
Sequence::unlink ()
{
AutoRegistered<Sequence>::detach();
TODO ("purge attached track"); //////////////////////////////////////////////TICKET #692
TODO ("purge attached fork"); //////////////////////////////////////////////TICKET #692
Struct::unlink();
}

View file

@ -1,5 +1,5 @@
/*
SEQUENCE.hpp - Compound of MObjects placed on a track tree. Building block of the Session
SEQUENCE.hpp - Compound of MObjects placed within a tree of tracks. Building block of the Session
Copyright (C) Lumiera.org
2009, Hermann Vosseler <Ichthyostega@web.de>
@ -26,18 +26,21 @@
** A Sequence is both a structural element of the session and part of the
** public session API exposed to clients for discovering the session contents
** and structure. Sequences are implemented as structural assets, delegating
** the actual implementation to the track-MObjects within the model.
** the actual implementation to the fork-MObjects within the model, which
** naturally form the necessary recursive and nested structure.
**
** Contrary to usual habits in video/sound editing software, in Lumiera the
** tracks form a tree and serve as backbone of the individual \em sequence,
** "tracks" form a tree and serve as backbone of the individual \em sequence,
** as opposed to the timeline, which manages output and frame quantisation,
** but not the track structure.
** but do not hold any contents themselves. Thus, the sequence is really
** a tree of nested scopes (session::mobject::Fork), together with all the
** media elements placed within these scopes.
**
** Like every structural asset, the creation of sequences happens automatically
** on referral; Sequences can be queried from the StructFactory, providing additional
** requested capabilities. Commonly clients will retrieve a given sequence by query
** on the name-ID of the sequence: \c Struct::retrieve(Query<Sequence> ("id(theName)."))
** Additionally, a specific root track may be requested: \c "id(theName),rootTrack(trackID)."
** Additionally, a specific fork root may be requested: \c "id(theName),rootFork(trackID)."
**
** @see Session
** @see StructFactory
@ -66,8 +69,8 @@ namespace proc {
namespace mobject {
namespace session {
class Track;
typedef MORef<Track> RTrack;
class Fork;
typedef MORef<Fork> RFork;
}}
@ -86,9 +89,9 @@ namespace asset {
: public Struct
, public lib::AutoRegistered<Sequence>
{
typedef mobject::session::RTrack RTrack;
typedef mobject::session::RFork RFork;
Sequence (Ident const&); //////////////////////////////////////////////TICKET #692 pass in track here
Sequence (Ident const&); //////////////////////////////////////////////TICKET #692 pass in fork here
public:
/** create and register a new Sequence instance */

View file

@ -76,9 +76,10 @@ namespace asset {
using proc::mobject::Session;
using proc::mobject::MObject;
using proc::mobject::session::Scope;
using proc::mobject::session::match_specificTrack;
using proc::mobject::session::match_specificFork;
using proc::mobject::session::RBinding;
using proc::mobject::session::RTrack;
using proc::mobject::session::RFork;
using proc::mobject::session::Fork;
using idi::StructTraits;
@ -134,22 +135,22 @@ namespace asset {
}
/** either fetch or build a suitable root track for a new sequence */
RTrack
getTrack_forSequence (string const& desiredID)
/** either fetch or build a suitable fork root for a new sequence */
RFork
getFork_forSequence (string const& desiredID)
{
RTrack track;
RFork fork;
if (!isnil (desiredID))
track = Session::current->elements.pick (match_specificTrack (desiredID));
fork = Session::current->elements.pick (match_specificFork (desiredID));
if (track && !Scope::containing (track.getRef()).isRoot())
if (fork && !Scope::containing (fork.getRef()).isRoot())
{
UNIMPLEMENTED ("how to deal with 'stealing' a sub-track tree to a new sequence??");
UNIMPLEMENTED ("how to deal with 'stealing' a fork sub-tree to a new sequence??");
}
if (!track)
track = Session::current->getRoot().attach (MObject::create (TrackID (desiredID)));
if (!fork)
fork = Session::current->getRoot().attach (MObject::create (ForkID (desiredID)));
return track;
return fork;
}
@ -230,14 +231,14 @@ namespace asset {
{
// when we reach this point it is clear a suitable sequence doesn't yet exist in the model
TODO ("actually extract properties/capabilities from the query...");
string trackID = caps.extractID ("track");
Query<Track> desiredTrack (isnil (trackID)? "" : "id("+trackID+")");
// PTrack track = Session::current->query (desiredTrack); ///////////////////////////////////TICKET #639
string forkID = caps.extractID ("fork");
Query<Fork> desiredFork (isnil (forkID)? "" : "id("+forkID+")");
// PFork fork = Session::current->query (desiredFork); ///////////////////////////////////TICKET #639
// TODO: handle the following cases
// - track doesn't exist --> create and root attach it
// - track exists and is root attached, but belongs already to a sequence --> throw
// - track exists, but isn't root attached ---> what do do here? steal it??
PSequence newSequence = Sequence::create (createIdent (caps)); ///////////TODO fed track in here
// - fork doesn't exist --> create and attach it as root
// - fork exists and is root attached, but belongs already to a sequence --> throw
// - fork exists, but isn't root attached ---> what do do here? steal it??
PSequence newSequence = Sequence::create (createIdent (caps)); ///////////TODO fed fork in here
ENSURE (newSequence); ///////////////////////TICKET #565 maybe store the capabilities query within the Struct asset somehow?
return newSequence.get();
}

View file

@ -53,14 +53,13 @@ namespace proc {
namespace mobject {
namespace session {
class Track;
class Fork;
class Clip;
}}
namespace asset{
class Track;
class Pipe;
class ProcPatt;
class Timeline;
@ -88,18 +87,11 @@ namespace asset{
};
///////////////////////////////////////////////////////////////////////////////////////////TICKET #581 intending to abandon asset::Track in favour of a plain EntryID
template<> struct StructTraits<asset::Track>
template<> struct StructTraits<mobject::session::Fork>
{
static Symbol namePrefix() { return "track"; }
static Symbol catFolder() { return "tracks";}
static Symbol idSymbol() { return "track"; }
};
template<> struct StructTraits<mobject::session::Track>
{
static Symbol namePrefix() { return "track"; }
static Symbol catFolder() { return "tracks";}
static Symbol idSymbol() { return "track"; }
static Symbol namePrefix() { return "fork"; }
static Symbol catFolder() { return "forks";}
static Symbol idSymbol() { return "fork"; }
};
template<> struct StructTraits<mobject::session::Clip>
{

View file

@ -22,8 +22,8 @@
/** @file struct.hpp
** Structural parts of the Session (e.g. Tracks) can be reflected
** into the "bookkeeping view" as a specific Kind of Asset.
** Structural parts of the Session (e.g. "tracks", i.e. Fork objects) can be
** reflected into the "bookkeeping view" as a specific Kind of Asset.
** For the different \em kinds of Assets, we use sub-interfaces inheriting
** from the general Asset interface, each of which expose a distinguishing feature.
** In the case of structural assets, the key point is the ability to retrieve an
@ -31,9 +31,9 @@
** on demand, just by referral. Thus, the collection of these assets provides a map
** for exploring the current session's structure and allow for tweaking of the
** default behaviour.
** - Track acts as unique track ID <i>(note: to be removed and replaced by a plain \c entryID )</i>
** - Timeline and Sequence are facades, part of the session API
** - Pipe is an attachment point for wiring connections and defines a StreamType
** - "tracks" are implemented as Fork represented as \c entryID within the asset view.
** - ProcPatt is used as a blueprint in the build process, a standard connection pattern
**
** \par access and creation
@ -44,9 +44,10 @@
** aren't deleted. Doing so would require a dedicated function which not only drops
** an asset instance from AssetManager, but also ensures removal of all properties
** within the model which could cause automatic re-creation of this asset. E.g.
** purging a track asset (=unique trackID) requires removing or disconnecting
** all placements referring to this track, which could be sub tracks, clips,
** effects, automation or labels.
** purging a track asset (=unique trackID) would necessitate to remove or
** disconnect all placements located within the scope of the referred Fork;
** this could be sub forks, clips, effects, automation or labels.
** Obviously, this is way beyond the realm of asset management.
**
** @ingroup asset
** @see asset.hpp for explanation regarding asset IDs

View file

@ -70,12 +70,12 @@ namespace query {
using proc::asset::Sequence;
using proc::asset::PSequence;
using proc::mobject::session::Track;
using proc::mobject::session::PTrack;
using proc::mobject::session::Fork;
using proc::mobject::session::PFork;
template PPipe DefsManager::operator() (Query<Pipe> const&);
template PProcPatt DefsManager::operator() (Query<const ProcPatt> const&);
template PTrack DefsManager::operator() (Query<Track> const&);
template PFork DefsManager::operator() (Query<Fork> const&);
template PTimeline DefsManager::operator() (Query<Timeline> const&);
template PSequence DefsManager::operator() (Query<Sequence> const&);

View file

@ -70,7 +70,7 @@ namespace proc {
* the list of all concrete types participating in the
* rule based config query system
*/
typedef lib::meta::Types < proc::mobject::session::Track
typedef lib::meta::Types < proc::mobject::session::Fork
, proc::asset::Pipe
, const proc::asset::ProcPatt
, proc::asset::Timeline

View file

@ -1,5 +1,5 @@
/*
EXPLICITPLACEMENT.hpp - special Placement yielding an absolute location (Time,Track) for a MObject
EXPLICITPLACEMENT.hpp - special Placement yielding an absolute location (Time,Output) for a MObject
Copyright (C) Lumiera.org
2008, Hermann Vosseler <Ichthyostega@web.de>

View file

@ -47,7 +47,7 @@
** @note there is a twist concerning the nominal Placement hierarchy
** as generated by the return type of PlacementRef::operator*().
** While the original Placement (as added to the session) might been
** defined to mimic a more elaborate hierarchy (e.g. Placement<Track>
** defined to mimic a more elaborate hierarchy (e.g. Placement<Fork>
** inherits from Placement<Meta>), the Placement returned here in
** these cases will just be a subclass or Placement<MObject>
** (which in the mentioned example would mean it couldn't be

View file

@ -39,7 +39,7 @@
** is controlled and parametrised by a collection (chain) of LocatingPin objects. By adding
** to this chain, the position of the MObject is increasingly constrained. The simplest
** case of such constraining is to add a FixedLocation, thus placing the MObject at one
** absolute position (time, track).
** absolute position (time, output).
**
** Together, this yields semantics somewhere in between value semantics and reference semantics.
** As any smart-ptr, placements are copyable, but each such copy takes on a <i>distinct identity.</i>

View file

@ -44,7 +44,7 @@ namespace session {
return true;
// Ideas: - compare the bound sequence's channels with this binding's channel configuration
// - verify the virtual media, unless this biding is creating a top-level timeline
// - verify the bound sequence is based on a track within the model
// - verify the bound sequence is based on a fork within the model
}

View file

@ -40,17 +40,17 @@ namespace mobject {
* in the Session: directly specifying a constant position.
* @todo use a subclass to represent the LocatingSolution?
* would solve the construction of a ExplicitPlacement
* much more natural. (ichthyo: siehe trac #100)
* much more natural. //////////TICKET #100
*/
class FixedLocation : public LocatingPin
{
Time time_;
Track track_;
Fork fork_;
friend class ExplicitPlacement; //TODO trac #100
friend class ExplicitPlacement; //////////////////////TICKET #100
protected:
FixedLocation (Time ti, Track tra) : time_(ti), track_(tra) {};
FixedLocation (Time ti, Fork fo) : time_(ti), fork_(fo) {};
friend class LocatingPin;
virtual void intersect (LocatingSolution&) const;

View file

@ -28,22 +28,25 @@ namespace proc {
namespace mobject {
namespace session {
/** create a new track-MObject based on the given unique ID.
* Initially, the reference (zero-point) time of this track
* will be set to 0
/** create a new fork-MObject based on the given unique ID.
* While the fork is an MObject attached locally within the
* given Sequence, it referres to a globally known forkID,
* which is an Asset. These fork-IDs might be shared among
* several Sequences and can be used to refer to several
* scopes simultaneously.
*/
Track::Track (TrackID const& trackID)
Fork::Fork (ForkID const& forkID)
: start_(Time::ZERO) //////////////////////////////////TODO something more inspired please
, id_(trackID)
, id_(forkID)
{
throwIfInvalid();
}
bool
Track::isValid() const
Fork::isValid() const
{
return bool(id_.isValid()); ////////TODO anything more 'real' to check?
return bool(id_.isValid()); ////////TODO anything more to check 'for real'?
}

View file

@ -37,50 +37,55 @@ namespace session { //////////////////////////////////////////////////////TI
using lib::P;
using lib::time::Time;
class Track;
class Fork;
typedef P<Track> PTrack;
typedef P<Fork> PFork;
}}
namespace asset { //////////////////////////////////////////////////////TICKET #637
typedef EntryID<mobject::session::Track> TrackID;
typedef EntryID<mobject::session::Fork> ForkID;
}
namespace mobject {
namespace session {
using asset::TrackID;
using asset::ForkID;
//////////////////////////////////////////////////////TICKET #646
//////////////////////////////////////////////////////TICKET #715
/**
* A Track is grouping device within the Session.
* The corresponding Placement by which this Track object is referred
* defines fallback placing properties to be used by all objects placed on this track
* in case they don't specify more concrete placements.
* Typically, tracks are used do make default processing pipe connections,
* define a layer or pan for sound and for for disabling groups
* of clips. Note tracks are grouped in a tree like fashion.
* A Fork serves as grouping device within the Session.
* Within the timeline, forks are used to organise continuous trails of consecutive
* clips -- similar to the role of "Tracks" in other editing applications. Just, in
* Lumiera a Fork is \em only a grouping device and not limited just to video or audio.
* Moreover, Forks are also used to organise and group clips in preparation to editing
* (the so called "media bins"). And forks can be used to create assortments of effects
* and other editing tools. In all these cases, the Fork creates a \em scope.
*
* The corresponding Placement by which this Fork object is attached to the session
* defines fallback placing properties to be used by all objects placed within the
* scope of this fork, unless individual objects specify more concrete placements.
* Typically, the placement within a fork of the timeline is used to derive the
* default processing pipe connections, define a layer or pan for sound and also
* for for disabling groups of clips. But note that forks are always nested,
* forming a tree like grouping device with hierarchically nested scopes.
* \par
* This Media Object (often referred to as "track-MO") is always dealt with
* This Fork Media Object (sometimes referred to as "fork-MO") is always dealt with
* locally within one Sequence. Client code normally doesn't have to care for creating
* or retrieving track-MO. Rather, it refers to the global track-asset-ID. The same
* holds true when placing some other Media Object onto a track: the corresponding
* placement just refers the global trackID, while the builder automatically retrieves the
* matching track-MO for the Sequence in question. If the Session contains several instances
* (track-MO) referring to the same trackID (asset), then this causes all objects placed
* onto this track to be included several times in the resulting render nodes network
* (possibly with varying placement properties) //////////////TODO 3/2010 likely *not* implementing this feature, because we have sequences
* or retrieving a fork-MO. Rather, it refers to the global fork-asset-ID. The same
* holds true when placing some other Media Object into the scope of a fork:
* the corresponding placement just refers the global forkID, while the builder
* automatically retrieves the matching fork-MO for the Sequence in question.
*/
class Track : public Meta
class Fork : public Meta
{
Time start_; /////////////////////////////////TODO: this doesn't belong here. The start position is governed by the Placement!!!
TrackID id_;
ForkID id_;
string
@ -92,7 +97,7 @@ namespace session {
bool isValid() const;
protected:
Track (TrackID const&);
Fork (ForkID const&);
friend class MObjectFactory;
public:
@ -106,7 +111,7 @@ namespace session {
inline bool
Track::isSameID(string const& refID)
Fork::isSameID(string const& refID)
{
return refID == id_.getSym();
}
@ -114,9 +119,9 @@ namespace session {
} // namespace mobject::session
/** Placement<Track> defined to be subclass of Placement<Meta> */
template class Placement<session::Track, session::Meta>;
typedef Placement<session::Track, session::Meta> PTrack;
/** Placement<Fork> defined to be subclass of Placement<Meta> */
template class Placement<session::Fork, session::Meta>;
typedef Placement<session::Fork, session::Meta> PFork;
}} // namespace proc::mobject
#endif /*MOBJECT_SESSION_FORK_H*/

View file

@ -182,7 +182,7 @@ namespace session {
/* === Factory functions for adding LocatingPins === */
FixedLocation&
LocatingPin::operator() (Time start, Track track)
LocatingPin::operator() (Time start, Fork track) /////////////TODO "track" should be reworked to be the output designation
{
return static_cast<FixedLocation&>
(addChain (new FixedLocation (start, track)));

View file

@ -101,7 +101,7 @@ namespace mobject {
typedef lib::time::Time Time;
typedef lib::time::TimeVar TimeVar;
typedef lib::time::Offset Offset;
typedef Time* Track; //TODO dummy declaration; we don't use Tracks as first-class entity any longer
typedef Time* Fork; //TODO dummy declaration; we don't use Tracks as first-class entity any longer. This role should be taken by the "Output Designation"
typedef std::shared_ptr<asset::Pipe> Pipe;
typedef std::pair<Time,Pipe> SolutionData; //TICKET #100 (ichthyo considers better passing of solution by subclass)
struct LocatingSolution;
@ -122,7 +122,7 @@ namespace mobject {
/* Factory functions for adding LocatingPins */
FixedLocation& operator() (Time start, Track track=0);
FixedLocation& operator() (Time start, Fork track=0); //////////TODO: Tracks are gone, long live the Forks!
RelativeLocation& operator() (PlacementRef<MObject>& refObj, Offset const& offset=Offset(Time::ZERO)); //////////TODO: warning, just a dummy placeholder for now!!
LocatingPin (const LocatingPin&);
@ -151,8 +151,8 @@ protected:
{
TimeVar minTime;
TimeVar maxTime;
Track minTrack; // TODO don't use Tracks
Track maxTrack;
Fork minTrack; // TODO don't use Tracks
Fork maxTrack;
bool impo;
LocatingSolution ()

View file

@ -64,7 +64,7 @@ namespace session {
* internally and wrapped into a Placement, which takes ownership.
* So, when the render engine gets across this Clip-MO, it is able
* to obtain the media information contained in the corresponding
* media asset. Note this will create a single track clip.
* media asset.
* @param mediaDef the actual asset::Media to be used
* created Clip could be a compound (multichannel) clip
* comprised of several SimpleClip sub-objects.
@ -85,13 +85,13 @@ namespace session {
UNIMPLEMENTED ("build multichannel compound clip-MO");
}
/** fabricate a new track-MObject, using the given unique ID */
Placement<Track>
MObjectFactory::operator() (TrackID const& id)
/** fabricate a new fork-MObject, using the given unique ID */
Placement<Fork>
MObjectFactory::operator() (ForkID const& id)
{
TODO ("what needs to be registered when creating an Track-MO?");
TODO ("assure the ID is indeed unique and not already used for another track"); //////////TICKET #638
return Placement<Track> (*new Track (id), &deleterFunc);
TODO ("what needs to be registered when creating an Fork-MO?");
TODO ("assure the ID is indeed unique and not already used for another fork??"); //////////TICKET #638
return Placement<Fork> (*new Fork (id), &deleterFunc);
}
/** */

View file

@ -51,7 +51,7 @@ namespace session {
class Root;
class Clip;
class Track;
class Fork;
class Effect;
class Label;
class Binding;
@ -70,7 +70,7 @@ namespace session {
Placement<Root> operator() (lumiera::query::DefsManager&);
Placement<Clip> operator() (asset::Clip const&, asset::Media const&);
Placement<Clip> operator() (asset::Clip const&, vector<asset::Media const*>);
Placement<Track> operator() (asset::EntryID<Track> const&);
Placement<Fork> operator() (asset::EntryID<Fork> const&);
Placement<Effect> operator() (asset::Effect const&);
Placement<Label> operator() (lib::Symbol);
Placement<Binding>operator() (asset::PSequence const&);

View file

@ -57,7 +57,8 @@
** another Placement already registered within the index; the new Placement can be thought
** of as being located "within" or "below" this scope-defining reference Placement. An
** typical example would be the addition of a \c Placement<session::Clip>, specifying
** a \c Placement<session::Track> as scope. Thus, all "object instances" within the
** a \c Placement<session::Fork> as scope. This would bring the mentioned Clip onto the
** "Track", as implemented by a Fork-MObject. Thus, all "object instances" within the
** session are arranged in a tree-like fashion. On creation of the PlacementIndex,
** a root element needs to be provided. While this root element has a meaning for
** the session, within the index it is just a scope-providing element.

View file

@ -72,7 +72,7 @@ namespace session {
* given scope), or do discover depth-first any content within
* this scope. The result set of these queries will be filtered
* to yield only placements compatible to the specified kind of
* MObject. E.g, you may query all Clip objects within a given Track.
* MObject. E.g, you may query all Clip objects within a given Fork.
*
* The implementation of these query operations is backed by the
* PlacementIndex in the current session. The link to the session

View file

@ -130,7 +130,7 @@ namespace session {
* @note this yields the \em raw path (basic containment hierarchy),
* as opposed to an effective or virtual path, which should reflect
* the attachment of Sequences to Timelines or meta-clips. That is,
* you'll always get the top-level track of any sequence as direct
* you'll always get the top-level fork root of any sequence as direct
* child of the root node and timelines (BindingMO) just appear
* to be "dead ends"
*/

View file

@ -51,8 +51,8 @@ namespace session {
*
* Actually, Scope is implemented through a PlacementRef pointing to
* the Placement which \em constitutes this Scope. We call this Placement
* the "scope top". A track e.g. can \em contain several clips, but also
* nested sub tracks, all of which would be within the scope of this track.
* the "scope top". A fork e.g. can \em contain several clips, but also
* nested sub forks, all of which would be within the scope of this fork.
* This scoping relation plays an important role when it comes to \em resolving
* properties of placement, like e.g. the output designation, overlay mode,
* sound pan position etc -- properties from enclosing scopes will be

View file

@ -38,7 +38,7 @@
** managed automatically and kept in sync with the session::Binding elements
** located directly below model root.
** - likewise there is an table of all Sequence (structural assets), which
** correspond to the roots of track trees, attached below model root.
** correspond to the fork roots (roots of "track" trees), attached below model root.
** - the ElementQuery interface allows to retrieve specific object
** instances by applying a filter predicate.
**
@ -50,8 +50,8 @@
** sequences is closely connected to some structural changes within the model
** - Timeline is related to session::Binding, where the timelines are leading
** and the binding elements are dependent on both a timeline and a sequence
** - Sequence is related to a Placement<session::Track> -- but only if attached
** immediately below model root; here the tracks are leading and the sequences
** - Sequence is related to a Placement<session::Fork> -- but only if attached
** immediately below model root; here the forks are leading and the sequences
** are completely dependent.
** In any case, ctor and dtor of Timeline and Sequence have to care for proper
** registration into the SessionInterfaceModules for timelines and sequences

View file

@ -52,32 +52,20 @@ namespace proc {
namespace mobject {
namespace session {
using std::bind;
using std::function;
using std::placeholders::_1;
////////////TODO: shall we use a sub-namespace "query" ??
namespace { // query function implementations....
inline bool
_compareTrackID (Placement<Track> const& trackMO, string refTrackID)
{
return trackMO->isSameID (refTrackID);
}
}//(End) query functions
/* ====== Predicates for picking objects ====== */
/** yield a query predicate to pick a specific track */
inline function<bool(Placement<Track> const&)>
match_specificTrack (string const& trackID)
/** yield a query predicate to pick a specific fork */
inline function<bool(Placement<Fork> const&)>
match_specificFork (string const& forkID)
{
return bind (_compareTrackID, _1, trackID);
return [=](Placement<Fork> const& forkMO)
{
return forkMO->isSameID (forkID);
};
}
}}} // namespace proc::mobject::session

View file

@ -260,9 +260,9 @@ namespace lumiera {
*
*/
Play::Controller
Play::perform (Track)
Play::perform (Fork)
{
UNIMPLEMENTED ("build PlayProcess for a single Track");
UNIMPLEMENTED ("build PlayProcess for a single Fork");
}

View file

@ -37,10 +37,10 @@ TEST "plain entry-ID" EntryID_test <<END
out: ID<..proc.asset.+Dummy.>-..proc.asset.+Dummy.\.001
out: ID<..proc.asset.+Dummy.>-strange
out: ID<..proc.asset.+Dummy.>-..proc.asset.+Dummy.\.002
out: ID<track>-track\.001
out: ID<track>-track\.002
out: ID<track>-special
out: sizeof\( ..proc.asset.+EntryID.+mobject.+session.+Track.+ \) =
out: ID<fork>-fork\.001
out: ID<fork>-fork\.002
out: ID<fork>-special
out: sizeof\( ..proc.asset.+EntryID.+mobject.+session.+Fork.+ \) =
out: sizeof\( ..proc.asset.+BareEntryID. \) =
return: 0
END

View file

@ -58,8 +58,8 @@ namespace test {
struct Dummy { };
typedef EntryID<Dummy> DummyID;
typedef EntryID<mobject::session::Track> TrackID;
typedef EntryID<mobject::session::Clip> ClipID;
typedef EntryID<mobject::session::Fork> ForkID;
typedef EntryID<mobject::session::Clip> ClipID;
}
@ -105,9 +105,9 @@ namespace test {
CHECK (dID2 != dID3); CHECK (dID3 != dID2);
CHECK (dID1 != dID3); CHECK (dID3 != dID1);
TrackID tID1;
TrackID tID2;
TrackID tID3("special");
ForkID tID1;
ForkID tID2;
ForkID tID3("special");
CHECK (tID1.isValid());
CHECK (tID2.isValid());
CHECK (tID3.isValid());
@ -132,14 +132,14 @@ namespace test {
void
checkBasicProperties ()
{
TrackID tID(" test ⚡ ☠ ☭ ⚡ track ");
CHECK (tID.getIdent() == Asset::Ident("test_track", Category(STRUCT,"tracks"), "lumi", 0));
ForkID tID(" test ⚡ ☠ ☭ ⚡ track ");
CHECK (tID.getIdent() == Asset::Ident("test_track", Category(STRUCT,"forks"), "lumi", 0));
CHECK (tID.getHash() == TrackID("☢ test ☢ track ☢").getHash());
CHECK (tID.getHash() == ForkID("☢ test ☢ track ☢").getHash());
CHECK (tID.getSym() == tID.getIdent().name);
CHECK (TrackID().getIdent().category == Category (STRUCT,"tracks"));
CHECK (ClipID().getIdent().category == Category (STRUCT,"clips"));
CHECK (ForkID().getIdent().category == Category (STRUCT,"forks"));
CHECK (ClipID().getIdent().category == Category (STRUCT,"clips"));
ClipID cID2,cID3;
CHECK (cID2.getSym() < cID3.getSym());
@ -147,7 +147,7 @@ namespace test {
for (uint i=0; i<10000; ++i)
{
TrackID arbitrary(randStr(30));
ForkID arbitrary(randStr(30));
CHECK (0 < arbitrary.getHash());
CHECK (tID.getHash() != arbitrary.getHash());
tID = arbitrary;
@ -156,20 +156,20 @@ namespace test {
CHECK (tID.getIdent()== arbitrary.getIdent());
}
cout << showSizeof<TrackID>() << endl;
cout << showSizeof<ForkID>() << endl;
cout << showSizeof<BareEntryID>() << endl;
CHECK (sizeof(TrackID) == sizeof(BareEntryID));
CHECK (sizeof(TrackID) == sizeof(lumiera_uid) + sizeof(void*));
CHECK (sizeof(ForkID) == sizeof(BareEntryID));
CHECK (sizeof(ForkID) == sizeof(lumiera_uid) + sizeof(void*));
}
void
checkComparisions ()
{
TrackID tID1("a1");
TrackID tID2("a1");
TrackID tID3("a2");
TrackID tID4("b");
ForkID tID1("a1");
ForkID tID2("a1");
ForkID tID3("a2");
ForkID tID4("b");
CHECK (tID1 == tID2);
CHECK (tID2 < tID3);
@ -182,7 +182,7 @@ namespace test {
CHECK (tID4 >= tID3);
CHECK (tID4 > tID3);
TrackID trackID1, trackID2;
ForkID trackID1, trackID2;
CHECK (trackID1 < trackID2); // auto generated IDs are prefix + running counter
}
@ -199,8 +199,8 @@ namespace test {
void
checkErasure ()
{
TrackID tID("suspicious");
ClipID cID("suspicious");
ForkID tID("suspicious");
ClipID cID("suspicious");
CHECK (tID.getHash() != cID.getHash());
CHECK (tID.getSym() == cID.getSym());
@ -213,20 +213,20 @@ namespace test {
CHECK (bIDt.getSym() == bIDc.getSym());
CHECK ("suspicious" == bIDc.getSym());
using mobject::session::Track;
using mobject::session::Fork;
using mobject::session::Clip;
TrackID tIDnew = bIDt.recast<Track>();
ClipID cIDnew = bIDc.recast<Clip>();
ForkID tIDnew = bIDt.recast<Fork>();
ClipID cIDnew = bIDc.recast<Clip>();
CHECK (tIDnew == tID);
CHECK (cIDnew == cID);
VERIFY_ERROR (WRONG_TYPE, bIDt.recast<Clip>());
VERIFY_ERROR (WRONG_TYPE, bIDc.recast<Track>());
VERIFY_ERROR (WRONG_TYPE, bIDc.recast<Fork>());
VERIFY_ERROR (WRONG_TYPE, bIDc.recast<Dummy>());
VERIFY_ERROR (WRONG_TYPE, bIDt.recast<Dummy>());
CHECK (tID == TrackID::recast (bIDt)); // equivalent static API on typed subclass
VERIFY_ERROR (WRONG_TYPE, TrackID::recast(bIDc));
CHECK (tID == ForkID::recast (bIDt)); // equivalent static API on typed subclass
VERIFY_ERROR (WRONG_TYPE, ForkID::recast(bIDc));
VERIFY_ERROR (WRONG_TYPE, ClipID::recast(bIDt));
VERIFY_ERROR (WRONG_TYPE, DummyID::recast(bIDc));
VERIFY_ERROR (WRONG_TYPE, DummyID::recast(bIDt));
@ -240,10 +240,10 @@ namespace test {
CHECK (cID != bIDt_copy);
CHECK (tID == bIDt_copy);
CHECK (bIDt == TrackID ("suspicious"));
CHECK (bIDt == ForkID ("suspicious"));
CHECK (bIDt != ClipID ("suspicious"));
CHECK (bIDc == ClipID ("suspicious"));
CHECK (TrackID ("suspicious") != ClipID ("suspicious"));
CHECK (ForkID ("suspicious") != ClipID ("suspicious"));
}

View file

@ -74,7 +74,7 @@ namespace test {
// using the Placement interface
// TODO: how to handle insufficiently determinated Placement? Throw?
FixedLocation & fixloc = pc.chain (Time(0,1)); // TODO: the track??
FixedLocation & fixloc = pc.chain (Time(0,1)); // TODO: the fork??
ExplicitPlacement expla = pc.resolve();
CHECK (expla.time == Time(0,1));
CHECK (!expla.chain.isOverdetermined());

View file

@ -68,7 +68,7 @@ namespace test {
/***************************************************************************//**
* @test perform the most important structural modifications on a session and
* verify they're carried out properly.
* - attaching tracks
* - attaching forks ("tracks")
* - adding clips
*
*
@ -84,7 +84,7 @@ namespace test {
Session::current.reset();
CHECK (Session::current.isUp());
addTracks();
addForks();
addObjects();
removeParts();
@ -93,7 +93,7 @@ namespace test {
void
addTracks()
addForks()
{
PSess sess = Session::current;
CHECK (sess->isValid());
@ -102,44 +102,44 @@ namespace test {
CHECK (seq);
#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #499
RTrack track1 = seq->attachTrack();
RTrack track2 = seq->attachTrack("track-2");
RTrack track21 = seq->attachTrack("track-2.1", track2);
RTrack track22 = seq->attachTrack("track-2.2", "track-2");
RFork fork1 = seq->attachFork();
RFork fork2 = seq->attachFork("fork-2");
RFork fork21 = seq->attachFork("fork-2.1", fork2);
RFork fork22 = seq->attachFork("fork-2.2", "fork-2");
QueryFocus& focus = sess->focus();
CHECK (track22 == focus.getObject());
CHECK (fork22 == focus.getObject());
RTrack track3 = seq->attachTrack("track-3", "root");
CHECK (track3 == focus.getObject());
RFork fork3 = seq->attachFork("fork-3", "root");
CHECK (fork3 == focus.getObject());
RTrack track31 = sess->attach(
asset::Struct::retrieve (Query<asset::Track> ("id(track31)")));
RFork fork31 = sess->attach(
asset::Struct::retrieve (Query<asset::????> ("id(fork31)"))); ////TODO broken: we don't use a dedicated Fork asset anymore. It's just an EntryID<Fork>
CHECK (track31 == focus.getObject());
RTrack rootTrack = seq->rootTrack();
CHECK (3 == rootTrack->subTracks.size());
CHECK (track1 == rootTrack->subTracks[0]);
CHECK (track2 == rootTrack->subTracks[1]);
CHECK (track3 == rootTrack->subTracks[2]);
CHECK (0 == track1->subTracks.size());
CHECK (2 == track2->subTracks.size());
CHECK (track21 == track2->subTracks[0]);
CHECK (track22 == track2->subTracks[1]);
CHECK (1 == track3->subTracks.size());
CHECK (track21 == track3->subTracks[0]);
CHECK (fork31 == focus.getObject());
RFork rootFork = seq->rootFork();
CHECK (3 == rootFork->subForks.size());
CHECK (fork1 == rootFork->subForks[0]);
CHECK (fork2 == rootFork->subForks[1]);
CHECK (fork3 == rootFork->subForks[2]);
CHECK (0 == fork1->subForks.size());
CHECK (2 == fork2->subForks.size());
CHECK (fork21 == fork2->subForks[0]);
CHECK (fork22 == fork2->subForks[1]);
CHECK (1 == fork3->subForks.size());
CHECK (fork21 == fork3->subForks[0]);
set<RTrack> allTracks;
allTracks.insert(track1);
allTracks.insert(track2);
allTracks.insert(track21);
allTracks.insert(track22);
allTracks.insert(track3);
allTracks.insert(track31);
set<RFork> allForks;
allForks.insert(fork1);
allForks.insert(fork2);
allForks.insert(fork21);
allForks.insert(fork22);
allForks.insert(fork3);
allForks.insert(fork31);
// verify we indeed covered all tracks known to the session....
CHECK (and_all (sess->all<Track>(), contains, ref(allTracks), _1 ));
// verify we indeed covered all forks known to the session....
CHECK (and_all (sess->all<Fork>(), contains, ref(allForks), _1 ));
#endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #499
}
@ -152,18 +152,18 @@ namespace test {
#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #499
QueryFocus& focus = sess->focus();
CHECK (focus.getObject().isCompatible<session::Track>());
CHECK (focus.getObject().isCompatible<session::Fork>());
RClip clip1 = sess->attach (TestClip::create());
RTrack track31 = clip.getParent();
CHECK (track31);
CHECK ("track31" == track31->getNameID());
RTrack fork31 = clip.getParent();
CHECK (fork31);
CHECK ("fork31" == fork31->getNameID());
CHECK (1 == track31->clips.size());
CHECK (clip1 == track31->clips[0]);
CHECK (1 == fork31->clips.size());
CHECK (clip1 == fork31->clips[0]);
RClip clip2 = track31.attach (TestClip::create());
RClip clip3 = track31.attach (clip1); // creates a clone instance
RClip clip2 = fork31.attach (TestClip::create());
RClip clip3 = fork31.attach (clip1); // creates a clone instance
CHECK (clip1); CHECK (clip2); CHECK (clip3);
CHECK (clip1 != clip2);
@ -176,20 +176,20 @@ namespace test {
CHECK (isEquivalentPlacement (clip2, clip3));
CHECK (isEquivalentPlacement (clip1, clip3));
RTrack track2 = sess->sequences[0]
RTrack fork2 = sess->sequences[0]
->rootTrack()
->subTracks[1];
RClip clip4 = track2.attach (TestClip::create());
RClip clip4 = fork2.attach (TestClip::create());
// now verify structure built up thus far
CHECK (focus.getObject() == track2); // focus follows point-of-mutation
CHECK (focus.getObject() == fork2); // focus follows point-of-mutation
CHECK (focus.contains (clip4));
CHECK (!focus.contains (clip1));
CHECK (!focus.contains (clip2));
CHECK (!focus.contains (clip3));
focus.attach (track31);
CHECK (focus.getObject() == track31);
focus.attach (fork31);
CHECK (focus.getObject() == fork31);
CHECK (focus.contains (clip1));
CHECK (focus.contains (clip2));
CHECK (focus.contains (clip3));
@ -207,12 +207,12 @@ namespace test {
CHECK (!focus.hasChild (clip4));
focus.attach (sess->sequences[0]->rootTrack()->subTracks[2]->subTracks[0]); // train wreck. Don't try it at home!
CHECK (focus.getObject() == track31); // (this test is an exception, as we know the structure precisely
CHECK (focus.getObject() == fork31); // (this test is an exception, as we know the structure precisely
// production code should always discover one level a time)
CHECK ( focus.hasChild (clip1));
CHECK ( focus.hasChild (clip2));
CHECK ( focus.hasChild (clip3));
CHECK (!focus.hasChild (clip4)); // ...because this one is on track2, not track31
CHECK (!focus.hasChild (clip4)); // ...because this one is on fork2, not fork31
#endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #499
}
@ -224,10 +224,10 @@ namespace test {
PSess sess = Session::current;
CHECK (sess->isValid());
RTrack track31 = sess->sequences[0]->rootTrack()->subTracks[2]->subTracks[0];
CHECK (track31);
CHECK (3 == track31->clips.size());
RClip clip2 = track31->clips[1];
RTrack fork31 = sess->sequences[0]->rootTrack()->subTracks[2]->subTracks[0];
CHECK (fork31);
CHECK (3 == fork31->clips.size());
RClip clip2 = fork31->clips[1];
QueryFocus& focus = sess->focus();
focus.reset(); // navigate to root
@ -238,12 +238,12 @@ namespace test {
CHECK (!clip2);
CHECK (!focus.contains (clip2));
CHECK (2 == track31->clips.size());
CHECK (clip2 != track31->clips[1]);
CHECK (2 == fork31->clips.size());
CHECK (clip2 != fork31->clips[1]);
CHECK (focus.getObject() == track31); // focus follows point-of-mutation
CHECK (focus.getObject() == fork31); // focus follows point-of-mutation
// Using the query-focus to explore the contents of this current object (track31)
// Using the query-focus to explore the contents of this current object (fork31)
ScopeQuery<Clip>::iterator discoverClips = focus.explore<Clip>();
CHECK (discoverClips);
RClip clip1 = *discoverClips;
@ -252,48 +252,48 @@ namespace test {
++discoverClips;
CHECK (!discoverClips);
CHECK (track31->clips[0] == clip1);
CHECK (track31->clips[1] == clip3);
CHECK (fork31->clips[0] == clip1);
CHECK (fork31->clips[1] == clip3);
/* please note: the clips aren't discovered in any defined order (hashtable!)
* especially, the order doesn't match the order of addition!
* thus, what's called clip1 here may or may not be
* what we called clip1 in addObjects()
*/
RTrack track3 = track31.getParent();
RTrack fork3 = fork31.getParent();
focus.reset(); // back to root
CHECK (focus.contains (clip1));
CHECK (focus.contains (clip3));
CHECK (focus.contains (track3));
CHECK (focus.contains (track31));
CHECK (focus.contains (fork3));
CHECK (focus.contains (fork31));
CHECK (clip1);
CHECK (clip3);
CHECK (track3);
CHECK (track31);
CHECK (fork3);
CHECK (fork31);
sess->purge (track31);
sess->purge (fork31);
CHECK (focus.getObject() == track3);
CHECK (focus.getObject() == fork3);
focus.reset();
CHECK ( focus.contains (track3));
CHECK ( focus.contains (fork3));
CHECK (!focus.contains (clip1));
CHECK (!focus.contains (clip3));
CHECK (!focus.contains (track31));
CHECK (!focus.contains (fork31));
CHECK (!clip1);
CHECK (!clip3);
CHECK (!track31);
CHECK (track3);
CHECK (!fork31);
CHECK (fork3);
track3.purge();
CHECK (!track3);
fork3.purge();
CHECK (!fork3);
PSequence aSequence = sess->sequences[0];
CHECK (focus.getObject() == aSequence->rootTrack());
CHECK (2 == aSequece->rootTrack()->subTracks.size());
CHECK ( contains (sess->sequences, aSequence));
aSequence->rootTrack().purge(); // automatically kills the sequence as well (sequence == facade to the root track)
aSequence->rootFork().purge(); // automatically kills the sequence as well (sequence == facade to the fork root)
CHECK (!contains (sess->sequences, aSequence));
CHECK (0 == sess->sequences.size());
CHECK (0 == sess->timelines.size()); // killing the sequence also cascaded to the timeline and binding

View file

@ -53,9 +53,9 @@ namespace test {
* @test access the current session and verify the correct
* structure of the most important components: The session
* contains an Sequence, we can get at the Fixture, we have at least
* one Track and the corresponding Track asset is available.
* one Fork and the corresponding Fork-ID (asset) can be retrieved.
* @todo define further criteria to be checked
* @todo implement Sequence, Fixture, Session#rebuildFixture, asset::Track
* @todo implement Sequence, Fixture, Session#rebuildFixture, handling of EntryID<Fork>
*/
class SessionStructure_test : public Test
{
@ -111,24 +111,24 @@ namespace test {
//TODO
//verify default sequence
RTrack rootTrack = seq->rootTrack();
CHECK (rootTrack->isValid());
CHECK (Time(0) == rootTrack->length());
CHECK (0 == rootTrack->subTracks.size());
CHECK (0 == rootTrack->clips.size());
RFork rootFork = seq->rootFork();
CHECK (rootFork->isValid());
CHECK (Time(0) == rootFork->length());
CHECK (0 == rootFork->subForks.size());
CHECK (0 == rootFork->clips.size());
//TODO verify the output slots of the sequence
//TODO now use the generic query API to discover the same structure.
CHECK (til == *(sess->all<Timeline>()));
CHECK (seq == *(sess->all<Sequence>()));
CHECK (rootTrack == *(sess->all<Track>()));
CHECK (rootFork == *(sess->all<Fork>()));
CHECK (! sess->all<Clip>());
QueryFocus& focus = sess->focus();
CHECK (rootTrack == focus.getObject());
CHECK (rootFork == focus.getObject());
focus.navigate (til);
CHECK (til.getBinding() == focus.getObject());
CHECK (rootTrack == *(focus.children()));
CHECK (rootFork == *(focus.children()));
#endif //////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #546
}
};

View file

@ -278,24 +278,24 @@ namespace test {
uint num_sequences = sess->sequences.size();
#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #499
RTrack someTrack = sess->sequences[0]->getTracks();
RFork someFork = sess->sequences[0]->getForks();
// indirectly cause a new sequence to come to life...
RTrack newTrack = sess->getRoot().attach (someTrack); // attach new Placement<Track> to root scope
CHECK (newTrack != someTrack); // it's a new placement
RFork newFork = sess->getRoot().attach (someFork); // attach new Placement<Fork> to root scope
CHECK (newFork != someFork); // it's a new placement
CHECK (num_sequences + 1 == sess->sequences.size()); // this root-attachment created a new sequence by sideeffect
PSequence aSequence = sess->sequences[num_sequences];
CHECK (newTrack == aSequence->getTracks());
CHECK (newTrack);
CHECK (someTrack);
CHECK (newFork == aSequence->getForks());
CHECK (newFork);
CHECK (someFork);
CHECK (assetM.known (aSequence->getID()));
//TODO maybe even bind it into a new timeline. Then verify this new timeline gets removed alongside with the sequence below!
// just moving the new track away from root position
// just moving the new fork away from root position
// causes the sequence to disappear
newTrack.getPlacement().chain (someTrack, Time(20)); /////////////////TICKET #555 does moving by placement really work this way??
newFork.getPlacement().chain (someFork, Time(20)); /////////////////TICKET #555 does moving by placement really work this way??
//TODO 3/2010 not finally decided *if* we want this behaviour
//TODO how to verify the changed placement??
@ -304,8 +304,8 @@ namespace test {
CHECK (num_sequences == sess->sequences.size());
CHECK (!contains (sess->sequences, aSequence));
CHECK (someTrack);
CHECK (newTrack);
CHECK (someFork);
CHECK (newFork);
#endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #499
}
};