Add Model::removePlugin() function
This commit is contained in:
parent
37637ff544
commit
3d9d08b808
|
@ -418,16 +418,15 @@ ChannelShared& Model::addChannelShared(std::unique_ptr<ChannelShared> cs) { retu
|
|||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
void Model::removePlugin(const Plugin& p) { remove_(m_shared.plugins, p); }
|
||||
|
||||
template <typename T>
|
||||
void Model::removeShared(const T& ref)
|
||||
{
|
||||
if constexpr (std::is_same_v<T, Plugin>)
|
||||
remove_(m_shared.plugins, ref);
|
||||
if constexpr (std::is_same_v<T, Wave>)
|
||||
remove_(m_shared.waves, ref);
|
||||
}
|
||||
|
||||
template void Model::removeShared<Plugin>(const Plugin& t);
|
||||
template void Model::removeShared<Wave>(const Wave& t);
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
|
|
@ -204,6 +204,8 @@ public:
|
|||
template <typename T>
|
||||
void removeShared(const T&);
|
||||
|
||||
void removePlugin(const Plugin&);
|
||||
|
||||
template <typename T>
|
||||
void clearShared();
|
||||
|
||||
|
|
|
@ -130,13 +130,13 @@ void PluginHost::swapPlugin(const m::Plugin& p1, const m::Plugin& p2, std::vecto
|
|||
|
||||
void PluginHost::freePlugin(const m::Plugin& plugin)
|
||||
{
|
||||
m_model.removeShared(plugin);
|
||||
m_model.removePlugin(plugin);
|
||||
}
|
||||
|
||||
void PluginHost::freePlugins(const std::vector<Plugin*>& plugins)
|
||||
{
|
||||
for (const Plugin* p : plugins)
|
||||
m_model.removeShared(*p);
|
||||
m_model.removePlugin(*p);
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
|
Loading…
Reference in New Issue