-
Notifications
You must be signed in to change notification settings - Fork 5
/
Volume.as
46 lines (41 loc) · 964 Bytes
/
Volume.as
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package {
import flash.net.Socket;
import flash.utils.ByteArray;
import mx.utils.Base64Decoder;
public class Volume {
public var name:String;
public var type:int;
public var minval:Number;
public var maxval:Number;
public var colors:Vector.<uint>=null;
public var names:Vector.<String>=null;
public function Volume(config:Socket) {
type=config.readByte();
name=config.readUTF();
switch(type) {
case 1:
case 2:
minval=config.readDouble();
maxval=config.readDouble();
break;
case 3:
case 4:
const items:int=config.readUnsignedShort();
colors=new Vector.<uint>;
names=new Vector.<String>;
for(var i:int=0;i<items;i++) {
colors.push(config.readUnsignedInt());
names.push(config.readUTF());
}
break;
case 5:
break;
default:
trace("type?");
}
}
public var parammin:Number;
public var parammax:Number;
public var gray:Boolean=true;
}
}