Skip to content

Commit

Permalink
Merge pull request #22 from Trinitou/update-helpers-host-proxy
Browse files Browse the repository at this point in the history
Update helpers
  • Loading branch information
abique authored Oct 16, 2023
2 parents f1e9be4 + 8e4f52d commit 71f3071
Show file tree
Hide file tree
Showing 24 changed files with 27 additions and 27 deletions.
8 changes: 4 additions & 4 deletions plugins/clap-entry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@
#include "plugs/realtime-requirement/realtime-requirement.hh"

struct PluginEntry {
using create_func = std::function<const clap_plugin *(const clap_host *)>;
using create_func = std::function<const clap_plugin *(const clap_host &)>;

PluginEntry(const clap_plugin_descriptor *d, create_func &&func)
: desc(d), create(std::move(func)) {}

const clap_plugin_descriptor *desc;
std::function<const clap_plugin *(const clap_host *)> create;
std::function<const clap_plugin *(const clap_host &)> create;
};

static std::vector<PluginEntry> g_plugins;
static std::string g_pluginPath;

template <typename T>
static void addPlugin() {
g_plugins.emplace_back(T::descriptor(), [](const clap_host *host) -> const clap_plugin * {
g_plugins.emplace_back(T::descriptor(), [](const clap_host &host) -> const clap_plugin * {
auto plugin = new T(g_pluginPath, host);
return plugin->clapPlugin();
});
Expand Down Expand Up @@ -77,7 +77,7 @@ static const clap_plugin *
clap_create_plugin(const clap_plugin_factory *, const clap_host *host, const char *plugin_id) {
for (auto &entry : g_plugins)
if (!strcmp(entry.desc->id, plugin_id))
return entry.create(host);
return entry.create(*host);
return nullptr;
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/core-plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace clap {

CorePlugin::CorePlugin(std::unique_ptr<PathProvider> &&pathProvider,
const clap_plugin_descriptor *desc,
const clap_host *host)
const clap_host &host)
: Plugin(desc, host), _pathProvider(std::move(pathProvider)) {
assert(_pathProvider);
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/core-plugin.hh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace clap {
public:
CorePlugin(std::unique_ptr<PathProvider> &&pathProvider,
const clap_plugin_descriptor *desc,
const clap_host *host);
const clap_host &host);
~CorePlugin() override;

const PathProvider &pathProvider() const noexcept { return *_pathProvider; }
Expand Down
2 changes: 1 addition & 1 deletion plugins/plugs/adsr/adsr-plug.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ namespace clap {
return &desc;
}

AdsrPlug::AdsrPlug(const std::string &pluginPath, const clap_host *host)
AdsrPlug::AdsrPlug(const std::string &pluginPath, const clap_host &host)
: CorePlugin(PathProvider::create(pluginPath, "AdsrPlug"), descriptor(), host) {
_rootModule = std::make_unique<AdsrPlugModule>(*this);
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/plugs/adsr/adsr-plug.hh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace clap {
using super = CorePlugin;

public:
AdsrPlug(const std::string &pluginPath, const clap_host *host);
AdsrPlug(const std::string &pluginPath, const clap_host &host);

static const clap_plugin_descriptor *descriptor();

Expand Down
2 changes: 1 addition & 1 deletion plugins/plugs/char-check/char-check.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace clap {
return &desc;
}

CharCheck::CharCheck(const std::string &pluginPath, const clap_host *host)
CharCheck::CharCheck(const std::string &pluginPath, const clap_host &host)
: CorePlugin(PathProvider::create(pluginPath, "char-check"), descriptor(), host) {
_rootModule = std::make_unique<CharCheckModule>(*this);

Expand Down
2 changes: 1 addition & 1 deletion plugins/plugs/char-check/char-check.hh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace clap {
using super = CorePlugin;

public:
CharCheck(const std::string &pluginPath, const clap_host *host);
CharCheck(const std::string &pluginPath, const clap_host &host);

static const clap_plugin_descriptor *descriptor();

Expand Down
2 changes: 1 addition & 1 deletion plugins/plugs/dc-offset/dc-offset.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ namespace clap {
return &desc;
}

DcOffset::DcOffset(const std::string &pluginPath, const clap_host *host)
DcOffset::DcOffset(const std::string &pluginPath, const clap_host &host)
: CorePlugin(PathProvider::create(pluginPath, "dc-offset"), descriptor(), host) {
_rootModule = std::make_unique<DcOffsetModule>(*this);
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/plugs/dc-offset/dc-offset.hh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace clap {
using super = CorePlugin;

public:
DcOffset(const std::string& pluginPath, const clap_host *host);
DcOffset(const std::string& pluginPath, const clap_host &host);

static const clap_plugin_descriptor *descriptor();

Expand Down
2 changes: 1 addition & 1 deletion plugins/plugs/gain/gain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace clap {
kParamIdGain = 0,
};

Gain::Gain(const std::string &pluginPath, const clap_host *host)
Gain::Gain(const std::string &pluginPath, const clap_host &host)
: CorePlugin(PathProvider::create(pluginPath, "gain"), descriptor(), host) {
_rootModule = std::make_unique<GainModule>(*this);
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/plugs/gain/gain.hh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace clap {
using super = CorePlugin;

public:
Gain(const std::string &pluginPath, const clap_host *host);
Gain(const std::string &pluginPath, const clap_host &host);

static const clap_plugin_descriptor *descriptor();

Expand Down
2 changes: 1 addition & 1 deletion plugins/plugs/latency/latency.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace clap {
return &desc;
}

Latency::Latency(const std::string &pluginPath, const clap_host *host)
Latency::Latency(const std::string &pluginPath, const clap_host &host)
: CorePlugin(PathProvider::create(pluginPath, "Latency"), descriptor(), host) {
_rootModule = std::make_unique<LatencyModule>(*this);
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/plugs/latency/latency.hh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace clap {
using super = CorePlugin;

public:
Latency(const std::string &pluginPath, const clap_host *host);
Latency(const std::string &pluginPath, const clap_host &host);

static const clap_plugin_descriptor *descriptor();

Expand Down
2 changes: 1 addition & 1 deletion plugins/plugs/offline-latency/offline-latency.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace clap {
return &desc;
}

OfflineLatency::OfflineLatency(const std::string &pluginPath, const clap_host *host)
OfflineLatency::OfflineLatency(const std::string &pluginPath, const clap_host &host)
: CorePlugin(PathProvider::create(pluginPath, "Offline Latency"), descriptor(), host) {
_rootModule = std::make_unique<OfflineLatencyModule>(*this);
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/plugs/offline-latency/offline-latency.hh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace clap {
using super = CorePlugin;

public:
OfflineLatency(const std::string &pluginPath, const clap_host *host);
OfflineLatency(const std::string &pluginPath, const clap_host &host);

static const clap_plugin_descriptor *descriptor();

Expand Down
2 changes: 1 addition & 1 deletion plugins/plugs/realtime-requirement/realtime-requirement.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace clap {
return &desc;
}

RealtimeRequirement::RealtimeRequirement(const std::string &pluginPath, const clap_host *host)
RealtimeRequirement::RealtimeRequirement(const std::string &pluginPath, const clap_host &host)
: CorePlugin(PathProvider::create(pluginPath, "Offline Latency"), descriptor(), host) {
_rootModule = std::make_unique<RealtimeRequirementModule>(*this);
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/plugs/realtime-requirement/realtime-requirement.hh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace clap {
using super = CorePlugin;

public:
RealtimeRequirement(const std::string &pluginPath, const clap_host *host);
RealtimeRequirement(const std::string &pluginPath, const clap_host &host);

static const clap_plugin_descriptor *descriptor();

Expand Down
2 changes: 1 addition & 1 deletion plugins/plugs/svf/svf-plug.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace clap {
return &desc;
}

SvfPlug::SvfPlug(const std::string &pluginPath, const clap_host *host)
SvfPlug::SvfPlug(const std::string &pluginPath, const clap_host &host)
: CorePlugin(PathProvider::create(pluginPath, "svf"), descriptor(), host) {
_rootModule = std::make_unique<SvfPlugModule>(*this);
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/plugs/svf/svf-plug.hh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace clap {
using super = CorePlugin;

public:
SvfPlug(const std::string &pluginPath, const clap_host *host);
SvfPlug(const std::string &pluginPath, const clap_host &host);

static const clap_plugin_descriptor *descriptor();

Expand Down
2 changes: 1 addition & 1 deletion plugins/plugs/synth/synth.cc
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ namespace clap {
return &desc;
}

Synth::Synth(const std::string &pluginPath, const clap_host *host)
Synth::Synth(const std::string &pluginPath, const clap_host &host)
: CorePlugin(PathProvider::create(pluginPath, "synth"), descriptor(), host) {
_rootModule = std::make_unique<SynthModule>(*this);
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/plugs/synth/synth.hh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace clap {
using super = CorePlugin;

public:
Synth(const std::string &pluginPath, const clap_host *host);
Synth(const std::string &pluginPath, const clap_host &host);

static const clap_plugin_descriptor *descriptor();

Expand Down
2 changes: 1 addition & 1 deletion plugins/plugs/transport/transport-info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace clap {
kParamIdOffset = 0,
};

TransportInfo::TransportInfo(const std::string &pluginPath, const clap_host *host)
TransportInfo::TransportInfo(const std::string &pluginPath, const clap_host &host)
: CorePlugin(PathProvider::create(pluginPath, "transport-info"), descriptor(), host) {
_rootModule = std::make_unique<TransportInfoModule>(*this);
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/plugs/transport/transport-info.hh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace clap {
using super = CorePlugin;

public:
TransportInfo(const std::string& pluginPath, const clap_host *host);
TransportInfo(const std::string& pluginPath, const clap_host &host);

static const clap_plugin_descriptor *descriptor();
};
Expand Down

0 comments on commit 71f3071

Please sign in to comment.