c@123: c@123: @0xc4b1c6c44c999206; c@123: c@123: using Cxx = import "/capnp/c++.capnp"; c@123: $Cxx.namespace("vampipe"); c@123: c@123: enum InputDomain { c@123: timeDomain @0; c@123: frequencyDomain @1; c@123: } c@123: c@123: enum SampleType { c@123: oneSamplePerStep @0; c@123: fixedSampleRate @1; c@123: variableSampleRate @2; c@123: } c@123: c@123: enum AdapterFlag { c@123: adaptInputDomain @0; c@123: adaptChannelCount @1; c@123: adaptBufferSize @2; c@123: } c@123: c@123: const adaptAllSafe :List(AdapterFlag) = c@123: [ adaptInputDomain, adaptChannelCount ]; c@123: c@123: const adaptAll :List(AdapterFlag) = c@123: [ adaptInputDomain, adaptChannelCount, adaptBufferSize ]; c@123: c@123: struct RealTime { c@123: sec @0 :Int32 = 0; c@123: nsec @1 :Int32 = 0; c@123: } c@123: c@123: struct Basic { c@123: identifier @0 :Text; c@123: name @1 :Text; c@123: description @2 :Text; c@123: } c@123: c@123: struct ParameterDescriptor { c@123: basic @0 :Basic; c@123: unit @1 :Text; c@123: minValue @2 :Float32 = 0.0; c@123: maxValue @3 :Float32 = 0.0; c@123: defaultValue @4 :Float32 = 0.0; c@123: isQuantized @5 :Bool = false; c@123: quantizeStep @6 :Float32 = 0.0; c@123: valueNames @7 :List(Text) = []; c@123: } c@123: c@123: struct OutputDescriptor { c@123: basic @0 :Basic; c@123: unit @1 :Text; c@123: hasFixedBinCount @2 :Bool = false; c@123: binCount @3 :Int32 = 0; c@123: binNames @4 :List(Text) = []; c@123: hasKnownExtents @5 :Bool = false; c@123: minValue @6 :Float32 = 0.0; c@123: maxValue @7 :Float32 = 0.0; c@123: isQuantized @8 :Bool = false; c@123: quantizeStep @9 :Float32 = 0.0; c@123: sampleType @10 :SampleType; c@123: sampleRate @11 :Float32 = 0.0; c@123: hasDuration @12 :Bool = false; c@123: } c@123: c@123: struct PluginStaticData { c@123: pluginKey @0 :Text; c@123: basic @1 :Basic; c@123: maker @2 :Text; c@123: copyright @3 :Text; c@123: pluginVersion @4 :Int32; c@123: category @5 :List(Text); c@123: minChannelCount @6 :Int32; c@123: maxChannelCount @7 :Int32; c@123: parameters @8 :List(ParameterDescriptor); c@123: programs @9 :List(Text); c@123: inputDomain @10 :InputDomain; c@123: basicOutputInfo @11 :List(Basic); c@123: } c@123: c@123: struct ProcessInput { c@123: inputBuffers @0 :List(List(Float32)); c@123: timestamp @1 :RealTime; c@123: } c@123: c@123: struct Feature { c@123: hasTimestamp @0 :Bool = false; c@123: timestamp @1 :RealTime; c@123: hasDuration @2 :Bool = false; c@123: duration @3 :RealTime; c@123: label @4 :Text; c@123: values @5 :List(Float32) = []; c@123: } c@123: c@123: struct FeatureSet { c@123: struct FSPair { c@123: output @0 :Int32; c@123: features @1 :List(Feature) = []; c@123: } c@123: featurePairs @0 :List(FSPair); c@123: } c@123: c@123: struct PluginConfiguration { c@123: struct PVPair { c@123: parameter @0 :Text; c@123: value @1 :Float32; c@123: } c@123: parameterValues @0 :List(PVPair); c@123: currentProgram @1 :Text; c@123: channelCount @2 :Int32; c@123: stepSize @3 :Int32; c@123: blockSize @4 :Int32; c@123: } c@123: c@123: struct LoadRequest { c@123: pluginKey @0 :Text; c@123: inputSampleRate @1 :Float32; c@123: adapterFlags @2 :List(AdapterFlag); c@123: } c@123: c@123: struct LoadResponse { c@126: pluginHandle @0 :Int32; c@123: staticData @1 :PluginStaticData; c@123: defaultConfiguration @2 :PluginConfiguration; c@123: } c@123: c@123: struct ConfigurationRequest { c@126: pluginHandle @0 :Int32; c@123: configuration @1 :PluginConfiguration; c@123: } c@123: c@123: struct ConfigurationResponse { c@123: outputs @0 :List(OutputDescriptor); c@123: } c@123: c@125: struct ProcessRequest { c@126: pluginHandle @0 :Int32; c@125: timestamp @1 :RealTime; c@125: input @2 :List(List(Float32)); c@125: } c@125: c@123: struct VampRequest { c@123: request :union { c@123: list @0 :Void; c@123: load @1 :LoadRequest; c@123: configure @2 :ConfigurationRequest; c@125: process @3 :ProcessRequest; c@123: } c@123: } c@123: c@123: struct VampResponse { c@123: success @0 :Bool; c@123: errorText @1 :Text = ""; c@123: response :union { c@123: list @2 :List(PluginStaticData); c@123: load @3 :LoadResponse; c@123: configure @4 :ConfigurationResponse; c@125: process @5 :FeatureSet; c@123: } c@123: } c@123: