Chris@37
|
1 /*
|
Chris@37
|
2 jVamp
|
Chris@37
|
3
|
Chris@37
|
4 A Java host interface for Vamp audio analysis plugins
|
Chris@37
|
5
|
Chris@37
|
6 Centre for Digital Music, Queen Mary, University of London.
|
Chris@37
|
7 Copyright 2012 Chris Cannam and QMUL.
|
Chris@37
|
8
|
Chris@37
|
9 Permission is hereby granted, free of charge, to any person
|
Chris@37
|
10 obtaining a copy of this software and associated documentation
|
Chris@37
|
11 files (the "Software"), to deal in the Software without
|
Chris@37
|
12 restriction, including without limitation the rights to use, copy,
|
Chris@37
|
13 modify, merge, publish, distribute, sublicense, and/or sell copies
|
Chris@37
|
14 of the Software, and to permit persons to whom the Software is
|
Chris@37
|
15 furnished to do so, subject to the following conditions:
|
Chris@37
|
16
|
Chris@37
|
17 The above copyright notice and this permission notice shall be
|
Chris@37
|
18 included in all copies or substantial portions of the Software.
|
Chris@37
|
19
|
Chris@37
|
20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
Chris@37
|
21 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
Chris@37
|
22 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
Chris@37
|
23 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
|
Chris@37
|
24 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
Chris@37
|
25 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
Chris@37
|
26 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
Chris@37
|
27
|
Chris@37
|
28 Except as contained in this notice, the names of the Centre for
|
Chris@37
|
29 Digital Music; Queen Mary, University of London; and Chris Cannam
|
Chris@37
|
30 shall not be used in advertising or otherwise to promote the sale,
|
Chris@37
|
31 use or other dealings in this Software without prior written
|
Chris@37
|
32 authorization.
|
Chris@37
|
33 */
|
Chris@3
|
34
|
Chris@3
|
35 package org.vamp_plugins;
|
Chris@3
|
36
|
Chris@28
|
37 /**
|
Chris@28
|
38 * ParameterDescriptor describes the properties of a configurable
|
Chris@28
|
39 * parameter of a Plugin.
|
Chris@28
|
40 */
|
Chris@3
|
41 public class ParameterDescriptor {
|
Chris@28
|
42
|
Chris@28
|
43 /**
|
Chris@28
|
44 * The name of the parameter, in computer-usable form. Will
|
Chris@28
|
45 * contain only the characters [a-zA-Z0-9_-].
|
Chris@28
|
46 */
|
Chris@3
|
47 public String identifier;
|
Chris@28
|
48
|
Chris@28
|
49 /**
|
Chris@28
|
50 * The human-readable name of the parameter.
|
Chris@28
|
51 */
|
Chris@3
|
52 public String name;
|
Chris@28
|
53
|
Chris@28
|
54 /**
|
Chris@28
|
55 * A human-readable short text describing the parameter. May be
|
Chris@28
|
56 * empty if the name has said it all already.
|
Chris@28
|
57 */
|
Chris@3
|
58 public String description;
|
Chris@28
|
59
|
Chris@28
|
60 /**
|
Chris@28
|
61 * The unit of the parameter, in human-readable form.
|
Chris@28
|
62 */
|
Chris@3
|
63 public String unit;
|
Chris@28
|
64
|
Chris@28
|
65 /**
|
Chris@28
|
66 * The minimum value of the parameter.
|
Chris@28
|
67 */
|
Chris@3
|
68 public float minValue;
|
Chris@28
|
69
|
Chris@28
|
70 /**
|
Chris@28
|
71 * The maximum value of the parameter.
|
Chris@28
|
72 */
|
Chris@3
|
73 public float maxValue;
|
Chris@28
|
74
|
Chris@28
|
75 /**
|
Chris@28
|
76 * The default value of the parameter. The plugin should
|
Chris@28
|
77 * ensure that parameters have this value on initialisation
|
Chris@28
|
78 * (i.e. the host is not required to explicitly set parameters
|
Chris@28
|
79 * if it wants to use their default values).
|
Chris@28
|
80 */
|
Chris@3
|
81 public float defaultValue;
|
Chris@28
|
82
|
Chris@28
|
83 /**
|
Chris@28
|
84 * True if the parameter values are quantized to a particular
|
Chris@28
|
85 * resolution.
|
Chris@28
|
86 */
|
Chris@3
|
87 public boolean isQuantized;
|
Chris@28
|
88
|
Chris@28
|
89 /**
|
Chris@28
|
90 * Quantization resolution of the parameter values (e.g. 1.0
|
Chris@28
|
91 * if they are all integers). Undefined if isQuantized is
|
Chris@28
|
92 * false.
|
Chris@28
|
93 */
|
Chris@3
|
94 public float quantizeStep;
|
Chris@28
|
95
|
Chris@28
|
96 /**
|
Chris@28
|
97 * Names for the quantized values. If isQuantized is true,
|
Chris@28
|
98 * this may either be empty or contain one string for each of
|
Chris@28
|
99 * the quantize steps from minValue up to maxValue inclusive.
|
Chris@28
|
100 * Undefined if isQuantized is false.
|
Chris@28
|
101 *
|
Chris@28
|
102 * If these names are provided, they should be shown to the
|
Chris@28
|
103 * user in preference to the values themselves. The user may
|
Chris@28
|
104 * never see the actual numeric values unless they are also
|
Chris@28
|
105 * encoded in the names.
|
Chris@28
|
106 */
|
Chris@3
|
107 public String[] valueNames;
|
Chris@3
|
108
|
Chris@3
|
109 ParameterDescriptor() {
|
Chris@3
|
110 minValue = 0;
|
Chris@3
|
111 maxValue = 0;
|
Chris@3
|
112 defaultValue = 0;
|
Chris@3
|
113 isQuantized = false;
|
Chris@3
|
114 }
|
Chris@3
|
115 }
|
Chris@3
|
116
|