-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathChannelData.java
More file actions
52 lines (45 loc) · 1.14 KB
/
ChannelData.java
File metadata and controls
52 lines (45 loc) · 1.14 KB
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
47
48
49
50
51
52
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package javaFlacEncoder;
/**
*
* @author preston
*/
public class ChannelData {
public enum ChannelName {
LEFT,
RIGHT,
MID,
SIDE,
INDEPENDENT
}
private int[] samples = null;
private int count;
private int sampleSize;
private ChannelName name;
public ChannelData(int[] samples, int count, int sampleSize, ChannelName n) {
this.count = count;
this.samples = samples;
this.sampleSize = sampleSize;
this.name = n;
}
public int[] getSamples() { return samples; }
public int getCount() { return count; }
public int getSampleSize() { return sampleSize; }
public ChannelName getChannelName() { return name; }
public int setData(int[] newSamples, int count, int sampleSize, ChannelName n) {
samples = newSamples;
this.sampleSize = sampleSize;
this.name = n;
return setCount(count);
}
public int setCount(int count) {
this.count = (count <= samples.length) ? count:samples.length;
return this.count;
}
public void setChannelName(ChannelName cn) {
this.name = cn;
}
}