comparison plugin/LADSPAPluginFactory.cpp @ 1040:a1cd5abcb38b cxx11

Introduce and use a samplerate type
author Chris Cannam
date Wed, 04 Mar 2015 12:01:04 +0000
parents b14064bd1f97
children 6b1af0f05f06
comparison
equal deleted inserted replaced
1039:b14064bd1f97 1040:a1cd5abcb38b
159 float ub = descriptor->PortRangeHints[port].UpperBound; 159 float ub = descriptor->PortRangeHints[port].UpperBound;
160 minimum = std::min(0.f, ub - 1.f); 160 minimum = std::min(0.f, ub - 1.f);
161 } 161 }
162 162
163 if (LADSPA_IS_HINT_SAMPLE_RATE(d)) { 163 if (LADSPA_IS_HINT_SAMPLE_RATE(d)) {
164 minimum *= float(m_sampleRate); 164 minimum = float(minimum * m_sampleRate);
165 } 165 }
166 166
167 if (LADSPA_IS_HINT_LOGARITHMIC(d)) { 167 if (LADSPA_IS_HINT_LOGARITHMIC(d)) {
168 if (minimum == 0.f) minimum = 1.f; 168 if (minimum == 0.f) minimum = 1.f;
169 } 169 }
186 float lb = descriptor->PortRangeHints[port].LowerBound; 186 float lb = descriptor->PortRangeHints[port].LowerBound;
187 maximum = lb + 1.f; 187 maximum = lb + 1.f;
188 } 188 }
189 189
190 if (LADSPA_IS_HINT_SAMPLE_RATE(d)) { 190 if (LADSPA_IS_HINT_SAMPLE_RATE(d)) {
191 maximum *= float(m_sampleRate); 191 maximum = float(maximum * m_sampleRate);
192 } 192 }
193 193
194 return maximum; 194 return maximum;
195 } 195 }
196 196
329 329
330 RealTimePluginInstance * 330 RealTimePluginInstance *
331 LADSPAPluginFactory::instantiatePlugin(QString identifier, 331 LADSPAPluginFactory::instantiatePlugin(QString identifier,
332 int instrument, 332 int instrument,
333 int position, 333 int position,
334 unsigned int sampleRate, 334 sv_samplerate_t sampleRate,
335 unsigned int blockSize, 335 int blockSize,
336 unsigned int channels) 336 int channels)
337 { 337 {
338 Profiler profiler("LADSPAPluginFactory::instantiatePlugin"); 338 Profiler profiler("LADSPAPluginFactory::instantiatePlugin");
339 339
340 const LADSPA_Descriptor *descriptor = getLADSPADescriptor(identifier); 340 const LADSPA_Descriptor *descriptor = getLADSPADescriptor(identifier);
341 341