| !Start file for the MacroMedia Player for RISC OS version 1.3 (d24)

| Start up file to launch the Player, this is executed from the
| movie directories, by their !Run file.

If "<MMPlayer$IsRunning>"="Yes" Then Error 0 The MacroMedia Player is already running

Set MMPlayer$Resource$Dir <MMPlayer$Dir>

| Ensure any of our system extensions

RMEnsure AtomManager 1.01 RMLoad <MMPlayer$Dir>.Modules.Atom
RMEnsure AtomManager 1.01 Error AtomManager 1.01 needed
RMReInit AtomManager

RMEnsure SoundWave 0.12 RMLoad <MMPlayer$Dir>.Modules.SoundWave
RMEnsure SoundWave 0.12 Error SoundWave module 0.12 needed

RMEnsure CDSupport 0.12 RMLoad <MMPlayer$Dir>.Modules.CDSupport
RMEnsure CDSupport 0.12 Error CDSupport module 0.12 needed

| Check if we are running on any NC
Set NC True
RMEnsure OSVersion 0.01 Set NC False

IF "NC"="True"  Then RMEnsure UtilityModule 4.52 RMEnsure CallASWI 0.01 RMLoad <MMPlayer$Dir>.Modules.CallASWI 

IF "NC"="False" Then RMEnsure UtilityModule 3.70 RMEnsure CallASWI 0.01 RMLoad <MMPlayer$Dir>.Modules.CallASWI

If "<STB$Type>" <> "" Then RMEnsure CallASWI 0.01 RMLoad <MMPlayer$Dir>.Modules.CallASWI

| Check player version.  1024 for STB1 or RISC PC.  1025 for STB2

Set MMPlayer$MachineType 1025
RMEnsure UtilityModule 3.61 Set MMPlayer$MachineType 1024

| Check wimp version.  1 => nested wimp

Set MMPlayer$WimpVersion 1
RMEnsure WindowManager 3.82 Set MMPlayer$WimpVersion 0

| Ensure our slot, and then start the kick of the MMPlayer executable

WimpSlot -min 1000K -max 1000k

Set MMPlayer$IsRunning Yes

Run <MMPlayer$Dir>.Player %*0

If "<Navigator$Dir>" <> "" Then <Navigator$Dir>.Library.SetLims

UnSet MMPlayer$IsRunning
