Mercurial > hg > piper-cpp
comparison capnproto/VampnProto.h @ 17:3ef01276e15e
More request/response encodings
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Wed, 18 May 2016 15:31:22 +0100 |
parents | d907576aa299 |
children | 071c55f52c7d |
comparison
equal
deleted
inserted
replaced
16:913fc1d3710a | 17:3ef01276e15e |
---|---|
620 b.getRequest().setList(); | 620 b.getRequest().setList(); |
621 } | 621 } |
622 | 622 |
623 static void | 623 static void |
624 buildVampResponse_List(VampResponse::Builder &b, | 624 buildVampResponse_List(VampResponse::Builder &b, |
625 const std::vector<Vamp::HostExt::PluginStaticData> &d, | 625 std::string errorText, |
626 std::string errorText = "") { | 626 const std::vector<Vamp::HostExt::PluginStaticData> &d) { |
627 b.setSuccess(errorText == ""); | 627 b.setSuccess(errorText == ""); |
628 b.setErrorText(errorText); | 628 b.setErrorText(errorText); |
629 auto r = b.getResponse().initList(d.size()); | 629 auto r = b.getResponse().initList(d.size()); |
630 for (size_t i = 0; i < d.size(); ++i) { | 630 for (size_t i = 0; i < d.size(); ++i) { |
631 auto rd = r[i]; | 631 auto rd = r[i]; |
642 | 642 |
643 static void | 643 static void |
644 buildVampResponse_Load(VampResponse::Builder &b, | 644 buildVampResponse_Load(VampResponse::Builder &b, |
645 const Vamp::HostExt::LoadResponse &resp, | 645 const Vamp::HostExt::LoadResponse &resp, |
646 PluginHandleMapper &mapper) { | 646 PluginHandleMapper &mapper) { |
647 b.setSuccess(resp.plugin != 0); | |
648 b.setErrorText(""); | |
647 auto u = b.getResponse().initLoad(); | 649 auto u = b.getResponse().initLoad(); |
648 buildLoadResponse(u, resp, mapper); | 650 buildLoadResponse(u, resp, mapper); |
649 } | 651 } |
650 | 652 |
651 static void | 653 static void |
657 } | 659 } |
658 | 660 |
659 static void | 661 static void |
660 buildVampResponse_Configure(VampResponse::Builder &b, | 662 buildVampResponse_Configure(VampResponse::Builder &b, |
661 const Vamp::HostExt::ConfigurationResponse &cr) { | 663 const Vamp::HostExt::ConfigurationResponse &cr) { |
664 b.setSuccess(!cr.outputs.empty()); | |
665 b.setErrorText(""); | |
662 auto u = b.getResponse().initConfigure(); | 666 auto u = b.getResponse().initConfigure(); |
663 buildConfigurationResponse(u, cr); | 667 buildConfigurationResponse(u, cr); |
664 } | 668 } |
665 | 669 |
666 static void | 670 static void |
672 } | 676 } |
673 | 677 |
674 static void | 678 static void |
675 buildVampResponse_Process(VampResponse::Builder &b, | 679 buildVampResponse_Process(VampResponse::Builder &b, |
676 const Vamp::HostExt::ProcessResponse &pr) { | 680 const Vamp::HostExt::ProcessResponse &pr) { |
681 b.setSuccess(true); | |
682 b.setErrorText(""); | |
677 auto u = b.getResponse().initProcess(); | 683 auto u = b.getResponse().initProcess(); |
678 buildProcessResponse(u, pr); | 684 buildProcessResponse(u, pr); |
679 } | 685 } |
686 | |
687 static void | |
688 buildVampRequest_Finish(VampRequest::Builder &b) { | |
689 | |
690 b.getRequest().setFinish(); | |
691 } | |
692 | |
693 static void | |
694 buildVampResponse_Finish(VampResponse::Builder &b, | |
695 const Vamp::HostExt::ProcessResponse &pr) { | |
696 | |
697 buildVampResponse_Process(b, pr); | |
698 } | |
680 }; | 699 }; |
681 | 700 |
682 } | 701 } |
683 | 702 |
684 | 703 |