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: }