;****** thxplay.library/thxGetVolume ******************************************
;
;   NAME
;       thxGetVolume -- get master volume.
;
;   SYNOPSIS
;       volume = thxGetVolume()
;
;       UBYTE thxGetVolume(void);
;
;       volume := thxGetVolume()
;
;   FUNCTION
;       Returns the current master volume value. Does not stop play.
;
;   RESULT
;       volume - current volume setting from 0 (silent) to 64 (loudest)
;
;   SEE ALSO
;       thxSetVolume()
;
;****************************************************************************
;
;
	cnop	0,4
	xdef	thxGetVolume
thxGetVolume
	move.l	THX+thxBSS_P(pc),d0
	beq.s	.exit
	move.l	d0,a0
	moveq	#0,d0
	move.b	thx_pMainVolume(a0),d0
.exit	rts


;****** thxplay.library/thxSetVolume ******************************************
;
;   NAME
;       thxSetVolume -- set master volume.
;
;   SYNOPSIS
;       void thxSetVolume(volume)
;                         D0
;
;       void thxSetVolume(UBYTE);
;
;       thxSetVolume(volume)
;
;   FUNCTION
;       Sets the master volume. Does not stop play.
;
;   INPUTS
;       volume - from 0 (silent) to 64 (loudest)
;
;   NOTE
;       This  function  can take up to two frames to take an audible effect.
;       If the song is paused, will not take effect until unpaused.
;
;   SEE ALSO
;       thxGetVolume()
;
;****************************************************************************
;
;
	cnop	0,4
	xdef	thxSetVolume__i
thxSetVolume__i
	ifnd	_LIBRARY_
	move.l	4(sp),d0
	endc
	cmp.b	#64,d0
	bhi.s	.exit
	move.l	THX+thxBSS_P(pc),d1
	beq.s	.exit
	move.l	d1,a0
	move.b	d0,thx_pMainVolume(a0)
.exit	rts
