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) Lumiera.org
5  2008, 2011, 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 
28 #include "lib/test/run.hpp"
30 #include "steam/fixture/fixture.hpp" // TODO only temporarily needed
31 #include "steam/assetmanager.hpp"
32 #include "steam/asset/timeline.hpp"
33 #include "steam/asset/sequence.hpp"
34 //#include "lib/format-cout.hpp"
35 #include "lib/util.hpp"
36 
37 using util::isSameObject;
38 
39 
40 namespace steam {
41 namespace mobject {
42 namespace session {
43 namespace test {
44 
46  using proc_interface::PAsset;
47 
48  using asset::PTimeline;
49  using asset::PSequence;
50 
51 
52 
53  /***************************************************************************/
61  class SessionStructure_test : public Test
62  {
63  virtual void
64  run (Arg)
65  {
67  CHECK (Session::current.isUp());
68 
69  verify_defaultStructure();
70  }
71 
72 
73  void
74  verify_defaultStructure()
75  {
76 
77  PSess sess = Session::current;
78  CHECK (sess->isValid());
79 
80  UNIMPLEMENTED("the real standard structure of the session");
81 
82 #if false
83 
84 //
86  CHECK (0 <= sess->currEDL().size()); // TODO implement
87  CHECK (0 <= sess->getFixture()->size()); // TODO implement
88  CHECK (sess->currEDL().getTracks()->isValid());
89 
90 // PAsset track = sess->currEDL().getTracks()[0]; // TODO obsolete
91 // AssetManager& aMang = AssetManager::instance();
92 // CHECK (track == aMang.getAsset (track->getID()));
93 
94 #endif
95  UNIMPLEMENTED ("how to refer to tracks...");
96 
97  CHECK (0 < sess->timelines.size());
98  PTimeline til = sess->timelines[0];
99 
100  CHECK (0 < sess->sequences.size());
101  PSequence seq = sess->sequences[0];
102 
103 #if false
104  CHECK (isSameObject (seq, til->getSequence()));
105 
106  //verify default timeline
107  Axis& axis = til->getAxis();
108  CHECK (Time(0) == axis.origin());
109  CHECK (Time(0) == til->length());
110 
111  //verify global pipes
112  //TODO
113 
114  //verify default sequence
115  RFork rootFork = seq->rootFork();
116  CHECK (rootFork->isValid());
117  CHECK (Time(0) == rootFork->length());
118  CHECK (0 == rootFork->subForks.size());
119  CHECK (0 == rootFork->clips.size());
120  //TODO verify the output slots of the sequence
121 
122  //TODO now use the generic query API to discover the same structure.
123  CHECK (til == *(sess->all<Timeline>()));
124  CHECK (seq == *(sess->all<Sequence>()));
125  CHECK (rootFork == *(sess->all<Fork>()));
126  CHECK (! sess->all<Clip>());
127 
128  QueryFocus& focus = sess->focus();
129  CHECK (rootFork == focus.getObject());
130  focus.navigate (til);
131  CHECK (til.getBinding() == focus.getObject());
132  CHECK (rootFork == *(focus.children()));
133 #endif
134  }
135  };
136 
137 
139  LAUNCHER (SessionStructure_test, "unit session");
140 
141 
142 
143 }}}} // 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:94
TODO type comment.
Definition: sequence.hpp:92
virtual void reset()=0
reset all session config and start with a pristine default session.
Definition: run.hpp:49
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:129
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:74
Lumiera&#39;s internal time value datatype.
Definition: timevalue.hpp:308
Structural building block of the session: a sequence of clips.
Simple 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:161
SequenceAccess sequences
collection of sequences
Definition: session.hpp:134
A Fork serves as grouping device within the Session.
Definition: fork.hpp:103
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
Definition: trait.hpp:80
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:133
bool isSameObject(A const &a, B const &b)
compare plain object identity, bypassing any custom comparison operators.
Definition: util.hpp:372