annotate org/vamp_plugins/OutputDescriptor.java @ 28:f2914a92b553

Docs
author Chris Cannam
date Mon, 19 Nov 2012 15:12:44 +0000
parents 7b1740a9020a
children c9515589be7d
rev   line source
Chris@2 1
Chris@2 2 package org.vamp_plugins;
Chris@2 3
Chris@28 4 /**
Chris@28 5 * OutputDescriptor describes the properties of an output of a Vamp
Chris@28 6 * plugin. Returned by e.g. Plugin.getOutputDescriptors().
Chris@28 7 */
Chris@2 8 public class OutputDescriptor {
Chris@28 9
Chris@28 10 /**
Chris@28 11 * The name of the output, in computer-usable form. Will contain
Chris@28 12 * the characters [a-zA-Z0-9_-] only.
Chris@28 13 */
Chris@2 14 public String identifier;
Chris@28 15
Chris@28 16 /**
Chris@28 17 * The human-readable name of the output.
Chris@28 18 */
Chris@2 19 public String name;
Chris@28 20
Chris@28 21 /**
Chris@28 22 * A human-readable short text describing the output. May be
Chris@28 23 * empty if the name has said it all already.
Chris@28 24 */
Chris@2 25 public String description;
Chris@28 26
Chris@28 27 /**
Chris@28 28 * The unit of the output, in human-readable form.
Chris@28 29 */
Chris@2 30 public String unit;
Chris@28 31
Chris@28 32 /**
Chris@28 33 * True if the output has the same number of values per sample
Chris@28 34 * for every output sample.
Chris@28 35 */
Chris@2 36 public boolean hasFixedBinCount;
Chris@28 37
Chris@28 38 /**
Chris@28 39 * The number of values per result of the output. Undefined
Chris@28 40 * if hasFixedBinCount is false. If this is zero, the output
Chris@28 41 * is point data (i.e. only the time of each output is of
Chris@28 42 * interest, the value list will be empty).
Chris@28 43 */
Chris@2 44 public int binCount;
Chris@28 45
Chris@28 46 /**
Chris@28 47 * The (human-readable) names of each of the bins, if
Chris@28 48 * appropriate. This is always optional.
Chris@28 49 */
Chris@2 50 public String[] binNames;
Chris@28 51
Chris@28 52 /**
Chris@28 53 * True if the results in each output bin fall within a fixed
Chris@28 54 * numeric range (minimum and maximum values). Undefined if
Chris@28 55 * binCount is zero.
Chris@28 56 */
Chris@2 57 public boolean hasKnownExtents;
Chris@28 58
Chris@28 59 /**
Chris@28 60 * Minimum value of the results in the output. Undefined if
Chris@28 61 * hasKnownExtents is false or binCount is zero.
Chris@28 62 */
Chris@2 63 public float minValue;
Chris@28 64
Chris@28 65 /**
Chris@28 66 * Maximum value of the results in the output. Undefined if
Chris@28 67 * hasKnownExtents is false or binCount is zero.
Chris@28 68 */
Chris@2 69 public float maxValue;
Chris@28 70
Chris@28 71 /**
Chris@28 72 * True if the output values are quantized to a particular
Chris@28 73 * resolution. Undefined if binCount is zero.
Chris@28 74 */
Chris@2 75 public boolean isQuantized;
Chris@28 76
Chris@28 77 /**
Chris@28 78 * Quantization resolution of the output values (e.g. 1.0 if
Chris@28 79 * they are all integers). Undefined if isQuantized is false
Chris@28 80 * or binCount is zero.
Chris@28 81 */
Chris@2 82 public float quantizeStep;
Chris@28 83
Chris@2 84 public static enum SampleType {
Chris@28 85 /// Results from each process() align with that call's block start
Chris@28 86 OneSamplePerStep,
Chris@28 87
Chris@28 88 /// Results are evenly spaced in time (sampleRate specified below)
Chris@28 89 FixedSampleRate,
Chris@28 90
Chris@28 91 /// Results are unevenly spaced and have individual timestamps
Chris@28 92 VariableSampleRate
Chris@2 93 };
Chris@28 94
Chris@28 95 /**
Chris@28 96 * Positioning in time of the output results.
Chris@28 97 */
Chris@2 98 public SampleType sampleType;
Chris@28 99
Chris@28 100 /**
Chris@28 101 * Sample rate of the output results, as samples per second.
Chris@28 102 * Undefined if sampleType is OneSamplePerStep.
Chris@28 103 *
Chris@28 104 * If sampleType is VariableSampleRate and this value is
Chris@28 105 * non-zero, then it may be used to calculate a resolution for
Chris@28 106 * the output (i.e. the "duration" of each sample, in time,
Chris@28 107 * will be 1/sampleRate seconds). It's recommended to set
Chris@28 108 * this to zero if that behaviour is not desired.
Chris@28 109 */
Chris@2 110 public float sampleRate;
Chris@28 111
Chris@28 112 /**
Chris@28 113 * True if the returned results for this output are known to
Chris@28 114 * have a duration field.
Chris@28 115 */
Chris@2 116 public boolean hasDuration;
Chris@2 117
Chris@2 118 OutputDescriptor() {
Chris@2 119 hasFixedBinCount = false;
Chris@2 120 hasKnownExtents = false;
Chris@2 121 isQuantized = false;
Chris@2 122 sampleType = SampleType.OneSamplePerStep;
Chris@2 123 hasDuration = false;
Chris@2 124 }
Chris@3 125 }