Lumiera  0.pre.03
»edityourfreedom«
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
proc/mobject/session/clip.cpp
Go to the documentation of this file.
1 /*
2  Clip - a Media Clip
3 
4  Copyright (C) Lumiera.org
5  2008, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 * *****************************************************/
22 
23 
32 #include "proc/assetmanager.hpp"
33 #include "proc/asset/media.hpp"
34 #include "proc/asset/clip.hpp"
35 #include "lib/time/mutation.hpp"
36 #include "lib/util.hpp"
37 
39 using util::isnil;
40 
41 namespace proc {
42 namespace mobject {
43 namespace session {
44 
48  Clip::Clip (asset::Clip const& clipDef, Media const& mediaDef)
49  : mediaDef_(mediaDef)
50  , clipDef_(clipDef)
51  {
52  setupLength();
54  }
55 
56 
57 
61  bool
62  Clip::isValid () const
63  {
64  TODO ("check consistency of clip length def, implies accessing the underlying media def");
65  return not isnil(length_);
66  }
67 
68 
69  void
71  {
72  TODO ("really calculate the length of a clip and set length field");
73  this->length_.accept (Mutation::changeDuration(mediaDef_.getLength()));
74  }
75 
76 
77  PMedia
78  Clip::getMedia () const
79  {
81  }
82 
83 
86  {
88  }
89 
90 
91 
92 
93 }}} // namespace proc::mobject::session
94 
PMedia getMedia() const
access the underlying media asset
bookkeeping (Asset) view of a media clip.
PClipAsset findClipAsset() const
locate the corresponding asset representing this clip or the whole compound in case of a multichannel...
Clip(const asset::Clip &, const Media &)
new clip-MO linked with the given asset::Clip.
Proc-Layer Interface: Asset Lookup and Organisation.
Modifying time and timecode values.
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
Definition: trait.hpp:76
static lib::P< KIND > wrap(const KIND &asset)
retrieve the registered smart-ptr for any asset
Media data represented a specific kind of Asset.
Interface: an opaque change imposed onto some time value.
Definition: mutation.hpp:100
MObject in the Session to represent a clip on the timeline.
Definition of Asset representation for a media clip.
void accept(Mutation const &)
Definition: mutation.hpp:131
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
bool isValid() const
implementing the common MObject self test.
bool isnil(lib::time::Duration const &dur)
Definition: timevalue.hpp:642
Namespace of Session and user visible high-level objects.
Proc-Layer implementation namespace root.
Definition: id-scheme.hpp:63