Correct bypass handling in snapshots.
This commit is contained in:
@@ -671,6 +671,17 @@ void PiPedalModel::SetPedalboardItemEnable(int64_t clientId, int64_t pedalItemId
|
||||
std::lock_guard<std::recursive_mutex> guard{mutex};
|
||||
{
|
||||
this->pedalboard.SetItemEnabled(pedalItemId, enabled);
|
||||
PedalboardItem * pPedalboardItem = this->pedalboard.GetItem(pedalItemId);
|
||||
if (pPedalboardItem) {
|
||||
Lv2PluginInfo::ptr pluginInfo = GetPluginInfo(pPedalboardItem->uri());
|
||||
if (pluginInfo) {
|
||||
for (auto &port: pluginInfo->ports()) {
|
||||
if (port->is_bypass()) {
|
||||
pPedalboardItem->SetControlValue(port->symbol(), enabled? 1.0: 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Notify clients.
|
||||
std::vector<IPiPedalModelSubscriber::ptr> t{subscribers.begin(), subscribers.end()};
|
||||
|
||||
@@ -2246,6 +2246,19 @@ bool Lv2PluginInfo::WantsWorkerThread() const
|
||||
{
|
||||
return contains(this->required_features_, LV2_WORKER__schedule) || contains(this->supported_features_, LV2_WORKER__schedule);
|
||||
}
|
||||
|
||||
uint32_t Lv2PluginInfo::getBypassPortIndex() const
|
||||
{
|
||||
for (const auto &port : ports_)
|
||||
{
|
||||
if (port->is_bypass())
|
||||
{
|
||||
return port->index();
|
||||
}
|
||||
}
|
||||
return (uint32_t)-1;
|
||||
}
|
||||
|
||||
// void PiPedalHostLogError(const std::string &error)
|
||||
// {
|
||||
// Lv2Log::error("%s",error.c_str());
|
||||
|
||||
@@ -527,6 +527,7 @@ namespace pipedal
|
||||
}
|
||||
}
|
||||
bool IsPathProperty(const std::string &uri) const;
|
||||
uint32_t getBypassPortIndex() const;
|
||||
|
||||
public:
|
||||
virtual ~Lv2PluginInfo();
|
||||
|
||||
Reference in New Issue
Block a user