1 /*
2  * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * This code is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License version 2 only, as
7  * published by the Free Software Foundation.  Oracle designates this
8  * particular file as subject to the "Classpath" exception as provided
9  * by Oracle in the LICENSE file that accompanied this code.
10  *
11  * This code is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14  * version 2 for more details (a copy is included in the LICENSE file that
15  * accompanied this code).
16  *
17  * You should have received a copy of the GNU General Public License version
18  * 2 along with this work; if not, write to the Free Software Foundation,
19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20  *
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.
24  */
25 
26 package com.sun.media.sound;
27 
28 /**
29  * This class is used to identify destinations in connection blocks,
30  * see ModelConnectionBlock.
31  *
32  * @author Karl Helgason
33  */
34 public final class ModelDestination {
35 
36     public static final ModelIdentifier DESTINATION_NONE = null;
37     public static final ModelIdentifier DESTINATION_KEYNUMBER
38             = new ModelIdentifier("noteon", "keynumber");
39     public static final ModelIdentifier DESTINATION_VELOCITY
40             = new ModelIdentifier("noteon", "velocity");
41     public static final ModelIdentifier DESTINATION_PITCH
42             = new ModelIdentifier("osc", "pitch");   // cent
43     public static final ModelIdentifier DESTINATION_GAIN
44             = new ModelIdentifier("mixer", "gain");   // cB
45     public static final ModelIdentifier DESTINATION_PAN
46             = new ModelIdentifier("mixer", "pan");   // 0.1 %
47     public static final ModelIdentifier DESTINATION_REVERB
48             = new ModelIdentifier("mixer", "reverb");   // 0.1 %
49     public static final ModelIdentifier DESTINATION_CHORUS
50             = new ModelIdentifier("mixer", "chorus");   // 0.1 %
51     public static final ModelIdentifier DESTINATION_LFO1_DELAY
52             = new ModelIdentifier("lfo", "delay", 0); // timecent
53     public static final ModelIdentifier DESTINATION_LFO1_FREQ
54             = new ModelIdentifier("lfo", "freq", 0); // cent
55     public static final ModelIdentifier DESTINATION_LFO2_DELAY
56             = new ModelIdentifier("lfo", "delay", 1); // timecent
57     public static final ModelIdentifier DESTINATION_LFO2_FREQ
58             = new ModelIdentifier("lfo", "freq", 1); // cent
59     public static final ModelIdentifier DESTINATION_EG1_DELAY
60             = new ModelIdentifier("eg", "delay", 0); // timecent
61     public static final ModelIdentifier DESTINATION_EG1_ATTACK
62             = new ModelIdentifier("eg", "attack", 0); // timecent
63     public static final ModelIdentifier DESTINATION_EG1_HOLD
64             = new ModelIdentifier("eg", "hold", 0); // timecent
65     public static final ModelIdentifier DESTINATION_EG1_DECAY
66             = new ModelIdentifier("eg", "decay", 0); // timecent
67     public static final ModelIdentifier DESTINATION_EG1_SUSTAIN
68             = new ModelIdentifier("eg", "sustain", 0);
69                                         // 0.1 % (I want this to be value not %)
70     public static final ModelIdentifier DESTINATION_EG1_RELEASE
71             = new ModelIdentifier("eg", "release", 0); // timecent
72     public static final ModelIdentifier DESTINATION_EG1_SHUTDOWN
73             = new ModelIdentifier("eg", "shutdown", 0); // timecent
74     public static final ModelIdentifier DESTINATION_EG2_DELAY
75             = new ModelIdentifier("eg", "delay", 1); // timecent
76     public static final ModelIdentifier DESTINATION_EG2_ATTACK
77             = new ModelIdentifier("eg", "attack", 1); // timecent
78     public static final ModelIdentifier DESTINATION_EG2_HOLD
79             = new ModelIdentifier("eg", "hold", 1); // 0.1 %
80     public static final ModelIdentifier DESTINATION_EG2_DECAY
81             = new ModelIdentifier("eg", "decay", 1); // timecent
82     public static final ModelIdentifier DESTINATION_EG2_SUSTAIN
83             = new ModelIdentifier("eg", "sustain", 1);
84                                         // 0.1 % ( I want this to be value not %)
85     public static final ModelIdentifier DESTINATION_EG2_RELEASE
86             = new ModelIdentifier("eg", "release", 1); // timecent
87     public static final ModelIdentifier DESTINATION_EG2_SHUTDOWN
88             = new ModelIdentifier("eg", "shutdown", 1); // timecent
89     public static final ModelIdentifier DESTINATION_FILTER_FREQ
90             = new ModelIdentifier("filter", "freq", 0); // cent
91     public static final ModelIdentifier DESTINATION_FILTER_Q
92             = new ModelIdentifier("filter", "q", 0); // cB
93     private ModelIdentifier destination = DESTINATION_NONE;
94     private ModelTransform transform = new ModelStandardTransform();
95 
ModelDestination()96     public ModelDestination() {
97     }
98 
ModelDestination(ModelIdentifier id)99     public ModelDestination(ModelIdentifier id) {
100         destination = id;
101     }
102 
getIdentifier()103     public ModelIdentifier getIdentifier() {
104         return destination;
105     }
106 
setIdentifier(ModelIdentifier destination)107     public void setIdentifier(ModelIdentifier destination) {
108         this.destination = destination;
109     }
110 
getTransform()111     public ModelTransform getTransform() {
112         return transform;
113     }
114 
setTransform(ModelTransform transform)115     public void setTransform(ModelTransform transform) {
116         this.transform = transform;
117     }
118 }
119