Lumiera  0.pre.03
»edit your freedom«
mobject/session/clip.cpp
Go to the documentation of this file.
1 /*
2  Clip - 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 
23 #include "steam/assetmanager.hpp"
24 #include "steam/asset/media.hpp"
25 #include "steam/asset/clip.hpp"
26 #include "lib/time/mutation.hpp"
27 #include "lib/util.hpp"
28 
30 using util::isnil;
31 
32 namespace steam {
33 namespace mobject {
34 namespace session {
35 
39  Clip::Clip (asset::Clip const& clipDef, Media const& mediaDef)
40  : mediaDef_(mediaDef)
41  , clipDef_(clipDef)
42  {
43  setupLength();
44  throwIfInvalid();
45  }
46 
47 
48 
52  bool
53  Clip::isValid () const
54  {
55  TODO ("check consistency of clip length def, implies accessing the underlying media def");
56  return not isnil(length_);
57  }
58 
59 
60  void
61  Clip::setupLength()
62  {
63  TODO ("really calculate the length of a clip and set length field");
64  this->length_.accept (Mutation::changeDuration(mediaDef_.getLength()));
65  }
66 
67 
68  PMedia
69  Clip::getMedia () const
70  {
72  }
73 
74 
77  {
78  return asset::AssetManager::wrap (clipDef_);
79  }
80 
81 
82 
83 
84 }}} // namespace steam::mobject::session
85 
Steam-Layer Interface: Asset Lookup and Organisation.
Modifying time and timecode values.
key abstraction: media-like assets
Definition: media.hpp:63
Media data represented a specific kind of Asset.
PClipAsset findClipAsset() const
locate the corresponding asset representing this clip or the whole compound in case of a multichannel...
bool isValid() const
implementing the common MObject self test.
PMedia getMedia() const
access the underlying media asset
MObject in the Session to represent a clip on the timeline.
Interface: an opaque change imposed onto some time value.
Definition: mutation.hpp:91
Steam-Layer implementation namespace root.
Namespace of Session and user visible high-level objects.
Definition: sequence.hpp:65
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
virtual Duration getLength() const
Definition: media.cpp:122
Definition of Asset representation for a media clip.
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
Clip(const asset::Clip &, const Media &)
new clip-MO linked with the given asset::Clip.