comparison src/vamp-hostsdk/PluginWrapper.cpp @ 500:4a86f866bb6b

The PluginRateExtractor hack was exploiting undefined behaviour. Let's just give in and make that API official
author Chris Cannam
date Mon, 11 Dec 2017 13:22:11 +0000
parents c97e70ed5abc
children 8ffb8985ae8f
comparison
equal deleted inserted replaced
499:8ede825a54f6 500:4a86f866bb6b
40 40
41 namespace Vamp { 41 namespace Vamp {
42 42
43 namespace HostExt { 43 namespace HostExt {
44 44
45 class PluginRateExtractor : public Plugin
46 {
47 public:
48 PluginRateExtractor() : Plugin(0) { }
49 float getRate() const { return m_inputSampleRate; }
50 };
51
52 PluginWrapper::PluginWrapper(Plugin *plugin) : 45 PluginWrapper::PluginWrapper(Plugin *plugin) :
53 Plugin(((PluginRateExtractor *)plugin)->getRate()), 46 Plugin(plugin->getInputSampleRate()),
54 m_plugin(plugin) 47 m_plugin(plugin)
55 { 48 {
56 } 49 }
57 50
58 PluginWrapper::~PluginWrapper() 51 PluginWrapper::~PluginWrapper()