annotate capnproto/vamp.capnp @ 14:c35d0909a74e

Process requests
author Chris Cannam <c.cannam@qmul.ac.uk>
date Wed, 18 May 2016 12:21:23 +0100
parents 828930f9a65d
children d907576aa299
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@5 52 struct OutputDescriptor {
c@5 53 basic @0 :Basic;
c@5 54 unit @1 :Text;
c@5 55 hasFixedBinCount @2 :Bool = false;
c@5 56 binCount @3 :Int32 = 0;
c@5 57 binNames @4 :List(Text) = [];
c@5 58 hasKnownExtents @5 :Bool = false;
c@5 59 minValue @6 :Float32 = 0.0;
c@5 60 maxValue @7 :Float32 = 0.0;
c@5 61 isQuantized @8 :Bool = false;
c@5 62 quantizeStep @9 :Float32 = 0.0;
c@5 63 sampleType @10 :SampleType;
c@5 64 sampleRate @11 :Float32 = 0.0;
c@5 65 hasDuration @12 :Bool = false;
c@5 66 }
c@5 67
c@5 68 struct PluginStaticData {
c@5 69 pluginKey @0 :Text;
c@5 70 basic @1 :Basic;
c@5 71 maker @2 :Text;
c@5 72 copyright @3 :Text;
c@5 73 pluginVersion @4 :Int32;
c@5 74 category @5 :List(Text);
c@5 75 minChannelCount @6 :Int32;
c@5 76 maxChannelCount @7 :Int32;
c@5 77 parameters @8 :List(ParameterDescriptor);
c@5 78 programs @9 :List(Text);
c@5 79 inputDomain @10 :InputDomain;
c@5 80 basicOutputInfo @11 :List(Basic);
c@5 81 }
c@5 82
c@5 83 struct ProcessInput {
c@5 84 inputBuffers @0 :List(List(Float32));
c@5 85 timestamp @1 :RealTime;
c@5 86 }
c@5 87
c@5 88 struct Feature {
c@5 89 hasTimestamp @0 :Bool = false;
c@5 90 timestamp @1 :RealTime;
c@5 91 hasDuration @2 :Bool = false;
c@5 92 duration @3 :RealTime;
c@5 93 label @4 :Text;
c@5 94 values @5 :List(Float32) = [];
c@5 95 }
c@5 96
c@5 97 struct FeatureSet {
c@5 98 struct FSPair {
c@5 99 output @0 :Int32;
c@5 100 features @1 :List(Feature) = [];
c@5 101 }
c@5 102 featurePairs @0 :List(FSPair);
c@5 103 }
c@5 104
c@5 105 struct PluginConfiguration {
c@5 106 struct PVPair {
c@5 107 parameter @0 :Text;
c@5 108 value @1 :Float32;
c@5 109 }
c@5 110 parameterValues @0 :List(PVPair);
c@5 111 currentProgram @1 :Text;
c@5 112 channelCount @2 :Int32;
c@5 113 stepSize @3 :Int32;
c@5 114 blockSize @4 :Int32;
c@5 115 }
c@5 116
c@5 117 struct LoadRequest {
c@5 118 pluginKey @0 :Text;
c@5 119 inputSampleRate @1 :Float32;
c@5 120 adapterFlags @2 :List(AdapterFlag);
c@5 121 }
c@5 122
c@5 123 struct LoadResponse {
c@10 124 pluginHandle @0 :Int32;
c@5 125 staticData @1 :PluginStaticData;
c@5 126 defaultConfiguration @2 :PluginConfiguration;
c@5 127 }
c@5 128
c@5 129 struct ConfigurationRequest {
c@10 130 pluginHandle @0 :Int32;
c@5 131 configuration @1 :PluginConfiguration;
c@5 132 }
c@5 133
c@5 134 struct ConfigurationResponse {
c@5 135 outputs @0 :List(OutputDescriptor);
c@5 136 }
c@5 137
c@9 138 struct ProcessRequest {
c@10 139 pluginHandle @0 :Int32;
c@14 140 input @1 :ProcessInput;
c@9 141 }
c@9 142
c@5 143 struct VampRequest {
c@5 144 request :union {
c@5 145 list @0 :Void;
c@5 146 load @1 :LoadRequest;
c@5 147 configure @2 :ConfigurationRequest;
c@9 148 process @3 :ProcessRequest;
c@12 149 finish @4 :Void; # getRemainingFeatures and unload plugin
c@5 150 }
c@5 151 }
c@5 152
c@5 153 struct VampResponse {
c@5 154 success @0 :Bool;
c@5 155 errorText @1 :Text = "";
c@5 156 response :union {
c@5 157 list @2 :List(PluginStaticData);
c@5 158 load @3 :LoadResponse;
c@5 159 configure @4 :ConfigurationResponse;
c@9 160 process @5 :FeatureSet;
c@12 161 finish @6 :FeatureSet;
c@5 162 }
c@5 163 }
c@5 164