2007-10-19 06:39:52 +02:00
|
|
|
/*
|
|
|
|
|
MObjectFactory - creating concrete MObject subclass instances
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2008-03-10 04:25:03 +01:00
|
|
|
Copyright (C) Lumiera.org
|
2011-02-05 20:56:51 +01:00
|
|
|
2008,2010, Hermann Vosseler <Ichthyostega@web.de>
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2007-10-19 06:39:52 +02:00
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU General Public License as
|
2010-12-17 23:28:49 +01:00
|
|
|
published by the Free Software Foundation; either version 2 of
|
|
|
|
|
the License, or (at your option) any later version.
|
|
|
|
|
|
2007-10-19 06:39:52 +02:00
|
|
|
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.
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2007-10-19 06:39:52 +02:00
|
|
|
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.
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2007-10-19 06:39:52 +02:00
|
|
|
* *****************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "proc/mobject/session/mobjectfactory.hpp"
|
2009-12-12 03:50:41 +01:00
|
|
|
#include "proc/mobject/session/root.hpp"
|
2007-10-19 06:39:52 +02:00
|
|
|
#include "proc/mobject/session/clip.hpp"
|
2008-01-07 18:16:03 +01:00
|
|
|
#include "proc/mobject/session/track.hpp"
|
2007-10-19 06:39:52 +02:00
|
|
|
#include "proc/mobject/session/effect.hpp"
|
2009-12-17 03:14:59 +01:00
|
|
|
#include "proc/mobject/session/label.hpp"
|
2010-03-27 16:26:22 +01:00
|
|
|
#include "proc/mobject/session/binding.hpp"
|
2007-10-19 06:39:52 +02:00
|
|
|
#include "proc/asset/clip.hpp"
|
|
|
|
|
#include "proc/asset/effect.hpp"
|
2012-12-01 08:44:07 +01:00
|
|
|
#include "common/query/defs-manager.hpp"
|
|
|
|
|
|
|
|
|
|
using lumiera::query::DefsManager;
|
2007-10-19 06:39:52 +02:00
|
|
|
|
2011-12-02 16:10:03 +01:00
|
|
|
namespace proc {
|
2009-12-12 03:50:41 +01:00
|
|
|
namespace mobject {
|
|
|
|
|
namespace session {
|
2010-03-03 06:00:37 +01:00
|
|
|
////////////////////////////////////////////////////////////////////////////////TICKET #414
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** build a new session/model root element. */
|
|
|
|
|
Placement<Root>
|
|
|
|
|
MObjectFactory::operator() (DefsManager& sessionDefaultsHandler)
|
|
|
|
|
{
|
|
|
|
|
return Placement<Root> (*new Root (sessionDefaultsHandler), &deleterFunc);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** build a new session/model root element. */
|
|
|
|
|
Placement<Label>
|
|
|
|
|
MObjectFactory::operator() (Symbol labelType)
|
|
|
|
|
{
|
|
|
|
|
return Placement<Label> (*new Label (labelType), &deleterFunc);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** creating a Clip-MObject to be placed within the Session,
|
|
|
|
|
* based on a clip asset, which typically is obtained by calling
|
|
|
|
|
* the createClip()-function on some asset::Media.
|
|
|
|
|
* The newly created Clip-MO is (back)linked with this media Asset
|
|
|
|
|
* 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.
|
|
|
|
|
* @param mediaDef the actual asset::Media to be used
|
|
|
|
|
* created Clip could be a compound (multichannel) clip
|
|
|
|
|
* comprised of several SimpleClip sub-objects.
|
|
|
|
|
*/
|
|
|
|
|
Placement<Clip>
|
|
|
|
|
MObjectFactory::operator() (const asset::Clip& clipRef, const asset::Media& mediaDef)
|
|
|
|
|
{
|
|
|
|
|
return Placement<Clip> (*new Clip (clipRef,mediaDef), &deleterFunc);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** variant of the Clip-MO factory function, creating
|
|
|
|
|
* a multichannel (compound) clip.
|
|
|
|
|
* @todo work out the details of multichannel handling
|
|
|
|
|
*/
|
|
|
|
|
Placement<Clip>
|
|
|
|
|
MObjectFactory::operator() (const asset::Clip& clipRef, vector<const Media*> mediaTracks)
|
|
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED ("build multichannel compound clip-MO");
|
|
|
|
|
}
|
|
|
|
|
|
2010-06-14 02:08:45 +02:00
|
|
|
/** fabricate a new track-MObject, using the given unique ID */
|
|
|
|
|
Placement<Track>
|
|
|
|
|
MObjectFactory::operator() (TrackID 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);
|
|
|
|
|
}
|
|
|
|
|
|
2010-03-03 06:00:37 +01:00
|
|
|
/** */
|
|
|
|
|
Placement<Effect>
|
|
|
|
|
MObjectFactory::operator() (const asset::Effect& processorDef)
|
|
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED ("fabricate effect-MO");
|
|
|
|
|
}
|
|
|
|
|
|
2010-03-21 05:25:52 +01:00
|
|
|
/** */
|
|
|
|
|
Placement<Binding>
|
2010-03-28 05:14:57 +02:00
|
|
|
MObjectFactory::operator() (PSequence const& sequence_to_bind)
|
2010-03-21 05:25:52 +01:00
|
|
|
{
|
|
|
|
|
TODO ("any additional liabilities when creating a binding?");
|
2010-03-27 16:26:22 +01:00
|
|
|
return Placement<Binding> (*new Binding(sequence_to_bind), &deleterFunc);
|
2010-03-21 05:25:52 +01:00
|
|
|
}
|
|
|
|
|
|
2010-03-03 06:00:37 +01:00
|
|
|
|
|
|
|
|
|
2011-12-02 16:10:03 +01:00
|
|
|
}}} // namespace mobject::session
|