diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2016-07-14 17:00:10 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2016-07-14 17:00:10 +0200 |
commit | a9eadcc1b483d5d30a8443e78fa4d84c8f18d6c3 (patch) | |
tree | f5897ad46c0bc4cb8c4b3cfd1df3b07b66221774 | |
parent | 53b6cbafc8923cb6e305a7e868b502069ece5177 (diff) |
Add 'get' prefix to metadata info methods. Fix test plugin.
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | plugin.h | 14 | ||||
-rw-r--r-- | pluginlv2.h | 10 | ||||
-rw-r--r-- | plugintest.cc | 20 | ||||
-rw-r--r-- | plugintest.h | 5 | ||||
-rw-r--r-- | pluginvst.cc | 10 | ||||
-rw-r--r-- | pluginvst.h | 14 |
7 files changed, 51 insertions, 24 deletions
@@ -10,7 +10,7 @@ LV2_SRC = \ plugintest.cc -VST_PATH=/path/to/vstsdk2.4 +VST_PATH=../drumgizmo.broken/vst/vstsdk2.4 VST_SRC_BASE=$(VST_PATH)/public.sdk/source/vst2.x/ VST_CXXFLAGS=-DVST -I$(VST_PATH) VST_SRC = \ @@ -33,12 +33,12 @@ class MidiEvent; -//! Contains the same plugin categories as the VST enum VstPlugCategory +//! Plugin categories. enum class PluginCategory { Unknown = 0, // Unknown, category not implemented Effect, // Simple Effect - Synth, // VST Instrument (Synths, samplers,...) + Synth, // Instrument (Synths, samplers,...) Analysis, // Scope, Tuner, ... Mastering, // Dynamics, ... Spacializer, // Panners, ... @@ -123,11 +123,11 @@ public: //! Get unique plugin id. virtual std::string getId() = 0; - // Functions used to set plugin information for VST - virtual std::string effectName() = 0; - virtual std::string vendorString() = 0; - virtual std::string productString() = 0; - virtual PluginCategory pluginCategory() = 0; + // Functions used to set plugin information. + virtual std::string getEffectName() = 0; + virtual std::string getVendorString() = 0; + virtual std::string getProductString() = 0; + virtual PluginCategory getPluginCategory() = 0; //! Process callback. virtual void process(std::size_t pos, diff --git a/pluginlv2.h b/pluginlv2.h index 2c91dcc..da10ac3 100644 --- a/pluginlv2.h +++ b/pluginlv2.h @@ -112,11 +112,11 @@ public: //! Get unique plugin id. std::string getId() override = 0; - // Functions used to set plugin information for VST - std::string effectName() override = 0; - std::string vendorString() override = 0; - std::string productString() override = 0; - PluginCategory pluginCategory() override = 0; + // Functions used to set plugin information. + std::string getEffectName() override = 0; + std::string getVendorString() override = 0; + std::string getProductString() override = 0; + PluginCategory getPluginCategory() override = 0; virtual void process(std::size_t pos, const std::vector<MidiEvent>& input_events, diff --git a/plugintest.cc b/plugintest.cc index 283ba7b..48dad58 100644 --- a/plugintest.cc +++ b/plugintest.cc @@ -107,6 +107,26 @@ std::string PluginTest::getId() return "PluginTest"; } +std::string PluginTest::getEffectName() +{ + return "Test plugin"; +} + +std::string PluginTest::getVendorString() +{ + return "Test vendor"; +} + +std::string PluginTest::getProductString() +{ + return "Test product"; +} + +PluginCategory PluginTest::getPluginCategory() +{ + return PluginCategory::Synth; +} + void PluginTest::process(size_t pos, const std::vector<MidiEvent>& input_events, std::vector<MidiEvent>& output_events, diff --git a/plugintest.h b/plugintest.h index 2da5c73..294eecc 100644 --- a/plugintest.h +++ b/plugintest.h @@ -74,6 +74,11 @@ public: std::string getId() override; + std::string getEffectName() override; + std::string getVendorString() override; + std::string getProductString() override; + PluginCategory getPluginCategory() override; + void process(size_t pos, const std::vector<MidiEvent>& input_events, std::vector<MidiEvent>& output_events, diff --git a/pluginvst.cc b/pluginvst.cc index 66dc9b7..d3baee1 100644 --- a/pluginvst.cc +++ b/pluginvst.cc @@ -222,25 +222,25 @@ void PluginVST::setBlockSize(VstInt32 blockSize) bool PluginVST::getEffectName(char* name) { - vst_strncpy (name, this->effectName().c_str(), kVstMaxEffectNameLen); + vst_strncpy (name, this->getEffectName().c_str(), kVstMaxEffectNameLen); return true; } bool PluginVST::getVendorString(char* text) { - vst_strncpy (text, this->vendorString().c_str(), kVstMaxVendorStrLen); + vst_strncpy (text, this->getVendorString().c_str(), kVstMaxVendorStrLen); return true; } bool PluginVST::getProductString(char* text) { - vst_strncpy (text, this->productString().c_str(), kVstMaxProductStrLen); + vst_strncpy (text, this->getProductString().c_str(), kVstMaxProductStrLen); return true; } VstPlugCategory PluginVST::getPlugCategory() { - switch(this->pluginCategory()) + switch(this->getPluginCategory()) { case PluginCategory::Unknown: return kPlugCategUnknown; @@ -267,6 +267,8 @@ VstPlugCategory PluginVST::getPlugCategory() case PluginCategory::Generator: return kPlugCategGenerator; } + + return kPlugCategUnknown; } VstInt32 PluginVST::processEvents(VstEvents* events) diff --git a/pluginvst.h b/pluginvst.h index e65a2ef..ca140d1 100644 --- a/pluginvst.h +++ b/pluginvst.h @@ -112,20 +112,20 @@ public: //! Get unique plugin id. std::string getId() override = 0; - // Functions used to set plugin information for VST - + // Functions used to set plugin information for VST + //! Returns value which is then used by getEffectName - std::string effectName() override = 0; + std::string getEffectName() override = 0; //! Returns value which is then used by getVendorString - std::string vendorString() override = 0; + std::string getVendorString() override = 0; //! Returns value which is then used by getProductString - std::string productString() override = 0; + std::string getProductString() override = 0; //! Returns value which is then used by getPlugCategory - PluginCategory pluginCategory() override = 0; + PluginCategory getPluginCategory() override = 0; //! Fill \e text with a string identifying the effect bool getEffectName(char* name); - + //! Fill \e text with a string identifying the vendor bool getVendorString(char* text); |