change Timeline and Sequence to be structural assets

This commit is contained in:
Fischlurch 2010-02-28 07:17:12 +01:00
parent d4b66a42ad
commit c2cbe4c9e8
13 changed files with 374 additions and 166 deletions

View file

@ -39,6 +39,7 @@
** @see lumiera::Query
** @see mobject::session::DefsManager
** @see asset::StructFactory
** @see fake-configrules.hpp currently used dummy-implementation
**
*/

View file

@ -21,19 +21,18 @@
* *****************************************************/
#include "proc/mobject/session/sequence.hpp"
#include "asset/sequence.hpp"
//#include "proc/mobject/session/track.hpp"
//#include "proc/mobject/placement.hpp"
//#include "proc/mobject/session/mobjectfactory.hpp"
//#include "proc/asset/track.hpp"
namespace mobject {
namespace session {
namespace asset {
/** create an empty default configured Sequence */
Sequence::Sequence ()
Sequence::Sequence (const Asset::Ident& idi)
// : track (makeDefaultTrack ())
// , clips (0)
{
@ -45,4 +44,4 @@ namespace session {
}} // namespace mobject::session
} // namespace asset

View file

@ -0,0 +1,85 @@
/*
SEQUENCE.hpp - Compound of MObjects placed on a track tree. Building block of the Session
Copyright (C) Lumiera.org
2009, Hermann Vosseler <Ichthyostega@web.de>
This program 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.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/** @file sequence.hpp
** Structural building block of the session: a sequence of clips.
** 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.
**
** 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,
** as opposed to the timeline, which manages output and frame quantisation,
** but not the track structure.
**
** 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::create(Query<Sequence> ("id(theName)."))
** Additionally, a specific root track may be requested: \c "id(theName),rootTrack(trackID)."
**
** @see Session
** @see StructFactory
**
*/
#ifndef ASSET_SEQUENCE_H
#define ASSET_SEQUENCE_H
#include "proc/asset/struct.hpp"
//#include "proc/mobject/mobject.hpp"
//#include "proc/mobject/placement.hpp"
//#include <vector>
//#include <string>
//using std::vector;
//using std::string;
namespace asset {
/**
* TODO type comment
*/
class Sequence
: public Struct
{
protected:
Sequence (const Asset::Ident& idi);
friend class StructFactoryImpl;
};
typedef P<Sequence> PSequence;
///////////////////////////TODO currently just fleshing the API
} // namespace asset
#endif

View file

@ -1,8 +1,8 @@
/*
STRUCTFACTORYIMPL.hpp - crating structural assets (impl details)
STRUCT-FACTORY-IMPL.hpp - crating structural assets (impl details)
Copyright (C) Lumiera.org
2008, Hermann Vosseler <Ichthyostega@web.de>
2008-2010, Hermann Vosseler <Ichthyostega@web.de>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@ -21,8 +21,10 @@
*/
/** @file structfactoryimpl.hpp
/** @file struct-factory-impl.hpp
** Private implementation details of creating various structural assets.
** Details how to fabricate specific kinds of structural assets, based
** on capability informations encoded into a query (goal).
** @internal to be used by struct.cpp
**
** @see ConfigQuery
@ -30,8 +32,8 @@
*/
#ifndef ASSET_STRUCTFACTORYIMPL_H
#define ASSET_STRUCTFACTORYIMPL_H
#ifndef ASSET_STRUCT_FACTORY_IMPL_H
#define ASSET_STRUCT_FACTORY_IMPL_H
#include "proc/mobject/session.hpp"
@ -51,8 +53,7 @@ using asset::Query;
using lumiera::query::LUMIERA_ERROR_CAPABILITY_QUERY;
using lumiera::query::extractID;
namespace asset
{
namespace asset {
template<class STRU>
@ -85,7 +86,7 @@ namespace asset
*/
class StructFactoryImpl
{
/** @internal derive a sensible asset ident tuple when creating
* structural asset instances based on a capability query
*/
@ -114,8 +115,8 @@ namespace asset
return Asset::Ident (name, cat );
}
@ -130,7 +131,8 @@ namespace asset
/** make a new structural asset instance.
* default/fallback impl. throws.
* @warning default/fallback implementation just throws.
* @todo a real implementation using a resolution engine.
*/
template<class STRU>
STRU* fabricate (const Query<STRU>& caps)
@ -143,13 +145,13 @@ namespace asset
/* ============= specialisations =========================== */
template<>
Track*
StructFactoryImpl::fabricate (const Query<Track>& caps)
{
TODO ("actually extract properties/capabilities from the query...");
TODO ("make sure AssetManager detects duplicates (currently 4/08 it doesn't)");
TODO ("make sure AssetManager detects duplicates (currently 4/08 it doesn't)"); /////////////TICKET #102
return new Track (createIdent (caps));
}

View file

@ -28,7 +28,7 @@
#include "proc/asset/pipe.hpp"
#include "common/configrules.hpp"
#include "proc/asset/structfactoryimpl.hpp"
#include "proc/asset/struct-factory-impl.hpp"
#include "lib/util.hpp"
#include "include/logging.h"
@ -45,11 +45,10 @@ using lumiera::ConfigRules;
using util::contains;
namespace asset
{
namespace asset {
/****** NOTE: not really implemented yet. What follows is partially a hack to build simple tests *******/
/** query the currently defined properties of this
@ -67,7 +66,7 @@ namespace asset
{
return lumiera::query::extractID ("pipe", this->ident.name);
}
/** storage for the static StructFactory instance */
@ -85,6 +84,8 @@ namespace asset
* First tries to resolve the asset by issuing an capability query.
* If unsuccessful, use some internally specialised ctor call.
* @todo work out the struct asset naming scheme!
* @todo for now we're using a faked config query, just pulling preconfigured
* hardwired answers from a table. Should be replaced by a real resolution engine.
* @return an Struct smart ptr linked to the internally registered smart ptr
* created as a side effect of calling the concrete Struct subclass ctor.
*/
@ -126,9 +127,9 @@ namespace asset
Pipe* pP = impl_->fabricate (Query<Pipe> (descriptor % pipeID % streamID));
return AssetManager::instance().wrap (*pP);
}
} // namespace asset
@ -149,6 +150,6 @@ namespace asset {
template P<Pipe> StructFactory::operator() (const Query<Pipe>& query);
template P<Track> StructFactory::operator() (const Query<Track>& query);
template PProcPatt StructFactory::operator() (const Query<const ProcPatt>& query);
} // namespace asset

View file

@ -75,13 +75,15 @@ namespace asset {
/**
* key abstraction: structural asset
* @todo just a stub, have to figure out what a asset::Struct is
* @todo WIP as of 1/2010. Need to integrate Sequences and Timelines
*/
class Struct : public Asset
{
public:
static StructFactory create;
virtual const ID<Struct>& getID() const ///< @return ID of kind asset::Struct
virtual const ID<Struct>&
getID() const ///< @return ID of kind asset::Struct
{
return static_cast<const ID<Struct>& > (Asset::getID());
}
@ -97,7 +99,7 @@ namespace asset {
// definition of ID<Struct> ctors is possible now,
// after providing full definition of class Proc
// after providing full definition of class Struct
inline ID<Struct>::ID(size_t id) : ID<Asset> (id) {};
inline ID<Struct>::ID(const Struct& stru) : ID<Asset> (stru.getID()) {};
@ -123,7 +125,7 @@ namespace asset {
typedef P<asset::Struct> PType;
template<class STRU>
P<STRU> operator() (const Query<STRU>& query); ////////////TODO actually do something sensible here
P<STRU> operator() (const Query<STRU>& query); ////////////TODO for now we're just using a fake config query with preconfigured hardwired answers
P<Pipe> operator() (string pipeID, string streamID);

View file

@ -21,19 +21,18 @@
* *****************************************************/
#include "proc/mobject/session/timeline.hpp"
#include "proc/asset/timeline.hpp"
//#include "proc/mobject/session/track.hpp"
//#include "proc/mobject/placement.hpp"
//#include "proc/mobject/session/mobjectfactory.hpp"
//#include "proc/asset/track.hpp"
namespace mobject {
namespace session {
namespace asset {
/** TODO??? */
Timeline::Timeline ()
Timeline::Timeline (const Asset::Ident& idi)
// : track (makeDefaultTrack ())
// , clips (0)
{
@ -45,4 +44,4 @@ namespace session {
}} // namespace mobject::session
} // namespace asset

View file

@ -0,0 +1,88 @@
/*
TIMELINE.hpp - independent top-level element of the Session
Copyright (C) Lumiera.org
2009, Hermann Vosseler <Ichthyostega@web.de>
This program 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.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/** @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: \c Struct::create(Query<Timeline> ("id(theName)."))
** Additionally, the binding to a specific sequence may be established alongside:
** \c "timeline(theTimelineName),bindSequence(theTimelineName,sequenceID)."
**
** @see Session
** @see Sequence
** @see StructFactory
**
*/
#ifndef ASSET_TIMELINE_H
#define ASSET_TIMELINE_H
#include "proc/asset/struct.hpp"
//#include "proc/mobject/mobject.hpp"
//#include "proc/mobject/placement.hpp"
//#include <vector>
//#include <string>
//using std::vector;
//using std::string;
namespace asset {
/**
* TODO type comment
*/
class Timeline
: public Struct
{
protected:
Timeline (const Asset::Ident& idi);
friend class StructFactoryImpl;
};
typedef P<Timeline> PTimeline;
///////////////////////////TODO currently just fleshing the API
} // namespace asset
#endif

View file

@ -1,55 +0,0 @@
/*
SEQUENCE.hpp - Compound of MObjects placed on a track tree. Building block of the Session
Copyright (C) Lumiera.org
2009, Hermann Vosseler <Ichthyostega@web.de>
This program 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.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef MOBJECT_SESSION_SEQUENCE_H
#define MOBJECT_SESSION_SEQUENCE_H
//#include "proc/mobject/mobject.hpp"
//#include "proc/mobject/placement.hpp"
//#include <vector>
//#include <string>
//using std::vector;
//using std::string;
namespace mobject {
namespace session {
/**
* TODO type comment
*/
class Sequence
{
public:
Sequence();
};
///////////////////////////TODO currently just fleshing the API
}} // namespace mobject::session
#endif

View file

@ -1,55 +0,0 @@
/*
TIMELINE.hpp - independent top-level element of the Session
Copyright (C) Lumiera.org
2009, Hermann Vosseler <Ichthyostega@web.de>
This program 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.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef MOBJECT_SESSION_TIMELINE_H
#define MOBJECT_SESSION_TIMELINE_H
//#include "proc/mobject/mobject.hpp"
//#include "proc/mobject/placement.hpp"
//#include <vector>
//#include <string>
//using std::vector;
//using std::string;
namespace mobject {
namespace session {
/**
* TODO type comment
*/
class Timeline
{
public:
Timeline();
};
///////////////////////////TODO currently just fleshing the API
}} // namespace mobject::session
#endif

View file

@ -214,3 +214,7 @@ END
PLANNED "SessionStructure_test" SessionStructure_test <<END
END
PLANNED "Handling of Timelines and Sequences" TimelineSequenceHandling_test <<END
END

View file

@ -0,0 +1,121 @@
/*
TimelineSequenceHandling(Test) - managing the top level session facade objects
Copyright (C) Lumiera.org
2008-2010, Hermann Vosseler <Ichthyostega@web.de>
This program 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.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *****************************************************/
#include "lib/test/run.hpp"
#include "proc/mobject/session.hpp"
//#include "proc/mobject/session/fixture.hpp" // TODO only temporarily needed
#include "proc/assetmanager.hpp"
#include "lib/lumitime.hpp"
#include "lib/util.hpp"
#include <iostream>
using util::isSameObject;
using std::string;
using std::cout;
namespace mobject {
namespace session {
namespace test {
using proc_interface::AssetManager;
using proc_interface::PAsset;
using lumiera::Time;
/********************************************************************************
* @test verify retrieval and instance management of the top level facade objects
* as integrated with the session and high-level model.
*
* @see session-structure-test.cpp
* @see Timeline
* @see Sequence
* @see Session
*/
class TimelineSequenceHandling_test : public Test
{
virtual void
run (Arg)
{
Session::current.reset();
ASSERT (Session::current.isUp());
verify_retrieval();
}
void
verify_retrieval()
{
PSess sess = Session::current;
ASSERT (sess->isValid());
ASSERT (0 < sess->timelines.size());
Timeline& til = sess->timelines[0];
ASSERT (0 < sess->sequences.size());
Sequence& seq = sess->sequences[0];
ASSERT (isSameObject (seq, til.getSequence()));
//verify default timeline
Axis& axis = til.getAxis();
ASSERT (Time(0) == axis.origin());
ASSERT (Time(0) == til.length()); ////////////////////////TICKET #177
//verify global pipes
//TODO
//verify default sequence
Track rootTrack = seq.rootTrack();
ASSERT (rootTrack->isValid());
ASSERT (Time(0) == rootTrack->length());
ASSERT (0 == rootTrack->subTracks.size());
ASSERT (0 == rootTrack->clips.size());
//TODO verify the output slots of the sequence
//TODO now use the generic query API to discover the same structure.
ASSERT (til == *(sess->all<Timeline>()));
ASSERT (seq == *(sess->all<Sequence>()));
ASSERT (rootTrack == *(sess->all<Track>()));
ASSERT (! sess->all<Clip>());
QueryFocus& focus = sess->focus();
ASSERT (rootTrack == focus.getObject());
focus.navigate (til);
ASSERT (til.getBinding() == focus.getObject());
ASSERT (rootTrack == *(focus.children()));
}
};
/** Register this test class... */
LAUNCHER (TimelineSequenceHandling_test, "unit session");
}}} // namespace mobject::session::test

View file

@ -547,7 +547,7 @@ Even if the low-level memory manager(s) may use raw storage, we require that the
&amp;rarr; see MemoryManagement
</pre>
</div>
<div title="Asset" modifier="Ichthyostega" modified="200906071813" created="200708100337" tags="def classes img" changecount="17">
<div title="Asset" modifier="Ichthyostega" modified="201002272329" created="200708100337" tags="def classes img" changecount="18">
<pre>Asset management is a subsystem on its own. Assets are &quot;things&quot; that can be loaded into a session, like Media, Clips, Effects, Transitions. It is the &quot;bookkeeping view&quot;, while the Objects in the Session relate to the &quot;manipulation and process view&quot;. Some Assets can be //loaded// and a collection of Assets is saved with each Session. Besides, there is a collection of basic Assets always available by default.
The Assets are important reference points holding the information needed to access external resources. For example, an Clip asset can reference a Media asset, which in turn holds the external filename from which to get the media stream. For Effects, the situation is similar. Assets thus serve two quite distinct purposes. One is to load, list, group search and browse them, and to provide an entry point to create new or get at existing MObject in the Session, while the other purpose is to provide attribute and property informations to the inner parts of the engine, while at the same time isolating and decoupling them from environmental details.
@ -569,7 +569,7 @@ Some software component able to work on media data in the Lumiera Render engine
&amp;rarr; ProcAsset
!Structural Asset
Some of the building blocks providing the framework for the objects placed into the current Session. Notable examples are [[processing pipes|Pipe]] within the high-level-model, Viewer attachment points, Tracks, etc.
Some of the building blocks providing the framework for the objects placed into the current Session. Notable examples are [[processing pipes|Pipe]] within the high-level-model, Viewer attachment points, Tracks, Sequences, Timelines etc.
* __outward interface operations__ include...
* __inward interface operations__ include...
&amp;rarr; StructAsset {{red{to be defined}}}
@ -589,14 +589,20 @@ is how to implement the relationship between [[MObject]]s and Assets. Do we use
</pre>
</div>
<div title="AssetCreation" modifier="Ichthyostega" modified="200806030153" created="200709040307" tags="dynamic impl" changecount="3">
<div title="AssetCreation" modifier="Ichthyostega" modified="201002272321" created="200709040307" tags="dynamic impl" changecount="5">
<pre>Assets are created by a Factories returning smart pointers; the Asset creation is bound to specific use cases and //only available// for these specific situations. There is no generic Asset Factory.
For every Asset we generate a __Ident tuple__ and a long ID (hash) derived from this Ident tuple. The constructor of the abstract base class {{{Asset}}} takes care of this step and automatically registeres the new Asset object with the AssetManager. Typically, the factory methods for concrete Asset classes provide some shortcuts providing sensible default values for some of the Ident tuple data fields. They may take additional parameters &amp;mdash; for example the factory method for creating {{{asset::Media}}} takes a filename (and may at some point in the future aply &quot;magic&quot; based on examination of the file &amp;rarr; LoadingMedia)
Generally speaking, assets can be seen as the statical part or view of the session and model. They form a global scope and are tied to the [[model root|ModelRootMO]] &amp;mdash; which means, they're going to be serialised and de-serialised alongside with this model root scope. Especially the de-serialisation triggers (re)-creation of all assets associated with the session to be loaded.
{{red{TODO:}}} //there will be a special factory mechanism for this case, details pending definition as of 2/2010 //
</pre>
</div>
<div title="AssetManager" modifier="Ichthyostega" created="200709200300" changecount="1">
<pre>The Asset Manager provides an Interface to some internal Database holding all Assets in the current Session and System state. It may be a real Database at some point (and for the moment it's a Hashtable). Each [[Asset]] is registered automatically with the Asset Manager; it can be queried either by it's //identification tuple// or by it's unique ID.</pre>
<div title="AssetManager" modifier="Ichthyostega" modified="201002272324" created="200709200300" tags="def" changecount="2">
<pre>The Asset Manager provides an Interface to an internal Database holding all Assets in the current Session and System state. It may be a real Database at some point (and for the moment it's a Hashtable). Each [[Asset]] is registered automatically with the Asset Manager; it can be queried either by it's //identification tuple// or by it's unique ID.
Conceptually, assets belong to the [[global or root scope|ModelRootMO]] of the session data model. A mechanism for serialising and de-serialising all assets alongside with the session is planned as of 2/2010
</pre>
</div>
<div title="AttachedPlacementProblem" modifier="Ichthyostega" modified="200905310342" created="200801111305" tags="SessionLogic impl draft dynamic" changecount="17">
<pre>Placing an MObject relatively to another object such that it should be handled as //attached//&amp;nbsp; to the latter results in several design and implementation challenges. Actually, such an attachment creates a cluster of objects. The typical use case is that of an effect attached to a clip or processing pipe.
@ -4058,12 +4064,14 @@ A scope path is a sequence of scopes, where each scope is implemented by a Place
** clear a path (reset to default)
</pre>
</div>
<div title="Sequence" modifier="Ichthyostega" modified="201002010123" created="201001252327" tags="def" changecount="2">
<div title="Sequence" modifier="Ichthyostega" modified="201002270500" created="201001252327" tags="def" changecount="9">
<pre>A sequence is a collection of media objects, arranged onto a track tree. Sequences are the building blocks within the session. To be visible and editable, a session needs to be bound into a top-level [[Timeline]]. Alternatively, it may be used as a VirtualClip nested within another sequence.
The sequences within the session establish a //logical grouping//, allowing for lots of flexibility. Actually, we can have several sequences within one session, and these sequences can be linked together or not, they may be arranged in temporal order or may constitue a logical grouping of clips used simultanously in compositional work etc. Multiple sequences can use the same or different tracks, and tracks as well are only an organisational (grouping) device. But at any time, we have exactly one [[Fixture]], derived automatically from all sequences and containing the content actually to be rendered.
&amp;rarr; see considerations about [[the role of Tracks and Pipes in conjunction with the sequences|TrackPipeSequence]]
!!Implementation and lifecycle
Actually, sequences are façade objects to quite some extent, delegating the implementation of the exposed functionality to the relevant placements and ~MObjects within the model. But they're not completely shallow; each sequence has an distinguishable identity and may hold additional metadata. Thus, stressing this static aspect, sequences are implemented as MetaAsset {{red{TODO: ~StructAsset or ~MetaAsset??}}}, attached to the [[model root|ModelRootMO]] through the AssetManager, accessed and owned by refcounting smart-ptr.
</pre>
</div>
<div title="Session" modifier="Ichthyostega" modified="200911071800" created="200712100525" tags="def SessionLogic" changecount="8">
@ -4082,21 +4090,21 @@ The Session object is a singleton &amp;mdash; actually it is a »~PImpl«-Facade
&amp;rarr; see [[relation of timeline, sequences and objects|TimelineSequences]]
</pre>
</div>
<div title="SessionDataMem" modifier="Ichthyostega" modified="201001112310" created="200904252303" tags="impl design SessionLogic draft" changecount="4">
<div title="SessionDataMem" modifier="Ichthyostega" modified="201002270444" created="200904252303" tags="impl design SessionLogic draft" changecount="5">
<pre>The [[Session]] is interconnected with the GUI, the SessionStorage, [[Builder]] and the CommandHandling. The HighLevelModel is an conceptual view of the session. All these dependencies are isolated from the actual data layout in memory, but the latter is shaped by the intended interactions.
{{red{WIP...}}}Currently as of 5/09, this is an ongoing [[implementation and planning effort|PlanningSessionInMem]]
!Objects, Placements, References
Media objects are attached to the session by [[placements|Placement]]. A Placement within the session gets an distinguishable identity (&amp;rarr; ModelObjectIdentity) and behaves like being an instance of the attached object. Client code usually interacts with the compound of placement + ~MObject. In order to decouple this interaction from the actual implementation within the session, client code rather deals with //references.// These are implemented like a smart-ptr, but based on an opaque hash value, which is equivalent to the //object instance identity.//
&amp;rarr MObjectRef
&amp;rarr PlacementRef
&amp;rarr; MObjectRef
&amp;rarr; PlacementRef
!Index of placements attached to the session
For implementation, the HighLevelModel can be reduced to a compound of interconnected placements. These placement instances are owned and managed by the session; attaching a placement means copying it into the session, thereby creating a new placement-ID. A lookup mechanism for placements and placement relations (PlacementIndex) thus is the actual core of the session datastructure; the actual object instances are maintained by a pooling custom allocator ({{red{planned as of 1/10}}}).
For implementation, the HighLevelModel can be reduced to a compound of interconnected placements. These placement instances are owned and managed by the session; attaching a placement means copying it into the session, thereby creating a new placement-ID. A lookup mechanism for placements and placement relations (PlacementIndex) thus is the actual core of the session data structure; the actual object instances are maintained by a pooling custom allocator ({{red{planned as of 1/10}}}).
!Lifecycle
MObject lifetime is managed by reference counting; all placements and client side references to an MObject share ownership. The placement instances attached to the session are maintained by the index; thus, as long as an placement exists, the corresponding object automatically stays alive. A bare PlacementRef on the other hand doesn't guarantee anything about the referred placement; when dereferencting this reference token, the index is accessed to re-establish a connection to the object, if possible. The full-fledged MObjectRef is built on top of such a reference token and additionally incorporates a smart-ptr. For the client code this means, that holding a ref ensures existence of the object, while the //placement// of this object still can get removed from the session.
MObject lifetime is managed by reference counting; all placements and client side references to an MObject share ownership. The placement instances attached to the session are maintained by the index; thus, as long as an placement exists, the corresponding object automatically stays alive. Similarly, assets, as managed by shared-ptrs, stay alive when directly referenced, even after being dropped from the AssetManager. A bare PlacementRef on the other hand doesn't guarantee anything about the referred placement; when dereferencing this reference token, the index is accessed to re-establish a connection to the object, if possible. The full-fledged MObjectRef is built on top of such a reference token and additionally incorporates a smart-ptr. For the client code this means, that holding a ref ensures existence of the object, while the //placement// of this object still can get removed from the session.
</pre>
</div>
<div title="SessionInterface" modifier="Ichthyostega" modified="201002210435" created="200904242108" tags="SessionLogic GuiIntegration design draft discuss" changecount="35">
@ -4595,17 +4603,25 @@ Instead, we should try to just connect the various subsystems via Interfaces and
* to shield the rendering code of all complexities of thread communication and synchronization, we use the StateProxy
</pre>
</div>
<div title="StructAsset" modifier="Ichthyostega" modified="200906071813" created="200709221353" tags="def classes img" changecount="9">
<pre>Structural Assets are intended mainly for internal use, but the user should be able to see and query them. They are not &quot;loaded&quot; or &quot;created&quot; direcly, rather they //leap into existance // by creating or extending some other structures in the session, hence the name. Some of the structural Asset parametrisation can be modified to control of some aspects of the Proc Layer's (default) behaviour.
* [[Processing Patterns|ProcPatt]] encode information how to set up some parts of the render network to be created automatically: for example, when building a clip, we use the processing pattern how to decode and preprocess the actual media data.
* [[Tracks|Track]] are one of the dimensions used for organizing the session data. They serve as an Anchor to attach parametrisation of output pipe, overlay mode etc. By [[placing|Placement]] to a track, some media object inherits placement properties from this track.
* [[Pipes|Pipe]] form &amp;mdash; at least as visible to the user &amp;mdash; the basic building block of the render network, because the latter appears to be a collection of interconnected processing pipelines. (this is the //outward view; // in fact the render network consists of [[nodes|ProcNode]] and is [[built|Builder]] from the Pipes, clips, effects...)
[&gt;img[Asset Classess|uml/fig131205.png]]
<div title="StructAsset" modifier="Ichthyostega" modified="201002280044" created="200709221353" tags="def classes img" changecount="18">
<pre>Structural Assets are intended mainly for internal use, but the user should be able to see and query them. They are not &quot;loaded&quot; or &quot;created&quot; directly, rather they //leap into existence // by creating or extending some other structures in the session, hence the name. Some of the structural Asset parametrisation can be modified to exert control on some aspects of the Proc Layer's (default) behaviour.
* [[Processing Patterns|ProcPatt]] encode information how to set up some parts of the render network to be created automatically: for example, when building a clip, we use the processing pattern how to decode and pre-process the actual media data.
* [[Tracks|Track]] are one of the dimensions used for organizing the session data. They serve as an Anchor to attach parametrisation of output pipe, overlay mode etc. By [[placing|Placement]] to a track, a media object inherits placement properties from this track.
* [[Pipes|Pipe]] form &amp;mdash; at least as visible to the user &amp;mdash; the basic building block of the render network, because the latter appears to be a collection of interconnected processing pipelines. (this is the //outward view; // in fact the render network consists of [[nodes|ProcNode]] and is [[built|Builder]] from the Pipes, clips, effects...)[&gt;img[Asset Classess|uml/fig131205.png]]
* [[Sequence]] assets act as a façade to the fundamental compound building blocks within the model, a sequence being a collection of clips placed onto a tree of tracks. Sequences, as well as the top-level tracks enclosed will be created automatically on demand. Of course you may create them deliberately. Without binding it to a timeline or meta-clip, a sequence remains invisible.
* [[Timeline]] assets are the top level structures to access the model; similar to the sequences, they act as façade to relevant parts of the model (BindingMO) and will be created on demand, alongside with a new session if necessary, bound to the new timeline. Likewise, they can be referred by their name-ID
!naming scheme
The Asset name field of structural Assets utilizes a special naming scheme, which allows to derive the name based on the capabilities of the structural asset. For example, by default all media clips with a given media stream type (e.g. H264) will use the same [[processing Pattern|ProcPatt]] for rendering. {{red{todo: work out the details of this naming scheme??}}}
!querying
Structural assets can be queried by specifying the specific type (Pipe, Track, ProcPatt) and a query goal, which means in the current implementation just querying for some predicate defined with the structural asset. For example, you can {{{Query&lt;Pipe&gt; (&quot;stream(mpeg)&quot;)}}}, yieliding the first pipe found which declares to have stream type &quot;mpeg&quot;</pre>
Structural assets can be queried by specifying the specific type (Pipe, Track, ProcPatt) and a query goal. For example, you can {{{Query&lt;Pipe&gt; (&quot;stream(mpeg)&quot;)}}}, yielding the first pipe found which declares to have stream type &quot;mpeg&quot;. The access point for this querying facility is on the ~StructFactory, which (as usual within Lumiera) can be invoked as {{{Struct::create(Query&lt;...&gt; ...}}}. Given such a query, first an attempt is made to satisfy it by retrieving an existing object (which might bind variables as a side effect). On failure, a new structural asset of the requested type will be created to satisfy the given goal.
{{red{Note:}}} in the current implementation no real resolution engine is used (as of 2/2010); rather, we're just able to retrieve a hard-wired answer or create a new asset, simply pattern matching on parts of the query.
&amp;rarr; [[Assets in general|Asset]]
</pre>
</div>
<div title="StyleSheet" modifier="Ichthyostega" modified="200709040043" created="200701131624" tags="MPTWTheme excludeMissing" server.type="file" server.host="file:///home/ct/.homepage/home.html" server.page.revision="200706090017" changecount="14">
<pre>/*{{{*/
@ -5778,7 +5794,7 @@ function addKeyDownHandlers(e)
<div title="TiddlyWiki" modifier="Ichthyostega" created="200706220430" changecount="1">
<pre>http://tiddlywiki.com/</pre>
</div>
<div title="Timeline" modifier="Ichthyostega" modified="201002170358" created="200706250721" tags="def" changecount="9">
<div title="Timeline" modifier="Ichthyostega" modified="201002270504" created="200706250721" tags="def" changecount="11">
<pre>Timeline is the top level element within the [[Session (Project)|Session]]. It is visible within a //timeline view// in the GUI and represents the effective (resulting) arrangement of media objects, to be rendered for output or viewed in a Monitor (viewer window). A timeline is comprised of:
* a time axis in abolute time ({{red{WIP 1/10}}}: not clear if this is an entity or just a conceptual definition)
* a PlayControler
@ -5791,7 +5807,7 @@ Within the Project, there may be ''multiple timelines'', to be viewed and render
''Note'': in early drafts of the design (2007) there was an entity called &quot;Timeline&quot; within the [[Fixture]]. This entity seems superfluous and has been dropped. It never got any relevance in existing code and at most was used in some code comments.
!Façade and implementation
Actually, Timeline is both an interface and acts as façade. Its an interface, because we'll need &quot;timeline views&quot; ({{red{really? is that a reason to create a hierarchy right here, or shouldn't that be rather conceptual?}}}. It is a façade to the raw structures in the model, in this case a {{{Placement&lt;BindingMO&gt;}}} attached immediately below the [[root scope|ModelRootMO]].
Actually, Timeline is both an interface and acts as façade. Its an interface, because we'll need &quot;timeline views&quot; ({{red{really? is that a reason to create a hierarchy right here, or shouldn't that be rather conceptual?}}}. It is a façade to the raw structures in the model, in this case a {{{Placement&lt;BindingMO&gt;}}} attached immediately below the [[root scope|ModelRootMO]]. The implementation of the timeline(s) is maintained as StructAsset {{red{Really? or should this be a ~MetaAsset??}}} within the AssetManager, managed by shared-ptr.
</pre>
</div>
<div title="TimelineSequences" modifier="Ichthyostega" modified="200811022211" created="200811011836" tags="design draft discuss img" changecount="14">