'
'             QDXSOUND Object Sample
'               By Baptiste BIDEAUX
'
'           E-mail : zecreator@yahoo.fr
'
'           Show the object properties

$include <rapidq.inc>

declare sub btnclick() 
declare sub wavchange()

dim form as qform
dim wav as qdxsound
dim vol as qscrollbar
dim pan as qscrollbar
dim freq as qscrollbar
dim btn as qbutton
dim lab1 as qlabel
dim lab2 as qlabel
dim lab3 as qlabel


form.center
form.borderstyle=3
form.caption="QDXSOUND Object sample"

'Defint wav sound
wav.parent=form
wav.filename="sound.wav"
wav.volume=100

' Defint the playing button
btn.parent=form
btn.caption="Play"
btn.left=120
btn.top=4
btn.onclick=btnclick

'Defint the volume scrollbar
vol.parent=form
vol.max=100
vol.min=70
vol.width=230
vol.left=72
vol.top=48
vol.position=100
vol.onscroll=wavchange

'Defint the panning scrollbar
pan.parent=form
pan.max=100
pan.min=-100
pan.width=230
pan.left=72
pan.top=96
pan.position=0
pan.onscroll=wavchange

' Defint then frequency scrollbar
freq.parent=form
freq.max=44000
freq.min=11000
freq.width=230
freq.left=72
freq.top=144
freq.position=22000
freq.onscroll=wavchange

' The scrollbars labels
lab1.parent=form
lab1.caption="Volume"
lab1.left=16
lab1.top=48

lab2.parent=form
lab2.caption="Panning"
lab2.left=16
lab2.top=96

lab3.parent=form
lab3.caption="Frequency"
lab3.left=16
lab3.top=144

form.showmodal

sub btnclick()
'
' Playing wav file
'
wav.position=0 'Set the wav position at 0 (start)
wav.play
end sub

sub wavchange()
'
' Change the wav setting (vol, pan and freq)
'
wav.volume=vol.position
wav.pan=pan.position
wav.frequency=freq.position
end sub
