TriOS-alt/system/regnatix/wplay.spin

118 lines
10 KiB
Plaintext
Raw Normal View History

2010-04-16 00:25:58 +02:00
<EFBFBD><EFBFBD>{{
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Autor: Ingo Kripahle %
% Copyright (c) 2010 Ingo Kripahle %
% See end of file for terms of use. %
% Die Nutzungsbedingungen befinden sich am Ende der Datei %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Informationen : hive-project.de
Kontakt : drohne235@googlemail.com
System : TriOS
Name : wplay
Chip : Regnatix
Typ : Programm
Version :
Subversion :
Funktion : wav-player f<00>r kommandozeile
Komponenten : -
COG's : -
Logbuch :
16-04-2010-dr235 - erste trios-version
Kommandoliste :
/? : Hilfetext
/p name.wav : WAV-Datei abspielen
Notizen :
}}
OBJ
ios: "ios"
CON
_CLKMODE = XTAL1 + PLL16X
_XINFREQ = 5_000_000
VAR
byte parastr[64]
PUB main
ios.start 'ios initialisieren
ios.parastart 'parameter<00>bergabe starten
repeat while ios.paranext(@parastr) 'parameter einlesen
if byte[@parastr][0] == "/" 'option?
case byte[@parastr][1]
"?": ios.print(@help1) '/?
"p": playWav '/p
ios.stop
PRI playWav | err 'wav abspielen
if ios.paranext(@parastr) 'parameter?
ios.admsetsound(ios#SND_HSSOFF) 'hss ausschalten
ios.admsetsound(ios#SND_WAVON) 'wav einschalten
if err := ios.wav_play(@parastr) 'fehler bei start des players?
ios.print(@err0) 'fehlernummer ausgeben
ios.printdec(err)
else
wav_status 'warten, solange wav gespielt wird (sd belegt)
ios.admsetsound(ios#SND_WAVOFF) 'wav ausschalten
ios.admsetsound(ios#SND_HSSON) 'hss anschalten
else 'kein parameter: fehlermeldung
printErr(@err1)
PUB wav_status|status,curpos 'warten bis player fertig, oder abbruch
ios.print(string("Status <*> : "))
ios.curoff
curpos := ios.curgetx
repeat
status := ios.wav_status
ios.cursetx(curpos)
ios.printdec(status)
if ios.key 'bei taste stopsignal an player senden
ios.wav_stop
while status 'schleife solange player aktiv
ios.curon
PRI printErr(stradr)
ios.print(@err0)
ios.print(stradr)
ios.print(@help1)
DAT
err0 byte 13,"Fehler : ",0
err1 byte "Zu wenig Parameter!",13,0
help1 file "wplay.txt"
byte 13,0
DAT
{{
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TERMS OF USE: MIT License %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$%
%Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation %
%files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, %
%modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software%
%is furnished to do so, subject to the following conditions: %
% %
%The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.%
% %
%THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE %
%WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR %
%COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, %
%ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}}