author | never |
Mon, 12 Jul 2010 22:27:18 -0700 | |
changeset 5926 | a36f90d986b6 |
parent 5506 | 202f599c92aa |
child 18215 | b2afd66ce6db |
permissions | -rw-r--r-- |
1846
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
1 |
/* |
5506 | 2 |
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. |
1846
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
4 |
* |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
1846
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
1846
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
10 |
* |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
15 |
* accompanied this code). |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
16 |
* |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
17 |
* You should have received a copy of the GNU General Public License version |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
20 |
* |
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
1846
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
24 |
*/ |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
25 |
package com.sun.media.sound; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
26 |
|
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
27 |
import java.util.ArrayList; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
28 |
import java.util.List; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
29 |
|
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
30 |
/** |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
31 |
* This class is used to define how to synthesize audio in universal maner |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
32 |
* for both SF2 and DLS instruments. |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
33 |
* |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
34 |
* @author Karl Helgason |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
35 |
*/ |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
36 |
public class ModelPerformer { |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
37 |
|
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
38 |
private List<ModelOscillator> oscillators = new ArrayList<ModelOscillator>(); |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
39 |
private List<ModelConnectionBlock> connectionBlocks |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
40 |
= new ArrayList<ModelConnectionBlock>(); |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
41 |
private int keyFrom = 0; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
42 |
private int keyTo = 127; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
43 |
private int velFrom = 0; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
44 |
private int velTo = 127; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
45 |
private int exclusiveClass = 0; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
46 |
private boolean releaseTrigger = false; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
47 |
private boolean selfNonExclusive = false; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
48 |
private Object userObject = null; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
49 |
private boolean addDefaultConnections = true; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
50 |
private String name = null; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
51 |
|
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
52 |
public String getName() { |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
53 |
return name; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
54 |
} |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
55 |
|
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
56 |
public void setName(String name) { |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
57 |
this.name = name; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
58 |
} |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
59 |
|
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
60 |
public List<ModelConnectionBlock> getConnectionBlocks() { |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
61 |
return connectionBlocks; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
62 |
} |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
63 |
|
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
64 |
public void setConnectionBlocks(List<ModelConnectionBlock> connectionBlocks) { |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
65 |
this.connectionBlocks = connectionBlocks; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
66 |
} |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
67 |
|
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
68 |
public List<ModelOscillator> getOscillators() { |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
69 |
return oscillators; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
70 |
} |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
71 |
|
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
72 |
public int getExclusiveClass() { |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
73 |
return exclusiveClass; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
74 |
} |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
75 |
|
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
76 |
public void setExclusiveClass(int exclusiveClass) { |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
77 |
this.exclusiveClass = exclusiveClass; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
78 |
} |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
79 |
|
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
80 |
public boolean isSelfNonExclusive() { |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
81 |
return selfNonExclusive; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
82 |
} |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
83 |
|
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
84 |
public void setSelfNonExclusive(boolean selfNonExclusive) { |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
85 |
this.selfNonExclusive = selfNonExclusive; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
86 |
} |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
87 |
|
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
88 |
public int getKeyFrom() { |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
89 |
return keyFrom; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
90 |
} |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
91 |
|
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
92 |
public void setKeyFrom(int keyFrom) { |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
93 |
this.keyFrom = keyFrom; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
94 |
} |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
95 |
|
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
96 |
public int getKeyTo() { |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
97 |
return keyTo; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
98 |
} |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
99 |
|
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
100 |
public void setKeyTo(int keyTo) { |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
101 |
this.keyTo = keyTo; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
102 |
} |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
103 |
|
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
104 |
public int getVelFrom() { |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
105 |
return velFrom; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
106 |
} |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
107 |
|
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
108 |
public void setVelFrom(int velFrom) { |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
109 |
this.velFrom = velFrom; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
110 |
} |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
111 |
|
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
112 |
public int getVelTo() { |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
113 |
return velTo; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
114 |
} |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
115 |
|
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
116 |
public void setVelTo(int velTo) { |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
117 |
this.velTo = velTo; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
118 |
} |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
119 |
|
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
120 |
public boolean isReleaseTriggered() { |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
121 |
return releaseTrigger; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
122 |
} |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
123 |
|
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
124 |
public void setReleaseTriggered(boolean value) { |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
125 |
this.releaseTrigger = value; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
126 |
} |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
127 |
|
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
128 |
public Object getUserObject() { |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
129 |
return userObject; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
130 |
} |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
131 |
|
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
132 |
public void setUserObject(Object object) { |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
133 |
userObject = object; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
134 |
} |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
135 |
|
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
136 |
public boolean isDefaultConnectionsEnabled() { |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
137 |
return addDefaultConnections; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
138 |
} |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
139 |
|
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
140 |
public void setDefaultConnectionsEnabled(boolean addDefaultConnections) { |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
141 |
this.addDefaultConnections = addDefaultConnections; |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
142 |
} |
4a53d636e2f4
6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents:
diff
changeset
|
143 |
} |