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@18
|
34
|
Chris@18
|
35 package org.vamp_plugins;
|
Chris@18
|
36
|
Chris@28
|
37 /**
|
Chris@28
|
38 * Feature contains a single result returned from Plugin.process() or
|
Chris@28
|
39 * Plugin.getRemainingFeatures().
|
Chris@28
|
40 */
|
Chris@18
|
41 public class Feature {
|
Chris@28
|
42 /**
|
Chris@28
|
43 * True if an output feature has its own timestamp. This is
|
Chris@28
|
44 * mandatory if the output has VariableSampleRate, optional if
|
Chris@28
|
45 * the output has FixedSampleRate, and unused if the output
|
Chris@28
|
46 * has OneSamplePerStep.
|
Chris@28
|
47 */
|
Chris@18
|
48 public boolean hasTimestamp;
|
Chris@28
|
49
|
Chris@28
|
50 /**
|
Chris@28
|
51 * Timestamp of the output feature. This is mandatory if the
|
Chris@28
|
52 * output has VariableSampleRate or if the output has
|
Chris@28
|
53 * FixedSampleRate and hasTimestamp is true, and unused
|
Chris@28
|
54 * otherwise.
|
Chris@28
|
55 */
|
Chris@18
|
56 public RealTime timestamp;
|
Chris@28
|
57
|
Chris@28
|
58 /**
|
Chris@28
|
59 * True if an output feature has a specified duration. This
|
Chris@28
|
60 * is optional if the output has VariableSampleRate or
|
Chris@28
|
61 * FixedSampleRate, and and unused if the output has
|
Chris@28
|
62 * OneSamplePerStep.
|
Chris@28
|
63 */
|
Chris@18
|
64 public boolean hasDuration;
|
Chris@28
|
65
|
Chris@28
|
66 /**
|
Chris@28
|
67 * Duration of the output feature. This is mandatory if the
|
Chris@28
|
68 * output has VariableSampleRate or FixedSampleRate and
|
Chris@28
|
69 * hasDuration is true, and unused otherwise.
|
Chris@28
|
70 */
|
Chris@18
|
71 public RealTime duration;
|
Chris@28
|
72
|
Chris@28
|
73 /**
|
Chris@28
|
74 * Results for a single sample of this feature. If the output
|
Chris@28
|
75 * hasFixedBinCount, there must be the same number of values
|
Chris@28
|
76 * as the output's binCount count.
|
Chris@28
|
77 */
|
Chris@18
|
78 public float[] values;
|
Chris@28
|
79
|
Chris@28
|
80 /**
|
Chris@28
|
81 * Label for the sample of this feature.
|
Chris@28
|
82 */
|
Chris@18
|
83 public String label;
|
Chris@28
|
84
|
Chris@18
|
85 Feature() {
|
Chris@18
|
86 hasTimestamp = false; hasDuration = false;
|
Chris@18
|
87 }
|
Chris@18
|
88 };
|
Chris@18
|
89
|