Mercurial > hg > piper-vamp-js
comparison src/PiperAdapter.h @ 64:02efb2bbdaf7
Default step and block size should be actual default values, not 0
author | Chris Cannam |
---|---|
date | Fri, 11 Nov 2016 16:52:17 +0000 |
parents | 93513dba1354 |
children |
comparison
equal
deleted
inserted
replaced
63:ca8a541aa83f | 64:02efb2bbdaf7 |
---|---|
112 | 112 |
113 int defaultChannels = 0; | 113 int defaultChannels = 0; |
114 if (p->getMinChannelCount() == p->getMaxChannelCount()) { | 114 if (p->getMinChannelCount() == p->getMaxChannelCount()) { |
115 defaultChannels = p->getMinChannelCount(); | 115 defaultChannels = p->getMinChannelCount(); |
116 } | 116 } |
117 | 117 |
118 response.defaultConfiguration = piper_vamp::PluginConfiguration::fromPlugin | 118 int defaultBlockSize = p->getPreferredBlockSize(); |
119 int defaultStepSize = p->getPreferredStepSize(); | |
120 | |
121 if (defaultBlockSize == 0) { | |
122 defaultBlockSize = 1024; | |
123 } | |
124 if (defaultStepSize == 0) { | |
125 if (p->getInputDomain() == Vamp::Plugin::FrequencyDomain) { | |
126 defaultStepSize = defaultBlockSize / 2; | |
127 } else { | |
128 defaultStepSize = defaultBlockSize; | |
129 } | |
130 } | |
131 | |
132 response.defaultConfiguration = | |
133 piper_vamp::PluginConfiguration::fromPlugin | |
119 (p, | 134 (p, |
120 defaultChannels, | 135 defaultChannels, |
121 p->getPreferredStepSize(), | 136 defaultStepSize, |
122 p->getPreferredBlockSize()); | 137 defaultBlockSize); |
123 | 138 |
124 return response; | 139 return response; |
125 } | 140 } |
126 | 141 |
127 private: | 142 private: |