mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-21 17:37:50 -05:00
Brought up to date with the private repository (feea4c7)
This commit is contained in:
1 parent
1aa738d692
commit
1b1df1ae48
7925 files changed
+2617237
-20
No files matched your search
@@ -0,0 +1,116 @@
|
||||
package org.osmf.traits
|
||||
{
|
||||
import org.osmf.events.AudioEvent;
|
||||
|
||||
public class AudioTrait extends MediaTraitBase
|
||||
{
|
||||
|
||||
private var _volume:Number = 1;
|
||||
|
||||
private var _muted:Boolean = false;
|
||||
|
||||
private var _pan:Number = 0;
|
||||
|
||||
public function AudioTrait()
|
||||
{
|
||||
super(MediaTraitType.AUDIO);
|
||||
}
|
||||
|
||||
public function get volume() : Number
|
||||
{
|
||||
return this._volume;
|
||||
}
|
||||
|
||||
final public function set volume(param1:Number) : void
|
||||
{
|
||||
if(isNaN(param1))
|
||||
{
|
||||
param1 = 0;
|
||||
}
|
||||
else if(param1 > 1)
|
||||
{
|
||||
param1 = 1;
|
||||
}
|
||||
else if(param1 < 0)
|
||||
{
|
||||
param1 = 0;
|
||||
}
|
||||
if(param1 != this._volume)
|
||||
{
|
||||
this.volumeChangeStart(param1);
|
||||
this._volume = param1;
|
||||
this.volumeChangeEnd();
|
||||
}
|
||||
}
|
||||
|
||||
public function get muted() : Boolean
|
||||
{
|
||||
return this._muted;
|
||||
}
|
||||
|
||||
final public function set muted(param1:Boolean) : void
|
||||
{
|
||||
if(param1 != this._muted)
|
||||
{
|
||||
this.mutedChangeStart(param1);
|
||||
this._muted = param1;
|
||||
this.mutedChangeEnd();
|
||||
}
|
||||
}
|
||||
|
||||
public function get pan() : Number
|
||||
{
|
||||
return this._pan;
|
||||
}
|
||||
|
||||
final public function set pan(param1:Number) : void
|
||||
{
|
||||
if(isNaN(param1))
|
||||
{
|
||||
param1 = 0;
|
||||
}
|
||||
else if(param1 > 1)
|
||||
{
|
||||
param1 = 1;
|
||||
}
|
||||
else if(param1 < -1)
|
||||
{
|
||||
param1 = -1;
|
||||
}
|
||||
if(param1 != this._pan)
|
||||
{
|
||||
this.panChangeStart(param1);
|
||||
this._pan = param1;
|
||||
this.panChangeEnd();
|
||||
}
|
||||
}
|
||||
|
||||
protected function volumeChangeStart(param1:Number) : void
|
||||
{
|
||||
}
|
||||
|
||||
protected function volumeChangeEnd() : void
|
||||
{
|
||||
dispatchEvent(new AudioEvent(AudioEvent.VOLUME_CHANGE,false,false,false,this._volume));
|
||||
}
|
||||
|
||||
protected function mutedChangeStart(param1:Boolean) : void
|
||||
{
|
||||
}
|
||||
|
||||
protected function mutedChangeEnd() : void
|
||||
{
|
||||
dispatchEvent(new AudioEvent(AudioEvent.MUTED_CHANGE,false,false,this._muted));
|
||||
}
|
||||
|
||||
protected function panChangeStart(param1:Number) : void
|
||||
{
|
||||
}
|
||||
|
||||
protected function panChangeEnd() : void
|
||||
{
|
||||
dispatchEvent(new AudioEvent(AudioEvent.PAN_CHANGE,false,false,false,NaN,this._pan));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user