45 using std::placeholders::_1;
57 using proc_interface::PAsset;
65 typedef MORef<session::Clip> RClip;
66 typedef PlacementMO::ID PID;
93 verify_dispatchedCommands();
101 CHECK (sess->isValid());
107 RFork fork1 = seq->attachFork(); 108 RFork fork2 = seq->attachFork(
"fork-2");
109 RFork fork21 = seq->attachFork(
"fork-2.1", fork2);
110 RFork fork22 = seq->attachFork(
"fork-2.2",
"fork-2");
113 CHECK (fork22 == focus.getObject());
115 RFork fork3 = seq->attachFork(
"fork-3",
"root");
116 CHECK (fork3 == focus.getObject());
118 RFork fork31 = sess->attach(
122 CHECK (fork31 == focus.getObject());
123 RFork rootFork = seq->rootFork();
124 CHECK (3 == rootFork->subForks.size());
125 CHECK (fork1 == rootFork->subForks[0]);
126 CHECK (fork2 == rootFork->subForks[1]);
127 CHECK (fork3 == rootFork->subForks[2]);
128 CHECK (0 == fork1->subForks.size());
129 CHECK (2 == fork2->subForks.size());
130 CHECK (fork21 == fork2->subForks[0]);
131 CHECK (fork22 == fork2->subForks[1]);
132 CHECK (1 == fork3->subForks.size());
133 CHECK (fork21 == fork3->subForks[0]);
136 allForks.insert(fork1);
137 allForks.insert(fork2);
138 allForks.insert(fork21);
139 allForks.insert(fork22);
140 allForks.insert(fork3);
141 allForks.insert(fork31);
144 CHECK (and_all (sess->all<
Fork>(), contains, ref(allForks), _1 ));
153 CHECK (sess->isValid());
156 QueryFocus& focus = sess->focus(); 158 RClip clip1 = sess->attach (TestClip::create());
160 RTrack fork31 = clip.getParent();
162 CHECK (
"fork31" == fork31->getNameID());
164 CHECK (1 == fork31->clips.size());
165 CHECK (clip1 == fork31->clips[0]);
167 RClip clip2 = fork31.attach (TestClip::create());
168 RClip clip3 = fork31.attach (clip1);
170 CHECK (clip1); CHECK (clip2); CHECK (clip3);
171 CHECK (clip1 != clip2);
172 CHECK (clip1 != clip3);
173 CHECK (clip2 != clip3);
184 RClip clip4 = fork2.attach (TestClip::create());
187 CHECK (focus.getObject() == fork2);
188 CHECK (focus.contains (clip4));
189 CHECK (!focus.contains (clip1));
190 CHECK (!focus.contains (clip2));
191 CHECK (!focus.contains (clip3));
193 focus.attach (fork31);
194 CHECK (focus.getObject() == fork31);
195 CHECK (focus.contains (clip1));
196 CHECK (focus.contains (clip2));
197 CHECK (focus.contains (clip3));
198 CHECK (!focus.contains (clip4));
201 CHECK (focus.getObject() == sess->getRoot());
202 CHECK (focus.contains (clip1));
203 CHECK (focus.contains (clip2));
204 CHECK (focus.contains (clip3));
205 CHECK (focus.contains (clip4));
206 CHECK (!focus.hasChild (clip1));
207 CHECK (!focus.hasChild (clip2));
208 CHECK (!focus.hasChild (clip3));
209 CHECK (!focus.hasChild (clip4));
211 focus.attach (sess->
sequences[0]->rootTrack()->subTracks[2]->subTracks[0]);
212 CHECK (focus.getObject() == fork31);
214 CHECK ( focus.hasChild (clip1));
215 CHECK ( focus.hasChild (clip2));
216 CHECK ( focus.hasChild (clip3));
217 CHECK (!focus.hasChild (clip4));
226 PSess sess = Session::current; 227 CHECK (sess->isValid());
229 RTrack fork31 = sess->
sequences[0]->rootTrack()->subTracks[2]->subTracks[0];
231 CHECK (3 == fork31->clips.size());
232 RClip clip2 = fork31->clips[1];
237 CHECK (focus.contains (clip2));
241 CHECK (!focus.contains (clip2));
243 CHECK (2 == fork31->clips.size());
244 CHECK (clip2 != fork31->clips[1]);
246 CHECK (focus.getObject() == fork31);
250 CHECK (discoverClips);
251 RClip clip1 = *discoverClips;
253 RClip clip3 = *discoverClips;
255 CHECK (!discoverClips);
257 CHECK (fork31->clips[0] == clip1);
258 CHECK (fork31->clips[1] == clip3);
265 RTrack fork3 = fork31.getParent();
268 CHECK (focus.contains (clip1));
269 CHECK (focus.contains (clip3));
270 CHECK (focus.contains (fork3));
271 CHECK (focus.contains (fork31));
277 sess->purge (fork31);
279 CHECK (focus.getObject() == fork3);
281 CHECK ( focus.contains (fork3));
283 CHECK (!focus.contains (clip1));
284 CHECK (!focus.contains (clip3));
285 CHECK (!focus.contains (fork31));
293 PSequence aSequence = sess->
sequences[0];
294 CHECK (focus.getObject() == aSequence->rootTrack());
295 CHECK (2 == aSequece->rootTrack()->subTracks.size());
297 CHECK ( contains (sess->
sequences, aSequence));
298 aSequence->rootFork().purge();
299 CHECK (!contains (sess->
sequences, aSequence));
302 CHECK (!sess->isValid());
304 CHECK (focus.getObject() == sess->getRoot());
306 PID currRoot = sess->getRoot.getPlacement().getID();
307 sess->getRoot().
purge();
308 CHECK (currRoot == sess->getRoot.getPlacement.getID);
310 CHECK (sess->isValid());
314 CHECK (aSequence.use_count() == 1);
320 verify_dispatchedCommands()
322 TODO (
"verify the commands issued by this test");
An active (smart-ptr like) external reference to a specifically placed MObject "instance" within the ...
virtual void reset()=0
reset all session config and start with a pristine default session.
Basic and generic representation of an internal query.
void purge()
detach this object instance from model, including all child elements.
Core abstraction: placement of a media object into session context.
Backbone data structure of the low-level render node model The fixture defines the boundary between t...
bool isSharedPointee(MORef< MOX > const &ref1, MORef< MOY > const &ref2)
check if the two references actually share ownership on the same underlying MObject (as opposed to re...
bool and_all(CON const &elements, FUN function, P1 &&bind1, ARGS &&...args)
Accept binding for arbitrary function arguments.
static session::SessManager & current
access point to the current Session
A user visible/editable Clip is a reference to a contiguous sequence of media data loaded as Asset in...
Steam-Layer implementation namespace root.
DefaultsAccess defaults
manages default configured objects
Namespace of Session and user visible high-level objects.
static StructFactory retrieve
storage for the static StructFactory instance
Structural building block of the session: a sequence of clips.
External MObject/Placement reference.
Simple test class runner.
ScopeQuery< MO >::iterator explore() const
discover any matching object contained as immediate Child within current focus.
creation, access and Session lifecycle Interface.
A stub implementation of the Clip interface for unit testing.
SequenceAccess sequences
collection of sequences
A Fork serves as grouping device within the Session.
QueryFocus & reset()
discard any state and navigate current focus path to model root
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
Primary Interface to the current Session.
Current focus location to use as point-of reference for contents and location discovery queries...
Perform operations "for each element" of a collection.
Adapter for building an implementation of the »Lumiera Forward Iterator« concept. ...
Generic interface to express a query for specifically typed result elements exposing some capabilitie...
bool isEquivalentPlacement(MORef< MOX > const &ref1, MORef< MOY > const &ref2)
check if the two references actually denote an equivalent placement
TimelineAccess timelines
collection of timelines (top level)
bool isSameObject(A const &a, B const &b)
compare plain object identity, bypassing any custom comparison operators.