annotate vamp-support/RequestOrResponse.h @ 186:52322dde68ea

Fix erroneous logic for handling step and block size in prior commit The earlier change had a logical misconception. If PluginStub is receiving the correct step and block size back from the configure call, the plugin on the server side must have already been successfully initialised, as the step and block size are only returned in a successful configure response. This means the test for a failed initialise and redo with the correct parameters must be done on the server side (in LoaderRequests) not the client. The client has a more complicated job, which is to notice that a *successful* configure had returned different framing parameters from those passed to the initialise call, and to pretend that it had actually failed until the host called again with the correct parameters. We definitely need tests for this!
author Chris Cannam <cannam@all-day-breakfast.com>
date Mon, 06 Feb 2017 16:44:33 +0000
parents 5b113c87b6e6
children
rev   line source
c@75 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
c@75 2
c@75 3 /*
c@75 4 Piper C++
c@75 5
c@75 6 Centre for Digital Music, Queen Mary, University of London.
c@75 7 Copyright 2006-2016 Chris Cannam and QMUL.
c@75 8
c@75 9 Permission is hereby granted, free of charge, to any person
c@75 10 obtaining a copy of this software and associated documentation
c@75 11 files (the "Software"), to deal in the Software without
c@75 12 restriction, including without limitation the rights to use, copy,
c@75 13 modify, merge, publish, distribute, sublicense, and/or sell copies
c@75 14 of the Software, and to permit persons to whom the Software is
c@75 15 furnished to do so, subject to the following conditions:
c@75 16
c@75 17 The above copyright notice and this permission notice shall be
c@75 18 included in all copies or substantial portions of the Software.
c@75 19
c@75 20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
c@75 21 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
c@75 22 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
c@75 23 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
c@75 24 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
c@75 25 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
c@75 26 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
c@75 27
c@75 28 Except as contained in this notice, the names of the Centre for
c@75 29 Digital Music; Queen Mary, University of London; and Chris Cannam
c@75 30 shall not be used in advertising or otherwise to promote the sale,
c@75 31 use or other dealings in this Software without prior written
c@75 32 authorization.
c@75 33 */
c@75 34
c@75 35 #ifndef PIPER_REQUEST_OR_RESPONSE_H
c@75 36 #define PIPER_REQUEST_OR_RESPONSE_H
c@75 37
c@75 38 #include "RequestResponseType.h"
c@97 39 #include "PluginStaticData.h"
c@97 40 #include "RequestResponse.h"
c@75 41
c@75 42 #include <string>
c@75 43 #include <vector>
c@75 44
c@97 45 namespace piper_vamp {
c@75 46
c@75 47 class RequestOrResponse
c@75 48 {
c@75 49 public:
c@75 50 enum Direction {
c@75 51 Request, Response
c@75 52 };
c@75 53
c@75 54 struct RpcId {
c@75 55 enum { Absent, Number, Tag } type;
c@75 56 int number;
c@75 57 std::string tag;
c@75 58 };
c@75 59
c@75 60 RequestOrResponse() : // nothing by default
c@75 61 direction(Request),
c@75 62 type(RRType::NotValid),
c@75 63 success(false),
c@75 64 id({ RpcId::Absent, 0, "" })
c@75 65 { }
c@75 66
c@75 67 Direction direction;
c@75 68 RRType type;
c@75 69 bool success;
c@75 70 std::string errorText;
c@75 71 RpcId id;
c@75 72
c@127 73 ListRequest listRequest;
c@97 74 ListResponse listResponse;
c@97 75 LoadRequest loadRequest;
c@97 76 LoadResponse loadResponse;
c@97 77 ConfigurationRequest configurationRequest;
c@97 78 ConfigurationResponse configurationResponse;
c@97 79 ProcessRequest processRequest;
c@97 80 ProcessResponse processResponse;
c@97 81 FinishRequest finishRequest;
c@97 82 FinishResponse finishResponse;
c@75 83 };
c@75 84
c@75 85 }
c@75 86
c@75 87 #endif