Lumiera  0.pre.03
»edit your freedom«
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 
23 using std::static_pointer_cast;
24 
25 
26 namespace steam {
27 namespace 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
A refcounting Handle to an MObject of type MO, used to constrain or explicitly specify the location w...
Definition: trait.hpp:82
string name
element ID, comprehensible but sanitised.
Definition: asset.hpp:155
key abstraction: media-like assets
Definition: media.hpp:63
Tree like classification of Assets.
Definition: category.hpp:66
virtual PClipAsset getClipAsset()
return this wrapped into a shared ptr, because it&#39;s already the desired asset::Clip ...
Definition: asset/clip.cpp:87
const Ident ident
Asset identification tuple.
Definition: asset.hpp:199
const Asset::Ident createClipIdent(const Media &mediaref)
Definition: asset/clip.cpp:38
Steam-Layer implementation namespace root.
virtual PMedia checkCompound() const
specialisation delegating the decision to the media asset referred by this clip
Definition: asset/clip.cpp:98
a POD comprised of all the information sufficiently identifying any given Asset.
Definition: asset.hpp:149
const Media & source_
media source of this clip
Definition: asset/clip.hpp:38
virtual PClip createClip() const
Specialisation of the asset::Media interface method, just returning the already existing Clip-MO...
Definition: asset/clip.cpp:76
virtual Duration getLength() const
Definition: media.cpp:122
Definition of Asset representation for a media clip.
Core factory to generate media objects for use in the Session model.
const string org
origin or authorship id.
Definition: asset.hpp:167
bookkeeping (Asset) view of a media clip.
Definition: asset/clip.hpp:35
static lib::P< KIND > wrap(const KIND &asset)
retrieve the registered smart-ptr for any asset
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
Definition: trait.hpp:71
static session::MObjectFactory create
Storage for the (single, static) MObject factory object.
Definition: mobject.hpp:89
const uint version
version number of the thing or concept represented by this asset.
Definition: asset.hpp:175
asset::Category category
primary tree like classification of the asset.
Definition: asset.hpp:160
The asset subsystem of the Steam-Layer.
Definition: wrapperptr.hpp:35
PClip clipMO_
the corresponding (dependent) clip-MO
Definition: asset/clip.hpp:41
virtual PMedia checkCompound() const
predicate to decide if this asset::Media is part of a compound (multichannel) media.
Definition: media.cpp:100
ElementBoxWidget::Config::Qualifier name(string id)
define the name-ID displayed in the caption