Chris@37: /* Chris@37: jVamp Chris@37: Chris@37: A Java host interface for Vamp audio analysis plugins Chris@37: Chris@37: Centre for Digital Music, Queen Mary, University of London. Chris@37: Copyright 2012 Chris Cannam and QMUL. Chris@37: Chris@37: Permission is hereby granted, free of charge, to any person Chris@37: obtaining a copy of this software and associated documentation Chris@37: files (the "Software"), to deal in the Software without Chris@37: restriction, including without limitation the rights to use, copy, Chris@37: modify, merge, publish, distribute, sublicense, and/or sell copies Chris@37: of the Software, and to permit persons to whom the Software is Chris@37: furnished to do so, subject to the following conditions: Chris@37: Chris@37: The above copyright notice and this permission notice shall be Chris@37: included in all copies or substantial portions of the Software. Chris@37: Chris@37: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, Chris@37: EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF Chris@37: MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND Chris@37: NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR Chris@37: ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF Chris@37: CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION Chris@37: WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Chris@37: Chris@37: Except as contained in this notice, the names of the Centre for Chris@37: Digital Music; Queen Mary, University of London; and Chris Cannam Chris@37: shall not be used in advertising or otherwise to promote the sale, Chris@37: use or other dealings in this Software without prior written Chris@37: authorization. Chris@37: */ Chris@2: Chris@2: package org.vamp_plugins; Chris@2: Chris@28: /** Chris@28: * OutputDescriptor describes the properties of an output of a Vamp Chris@28: * plugin. Returned by e.g. Plugin.getOutputDescriptors(). Chris@28: */ Chris@2: public class OutputDescriptor { Chris@28: Chris@28: /** Chris@28: * The name of the output, in computer-usable form. Will contain Chris@28: * the characters [a-zA-Z0-9_-] only. Chris@28: */ Chris@2: public String identifier; Chris@28: Chris@28: /** Chris@28: * The human-readable name of the output. Chris@28: */ Chris@2: public String name; Chris@28: Chris@28: /** Chris@28: * A human-readable short text describing the output. May be Chris@28: * empty if the name has said it all already. Chris@28: */ Chris@2: public String description; Chris@28: Chris@28: /** Chris@28: * The unit of the output, in human-readable form. Chris@28: */ Chris@2: public String unit; Chris@28: Chris@28: /** Chris@28: * True if the output has the same number of values per sample Chris@28: * for every output sample. Chris@28: */ Chris@2: public boolean hasFixedBinCount; Chris@28: Chris@28: /** Chris@28: * The number of values per result of the output. Undefined Chris@28: * if hasFixedBinCount is false. If this is zero, the output Chris@28: * is point data (i.e. only the time of each output is of Chris@28: * interest, the value list will be empty). Chris@28: */ Chris@2: public int binCount; Chris@28: Chris@28: /** Chris@28: * The (human-readable) names of each of the bins, if Chris@28: * appropriate. This is always optional. Chris@28: */ Chris@2: public String[] binNames; Chris@28: Chris@28: /** Chris@28: * True if the results in each output bin fall within a fixed Chris@28: * numeric range (minimum and maximum values). Undefined if Chris@28: * binCount is zero. Chris@28: */ Chris@2: public boolean hasKnownExtents; Chris@28: Chris@28: /** Chris@28: * Minimum value of the results in the output. Undefined if Chris@28: * hasKnownExtents is false or binCount is zero. Chris@28: */ Chris@2: public float minValue; Chris@28: Chris@28: /** Chris@28: * Maximum value of the results in the output. Undefined if Chris@28: * hasKnownExtents is false or binCount is zero. Chris@28: */ Chris@2: public float maxValue; Chris@28: Chris@28: /** Chris@28: * True if the output values are quantized to a particular Chris@28: * resolution. Undefined if binCount is zero. Chris@28: */ Chris@2: public boolean isQuantized; Chris@28: Chris@28: /** Chris@28: * Quantization resolution of the output values (e.g. 1.0 if Chris@28: * they are all integers). Undefined if isQuantized is false Chris@28: * or binCount is zero. Chris@28: */ Chris@2: public float quantizeStep; Chris@28: Chris@2: public static enum SampleType { Chris@28: /// Results from each process() align with that call's block start Chris@28: OneSamplePerStep, Chris@28: Chris@28: /// Results are evenly spaced in time (sampleRate specified below) Chris@28: FixedSampleRate, Chris@28: Chris@28: /// Results are unevenly spaced and have individual timestamps Chris@28: VariableSampleRate Chris@2: }; Chris@28: Chris@28: /** Chris@28: * Positioning in time of the output results. Chris@28: */ Chris@2: public SampleType sampleType; Chris@28: Chris@28: /** Chris@28: * Sample rate of the output results, as samples per second. Chris@28: * Undefined if sampleType is OneSamplePerStep. Chris@28: * Chris@28: * If sampleType is VariableSampleRate and this value is Chris@28: * non-zero, then it may be used to calculate a resolution for Chris@28: * the output (i.e. the "duration" of each sample, in time, Chris@28: * will be 1/sampleRate seconds). It's recommended to set Chris@28: * this to zero if that behaviour is not desired. Chris@28: */ Chris@2: public float sampleRate; Chris@28: Chris@28: /** Chris@28: * True if the returned results for this output are known to Chris@28: * have a duration field. Chris@28: */ Chris@2: public boolean hasDuration; Chris@2: Chris@2: OutputDescriptor() { Chris@2: hasFixedBinCount = false; Chris@2: hasKnownExtents = false; Chris@2: isQuantized = false; Chris@2: sampleType = SampleType.OneSamplePerStep; Chris@2: hasDuration = false; Chris@2: } Chris@3: }