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

Clean up pass

* Merged the changes between 1.37a and 1.39
* Internationalised the task name and format descriptions
* Get the version/date from the build system
* Tidied up the templates a bit, so button sizes are per Style Guide
* Deleted duplicate sprites, simplified !Run

Tested with a selection of WAV files. MIDI playback has not been tested.

Version 1.40. Tagged as 'Player-1_40'
parent cc859d38
| !Player Run file
Wimpslot -min 90K -max 90K
If "<File$Type_BF7>" = "" Then Set File$Type_BF7 RIFF
If "<File$Type_FB1>" = "" Then Set File$Type_FB1 WaveForm
If "<File$Type_D3C>" = "" Then Set File$Type_D3C ArmSamp
Iconsprites <Obey$Dir>.!Sprites
|RMEnsure RealTime 0.01 RMload System:Modules.RTime
Set Player$Dir <Obey$Dir>
Run <Player$Dir>.CheckSound
Obey <Player$Dir>.!Boot
Wimpslot -min 90K -max 90K
Run <Player$Dir>.CheckSound
/<Player$Dir>.!RunImage %*0
No preview for this file type
No preview for this file type
No preview for this file type
!Player can play MIDI files (through MIDIPort 0, i.e. the default MIDI OUT
port) and sound sample player (through SharedSound). Sample formats supported
are: ArmMovie, 'Data', Armadeus, AudioWrk, WaveForm (WAV), Riff, DOS and
Modules.
For sales and support, please contact sales@liquid-silicon.com and NOT ESP.
!Player history
===============
1.37 26/32-bit neutral modules. Requires RISC OS 3.50 or later.
Fixed MIDIPlay module, had problems with dynamic areas. Now doesn't
use them.
Removed hourglass when playing samples.
Stopped Menu button confusingly activating the icons.
Fixed Control button bring greyed out unless loading a MIDI file
first. Don't know if this was a bug or a feature!
File/song name increased from 10 to 16 characters.
Now resets song pointer on new sample loads.
1.37a Had left some test lines in e.g. when dragging an unknown file in.
!Player
=======
Player can play
* MIDI files (through MIDIPort 0, ie. the default MIDI OUT port)
* Sound samples (through SharedSound) sample formats supported are:
- ArmMovie
- Raw samples filetyped 'Data' and 'DOS'
- Armadeus
- AudioWrk
- WaveForm (WAV)
- Riff
- Modules.
There appear to be some issues on 8-bit sound Risc PCs, where the sound can
sometimes give crackles or white noise after pressing Stop. This hasn't been
tracked down. Usually having !Synth loaded solves the problems.
About !Player
-------------
Player was written by Expressive Software Projects with additional work and
improvements by Liquid Silicon.
Copyright (c) 1994, Expressive Software Projects
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Expressive Software Projects nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL EXPRESSIVE SOFTWARE PROJECTS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ESP Sample Player Messages
# ESP MAY 1994,Dec 1996
# 0.2 04/12/96
# ESP 1994
#
# -- Icon menu contains 2 items
iconM0:Player
iconM1:Info
iconM2:Quit
#
# -- About this program
_TaskName:Digital sample player
_Version:9.99 (DD-Mmm-YY)
#
# -- Sample rate title
rateM0:Sample rate
#
# -- Bit messages
# -- Format messages
Bit4:4 bit
Bit8:8 bit
Bit12:12 bit
Bit16:16 bit
FmtS:Signed
FmtU:Unsigned
Mono:Mono
Stereo:Stereo
#
# -- Error/Report messages
Report0:Incorrect file type
......@@ -24,4 +31,3 @@ Report3:ADPCM sample rates can only be taken from those in the menu list
Report4:Movie does not contain sound
Report5:Sound playback not available
Report6:MIDI playback not available
#
/* (1.39)
/* (1.40)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 1.39
#define Module_MajorVersion_CMHG 1.40
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 22 Jun 1999
#define Module_Date_CMHG 12 Mar 2021
#define Module_MajorVersion "1.39"
#define Module_Version 139
#define Module_MajorVersion "1.40"
#define Module_Version 140
#define Module_MinorVersion ""
#define Module_Date "22 Jun 1999"
#define Module_Date "12 Mar 2021"
#define Module_ApplicationDate "22-Jun-99"
#define Module_ApplicationDate "12-Mar-21"
#define Module_ComponentName "Player"
#define Module_FullVersion "1.39"
#define Module_HelpVersion "1.39 (22 Jun 1999)"
#define Module_LibraryVersionInfo "1:39"
#define Module_FullVersion "1.40"
#define Module_HelpVersion "1.40 (12 Mar 2021)"
#define Module_LibraryVersionInfo "1:40"
......@@ -26,21 +26,19 @@ 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$=" (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
dir$="<Player$Dir>."
PROCMakeDims
PROCOpenMessage
PROCSet
PROCStartWimp
......@@ -49,8 +47,8 @@ rcode%=FNCheckRealTime
PROCLoadWimpSprites
PROCLoadWindows
PROCLoadMenus
PROCCloseMessage
PROCGetType(TRUE,TRUE)
PROCshadeIcon(playerWin%,playerMenuIcon%,TRUE)
PROCSetVolume(currentVolume%)
ON ERROR PROCError
......@@ -87,14 +85,14 @@ REPEAT
SYS"XMIDIPlay_Info" TO L%,posn%,stop%,mtext%:stop%=stop% EOR 1
IF doText% THEN
IF ?mtext%<>mtx% THEN
mtx%=?mtext%
IF mtx%=1 THEN
mtx%=?mtext%
IF mtx%=1 THEN
mtext$=FNstring(mtext%+1)
ELSE
ELSE
mtext$=mtext$+FNstring(mtext%+1)
ENDIF
$MControlTextPtr%=mtext$
PROCSetIcon(MControlWin%,MControlText%,FALSE)
ENDIF
$MControlTextPtr%=mtext$
PROCSetIcon(MControlWin%,MControlText%,FALSE)
ENDIF
ENDIF
IF L%>midiLen% THEN midiLen%=L%
......@@ -174,6 +172,7 @@ CASE handle% OF
WHEN 2:PROCOpenMenu(iconMenuPtr%,iconMenuNum%,iconM%,X%,180)
ENDCASE
WHEN playerWin%
IF button%=2 THEN icon%=-1:REM Disable Menu button
CASE icon% OF
WHEN playerMenuIcon%:
CASE playType% OF
......@@ -685,7 +684,7 @@ IF FNCheckLoad(tempType%,C%) THEN
WHEN playWAVE%:
IF FNLoadFile(fileBlk%,tempType%,FALSE,TRUE) THEN
fileType%=tempType%
$playerFilePtr%=RIGHT$($fileName%,10)
$playerFilePtr%=RIGHT$($fileName%,16)
$playerTitlePtr%=$fileBlk%
!Z%=playerWin%
PROCCloseWindow(Z%)
......@@ -705,7 +704,7 @@ IF FNCheckLoad(tempType%,C%) THEN
PROCSetTimeDisplay
PROCSetTime(posn%)
PROCGetType(FALSE,TRUE)
$playerFilePtr%=RIGHT$($fileName%,10)
$playerFilePtr%=RIGHT$($fileName%,16)
$playerTitlePtr%=$fileBlk%
!Z%=playerWin%
PROCCloseWindow(Z%)
......@@ -754,7 +753,7 @@ CASE type% OF
WHEN file_MIDI%
PROCReCheckMIDI
IF midiOn% THEN
PROCshadeIcon(playerWin%,playerMenuIcon%,TRUE)
PROCshadeIcon(playerWin%,playerMenuIcon%,FALSE)
PROCshadeIcon(playerWin%,playerRewind%,FALSE)
PROCshadeIcon(playerWin%,playerForward%,FALSE)
playType%=playMIDI%
......@@ -816,8 +815,7 @@ ENDIF
DEFPROCLoadF(file%,type%,play%,reset%)
LOCAL A%,B%,C%,D%,E%
REM PROCStop(reset%)
PROCshadeIcon(playerWin%,playerMenuIcon%,FALSE)
PROCStop(reset%)
SYS"Hourglass_On"
IF type%=armMovie% THEN
oldTime%=-1
......@@ -853,6 +851,7 @@ ELSE
PROCSetTime(posn%)
dataPlay%=TRUE
discPlay%=FALSE
PROCshadeIcon(playerWin%,playerMenuIcon%,FALSE)
PROCshadeIcon(playerWin%,playerRewind%,FALSE)
PROCshadeIcon(playerWin%,playerForward%,FALSE)
dataLoad%=TRUE
......@@ -1087,8 +1086,8 @@ V%=tempo%+V%
IF V%<0 THEN V%=0
IF V%>tempoMax% THEN V%=tempoMax%
PROCRangeSprite(tempoSprite%,V%,tempoMax%)
REM !T%=MControlWin%:T%!4=MControlTempoBar%:T%!8=0:T%!12=0
REM SYS"Wimp_SetIconState",,T%
!T%=MControlWin%:T%!4=MControlTempoBar%:T%!8=0:T%!12=0
SYS"Wimp_SetIconState",,T%
tempo%=V%
M%=tempoMax%/2
V=4^(tempo%/M%-1)
......@@ -1121,9 +1120,8 @@ ENDPROC
REM ---------------- Initialising routines
DEFPROCStartWimp
taskName$="Player for sample data"
taskName$=FNGetToken("_TaskName")
appName$="!Player"
dir$="<Player$Dir>."
$Z%="TASK"
$(Z%+4)=taskName$+CHR$(0)
SYS"Wimp_Initialise",200,!Z%,Z%+4 TO vers%,taskHandle%
......@@ -1153,12 +1151,15 @@ oldRates%()=5000,6250,6944,7812,8928,10416,11025,11363,12500,13888,15625,17857,2
ENDPROC
DEFPROCSet
signedLin%=0:sampName$(0)="Signed"
unsignedLin%=1:sampName$(1)="Unsigned"
doText%=FALSE
autoPlay%=FALSE
sendMIDIstartstop%=FALSE
signedLin%=0:sampName$(0)=FNGetToken("FmtS")
unsignedLin%=1:sampName$(1)=FNGetToken("FmtU")
arcLog%=2:sampName$(2)="Arc"
adpcm%=3:sampName$(3)="ADPCM"
mono%=1:sampName$(4)="Mono"
stereo%=2:sampName$(5)="Stereo"
mono%=1:sampName$(4)=FNGetToken("Mono")
stereo%=2:sampName$(5)=FNGetToken("Stereo")
pause%=FALSE
loop%=FALSE
mute%=FALSE
......@@ -1217,7 +1218,7 @@ LOCAL W$,str%
W%=wdata%
$T%=dir$+"Templates"
SYS"Wimp_OpenTemplate",,T%
$T%="Player,Options,Info"
$T%="Player,Options,Info,MControl"
str%=T%:L%=str%+LEN($T%)
REPEAT
I%=INSTR($str%,",")
......@@ -1285,7 +1286,7 @@ REPEAT
optionsOK%=22
optionsCancel%=21
WHEN "Info":
$(!(P%+4*32))=v$+d$
$(!(P%+4*32))=FNGetToken("_Version")
WHEN "MControl"
R%!64=wimpSprites%
MControlTempoBar%=2
......@@ -1322,18 +1323,18 @@ ENDCASE
ENDPROC
DEFPROCLoadMenus
LOCALentry$
DIM menuList$(30)
M%=0:mcount%=0
PROCOpenMessage
iconM%=mcount%:mcount%+=1
iconMenuNum%=2
iconMenuPtr%=M%:M%+=(iconMenuNum%+1)
FOR I%=0 TO iconMenuNum%
PROCGetToken("iconM"+STR$(I%))
entry$=FNGetToken("iconM"+STR$(I%))
CASE I% OF
WHEN 1:out$+=">"+STR$(infoWin%)
WHEN 1:entry$+=">"+STR$(infoWin%)
ENDCASE
menuList$(iconMenuPtr%+I%)=out$
menuList$(iconMenuPtr%+I%)=entry$
NEXT
rateM%=mcount%:mcount%+=1
IF soundOn% AND sound16% THEN
......@@ -1342,8 +1343,7 @@ ELSE
rateMenuNum%=oldRateNum%
ENDIF
rateMenuPtr%=M%:M%+=(rateMenuNum%+1)
PROCGetToken("rateM0")
menuList$(rateMenuPtr%)=out$
menuList$(rateMenuPtr%)=FNGetToken("rateM0")
FOR I%=1 TO rateMenuNum%
IF soundOn% AND sound16% THEN
SYS"Sound_SampleRate",2,I% TO ,,A%
......@@ -1353,33 +1353,24 @@ FOR I%=1 TO rateMenuNum%
menuList$(rateMenuPtr%+I%)=STR$(A%>>10)
NEXT
FOR I%=1 TO 3
PROCGetToken("Bit"+STR$((I%+1)*4))
bit$(I%)=" "+out$
FOR I%=0 TO 3
bit$(I%)=" "+FNGetToken("Bit"+STR$((I%+1)*4))
NEXT
PROCGetToken("Report0")
fileTypeError%=0
message$(0)=out$
PROCGetToken("Report1")
message$(0)=FNGetToken("Report0")
fileTypeLoadError%=1
message$(1)=out$
PROCGetToken("Report2")
message$(1)=FNGetToken("Report1")
sampleRateError%=2
message$(2)=out$
PROCGetToken("Report3")
message$(2)=FNGetToken("Report2")
adpcmRateError%=3
message$(3)=out$
PROCGetToken("Report4")
message$(3)=FNGetToken("Report3")
movieNoSoundError%=4
message$(4)=out$
PROCGetToken("Report5")
message$(4)=FNGetToken("Report4")
soundNotOnError%=5
message$(5)=out$
PROCGetToken("Report6")
message$(5)=FNGetToken("Report5")
midiNotOnError%=6
message$(6)=out$
PROCCloseMessage
message$(6)=FNGetToken("Report6")
fileLoadError%=7
ENDPROC
......@@ -1439,13 +1430,14 @@ REM ------------------------ Messages
DEFPROCOpenMessage
$fileBlk%=dir$+"Messages"
SYS"MessageTrans_FileInfo",,fileBlk% TO F%,,S%
IF (F% AND 1) = 0 THEN mbuf%=Z%
IF (F% AND 1) = 0 THEN DIM mbuf% S%
SYS"MessageTrans_OpenFile",msgBlk%,fileBlk%,mbuf%
ENDPROC
DEFPROCGetToken(token$)
DEFFNGetToken(token$)
LOCALout$
SYS"MessageTrans_Lookup",msgBlk%,token$,T%,256,0,0,0,0 TO ,,out$
ENDPROC
=out$
DEFPROCCloseMessage
SYS"MessageTrans_CloseFile",msgBlk%
......@@ -1454,22 +1446,18 @@ ENDPROC
REM MIDI Re-Check routine
DEFPROCReCheckMIDI
IF FNCheckMIDI THEN
IF FNCheckMIDIPlayer THEN
midiOn%=TRUE
ELSE
midiOn%=FALSE
ENDIF
IF FNCheckMIDI AND FNCheckMIDIPlayer THEN
midiOn%=TRUE
ELSE
midiOn%=FALSE
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")
OSCLI("RMEnsure MIDIPlay 2.24 RMLoad <Player$Dir>.MPlay")
OSCLI("RMEnsure MIDIPlay 2.24 Error NoMIDIPlayer")
=TRUE
DEFFNCheckMIDI
......@@ -1486,6 +1474,7 @@ ELSE
V%=V%+(V%!20)
T%=textBlk%
WHILE ?V%<>9:V%+=1:ENDWHILE
IF ?V%=9:V%+=1
REPEAT:V%+=1:?T%=?V%:T%+=1:UNTIL ?V%=32
?T%=13
ENDIF
......@@ -1501,6 +1490,7 @@ SYS"Wimp_ReportError",Z%,1,taskName$ TO ,R%
ENDPROC
DEFPROCErr
taskName$="Player"
PROCError
END
ENDPROC
......
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