annotate capnproto/vamp.capnp @ 126:dbc6ac3a4fe3

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