v1.4.89 TInternal
This commit is contained in:
+23
-2
@@ -104,6 +104,14 @@ Lv2Effect::Lv2Effect(
|
||||
auto uriNode = lilv_new_uri(pWorld, pedalboardItem.uri().c_str());
|
||||
const LilvPlugin *pPlugin = lilv_plugins_get_by_uri(plugins, uriNode);
|
||||
|
||||
for (auto&port : info->ports())
|
||||
{
|
||||
if (port->is_bypass())
|
||||
{
|
||||
this->bypassControlIndex = port->index();
|
||||
break;
|
||||
}
|
||||
}
|
||||
lilv_node_free(uriNode);
|
||||
{
|
||||
AutoLilvNode bundleUri = lilv_plugin_get_bundle_uri(pPlugin);
|
||||
@@ -545,7 +553,13 @@ void Lv2Effect::Activate()
|
||||
this->activated = true;
|
||||
this->AssignUnconnectedPorts();
|
||||
lilv_instance_activate(pInstance);
|
||||
this->BypassTo(this->bypass ? 1.0f : 0.0f);
|
||||
if (this->bypassControlIndex == -1)
|
||||
{
|
||||
this->BypassDezipperSet(this->bypass ? 1.0f : 0.0f);
|
||||
} else {
|
||||
this->BypassDezipperSet(1.0f);
|
||||
this->controlValues[this->bypassControlIndex] = this->bypass ? 1.0f: 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
void Lv2Effect::UpdateAudioPorts()
|
||||
@@ -835,8 +849,15 @@ void Lv2Effect::ResetOutputAtomBuffer(char *data)
|
||||
header->size = pHost->GetAtomBufferSize() - 8;
|
||||
header->type = urids.atom__Chunk;
|
||||
}
|
||||
void Lv2Effect::BypassDezipperSet(float targetValue)
|
||||
{
|
||||
this->targetBypass = targetValue;
|
||||
this->currentBypass = targetValue;
|
||||
this->currentBypassDx = 0;
|
||||
this->bypassSamplesRemaining = 0;
|
||||
}
|
||||
|
||||
void Lv2Effect::BypassTo(float targetValue)
|
||||
void Lv2Effect::BypassDezipperTo(float targetValue)
|
||||
{
|
||||
this->targetBypass = targetValue;
|
||||
double dx = targetValue - this->currentBypass;
|
||||
|
||||
+11
-2
@@ -101,6 +101,7 @@ namespace pipedal
|
||||
std::vector<bool> isInputControlPort;
|
||||
std::vector<float> defaultInputControlValues;
|
||||
std::vector<bool> isInputTriggerControlPort;;
|
||||
int bypassControlIndex = -1;
|
||||
|
||||
virtual std::string GetUri() const { return info->uri(); }
|
||||
|
||||
@@ -185,6 +186,8 @@ namespace pipedal
|
||||
const void *data);
|
||||
|
||||
|
||||
int GetBypassControlPort() const { return bypassControlIndex; }
|
||||
|
||||
void ResetInputAtomBuffer(char*data);
|
||||
void ResetOutputAtomBuffer(char*data);
|
||||
|
||||
@@ -202,7 +205,9 @@ namespace pipedal
|
||||
int actualAudioInputs = 0;
|
||||
int actualAudioOutputs = 0;
|
||||
std::vector<std::vector<float>> outputMixBuffers;
|
||||
void BypassTo(float value);
|
||||
void BypassDezipperTo(float value);
|
||||
void BypassDezipperSet(float value);
|
||||
|
||||
bool borrowedEffect = false;
|
||||
bool activated = false;
|
||||
|
||||
@@ -329,7 +334,11 @@ namespace pipedal
|
||||
if (bypass != this->bypass)
|
||||
{
|
||||
this->bypass = bypass;
|
||||
BypassTo(bypass? 1.0f: 0.0f);
|
||||
if (bypassControlIndex == -1) {
|
||||
BypassDezipperTo(bypass? 1.0f: 0.0f);
|
||||
} else {
|
||||
controlValues[bypassControlIndex] = bypass? 1.0f: 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
#include "JackConfiguration.hpp"
|
||||
#include "lv2/urid/urid.h"
|
||||
#include "lv2/ui/ui.h"
|
||||
#include "lv2/core/lv2.h"
|
||||
|
||||
// #include "lv2.h"
|
||||
#include "lv2/atom/atom.h"
|
||||
#include "lv2/time/time.h"
|
||||
@@ -1224,6 +1226,7 @@ Lv2PortInfo::Lv2PortInfo(PluginHost *host, const LilvPlugin *plugin, const LilvP
|
||||
|
||||
AutoLilvNode designationValue = lilv_port_get(plugin, pPort, host->lilvUris->core__designation);
|
||||
designation_ = nodeAsString(designationValue);
|
||||
is_bypass_ = designation_ == LV2_CORE__enabled;
|
||||
|
||||
AutoLilvNode portGroup_value = lilv_port_get(plugin, pPort, host->lilvUris->portgroups__group);
|
||||
port_group_ = nodeAsString(portGroup_value);
|
||||
@@ -1957,6 +1960,7 @@ json_map::storage_type<Lv2PortInfo> Lv2PortInfo::jmap{
|
||||
MAP_REF(Lv2PortInfo, not_on_gui),
|
||||
MAP_REF(Lv2PortInfo, buffer_type),
|
||||
MAP_REF(Lv2PortInfo, port_group),
|
||||
MAP_REF(Lv2PortInfo, is_bypass),
|
||||
MAP_REF(Lv2PortInfo, pipedal_ledColor),
|
||||
|
||||
json_map::enum_reference("units", &Lv2PortInfo::units_, get_units_enum_converter()),
|
||||
|
||||
+5
-1
@@ -231,6 +231,7 @@ namespace pipedal
|
||||
std::string port_group_;
|
||||
|
||||
std::string designation_;
|
||||
bool is_bypass_ = false;
|
||||
Units units_ = Units::none;
|
||||
std::string comment_;
|
||||
PiPedalUI::ptr piPedalUI_;
|
||||
@@ -280,6 +281,7 @@ namespace pipedal
|
||||
LV2_PROPERTY_GETSET_SCALAR(min_value);
|
||||
LV2_PROPERTY_GETSET_SCALAR(max_value);
|
||||
LV2_PROPERTY_GETSET_SCALAR(default_value);
|
||||
LV2_PROPERTY_GETSET_SCALAR(is_bypass);
|
||||
|
||||
LV2_PROPERTY_GETSET_SCALAR(is_input);
|
||||
LV2_PROPERTY_GETSET_SCALAR(is_output);
|
||||
@@ -594,7 +596,9 @@ namespace pipedal
|
||||
}
|
||||
}
|
||||
}
|
||||
is_bypass_ = name_ == "bypass" || name_ == "Bypass" || symbol_ == "bypass" || symbol_ == "Bypass";
|
||||
is_bypass_ =
|
||||
pPort->is_bypass() ||
|
||||
name_ == "bypass" || name_ == "Bypass" || symbol_ == "bypass" || symbol_ == "Bypass";
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user