00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "proc/mobject/session/clip.hpp"
00025 #include "proc/assetmanager.hpp"
00026 #include "proc/asset/media.hpp"
00027 #include "proc/asset/clip.hpp"
00028
00029 namespace mobject
00030 {
00031 namespace session
00032 {
00033
00037 Clip::Clip (const asset::Clip& clipDef, const Media& mediaDef)
00038 : start_(0),
00039 mediaDef_(mediaDef),
00040 clipDef_(clipDef)
00041 {
00042 setupLength();
00043 }
00044
00045
00046
00050 bool
00051 Clip::isValid () const
00052 {
00053 TODO ("check consistency of clip length def, implies accessing the underlying media def");
00054 return length > 0;
00055 }
00056
00057
00058 void
00059 Clip::setupLength()
00060 {
00061 TODO ("really calculate the length of a clip and set length field");
00062 this->length = mediaDef_.getLength();
00063 }
00064
00065
00066 PMedia
00067 Clip::getMedia () const
00068 {
00069 return asset::AssetManager::wrap (mediaDef_);
00070 }
00071
00072
00073 PClipAsset
00074 Clip::findClipAsset () const
00075 {
00076 return asset::AssetManager::wrap (clipDef_);
00077 }
00078
00079
00080
00081
00082
00083
00084
00085 }
00086
00087 }