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