PM123 Playable object handling - Asynchronous request service
In general all kind of information about any playable object
except for the usage information is retrieved asynchronously.
The sequence is as follows:
- Register as an observer to the object.
- Request the information by calling RequestInfo
or RequestAggregateInfo.
Note
that calling RequestAggregateInfo with an empty exclusion
list is
equivalent to calling RequestInfo with the same parameters.
- If (some of) the requested information is not immediately
available wait for the InfoChange event
with the corresponding Loaded flags set. Note that if you
requested
more than one information each info may be available at a different
time. You should collect the bits if you need several infos together.
- Do your work with the information, but do it not in
the callback handler.
- Cancel your observer registration unless you need it for other
purposes.
The helper classes WaitInfo and WaitAggregateInfo
will assist the above steps. But normally
you should never wait synchronously for an information to
become
available. Dispatch other tasks in this time. At least you must not do
this in threads that serve GUI windows or you will block the SIQ.
Furthermore it is recommended that GUI interactions do not work with
a "local echo". Instead you should apply the change to the playable
object and wait for the update notification of your own change to
refresh the GUI. This has the advantage that you are also synchronized
to changes made by other windows or even by the remote interface as well.