36 using std::placeholders::_1;
48 using proc_interface::PAsset;
56 typedef MORef<session::Clip> RClip;
57 typedef PlacementMO::ID PID;
84 verify_dispatchedCommands();
92 CHECK (sess->isValid());
98 RFork fork1 = seq->attachFork(); 99 RFork fork2 = seq->attachFork(
"fork-2");
100 RFork fork21 = seq->attachFork(
"fork-2.1", fork2);
101 RFork fork22 = seq->attachFork(
"fork-2.2",
"fork-2");
104 CHECK (fork22 == focus.getObject());
106 RFork fork3 = seq->attachFork(
"fork-3",
"root");
107 CHECK (fork3 == focus.getObject());
109 RFork fork31 = sess->attach(
113 CHECK (fork31 == focus.getObject());
114 RFork rootFork = seq->rootFork();
115 CHECK (3 == rootFork->subForks.size());
116 CHECK (fork1 == rootFork->subForks[0]);
117 CHECK (fork2 == rootFork->subForks[1]);
118 CHECK (fork3 == rootFork->subForks[2]);
119 CHECK (0 == fork1->subForks.size());
120 CHECK (2 == fork2->subForks.size());
121 CHECK (fork21 == fork2->subForks[0]);
122 CHECK (fork22 == fork2->subForks[1]);
123 CHECK (1 == fork3->subForks.size());
124 CHECK (fork21 == fork3->subForks[0]);
127 allForks.insert(fork1);
128 allForks.insert(fork2);
129 allForks.insert(fork21);
130 allForks.insert(fork22);
131 allForks.insert(fork3);
132 allForks.insert(fork31);
135 CHECK (and_all (sess->all<
Fork>(), contains, ref(allForks), _1 ));
144 CHECK (sess->isValid());
147 QueryFocus& focus = sess->focus(); 149 RClip clip1 = sess->attach (TestClip::create());
151 RTrack fork31 = clip.getParent();
153 CHECK (
"fork31" == fork31->getNameID());
155 CHECK (1 == fork31->clips.size());
156 CHECK (clip1 == fork31->clips[0]);
158 RClip clip2 = fork31.attach (TestClip::create());
159 RClip clip3 = fork31.attach (clip1);
161 CHECK (clip1); CHECK (clip2); CHECK (clip3);
162 CHECK (clip1 != clip2);
163 CHECK (clip1 != clip3);
164 CHECK (clip2 != clip3);
175 RClip clip4 = fork2.attach (TestClip::create());
178 CHECK (focus.getObject() == fork2);
179 CHECK (focus.contains (clip4));
180 CHECK (!focus.contains (clip1));
181 CHECK (!focus.contains (clip2));
182 CHECK (!focus.contains (clip3));
184 focus.attach (fork31);
185 CHECK (focus.getObject() == fork31);
186 CHECK (focus.contains (clip1));
187 CHECK (focus.contains (clip2));
188 CHECK (focus.contains (clip3));
189 CHECK (!focus.contains (clip4));
192 CHECK (focus.getObject() == sess->getRoot());
193 CHECK (focus.contains (clip1));
194 CHECK (focus.contains (clip2));
195 CHECK (focus.contains (clip3));
196 CHECK (focus.contains (clip4));
197 CHECK (!focus.hasChild (clip1));
198 CHECK (!focus.hasChild (clip2));
199 CHECK (!focus.hasChild (clip3));
200 CHECK (!focus.hasChild (clip4));
202 focus.attach (sess->
sequences[0]->rootTrack()->subTracks[2]->subTracks[0]);
203 CHECK (focus.getObject() == fork31);
205 CHECK ( focus.hasChild (clip1));
206 CHECK ( focus.hasChild (clip2));
207 CHECK ( focus.hasChild (clip3));
208 CHECK (!focus.hasChild (clip4));
217 PSess sess = Session::current; 218 CHECK (sess->isValid());
220 RTrack fork31 = sess->
sequences[0]->rootTrack()->subTracks[2]->subTracks[0];
222 CHECK (3 == fork31->clips.size());
223 RClip clip2 = fork31->clips[1];
228 CHECK (focus.contains (clip2));
232 CHECK (!focus.contains (clip2));
234 CHECK (2 == fork31->clips.size());
235 CHECK (clip2 != fork31->clips[1]);
237 CHECK (focus.getObject() == fork31);
241 CHECK (discoverClips);
242 RClip clip1 = *discoverClips;
244 RClip clip3 = *discoverClips;
246 CHECK (!discoverClips);
248 CHECK (fork31->clips[0] == clip1);
249 CHECK (fork31->clips[1] == clip3);
256 RTrack fork3 = fork31.getParent();
259 CHECK (focus.contains (clip1));
260 CHECK (focus.contains (clip3));
261 CHECK (focus.contains (fork3));
262 CHECK (focus.contains (fork31));
268 sess->purge (fork31);
270 CHECK (focus.getObject() == fork3);
272 CHECK ( focus.contains (fork3));
274 CHECK (!focus.contains (clip1));
275 CHECK (!focus.contains (clip3));
276 CHECK (!focus.contains (fork31));
284 PSequence aSequence = sess->
sequences[0];
285 CHECK (focus.getObject() == aSequence->rootTrack());
286 CHECK (2 == aSequece->rootTrack()->subTracks.size());
288 CHECK ( contains (sess->
sequences, aSequence));
289 aSequence->rootFork().purge();
290 CHECK (!contains (sess->
sequences, aSequence));
293 CHECK (!sess->isValid());
295 CHECK (focus.getObject() == sess->getRoot());
297 PID currRoot = sess->getRoot.getPlacement().getID();
298 sess->getRoot().
purge();
299 CHECK (currRoot == sess->getRoot.getPlacement.getID);
301 CHECK (sess->isValid());
305 CHECK (aSequence.use_count() == 1);
311 verify_dispatchedCommands()
313 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.
Simplistic 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, based directly on the referee's memory identities. ...