Lumiera  0.pre.03
»edit your freedom«
session-structure-test.cpp
Go to the documentation of this file.
1 /*
2  SessionStructure(Test) - verifying basic Session/Model structure
3 
4  Copyright (C)
5  2008, 2011, 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"
21 #include "steam/fixture/fixture.hpp" // TODO only temporarily needed
22 #include "steam/assetmanager.hpp"
23 #include "steam/asset/timeline.hpp"
24 #include "steam/asset/sequence.hpp"
25 //#include "lib/format-cout.hpp"
26 #include "lib/util.hpp"
27 
28 using util::isSameObject;
29 
30 
31 namespace steam {
32 namespace mobject {
33 namespace session {
34 namespace test {
35 
37  using proc_interface::PAsset;
38 
39  using asset::PTimeline;
40  using asset::PSequence;
41 
42 
43 
44  /***************************************************************************/
52  class SessionStructure_test : public Test
53  {
54  virtual void
55  run (Arg)
56  {
58  CHECK (Session::current.isUp());
59 
60  verify_defaultStructure();
61  }
62 
63 
64  void
65  verify_defaultStructure()
66  {
67 
68  PSess sess = Session::current;
69  CHECK (sess->isValid());
70 
71  UNIMPLEMENTED("the real standard structure of the session");
72 
73 #if false
74 
75 //
77  CHECK (0 <= sess->currEDL().size()); // TODO implement
78  CHECK (0 <= sess->getFixture()->size()); // TODO implement
79  CHECK (sess->currEDL().getTracks()->isValid());
80 
81 // PAsset track = sess->currEDL().getTracks()[0]; // TODO obsolete
82 // AssetManager& aMang = AssetManager::instance();
83 // CHECK (track == aMang.getAsset (track->getID()));
84 
85 #endif
86  UNIMPLEMENTED ("how to refer to tracks...");
87 
88  CHECK (0 < sess->timelines.size());
89  PTimeline til = sess->timelines[0];
90 
91  CHECK (0 < sess->sequences.size());
92  PSequence seq = sess->sequences[0];
93 
94 #if false
95  CHECK (isSameObject (seq, til->getSequence()));
96 
97  //verify default timeline
98  Axis& axis = til->getAxis();
99  CHECK (Time(0) == axis.origin());
100  CHECK (Time(0) == til->length());
101 
102  //verify global pipes
103  //TODO
104 
105  //verify default sequence
106  RFork rootFork = seq->rootFork();
107  CHECK (rootFork->isValid());
108  CHECK (Time(0) == rootFork->length());
109  CHECK (0 == rootFork->subForks.size());
110  CHECK (0 == rootFork->clips.size());
111  //TODO verify the output slots of the sequence
112 
113  //TODO now use the generic query API to discover the same structure.
114  CHECK (til == *(sess->all<Timeline>()));
115  CHECK (seq == *(sess->all<Sequence>()));
116  CHECK (rootFork == *(sess->all<Fork>()));
117  CHECK (! sess->all<Clip>());
118 
119  QueryFocus& focus = sess->focus();
120  CHECK (rootFork == focus.getObject());
121  focus.navigate (til);
122  CHECK (til.getBinding() == focus.getObject());
123  CHECK (rootFork == *(focus.children()));
124 #endif
125  }
126  };
127 
128 
130  LAUNCHER (SessionStructure_test, "unit session");
131 
132 
133 
134 }}}} // namespace steam::mobject::session::test
Steam-Layer Interface: Asset Lookup and Organisation.
An active (smart-ptr like) external reference to a specifically placed MObject "instance" within the ...
Definition: mobject-ref.hpp:85
TODO type comment.
Definition: sequence.hpp:83
virtual void reset()=0
reset all session config and start with a pristine default session.
Definition: run.hpp:40
Backbone data structure of the low-level render node model The fixture defines the boundary between t...
Facade for the Asset subsystem.
static session::SessManager & current
access point to the current Session
Definition: session.hpp:120
A user visible/editable Clip is a reference to a contiguous sequence of media data loaded as Asset in...
Steam-Layer implementation namespace root.
Namespace of Session and user visible high-level objects.
Definition: sequence.hpp:65
Lumiera&#39;s internal time value datatype.
Definition: timevalue.hpp:299
Structural building block of the session: a sequence of clips.
Simplistic test class runner.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
creation, access and Session lifecycle Interface.
Definition: session.hpp:152
SequenceAccess sequences
collection of sequences
Definition: session.hpp:125
A Fork serves as grouping device within the Session.
Definition: fork.hpp:94
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
Definition: trait.hpp:71
Primary Interface to the current Session.
Current focus location to use as point-of reference for contents and location discovery queries...
Top level structural element within the session.
TimelineAccess timelines
collection of timelines (top level)
Definition: session.hpp:124
bool isSameObject(A const &a, B const &b)
compare plain object identity, based directly on the referee&#39;s memory identities. ...
Definition: util.hpp:421