Mercurial > hg > piper-cpp
comparison vamp-support/LoaderRequests.h @ 188:90c962b68d7f
Merge pull request #2 from piper-audio/dev/step-and-block-size
Pull step & block size out into framing struct, return in config
author | Chris Cannam <cannam@all-day-breakfast.com> |
---|---|
date | Mon, 06 Feb 2017 12:04:25 +0000 |
parents | 3eb00e5c76c4 |
children | 52322dde68ea |
comparison
equal
deleted
inserted
replaced
184:150cfa0c71e1 | 188:90c962b68d7f |
---|---|
128 } | 128 } |
129 | 129 |
130 ConfigurationResponse response; | 130 ConfigurationResponse response; |
131 | 131 |
132 response.plugin = req.plugin; | 132 response.plugin = req.plugin; |
133 | 133 |
134 if (req.configuration.framing.stepSize == 0 || | |
135 req.configuration.framing.blockSize == 0) { | |
136 return response; | |
137 } | |
138 | |
134 if (req.plugin->initialise(req.configuration.channelCount, | 139 if (req.plugin->initialise(req.configuration.channelCount, |
135 req.configuration.stepSize, | 140 req.configuration.framing.stepSize, |
136 req.configuration.blockSize)) { | 141 req.configuration.framing.blockSize)) { |
142 | |
137 response.outputs = req.plugin->getOutputDescriptors(); | 143 response.outputs = req.plugin->getOutputDescriptors(); |
138 } | 144 |
145 // If the Vamp plugin initialise() call succeeds, then by | |
146 // definition it is accepting the step and block size | |
147 // passed in | |
148 response.framing = req.configuration.framing; | |
149 | |
150 } else { | |
151 | |
152 // If initialise() fails, one reason could be that it | |
153 // didn't like the passed-in step and block size. If we | |
154 // return its current preferred values here, the | |
155 // host/client can retry with these (if they differ) | |
156 response.framing.stepSize = req.plugin->getPreferredStepSize(); | |
157 response.framing.blockSize = req.plugin->getPreferredBlockSize(); | |
158 } | |
139 | 159 |
140 return response; | 160 return response; |
141 } | 161 } |
142 }; | 162 }; |
143 | 163 |