See also the somewhat simpler way of loading PlayIt from an obey file.
The general sequence of events for starting PlayIt is then:
Check if PlayIt is already loaded (eg execute a OS_SWINumberFromString,,"PlayIt_Version") and take appropriate action: |
If not loaded then RMLoad it from the resource path. eg: |
RMLoad PlayIt:PlayIt PlayIt:Standard |
|
or | |
RMLoad PlayIt:PlayIt PlayIt: |
which respectively force the Standard driver to be loaded and automatically choose from those in the directory. |
If it is loaded then get the version number and ensure the major version number is that which is usable by the app (ie = 1 for this version, not >= 1; see PlayIt_Version for an explanation). |
If PlayIt is already loaded with an unsuitable version number then this either needs to be reported as an error or warning and use of PlayIt should be disabled within the app. There should be no reason for the application to refuse to start just because PlayIt is unavailable since sound is almost invariably an optional extra (unless of course its purpose in life is to play sound). |
Forcing a new version of PlayIt to load (ie replacing a version already running) is generally not recommended because another application might not like it. Certainly an application should not load a version with a different major version from that currently running but it is acceptable to load a version with a newer minor version provided that PlayIt is currently idle. An application should then be aware that the minor version might change behind its back but generally this should not be a problem. |
If PlayIt was already loaded and the version number is ok then check for the presence of an output driver (see PlayIt_DriverInfo ) and if not is not present one can be loaded from app's resources using PlayIt_LoadDriver . |
Finally, if the program using PlayIt requires the wimp task running to monitor messages then ensure that this is running with: |
Wimp_StartTask,"Desktop_PlayIt" |
Of course v1.59 should have already been ensured to be running above before executing this command. |
[ Parent ] [ Manual root ]