annotate capnproto/vamp.capnp @ 64:85ec33975434

Support split OutputDescriptor, and plugins rather than pluginData in listResponse from SDK
author Chris Cannam <c.cannam@qmul.ac.uk>
date Fri, 23 Sep 2016 14:20:29 +0100
parents 18951a1f1001
children 6f160dee1192
rev   line source
c@5 1
c@5 2 @0xc4b1c6c44c999206;
c@5 3
c@5 4 using Cxx = import "/capnp/c++.capnp";
c@5 5 $Cxx.namespace("vampipe");
c@5 6
c@5 7 enum InputDomain {
c@5 8 timeDomain @0;
c@5 9 frequencyDomain @1;
c@5 10 }
c@5 11
c@5 12 enum SampleType {
c@5 13 oneSamplePerStep @0;
c@5 14 fixedSampleRate @1;
c@5 15 variableSampleRate @2;
c@5 16 }
c@5 17
c@5 18 enum AdapterFlag {
c@5 19 adaptInputDomain @0;
c@5 20 adaptChannelCount @1;
c@5 21 adaptBufferSize @2;
c@5 22 }
c@5 23
c@5 24 const adaptAllSafe :List(AdapterFlag) =
c@5 25 [ adaptInputDomain, adaptChannelCount ];
c@5 26
c@5 27 const adaptAll :List(AdapterFlag) =
c@5 28 [ adaptInputDomain, adaptChannelCount, adaptBufferSize ];
c@5 29
c@5 30 struct RealTime {
c@5 31 sec @0 :Int32 = 0;
c@5 32 nsec @1 :Int32 = 0;
c@5 33 }
c@5 34
c@5 35 struct Basic {
c@5 36 identifier @0 :Text;
c@5 37 name @1 :Text;
c@5 38 description @2 :Text;
c@5 39 }
c@5 40
c@5 41 struct ParameterDescriptor {
c@5 42 basic @0 :Basic;
c@5 43 unit @1 :Text;
c@5 44 minValue @2 :Float32 = 0.0;
c@5 45 maxValue @3 :Float32 = 0.0;
c@5 46 defaultValue @4 :Float32 = 0.0;
c@5 47 isQuantized @5 :Bool = false;
c@5 48 quantizeStep @6 :Float32 = 0.0;
c@5 49 valueNames @7 :List(Text) = [];
c@5 50 }
c@5 51
c@64 52 struct ConfiguredOutputDescriptor {
c@64 53 unit @0 :Text;
c@64 54 hasFixedBinCount @1 :Bool = false;
c@64 55 binCount @2 :Int32 = 0;
c@64 56 binNames @3 :List(Text) = [];
c@64 57 hasKnownExtents @4 :Bool = false;
c@64 58 minValue @5 :Float32 = 0.0;
c@64 59 maxValue @6 :Float32 = 0.0;
c@64 60 isQuantized @7 :Bool = false;
c@64 61 quantizeStep @8 :Float32 = 0.0;
c@64 62 sampleType @9 :SampleType;
c@64 63 sampleRate @10 :Float32 = 0.0;
c@64 64 hasDuration @11 :Bool = false;
c@64 65 }
c@64 66
c@5 67 struct OutputDescriptor {
c@5 68 basic @0 :Basic;
c@64 69 configured @1 :ConfiguredOutputDescriptor;
c@5 70 }
c@5 71
c@5 72 struct PluginStaticData {
c@5 73 pluginKey @0 :Text;
c@5 74 basic @1 :Basic;
c@5 75 maker @2 :Text;
c@5 76 copyright @3 :Text;
c@5 77 pluginVersion @4 :Int32;
c@5 78 category @5 :List(Text);
c@5 79 minChannelCount @6 :Int32;
c@5 80 maxChannelCount @7 :Int32;
c@5 81 parameters @8 :List(ParameterDescriptor);
c@5 82 programs @9 :List(Text);
c@5 83 inputDomain @10 :InputDomain;
c@5 84 basicOutputInfo @11 :List(Basic);
c@5 85 }
c@5 86
c@5 87 struct ProcessInput {
c@5 88 inputBuffers @0 :List(List(Float32));
c@5 89 timestamp @1 :RealTime;
c@5 90 }
c@5 91
c@5 92 struct Feature {
c@5 93 hasTimestamp @0 :Bool = false;
c@5 94 timestamp @1 :RealTime;
c@5 95 hasDuration @2 :Bool = false;
c@5 96 duration @3 :RealTime;
c@5 97 label @4 :Text;
c@5 98 values @5 :List(Float32) = [];
c@5 99 }
c@5 100
c@5 101 struct FeatureSet {
c@5 102 struct FSPair {
c@49 103 output @0 :Text;
c@5 104 features @1 :List(Feature) = [];
c@5 105 }
c@5 106 featurePairs @0 :List(FSPair);
c@5 107 }
c@5 108
c@5 109 struct PluginConfiguration {
c@5 110 struct PVPair {
c@5 111 parameter @0 :Text;
c@5 112 value @1 :Float32;
c@5 113 }
c@5 114 parameterValues @0 :List(PVPair);
c@5 115 currentProgram @1 :Text;
c@5 116 channelCount @2 :Int32;
c@5 117 stepSize @3 :Int32;
c@5 118 blockSize @4 :Int32;
c@5 119 }
c@5 120
c@24 121 struct ListResponse {
c@24 122 plugins @0 :List(PluginStaticData);
c@24 123 }
c@24 124
c@5 125 struct LoadRequest {
c@5 126 pluginKey @0 :Text;
c@5 127 inputSampleRate @1 :Float32;
c@5 128 adapterFlags @2 :List(AdapterFlag);
c@5 129 }
c@5 130
c@5 131 struct LoadResponse {
c@10 132 pluginHandle @0 :Int32;
c@5 133 staticData @1 :PluginStaticData;
c@5 134 defaultConfiguration @2 :PluginConfiguration;
c@5 135 }
c@5 136
c@5 137 struct ConfigurationRequest {
c@10 138 pluginHandle @0 :Int32;
c@5 139 configuration @1 :PluginConfiguration;
c@5 140 }
c@5 141
c@5 142 struct ConfigurationResponse {
c@55 143 pluginHandle @0 :Int32;
c@55 144 outputs @1 :List(OutputDescriptor);
c@5 145 }
c@5 146
c@9 147 struct ProcessRequest {
c@10 148 pluginHandle @0 :Int32;
c@62 149 processInput @1 :ProcessInput;
c@9 150 }
c@9 151
c@49 152 struct ProcessResponse {
c@49 153 pluginHandle @0 :Int32;
c@49 154 features @1 :FeatureSet;
c@49 155 }
c@49 156
c@23 157 struct FinishRequest {
c@23 158 pluginHandle @0 :Int32;
c@23 159 }
c@23 160
c@5 161 struct VampRequest {
c@5 162 request :union {
c@5 163 list @0 :Void;
c@5 164 load @1 :LoadRequest;
c@5 165 configure @2 :ConfigurationRequest;
c@9 166 process @3 :ProcessRequest;
c@23 167 finish @4 :FinishRequest; # getRemainingFeatures and unload
c@5 168 }
c@5 169 }
c@5 170
c@5 171 struct VampResponse {
c@5 172 success @0 :Bool;
c@5 173 errorText @1 :Text = "";
c@5 174 response :union {
c@24 175 list @2 :ListResponse;
c@5 176 load @3 :LoadResponse;
c@5 177 configure @4 :ConfigurationResponse;
c@15 178 process @5 :ProcessResponse;
c@15 179 finish @6 :ProcessResponse;
c@5 180 }
c@5 181 }
c@5 182