Commit 3e50f1ae authored by Benjamin Heisch's avatar Benjamin Heisch
Browse files

try an approach to generated an random id, before extra information can be...

try an approach to generated an random id, before extra information  can be passed to format plugins.
parent d7ea7088
Pipeline #19371 passed with stages
in 6 minutes and 3 seconds
......@@ -2,7 +2,7 @@
XPlug is an crossplatform audio abstraction plugin, which is currently under heavy development.
At the moment it supports VST2, VST3, LV2 and LADSPA. But there are a lot more to come, because its made for adding more Formats to it.
Because its in an early phase of development it just supports audio and midi processing ( sure a lot more too, but that are details).
There should be GUI and Parameter support soon, so that this Library can be used in production.
There should be GUI and Parameter support soon, so that this Library can be used in production. 6
## Dependencies
Before building XPlug make sure, that all dependencies are installed. For the buildprocess you need CMake and an compiler.
......
......@@ -131,7 +131,7 @@ extern "C"
desc->Maker = plug->getInfoComponent()->getCreatorName().data();
desc->Name = plug->getInfoComponent()->getPluginName().data();
// desc->Name = "Hans peter";
desc->UniqueID = 278375745;
desc->UniqueID = plug->getInfoComponent()->getID();
desc->run = [](LADSPA_Handle instance, unsigned long SampleCount) {
auto data = static_cast<LADSPAHandleDataType*>(instance);
......
......@@ -357,7 +357,7 @@ extern "C"
effect->dispatcher = vst_dispatcher;
/******************INFORMATION*****************/
effect->uniqueID = 0;
effect->uniqueID = implementationData->plug->getInfoComponent()->getID();
effect->version = 0;
effect->numInputs = static_cast<int>(getNumberOfPorts<IAudioPort>(
implementationData->plug, PortDirection::Input));
......
......@@ -16,13 +16,15 @@ public:
std::string pluginCopyright;
std::string creatorName;
std::string creatorURL;
int64_t id;
StaticInfoComponent();
StaticInfoComponent(std::string pluginName,
std::string pluginUri,
std::string pluginDescription,
std::string pluginCopyright,
std::string creatorName,
std::string creatorURL);
std::string creatorURL,
int64_t _id);
virtual std::string_view getPluginName() override;
virtual std::string_view getPluginURI() override;
......@@ -30,6 +32,7 @@ public:
virtual std::string_view getPluginCopyright() override;
virtual std::string_view getCreatorName() override;
virtual std::string_view getCreatorURL() override;
virtual int64_t getID() override;
};
}
#endif //! INFO_COMPONENTS_HPP
\ No newline at end of file
......@@ -35,7 +35,11 @@ public:
* @return Copyright or Licence of the Plugin.
*/
virtual std::string_view getPluginCopyright() = 0;
/**
* @brief Gets the ID of the Plugin, which is used in the format libraries.
* @return returns the id of the plugin.
*/
virtual int64_t getID() = 0;
/********************Creator/Vendor information*********************/
/**
* @brief Gets the Name of the creator, vendor or developer.
......
......@@ -8,13 +8,15 @@ XPlug::StaticInfoComponent::StaticInfoComponent()
this->pluginCopyright = "";
this->creatorName = "";
this->creatorURL = "";
this->id = 0;
}
XPlug::StaticInfoComponent::StaticInfoComponent(std::string _pluginName,
std::string _pluginUri,
std::string _pluginDescription,
std::string _pluginCopyright,
std::string _creatorName,
std::string _creatorURL)
std::string _creatorURL,
int64_t _id)
{
this->pluginName = _pluginName;
this->pluginUri = _pluginUri;
......@@ -22,6 +24,7 @@ XPlug::StaticInfoComponent::StaticInfoComponent(std::string _pluginName,
this->pluginCopyright = _pluginCopyright;
this->creatorName = _creatorName;
this->creatorURL = _creatorURL;
this->id = _id;
}
std::string_view
XPlug::StaticInfoComponent::getPluginName()
......@@ -52,4 +55,10 @@ std::string_view
XPlug::StaticInfoComponent::getCreatorURL()
{
return this->creatorURL;
}
\ No newline at end of file
}
int64_t
XPlug::StaticInfoComponent::getID()
{
return this->id;
}
#include <base/PluginBases.hpp>
#include <memory>
#include <random>
using namespace XPlug;
XPlug::LazyPlugin::LazyPlugin()
{
std::default_random_engine engine;
this->infoComponent = std::make_unique<StaticInfoComponent>(
"No Name Plugin",
"urn://LazyPlugin/ToLazyToInit",
"A simple plugin wich does something... at least it exists",
"LGPL",
"Me",
"http://myhompeage.never.existed.com");
"http://myhompeage.never.existed.com",
std::uniform_int_distribution<int64_t>()(engine));
this->portComponent= std::make_unique<DynamicPortComponent>();
this->featureComponent = std::make_unique<AutomaticFeatureComponent>(this->portComponent.get());
this->portComponent = std::make_unique<DynamicPortComponent>();
this->featureComponent =
std::make_unique<AutomaticFeatureComponent>(this->portComponent.get());
}
XPlug::LazyPlugin::LazyPlugin(std::vector<std::unique_ptr<IPort>> ports)
......
......@@ -9,6 +9,7 @@ TEST_CASE("Test InfoComponent Methods")
"pluginDescription",
"pluginCopyright",
"creatorName",
"creatorURL");
"creatorURL",
1234);
testIInfoComponent(&comp);
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment