Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
154 lines (135 loc) · 3.78 KB

File metadata and controls

154 lines (135 loc) · 3.78 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
package clipgenerator;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.util.ArrayList;
import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import PamModel.parametermanager.PrivatePamParameterData;
/**
* General clip gen settings (file location, etc.
* and list of more detector specific settings.
* @author Doug Gillespie
*
*/
public class ClipSettings implements Serializable, Cloneable, ManagedParameters {
public static final long serialVersionUID = 1L;
public static final int STORE_WAVFILES = 0;
public static final int STORE_BINARY = 1;
public static final int STORE_ANNOTATION = 2;
public static final int STORE_BOTH = 3;
/**
* Raw Audio Data source.
*/
public String dataSourceName;
/**
* output file folder.
*/
public String outputFolder;
public boolean datedSubFolders = true;
public int storageOption = STORE_BINARY;
/**
* Id of compressor to use to squish data
* (currently only used in Annotation version, need
* to add to Integer version).
*/
public int compressorIndex;
/**
* List of clip generator settings.
*/
private ArrayList<ClipGenSetting> clipGenSettings;
/* (non-Javadoc)
* @see java.lang.Object#clone()
*/
@Override
public ClipSettings clone() {
try {
ClipSettings newSettings = (ClipSettings) super.clone();
int n = getNumClipGenerators();
newSettings.clipGenSettings = new ArrayList<ClipGenSetting>();
for (int i = 0; i < n; i++) {
newSettings.clipGenSettings.add(getClipGenSetting(i).clone());
}
return newSettings;
}
catch (CloneNotSupportedException e) {
e.printStackTrace();
return null;
}
}
/**
*
* @return the number of clip generators.
*/
public int getNumClipGenerators() {
if (clipGenSettings == null) {
return 0;
}
return clipGenSettings.size();
}
/**
* Get a clip generator setting objecct
* @param i number of the clip generator
* @return the slip generator settings
*/
public ClipGenSetting getClipGenSetting(int i) {
if (clipGenSettings == null) {
return null;
}
return clipGenSettings.get(i);
}
/**
* Find the clip generator settings for a specific data stream.
*
* @param dataName data name for the data block.
* @return clip generator settings, or null if none active.
*/
public ClipGenSetting findClipGenSetting(String dataName) {
int n = getNumClipGenerators();
for (int i = 0; i < n; i++) {
if (clipGenSettings.get(i).dataName.equals(dataName)) {
return clipGenSettings.get(i);
}
}
return null;
}
/**
* Clear all clip generator settings.
*/
public void clearClipGenSettings() {
if (clipGenSettings == null) return;
clipGenSettings.clear();
}
/**
* Add a new clip gen setting to the list.
* @param clipGenSetting
*/
public void addClipGenSettings(ClipGenSetting clipGenSetting) {
if (clipGenSettings == null) {
clipGenSettings = new ArrayList<ClipGenSetting>();
}
clipGenSettings.add(clipGenSetting);
}
public void replace(ClipGenSetting oldSetting, ClipGenSetting newSettings) {
// replace a clipgensetting in the list.
int pos = clipGenSettings.indexOf(oldSetting);
clipGenSettings.remove(pos);
clipGenSettings.add(pos, newSettings);
}
@Override
public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
try {
Field field = this.getClass().getDeclaredField("clipGenSettings");
ps.put(new PrivatePamParameterData(this, field) {
@Override
public Object getData() throws IllegalArgumentException, IllegalAccessException {
return clipGenSettings;
}
});
} catch (NoSuchFieldException | SecurityException e) {
e.printStackTrace();
}
return ps;
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.