2010-03-09 06:31:07 +01:00
|
|
|
/*
|
2010-06-20 04:30:42 +02:00
|
|
|
SESSION-INTERFACE-MODULES.hpp - composing the public session API from several interface modules
|
2010-03-09 06:31:07 +01:00
|
|
|
|
|
|
|
|
Copyright (C) Lumiera.org
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** @file session-interface-modules.hpp
|
|
|
|
|
** Self-contained sub-elements on the Session API.
|
|
|
|
|
** Part of the Session interface is exposed as self-contained
|
|
|
|
|
** interface modules -- both for notational convenience at the
|
|
|
|
|
** usage site, and for keeping session implementation code manageable.
|
|
|
|
|
** Clients access these modules as nested parts of the public Session interface
|
|
|
|
|
** through references exposing just the respective interfaces, while the actual
|
|
|
|
|
** implementation is located in-place (within the SesssionImpl object), packaged
|
|
|
|
|
** into a non-public baseclass.
|
|
|
|
|
** - the DefsManager acts as frontend to the system of default configurations
|
|
|
|
|
** and config rules, allowing to retrieve the \em default version of various
|
|
|
|
|
** kinds of objects
|
|
|
|
|
** - the top-level Timeline (structural assets) act as facade and entry point
|
|
|
|
|
** to the high-level-model (session contents). There is an table of timelines,
|
|
|
|
|
** 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.
|
2010-10-18 05:33:46 +02:00
|
|
|
** - the ElementQuery interface allows to retrieve specific object
|
|
|
|
|
** instances by applying a filter predicate.
|
2010-03-09 06:31:07 +01:00
|
|
|
**
|
|
|
|
|
** \par maintaining the link between session, timelines and sequences
|
2010-06-20 04:30:42 +02:00
|
|
|
**
|
2010-03-09 06:31:07 +01:00
|
|
|
** Timeline and Sequence are implemented as asset::Struct, causing them to be
|
|
|
|
|
** maintained by the AssetManager, which in turn is attached to the session::Root
|
|
|
|
|
** (WIP 3/2010: yet to be implemented). Creation and destruction of timelines and
|
|
|
|
|
** 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
|
|
|
|
|
** 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
|
2010-10-18 05:33:46 +02:00
|
|
|
** respectively. This is accomplished by using kind-of a backdoor, a SessionServices (???)
|
2010-03-09 06:31:07 +01:00
|
|
|
** (proc internal API) definition, allowing direct communication on implementation
|
|
|
|
|
** level, without the need to expose this access point on the public session API.
|
2010-10-18 05:33:46 +02:00
|
|
|
** The lib::ElementTracker configured in ( ??? ) receives these
|
2010-03-09 06:31:07 +01:00
|
|
|
** calls to maintain a list of asset smart-ptrs
|
|
|
|
|
**
|
|
|
|
|
** @see SessionImpl
|
|
|
|
|
** @see session-services.hpp
|
|
|
|
|
**
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef MOBJECT_SESSION_INTERFACE_MODULES_H
|
|
|
|
|
#define MOBJECT_SESSION_INTERFACE_MODULES_H
|
|
|
|
|
|
2010-03-11 18:27:52 +01:00
|
|
|
#include "lib/element-tracker.hpp"
|
2010-03-12 01:50:33 +01:00
|
|
|
#include "proc/asset/timeline.hpp"
|
|
|
|
|
#include "proc/asset/sequence.hpp"
|
|
|
|
|
#include "proc/mobject/session/defsmanager.hpp"
|
2010-06-20 04:30:42 +02:00
|
|
|
#include "proc/mobject/session/element-query.hpp"
|
2010-03-09 06:31:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace mobject {
|
|
|
|
|
namespace session {
|
|
|
|
|
|
|
|
|
|
|
2010-03-11 18:27:52 +01:00
|
|
|
typedef lib::ElementTracker<asset::Timeline> TimelineTracker;
|
|
|
|
|
typedef lib::ElementTracker<asset::Sequence> SequenceTracker;
|
2010-03-09 06:31:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Collection of implementation components,
|
|
|
|
|
* providing self-contained sub-elements
|
|
|
|
|
* exposed on the public Session API.
|
|
|
|
|
*/
|
|
|
|
|
struct SessionInterfaceModules
|
|
|
|
|
: boost::noncopyable
|
|
|
|
|
{
|
|
|
|
|
DefsManager defaultsManager_;
|
2010-06-20 04:30:42 +02:00
|
|
|
ElementQuery elementQueryAPI_;
|
2010-03-09 06:31:07 +01:00
|
|
|
TimelineTracker timelineRegistry_;
|
|
|
|
|
SequenceTracker sequenceRegistry_;
|
2010-10-20 04:08:58 +02:00
|
|
|
|
|
|
|
|
SessionInterfaceModules();
|
2010-03-09 06:31:07 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-10-20 04:08:58 +02:00
|
|
|
|
|
|
|
|
/** init element-tracking mechanism for
|
|
|
|
|
* timelines and sequences on session creation
|
|
|
|
|
*/
|
|
|
|
|
inline
|
|
|
|
|
SessionInterfaceModules::SessionInterfaceModules()
|
|
|
|
|
{
|
|
|
|
|
asset::Timeline::setRegistryInstance (timelineRegistry_);
|
|
|
|
|
asset::Sequence::setRegistryInstance (sequenceRegistry_);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2010-03-09 06:31:07 +01:00
|
|
|
}} // namespace mobject::session
|
|
|
|
|
#endif
|