Mercurial > hg > piper-cpp
comparison vamp-capnp/VampnProto.h @ 102:cd438188e3f9
Fix compiler warnings
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Mon, 17 Oct 2016 16:39:36 +0100 |
parents | 427c4c725085 |
children | d15cb1151d76 |
comparison
equal
deleted
inserted
replaced
101:8c449824e08d | 102:cd438188e3f9 |
---|---|
141 b.setSampleRate(od.sampleRate); | 141 b.setSampleRate(od.sampleRate); |
142 b.setHasDuration(od.hasDuration); | 142 b.setHasDuration(od.hasDuration); |
143 | 143 |
144 b.setHasFixedBinCount(od.hasFixedBinCount); | 144 b.setHasFixedBinCount(od.hasFixedBinCount); |
145 if (od.hasFixedBinCount) { | 145 if (od.hasFixedBinCount) { |
146 b.setBinCount(od.binCount); | 146 b.setBinCount(int(od.binCount)); |
147 if (od.binNames.size() > 0) { | 147 if (od.binNames.size() > 0) { |
148 auto binNames = b.initBinNames(od.binNames.size()); | 148 auto binNames = b.initBinNames(unsigned(od.binNames.size())); |
149 for (size_t i = 0; i < od.binNames.size(); ++i) { | 149 for (int i = 0; i < int(od.binNames.size()); ++i) { |
150 binNames.set(i, od.binNames[i]); | 150 binNames.set(i, od.binNames[i]); |
151 } | 151 } |
152 } | 152 } |
153 } | 153 } |
154 | 154 |
230 if (pd.isQuantized) { | 230 if (pd.isQuantized) { |
231 b.setQuantizeStep(pd.quantizeStep); | 231 b.setQuantizeStep(pd.quantizeStep); |
232 } | 232 } |
233 | 233 |
234 if (pd.valueNames.size() > 0) { | 234 if (pd.valueNames.size() > 0) { |
235 auto valueNames = b.initValueNames(pd.valueNames.size()); | 235 auto valueNames = b.initValueNames(unsigned(pd.valueNames.size())); |
236 for (size_t i = 0; i < pd.valueNames.size(); ++i) { | 236 for (int i = 0; i < int(pd.valueNames.size()); ++i) { |
237 valueNames.set(i, pd.valueNames[i]); | 237 valueNames.set(i, pd.valueNames[i]); |
238 } | 238 } |
239 } | 239 } |
240 } | 240 } |
241 | 241 |
280 } | 280 } |
281 | 281 |
282 b.setLabel(f.label); | 282 b.setLabel(f.label); |
283 | 283 |
284 if (f.values.size() > 0) { | 284 if (f.values.size() > 0) { |
285 auto values = b.initFeatureValues(f.values.size()); | 285 auto values = b.initFeatureValues(unsigned(f.values.size())); |
286 for (size_t i = 0; i < f.values.size(); ++i) { | 286 for (int i = 0; i < int(f.values.size()); ++i) { |
287 values.set(i, f.values[i]); | 287 values.set(i, f.values[i]); |
288 } | 288 } |
289 } | 289 } |
290 } | 290 } |
291 | 291 |
315 static void | 315 static void |
316 buildFeatureSet(piper::FeatureSet::Builder &b, | 316 buildFeatureSet(piper::FeatureSet::Builder &b, |
317 const Vamp::Plugin::FeatureSet &fs, | 317 const Vamp::Plugin::FeatureSet &fs, |
318 const PluginOutputIdMapper &omapper) { | 318 const PluginOutputIdMapper &omapper) { |
319 | 319 |
320 auto featureset = b.initFeaturePairs(fs.size()); | 320 auto featureset = b.initFeaturePairs(unsigned(fs.size())); |
321 int ix = 0; | 321 int ix = 0; |
322 for (const auto &fsi : fs) { | 322 for (const auto &fsi : fs) { |
323 auto fspair = featureset[ix]; | 323 auto fspair = featureset[ix]; |
324 fspair.setOutput(omapper.indexToId(fsi.first)); | 324 fspair.setOutput(omapper.indexToId(fsi.first)); |
325 auto featurelist = fspair.initFeatures(fsi.second.size()); | 325 auto featurelist = fspair.initFeatures(unsigned(fsi.second.size())); |
326 for (size_t j = 0; j < fsi.second.size(); ++j) { | 326 for (int j = 0; j < int(fsi.second.size()); ++j) { |
327 auto feature = featurelist[j]; | 327 auto feature = featurelist[j]; |
328 buildFeature(feature, fsi.second[j]); | 328 buildFeature(feature, fsi.second[j]); |
329 } | 329 } |
330 ++ix; | 330 ++ix; |
331 } | 331 } |
385 | 385 |
386 b.setMaker(d.maker); | 386 b.setMaker(d.maker); |
387 b.setCopyright(d.copyright); | 387 b.setCopyright(d.copyright); |
388 b.setVersion(d.pluginVersion); | 388 b.setVersion(d.pluginVersion); |
389 | 389 |
390 auto clist = b.initCategory(d.category.size()); | 390 auto clist = b.initCategory(unsigned(d.category.size())); |
391 for (size_t i = 0; i < d.category.size(); ++i) { | 391 for (int i = 0; i < int(d.category.size()); ++i) { |
392 clist.set(i, d.category[i]); | 392 clist.set(i, d.category[i]); |
393 } | 393 } |
394 | 394 |
395 b.setMinChannelCount(d.minChannelCount); | 395 b.setMinChannelCount(int(d.minChannelCount)); |
396 b.setMaxChannelCount(d.maxChannelCount); | 396 b.setMaxChannelCount(int(d.maxChannelCount)); |
397 | 397 |
398 const auto &vparams = d.parameters; | 398 const auto &vparams = d.parameters; |
399 auto plist = b.initParameters(vparams.size()); | 399 auto plist = b.initParameters(unsigned(vparams.size())); |
400 for (size_t i = 0; i < vparams.size(); ++i) { | 400 for (int i = 0; i < int(vparams.size()); ++i) { |
401 auto pd = plist[i]; | 401 auto pd = plist[i]; |
402 buildParameterDescriptor(pd, vparams[i]); | 402 buildParameterDescriptor(pd, vparams[i]); |
403 } | 403 } |
404 | 404 |
405 const auto &vprogs = d.programs; | 405 const auto &vprogs = d.programs; |
406 auto pglist = b.initPrograms(vprogs.size()); | 406 auto pglist = b.initPrograms(unsigned(vprogs.size())); |
407 for (size_t i = 0; i < vprogs.size(); ++i) { | 407 for (int i = 0; i < int(vprogs.size()); ++i) { |
408 pglist.set(i, vprogs[i]); | 408 pglist.set(i, vprogs[i]); |
409 } | 409 } |
410 | 410 |
411 b.setInputDomain(fromInputDomain(d.inputDomain)); | 411 b.setInputDomain(fromInputDomain(d.inputDomain)); |
412 | 412 |
413 const auto &vouts = d.basicOutputInfo; | 413 const auto &vouts = d.basicOutputInfo; |
414 auto olist = b.initBasicOutputInfo(vouts.size()); | 414 auto olist = b.initBasicOutputInfo(unsigned(vouts.size())); |
415 for (size_t i = 0; i < vouts.size(); ++i) { | 415 for (int i = 0; i < int(vouts.size()); ++i) { |
416 auto od = olist[i]; | 416 auto od = olist[i]; |
417 buildBasicDescriptor(od, vouts[i]); | 417 buildBasicDescriptor(od, vouts[i]); |
418 } | 418 } |
419 } | 419 } |
420 | 420 |
467 static void | 467 static void |
468 buildConfiguration(piper::Configuration::Builder &b, | 468 buildConfiguration(piper::Configuration::Builder &b, |
469 const PluginConfiguration &c) { | 469 const PluginConfiguration &c) { |
470 | 470 |
471 const auto &vparams = c.parameterValues; | 471 const auto &vparams = c.parameterValues; |
472 auto params = b.initParameterValues(vparams.size()); | 472 auto params = b.initParameterValues(unsigned(vparams.size())); |
473 int i = 0; | 473 int i = 0; |
474 for (const auto &pp : vparams) { | 474 for (const auto &pp : vparams) { |
475 auto param = params[i++]; | 475 auto param = params[i++]; |
476 param.setParameter(pp.first); | 476 param.setParameter(pp.first); |
477 param.setValue(pp.second); | 477 param.setValue(pp.second); |
527 } | 527 } |
528 if (req.adapterFlags & Vamp::HostExt::PluginLoader::ADAPT_BUFFER_SIZE) { | 528 if (req.adapterFlags & Vamp::HostExt::PluginLoader::ADAPT_BUFFER_SIZE) { |
529 flags.push_back(piper::AdapterFlag::ADAPT_BUFFER_SIZE); | 529 flags.push_back(piper::AdapterFlag::ADAPT_BUFFER_SIZE); |
530 } | 530 } |
531 | 531 |
532 auto f = r.initAdapterFlags(flags.size()); | 532 auto f = r.initAdapterFlags(unsigned(flags.size())); |
533 for (size_t i = 0; i < flags.size(); ++i) { | 533 for (int i = 0; i < int(flags.size()); ++i) { |
534 f.set(i, flags[i]); | 534 f.set(i, flags[i]); |
535 } | 535 } |
536 } | 536 } |
537 | 537 |
538 static void | 538 static void |
606 buildConfigurationResponse(piper::ConfigurationResponse::Builder &b, | 606 buildConfigurationResponse(piper::ConfigurationResponse::Builder &b, |
607 const ConfigurationResponse &cr, | 607 const ConfigurationResponse &cr, |
608 const PluginHandleMapper &pmapper) { | 608 const PluginHandleMapper &pmapper) { |
609 | 609 |
610 b.setHandle(pmapper.pluginToHandle(cr.plugin)); | 610 b.setHandle(pmapper.pluginToHandle(cr.plugin)); |
611 auto olist = b.initOutputs(cr.outputs.size()); | 611 auto olist = b.initOutputs(unsigned(cr.outputs.size())); |
612 for (size_t i = 0; i < cr.outputs.size(); ++i) { | 612 for (int i = 0; i < int(cr.outputs.size()); ++i) { |
613 auto od = olist[i]; | 613 auto od = olist[i]; |
614 buildOutputDescriptor(od, cr.outputs[i]); | 614 buildOutputDescriptor(od, cr.outputs[i]); |
615 } | 615 } |
616 } | 616 } |
617 | 617 |
635 Vamp::RealTime timestamp, | 635 Vamp::RealTime timestamp, |
636 const std::vector<std::vector<float> > &buffers) { | 636 const std::vector<std::vector<float> > &buffers) { |
637 | 637 |
638 auto t = b.initTimestamp(); | 638 auto t = b.initTimestamp(); |
639 buildRealTime(t, timestamp); | 639 buildRealTime(t, timestamp); |
640 auto vv = b.initInputBuffers(buffers.size()); | 640 auto vv = b.initInputBuffers(unsigned(buffers.size())); |
641 for (size_t ch = 0; ch < buffers.size(); ++ch) { | 641 for (int ch = 0; ch < int(buffers.size()); ++ch) { |
642 const int n = int(buffers[ch].size()); | 642 const int n = int(buffers[ch].size()); |
643 vv.init(ch, n); | 643 vv.init(ch, n); |
644 auto v = vv[ch]; | 644 auto v = vv[ch]; |
645 for (int i = 0; i < n; ++i) { | 645 for (int i = 0; i < n; ++i) { |
646 v.set(i, buffers[ch][i]); | 646 v.set(i, buffers[ch][i]); |
737 static void | 737 static void |
738 buildRpcResponse_List(piper::RpcResponse::Builder &b, | 738 buildRpcResponse_List(piper::RpcResponse::Builder &b, |
739 const ListResponse &resp) { | 739 const ListResponse &resp) { |
740 | 740 |
741 auto r = b.getResponse().initList(); | 741 auto r = b.getResponse().initList(); |
742 auto p = r.initAvailable(resp.available.size()); | 742 auto p = r.initAvailable(unsigned(resp.available.size())); |
743 for (size_t i = 0; i < resp.available.size(); ++i) { | 743 for (int i = 0; i < int(resp.available.size()); ++i) { |
744 auto pd = p[i]; | 744 auto pd = p[i]; |
745 buildExtractorStaticData(pd, resp.available[i]); | 745 buildExtractorStaticData(pd, resp.available[i]); |
746 } | 746 } |
747 } | 747 } |
748 | 748 |