Re: Important change to NWC2ClipItem interface
Reply #3 –
Everyone else seems to be having no trouble with this, but I'm still struggling with it! It turns out that you should add the second parameter as true if and only if you are making use of a NWC2PlayContext object.
- If you are not making use of a NWC2PlayContext object, you must not add the second parameter (or you can add it as false if you want to). Otherwise, your script will process objects that occured earlier in the measure of the selected object(s), even though they were not selected! [NWC now seems to provide as "context" all of the notes in a measure prior to the selection start.]
- If you are making use of a NWC2PlayContext object, you must add the second parameter as true. Otherwise, your script will not process context information to correctly set your clef, key, bar, etc, when the selection is a partial staff. In this case, you must also make sure that your script does not process the remapped fake objects, other than using them to update the context! Otherwise, your script will operate on objects that were not selected (but were earlier in the same measure of the selection). A template:
foreach ($clip->Items as $item) {
$o = new NWC2ClipItem($item, true);
if ($o->IsContextInfo()) {
$pc->UpdateContext($o);
continue;
}
<your script processing here>
$pc->UpdateContext($o);
}
I think NWSW has updated all of its user tools accordingly. And perhaps I am the only other user to make use of play-context objects so far?!