Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
placement-basic-test.cpp
Go to the documentation of this file.
1/*
2 PlacementBasic(Test) - basic Placement and MObject handling
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
19#include "lib/test/run.hpp"
20#include "steam/asset/media.hpp"
27//#include "lib/util.hpp"
28
29
30using lib::time::Time;
31
32
33namespace steam {
34namespace mobject {
35namespace session {
36namespace test {
37
38 using asset::VIDEO;
39
40
41
42 /***************************************************************/
49 class PlacementBasic_test : public Test
50 {
51 typedef shared_ptr<asset::Media> PM;
52 typedef shared_ptr<asset::Clip> PCA;
53
54 virtual void
55 run (Arg)
56 {
57 // create Clip-MObject, which is wrapped into a placement (smart ptr)
58 PM media = asset::Media::create("test-1", VIDEO);
59 PCA clipAsset = Media::create(*media);
60 Placement<Clip> pc = MObject::create (*clipAsset, *media);
61
62 // use of the Clip-MObject interface by dereferencing the placement
63 PM clip_media = pc->getMedia();
64 CHECK (clip_media->ident.category.hasKind (VIDEO));
65
66 // using the Placement interface
67 // TODO: how to handle insufficiently determinated Placement? Throw?
68 FixedLocation & fixloc = pc.chain (Time(0,1)); // TODO: the fork??
69 ExplicitPlacement expla = pc.resolve();
70 CHECK (expla.time == Time(0,1));
71 CHECK (!expla.chain.isOverdetermined());
72// CHECK (*expla == *pc); ////////////////////////////////////////////TICKET #511 define equivalence of locating chains and solutions
73
74 // now overconstraining with another Placement
75 pc.chain (Time(0,2));
76 ExplicitPlacement expla2 = pc.resolve();
77 CHECK (expla2.time == Time(0,2)); // the latest addition wins
78 CHECK (expla2.chain.isOverdetermined());
79 }
80 };
81
82
84 LAUNCHER (PlacementBasic_test, "unit session");
85
86
87
88}}}} // namespace steam::mobject::session::test
Lumiera's internal time value datatype.
static MediaFactory create
storage for the static MediaFactory instance
Definition media.hpp:75
Special kind of Placement, where the location of the MObject has been nailed down to a fixed position...
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...
The most common case of positioning a MObject in the Session: directly specifying a constant position...
Core abstraction: completely resolved placement of an MObject Within the session model,...
Media data represented a specific kind of Asset.
Core factory to generate media objects for use in the Session model.
Namespace of Session and user visible high-level objects.
Definition sequence.hpp:65
Steam-Layer implementation namespace root.
Test runner and basic definitions for tests.
Core abstraction: placement of a media object into session context.
Simplistic test class runner.
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
Definition run.hpp:116
Primary Interface to the current Session.
A stub implementation of the Clip interface for unit testing.
a family of time value like entities and their relationships.