home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CyberMycha 2006 April
/
SGP.iso
/
dema
/
Keepsake-Demo-en-li-v1.0.exe
/
res
/
bin
/
prime
/
oz'sound.tcl
< prev
next >
Wrap
Text File
|
2006-01-12
|
3KB
|
123 lines
proc oz'sound::property {this args} {
set optstring {
{volume "1"}
{repeat "0"}
{streaming "1"}
{pos "0 0 0"}
}
array set v [cmdline::getopt $args $optstring]
if $v(volume?) {oz'sound::volume $this $v(volume)}
if $v(repeat?) {oz'sound::repeat $this $v(repeat)}
if $v(streaming?) {oz'sound::streaming $this $v(streaming)}
if $v(pos?) {oz'sound::position $this $v(pos)}
}
rename oz'sound::position oz'sound::_position
proc oz'sound::position {this pos} {
_position $this [lindex $pos 0] [lindex $pos 1] [lindex $pos 2]
}
namespace eval wq'sound {
proc new {name args} {
set optstring {{play} {wait}}
array set v [cmdline::getopt $args $optstring]
set sound [::new oz'sound $name]
oz'sound::volume $sound $::config::soundfx::volume
oz'sound::position_follow $sound Lydia
eval "oz'sound::property $sound $args"
if $v(play?) {
oz'event {
oz'sound::play $sound
if $v(wait?) {oz'delay [oz'sound::duration $sound]}
}
}
return $sound
}
proc stop {this} {
oz'event {oz'sound::stop $this}
}
}
namespace eval ozqSound {
proc New {filename} {
set sound [::new oz'sound $name]
oz'sound::position_follow $sound Lydia
return $sound
}
proc New3DFX {vname filename} {
upvar $vname v
if ![info exists v] {
set v [::new oz'sound $filename]
oz'sound::position_follow $v Lydia
oz'event {
oz'sound::volume $v $::config::soundfx::volume
oz'sound::streaming $v 0
}
}
}
proc NewPosFX {filename} {
set v [::new oz'sound $filename]
oz'sound::position_follow $v Lydia
oz'event {
oz'sound::volume $v $::config::soundfx::volume
oz'sound::streaming $v 0
oz'sound::reference_distance $v 12
oz'sound::position $v "[wizEntityGetPosition Lydia]"
oz'sound::play $v
}
}
proc NewFX {filename} {
set v [::new oz'sound $filename]
oz'sound::position_follow $v Lydia
oz'event {
oz'sound::volume $v $::config::soundfx::volume
oz'sound::play $v
}
return [oz'sound::duration $v]
}
proc NewFX2 {filename} {
set v [::new oz'sound $filename]
oz'sound::position_follow $v Lydia
oz'event {
oz'sound::volume $v $::config::soundfx::volume
oz'sound::play $v
}
return $v
}
proc Position {this p} {
oz'event {oz'sound::position $this "$p"}
}
proc ReferenceDistance {this d} {
oz'event {oz'sound::reference_distance $this $d}
}
proc Volume {this v} {
oz'event {oz'sound::volume $this $v}
}
proc Rolloff {this d} {
oz'event {oz'sound::rolloff $this $d}
}
proc Repeat {this value} {
oz'event {oz'sound::repeat $this $value}
}
proc Play {this} {
oz'event {oz'sound::play $this}
}
}