home *** CD-ROM | disk | FTP | other *** search
EPOC OPL Source | 1998-08-30 | 1.8 KB | 66 lines |
-
-
- Rem play, an addon command for Shell5
- Rem Play an audio file
- Rem
- Rem Copyright (C) 1998 Nick Murray
- Rem
- Rem This program is free software; you can redistribute it and/or
- Rem modify it under the terms of the GNU General Public License
- Rem as published by the Free Software Foundation; either version 2
- Rem of the License, or (at your option) any later version.
- Rem
- Rem This program is distributed in the hope that it will be useful,
- Rem but WITHOUT ANY WARRANTY; without even the implied warranty of
- Rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- Rem See the GNU General Public License for more details.
- Rem
- Rem You should have received a copy of the GNU General Public License
- Rem along with this program; if not, write to the Free Software Foundation,
- Rem Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- Rem
- INCLUDE "System.oxh"
- PROC play%:(n%)
- LOCAL buf$(255),vol%,ret%
- ONERR ErrTrap::
- vol%=1
- IF n%>1
- buf$=PEEK$(argv&(2))
- IF buf$="-s"
- STOPSOUND&:
- ELSEIF buf$="-v" AND n%=4
- vol%=VAL(PEEK$(argv&(3)))
- IF vol%<0 OR vol%>3
- RAISE -7 Rem out of range
- ENDIF
- buf$=PEEK$(argv&(4))
- GOTO Play::
- ELSEIF n%=2
- Play::
- ret%=Fparse%:(ADDR(buf$),buf$)
- IF ret% < 0
- RAISE ret%
- ELSEIF ret%
- RAISE -2 Rem change this? Invalid arguments
- ENDIF
- IF _sndstat&
- STOPSOUND&:
- IOWAITSTAT32 _sndstat&
- ENDIF
- PLAYSOUNDA:(buf$,vol%,_sndstat&)
- ELSE
- GOTO Usage::
- ENDIF
- ELSE
- Usage::
- PRINT "Usage: play [-s] [-v <volume>] <filename>"
- ENDIF
- RETURN
- ErrTrap::
- ONERR off
- PRINT err$:(ERR)
- RETURN ERR
- ENDP
-
-
-