Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
asset/clip.cpp
Go to the documentation of this file.
1/*
2 Clip(Asset) - bookkeeping (asset) view of a media clip.
3
4 Copyright (C)
5 2008, Hermann Vosseler <Ichthyostega@web.de>
6
7  **Lumiera** is free software; you can redistribute it and/or modify it
8  under the terms of the GNU General Public License as published by the
9  Free Software Foundation; either version 2 of the License, or (at your
10  option) any later version. See the file COPYING for further details.
11
12* *****************************************************************/
13
14
20#include "steam/asset/clip.hpp"
22
23using std::static_pointer_cast;
24
25
26namespace steam {
27namespace asset {
28
29 namespace {
30
37 const Asset::Ident
38 createClipIdent (const Media& mediaref)
39 {
40 string name (mediaref.ident.name + "-clip"); // TODO something sensible here; append number, sanitise etc.
41 Category category (mediaref.ident.category);
42 category.setPath(CLIP_SUBFOLDER);
43 return Asset::Ident (name, category,
44 mediaref.ident.org,
45 mediaref.ident.version );
46 }
47
49 createClipMO (const Clip& thisClipAsset, const Media& mediaChannel)
50 {
51 return mobject::MObject::create (thisClipAsset,mediaChannel);
52 }
53 }
54
55
56
57 Clip::Clip (Media& mediaref)
58 : Media (createClipIdent (mediaref),
59 mediaref.getFilename(),
60 mediaref.getLength())
61 , source_ (mediaref)
62 , clipMO_ (createClipMO (*this, source_))
63 {
64 this->defineDependency (mediaref);
65 }
66
67
77 {
78 return clipMO_;
79 }
80
81
82
88 {
89 return AssetManager::wrap (*this);
90 }
91
92
93
99 {
100 return source_.checkCompound();
101 }
102
103
104
105}} // namespace steam::asset
Definition of Asset representation for a media clip.
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
Definition p.hpp:77
static lib::P< KIND > wrap(const KIND &asset)
retrieve the registered smart-ptr for any asset
const Ident ident
Asset identification tuple.
Definition asset.hpp:197
void defineDependency(PAsset parent)
establish a connection between this and the given parent asset, denoting we are in some way dependent...
Definition asset.cpp:183
Tree like classification of Assets.
Definition category.hpp:68
void setPath(string const &newpath)
Definition category.hpp:81
bookkeeping (Asset) view of a media clip.
virtual PClip createClip() const
Specialisation of the asset::Media interface method, just returning the already existing Clip-MO.
PClip clipMO_
the corresponding (dependent) clip-MO
const Media & source_
media source of this clip
virtual PMedia checkCompound() const
specialisation delegating the decision to the media asset referred by this clip
virtual PClipAsset getClipAsset()
return this wrapped into a shared ptr, because it's already the desired asset::Clip
key abstraction: media-like assets
Definition media.hpp:64
friend class steam::asset::Clip
Definition media.hpp:117
virtual PMedia checkCompound() const
predicate to decide if this asset::Media is part of a compound (multichannel) media.
Definition media.cpp:100
static session::MObjectFactory create
Storage for the (single, static) MObject factory object.
Definition mobject.hpp:87
A refcounting Handle to an MObject of type MO, used to constrain or explicitly specify the location w...
Core factory to generate media objects for use in the Session model.
Media::PClip createClipMO(const Clip &thisClipAsset, const Media &mediaChannel)
const Asset::Ident createClipIdent(const Media &mediaref)
The asset subsystem of the Steam-Layer.
const string CLIP_SUBFOLDER
Steam-Layer implementation namespace root.
a POD comprised of all the information sufficiently identifying any given Asset.
Definition asset.hpp:147
asset::Category category
primary tree like classification of the asset.
Definition asset.hpp:156
string name
element ID, comprehensible but sanitised.
Definition asset.hpp:151
const uint version
version number of the thing or concept represented by this asset.
Definition asset.hpp:171
const string org
origin or authorship id.
Definition asset.hpp:163