annotate capnp/piper.capnp @ 175:be122aec4bd1

Add id to rpc req/resp
author Chris Cannam <c.cannam@qmul.ac.uk>
date Tue, 11 Oct 2016 10:51:01 +0100
parents eac8b499c018
children 729645a0e0ce
rev   line source
c@174 1
c@174 2 @0xc4b1c6c44c999206;
c@174 3
c@174 4 using Cxx = import "/capnp/c++.capnp";
c@174 5 $Cxx.namespace("piper");
c@174 6
c@174 7 struct Basic {
c@174 8 identifier @0 :Text;
c@174 9 name @1 :Text;
c@174 10 description @2 :Text;
c@174 11 }
c@174 12
c@174 13 struct ParameterDescriptor {
c@174 14 basic @0 :Basic;
c@174 15 unit @1 :Text;
c@174 16 minValue @2 :Float32 = 0.0;
c@174 17 maxValue @3 :Float32 = 0.0;
c@174 18 defaultValue @4 :Float32 = 0.0;
c@174 19 isQuantized @5 :Bool = false;
c@174 20 quantizeStep @6 :Float32 = 0.0;
c@174 21 valueNames @7 :List(Text) = [];
c@174 22 }
c@174 23
c@174 24 enum SampleType {
c@174 25 oneSamplePerStep @0;
c@174 26 fixedSampleRate @1;
c@174 27 variableSampleRate @2;
c@174 28 }
c@174 29
c@174 30 struct ConfiguredOutputDescriptor {
c@174 31 unit @0 :Text;
c@174 32 hasFixedBinCount @1 :Bool = false;
c@174 33 binCount @2 :Int32 = 0;
c@174 34 binNames @3 :List(Text) = [];
c@174 35 hasKnownExtents @4 :Bool = false;
c@174 36 minValue @5 :Float32 = 0.0;
c@174 37 maxValue @6 :Float32 = 0.0;
c@174 38 isQuantized @7 :Bool = false;
c@174 39 quantizeStep @8 :Float32 = 0.0;
c@174 40 sampleType @9 :SampleType;
c@174 41 sampleRate @10 :Float32 = 0.0;
c@174 42 hasDuration @11 :Bool = false;
c@174 43 }
c@174 44
c@174 45 struct OutputDescriptor {
c@174 46 basic @0 :Basic;
c@174 47 configured @1 :ConfiguredOutputDescriptor;
c@174 48 }
c@174 49
c@174 50 enum InputDomain {
c@174 51 timeDomain @0;
c@174 52 frequencyDomain @1;
c@174 53 }
c@174 54
c@174 55 struct ExtractorStaticData {
c@174 56 key @0 :Text;
c@174 57 basic @1 :Basic;
c@174 58 maker @2 :Text;
c@174 59 copyright @3 :Text;
c@174 60 version @4 :Int32;
c@174 61 category @5 :List(Text);
c@174 62 minChannelCount @6 :Int32;
c@174 63 maxChannelCount @7 :Int32;
c@174 64 parameters @8 :List(ParameterDescriptor);
c@174 65 programs @9 :List(Text);
c@174 66 inputDomain @10 :InputDomain;
c@174 67 basicOutputInfo @11 :List(Basic);
c@174 68 }
c@174 69
c@174 70 struct RealTime {
c@174 71 sec @0 :Int32 = 0;
c@174 72 nsec @1 :Int32 = 0;
c@174 73 }
c@174 74
c@174 75 struct ProcessInput {
c@174 76 inputBuffers @0 :List(List(Float32));
c@174 77 timestamp @1 :RealTime;
c@174 78 }
c@174 79
c@174 80 struct Feature {
c@174 81 hasTimestamp @0 :Bool = false;
c@174 82 timestamp @1 :RealTime;
c@174 83 hasDuration @2 :Bool = false;
c@174 84 duration @3 :RealTime;
c@174 85 label @4 :Text;
c@174 86 featureValues @5 :List(Float32) = [];
c@174 87 }
c@174 88
c@174 89 struct FeatureSet {
c@174 90 struct FSPair {
c@174 91 output @0 :Text;
c@174 92 features @1 :List(Feature) = [];
c@174 93 }
c@174 94 featurePairs @0 :List(FSPair);
c@174 95 }
c@174 96
c@174 97 struct Configuration {
c@174 98 struct PVPair {
c@174 99 parameter @0 :Text;
c@174 100 value @1 :Float32;
c@174 101 }
c@174 102 parameterValues @0 :List(PVPair);
c@174 103 currentProgram @1 :Text;
c@174 104 channelCount @2 :Int32;
c@174 105 stepSize @3 :Int32;
c@174 106 blockSize @4 :Int32;
c@174 107 }
c@174 108
c@174 109 enum AdapterFlag {
c@174 110 adaptInputDomain @0;
c@174 111 adaptChannelCount @1;
c@174 112 adaptBufferSize @2;
c@174 113 }
c@174 114
c@174 115 const adaptAllSafe :List(AdapterFlag) =
c@174 116 [ adaptInputDomain, adaptChannelCount ];
c@174 117
c@174 118 const adaptAll :List(AdapterFlag) =
c@174 119 [ adaptInputDomain, adaptChannelCount, adaptBufferSize ];
c@174 120
c@174 121 struct ListRequest {
c@174 122 }
c@174 123
c@174 124 struct ListResponse {
c@174 125 available @0 :List(ExtractorStaticData);
c@174 126 }
c@174 127
c@174 128 struct LoadRequest {
c@174 129 key @0 :Text;
c@174 130 inputSampleRate @1 :Float32;
c@174 131 adapterFlags @2 :List(AdapterFlag);
c@174 132 }
c@174 133
c@174 134 struct LoadResponse {
c@174 135 handle @0 :Int32;
c@174 136 staticData @1 :ExtractorStaticData;
c@174 137 defaultConfiguration @2 :Configuration;
c@174 138 }
c@174 139
c@174 140 struct ConfigurationRequest {
c@174 141 handle @0 :Int32;
c@174 142 configuration @1 :Configuration;
c@174 143 }
c@174 144
c@174 145 struct ConfigurationResponse {
c@174 146 handle @0 :Int32;
c@174 147 outputs @1 :List(OutputDescriptor);
c@174 148 }
c@174 149
c@174 150 struct ProcessRequest {
c@174 151 handle @0 :Int32;
c@174 152 processInput @1 :ProcessInput;
c@174 153 }
c@174 154
c@174 155 struct ProcessResponse {
c@174 156 handle @0 :Int32;
c@174 157 features @1 :FeatureSet;
c@174 158 }
c@174 159
c@174 160 struct FinishRequest {
c@174 161 handle @0 :Int32;
c@174 162 }
c@174 163
c@174 164 struct FinishResponse {
c@174 165 handle @0 :Int32;
c@174 166 features @1 :FeatureSet;
c@174 167 }
c@174 168
c@174 169 struct Error {
c@174 170 code @0 :Int32;
c@174 171 message @1 :Text;
c@174 172 }
c@174 173
c@174 174 struct RpcRequest {
c@174 175 # Request bundle for use when using Cap'n Proto serialisation without
c@174 176 # Cap'n Proto RPC layer. For Cap'n Proto RPC, see piper.rpc.capnp.
c@175 177 id :union {
c@175 178 number @0 :Int32;
c@175 179 tag @1 :Text;
c@175 180 none @2 :Void;
c@175 181 }
c@174 182 request :union {
c@175 183 list @3 :ListRequest;
c@175 184 load @4 :LoadRequest;
c@175 185 configure @5 :ConfigurationRequest;
c@175 186 process @6 :ProcessRequest;
c@175 187 finish @7 :FinishRequest; # getRemainingFeatures and unload
c@174 188 }
c@174 189 }
c@174 190
c@174 191 struct RpcResponse {
c@174 192 # Response bundle for use when using Cap'n Proto serialisation without
c@174 193 # Cap'n Proto RPC layer. For Cap'n Proto RPC, see piper.rpc.capnp.
c@175 194 id :union {
c@175 195 number @0 :Int32;
c@175 196 tag @1 :Text;
c@175 197 none @2 :Void;
c@175 198 }
c@174 199 response :union {
c@175 200 error @3 :Error;
c@175 201 list @4 :ListResponse;
c@175 202 load @5 :LoadResponse;
c@175 203 configure @6 :ConfigurationResponse;
c@175 204 process @7 :ProcessResponse;
c@175 205 finish @8 :FinishResponse;
c@174 206 }
c@174 207 }
c@174 208