Commit cc859d38 authored by Robert Sprowson's avatar Robert Sprowson Committed by ROOL
Browse files

Import of ESP Player front end

This is Player 1.39, which was released in 1999 (before 2007's 1.37a).
parent 7e59ec88
/* (1.37)
/* (1.39)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 1.37
#define Module_MajorVersion_CMHG 1.39
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 18 Apr 2007
#define Module_Date_CMHG 22 Jun 1999
#define Module_MajorVersion "1.37"
#define Module_Version 137
#define Module_MajorVersion "1.39"
#define Module_Version 139
#define Module_MinorVersion ""
#define Module_Date "18 Apr 2007"
#define Module_Date "22 Jun 1999"
#define Module_ApplicationDate "18-Apr-07"
#define Module_ApplicationDate "22-Jun-99"
#define Module_ComponentName "Player"
#define Module_FullVersion "1.37"
#define Module_HelpVersion "1.37 (18 Apr 2007)"
#define Module_LibraryVersionInfo "1:37"
#define Module_FullVersion "1.39"
#define Module_HelpVersion "1.39 (22 Jun 1999)"
#define Module_LibraryVersionInfo "1:39"
......@@ -26,16 +26,20 @@ REM (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THI
REM SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
REM
d$=" (18 Apr 2007)"
v$="1.37a"
d$=" (22 Jun 1999)"
v$="1.39"
REM Sample Player - Using ESP Module
REM MIDI Player - Using ESP MIDIPlay
REM Version including WIMP File Message handling
REM 1.35x Is first attempt at RealTime Synch
REM 1.37 (26/32-bit neutral) on maintained by Liquid Silicon
REM 1.39 has improved MIDI detection
ON ERROR PROCErr
doText%=FALSE
autoPlay%=FALSE
sendMIDIstartstop%=FALSE
PROCMakeDims
PROCSet
PROCStartWimp
......@@ -46,7 +50,7 @@ PROCLoadWimpSprites
PROCLoadWindows
PROCLoadMenus
PROCGetType(TRUE,TRUE)
REMPROCshadeIcon(playerWin%,playerMenuIcon%,TRUE):REM 1.37 - Didn't allow access to Control window when loading a sample before a MIDI file.
PROCshadeIcon(playerWin%,playerMenuIcon%,TRUE)
PROCSetVolume(currentVolume%)
ON ERROR PROCError
......@@ -65,6 +69,11 @@ oldmtime%=0
REPEAT
PROCpoll
IF playType%=playMIDI% THEN
SYS"XMIDIPlay_Info" TO ,,stop%:stop%=stop% EOR 1
REM PROCe(STR$(stop%))
IF stop%=0 THEN playOn%=TRUE
ENDIF
IF playOn%=TRUE THEN
CASE playType% OF
WHEN playWAVE%
......@@ -72,14 +81,12 @@ REPEAT
REM PROCe("R2="+STR$(R2%)+" R3="+STR$(R3%)+" R4="+STR$(R4%)+" R5="+STR$(R5%))
PROCSetTime(posn%)
REM *********SYS "SharedSound_CheckDriver"
REM SYS "SharedSound_CheckDriver" :REM 1.37 It needs this
:REM for some reason to
:REM fix sample rate
REM SYS"Sound_LinearHandler",0 TO ,newHand%
REM IF newHand%=0 THEN stop%=TRUE
WHEN playMIDI%
SYS"XMIDIPlay_Info" TO L%,posn%,stop%,mtext%:stop%=stop% EOR 1
IF ?mtext%<>mtx% THEN
IF doText% THEN
IF ?mtext%<>mtx% THEN
mtx%=?mtext%
IF mtx%=1 THEN
mtext$=FNstring(mtext%+1)
......@@ -88,6 +95,7 @@ REM SYS "SharedSound_CheckDriver" :REM 1.37 It needs this
ENDIF
$MControlTextPtr%=mtext$
PROCSetIcon(MControlWin%,MControlText%,FALSE)
ENDIF
ENDIF
IF L%>midiLen% THEN midiLen%=L%
REM PROCe("Len: "+STR$(midiLen%)+" posn:"+STR$(posn%)+" stop:"+STR$(stop%))
......@@ -165,7 +173,7 @@ CASE handle% OF
WHEN 4:PROCOpenWindow(playerWin%,-1)
WHEN 2:PROCOpenMenu(iconMenuPtr%,iconMenuNum%,iconM%,X%,180)
ENDCASE
WHEN playerWin% AND button%<>2 :REM 1.37 Disable menu button
WHEN playerWin%
CASE icon% OF
WHEN playerMenuIcon%:
CASE playType% OF
......@@ -653,6 +661,7 @@ CASE pollSpace%!16 OF
IF NOT click% THEN PROCreport(fileTypeError%)
ELSE
PROCLoad(A%,pollSpace%+44,TRUE,TRUE)
IF autoPlay% THEN PROCPlay
ENDIF
ENDCASE
ENDPROC
......@@ -676,34 +685,34 @@ IF FNCheckLoad(tempType%,C%) THEN
WHEN playWAVE%:
IF FNLoadFile(fileBlk%,tempType%,FALSE,TRUE) THEN
fileType%=tempType%
REM $playerFilePtr%=RIGHT$($fileName%,10):REM 1.37
$playerFilePtr%=RIGHT$($fileName%,16)
$playerFilePtr%=RIGHT$($fileName%,10)
$playerTitlePtr%=$fileBlk%
!Z%=playerWin%
PROCCloseWindow(Z%)
IF open% THEN PROCOpenWindow(playerWin%,0)
ENDIF
WHEN playMIDI%
REM SYS"NotePad_Init",0 TO A%
REM IF A%<(midiMem%*1024) THEN SYS"NotePad_Init",midiMem%*1024
A%=T%+LEN($T%)-1
WHILE ?A%<>ASC"." AND A%>T%:A%-=1:ENDWHILE
SYS"XMIDIPlay_File",0,fileBlk%:REM C%,LEFT$($T%,A%-T%+1)
SYS"XMIDIPlay_Info" TO midiLen%
tempo%=tempoMax%/2
PROCSetTempo(0)
posn%=0
PROCSetTimeDisplay
PROCSetTime(posn%)
PROCGetType(FALSE,TRUE)
REM $playerFilePtr%=RIGHT$($fileName%,10):REM 1.37
$playerFilePtr%=RIGHT$($fileName%,16)
$playerTitlePtr%=$fileBlk%
!Z%=playerWin%
PROCCloseWindow(Z%)
IF open% THEN PROCOpenWindow(playerWin%,0)
dataLoad%=TRUE
mtx%=0
IF midiOn% THEN
REM SYS"NotePad_Init",0 TO A%
REM IF A%<(midiMem%*1024) THEN SYS"NotePad_Init",midiMem%*1024
A%=T%+LEN($T%)-1
WHILE ?A%<>ASC"." AND A%>T%:A%-=1:ENDWHILE
SYS"XMIDIPlay_File",0,fileBlk%:REM C%,LEFT$($T%,A%-T%+1)
SYS"XMIDIPlay_Info" TO midiLen%
tempo%=tempoMax%/2
PROCSetTempo(0)
posn%=0
PROCSetTimeDisplay
PROCSetTime(posn%)
PROCGetType(FALSE,TRUE)
$playerFilePtr%=RIGHT$($fileName%,10)
$playerTitlePtr%=$fileBlk%
!Z%=playerWin%
PROCCloseWindow(Z%)
IF open% THEN PROCOpenWindow(playerWin%,0)
dataLoad%=TRUE
mtx%=0
ENDIF
ENDCASE
IF ack% THEN
!(pollSpace%+12)=pollSpace%!8
......@@ -743,13 +752,14 @@ CASE type% OF
ENDIF
ENDIF
WHEN file_MIDI%
PROCReCheckMIDI
IF midiOn% THEN
PROCshadeIcon(playerWin%,playerMenuIcon%,FALSE)
PROCshadeIcon(playerWin%,playerMenuIcon%,TRUE)
PROCshadeIcon(playerWin%,playerRewind%,FALSE)
PROCshadeIcon(playerWin%,playerForward%,FALSE)
playType%=playMIDI%
R%=TRUE
ENDIF
playType%=playMIDI%
R%=TRUE
OTHERWISE
IF NOT click% THEN
SYS"XOS_ReadVarVal","File$Type_"+STR$~(type%),textBlk%,-1 TO ,,R%
......@@ -806,8 +816,9 @@ ENDIF
DEFPROCLoadF(file%,type%,play%,reset%)
LOCAL A%,B%,C%,D%,E%
PROCStop(reset%):REM Un-REMmed in 1.37 to reset sample pointer
REM SYS"Hourglass_On":REM 1.37
REM PROCStop(reset%)
PROCshadeIcon(playerWin%,playerMenuIcon%,FALSE)
SYS"Hourglass_On"
IF type%=armMovie% THEN
oldTime%=-1
SYS"Audio_PlayFile",file%,3+((1+reset%)<<8),,posn%,0 TO ,,,,A%
......@@ -842,12 +853,11 @@ ELSE
PROCSetTime(posn%)
dataPlay%=TRUE
discPlay%=FALSE
PROCshadeIcon(playerWin%,playerMenuIcon%,FALSE)
PROCshadeIcon(playerWin%,playerRewind%,FALSE)
PROCshadeIcon(playerWin%,playerForward%,FALSE)
dataLoad%=TRUE
ENDIF
REM SYS"Hourglass_Off":REM 1.37
SYS"Hourglass_Off"
ENDPROC
DEFPROCSetType
......@@ -896,6 +906,7 @@ ENDPROC
DEFPROCPlay
PROCSendMessage(17,message_PlayStart%)
IF sendMIDIstartstop% THEN SYS"MIDI_TxByte",&FA
oldTime%=-1
CASE playType% OF
WHEN playWAVE%
......@@ -926,6 +937,7 @@ ENDPROC
DEFPROCStop(reset%)
loopCount%=0
PROCSendMessage(17,message_PlayStop%)
IF sendMIDIstartstop% THEN SYS"MIDI_TxByte",&FC
IF dataLoad% AND reset% THEN
oldTime%=-1
posn%=0
......@@ -1075,8 +1087,8 @@ V%=tempo%+V%
IF V%<0 THEN V%=0
IF V%>tempoMax% THEN V%=tempoMax%
PROCRangeSprite(tempoSprite%,V%,tempoMax%)
!T%=MControlWin%:T%!4=MControlTempoBar%:T%!8=0:T%!12=0
SYS"Wimp_SetIconState",,T%
REM !T%=MControlWin%:T%!4=MControlTempoBar%:T%!8=0:T%!12=0
REM SYS"Wimp_SetIconState",,T%
tempo%=V%
M%=tempoMax%/2
V=4^(tempo%/M%-1)
......@@ -1109,7 +1121,7 @@ ENDPROC
REM ---------------- Initialising routines
DEFPROCStartWimp
taskName$="ESP MIDI/sample player"
taskName$="Player for sample data"
appName$="!Player"
dir$="<Player$Dir>."
$Z%="TASK"
......@@ -1205,7 +1217,7 @@ LOCAL W$,str%
W%=wdata%
$T%=dir$+"Templates"
SYS"Wimp_OpenTemplate",,T%
$T%="Player,Options,Info,MControl"
$T%="Player,Options,Info"
str%=T%:L%=str%+LEN($T%)
REPEAT
I%=INSTR($str%,",")
......@@ -1439,6 +1451,46 @@ DEFPROCCloseMessage
SYS"MessageTrans_CloseFile",msgBlk%
ENDPROC
REM MIDI Re-Check routine
DEFPROCReCheckMIDI
IF FNCheckMIDI THEN
IF FNCheckMIDIPlayer THEN
midiOn%=TRUE
ELSE
midiOn%=FALSE
ENDIF
ELSE
midiOn%=FALSE
ENDIF
ENDPROC
DEFFNCheckMIDIPlayer
LOCAL ERROR
ON ERROR LOCAL:RESTORE ERROR:=FALSE
OSCLI("RMEnsure MIDIPlay 0.15 RMLoad <Player$Dir>.MPlay")
OSCLI("RMEnsure MIDIPlay 0.15 Error NoMIDIPlayer")
=TRUE
DEFFNCheckMIDI
LOCAL V
V=FNGetVersion("MIDI")
=(V<>0)
DEFFNGetVersion(M$)
LOCAL V%,T%,N%
SYS"XOS_Module",18,M$ TO ,,,V%
IF V%=0 THEN
$textBlk%="0"
ELSE
V%=V%+(V%!20)
T%=textBlk%
WHILE ?V%<>9:V%+=1:ENDWHILE
REPEAT:V%+=1:?T%=?V%:T%+=1:UNTIL ?V%=32
?T%=13
ENDIF
=EVAL($textBlk%)
REM ------------------------ Error routines
DEFPROCError
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment