Skip to content

Commit

Permalink
Remove redundant LV2Ports::Audio::m_optional
Browse files Browse the repository at this point in the history
The same info is already stored in the `Lv2Ports::Meta` base class.
  • Loading branch information
JohannesLorenz committed Oct 4, 2020
1 parent b558865 commit 3fa4b98
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion include/Lv2Ports.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ struct Cv : public VisitablePort<Cv, ControlPortBase>

struct Audio : public VisitablePort<Audio, PortBase>
{
Audio(std::size_t bufferSize, bool isSidechain, bool isOptional);
Audio(std::size_t bufferSize, bool isSidechain);

//! Copy buffer passed by LMMS into our ports
//! @param channel channel index into each sample frame
Expand Down
4 changes: 2 additions & 2 deletions src/core/lv2/Lv2Ports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ QString PortBase::uri() const



Audio::Audio(std::size_t bufferSize, bool isSidechain, bool isOptional)
: m_buffer(bufferSize), m_sidechain(isSidechain), m_optional(isOptional)
Audio::Audio(std::size_t bufferSize, bool isSidechain)
: m_buffer(bufferSize), m_sidechain(isSidechain)
{
}

Expand Down
6 changes: 2 additions & 4 deletions src/core/lv2/Lv2Proc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ Plugin::PluginTypes Lv2Proc::check(const LilvPlugin *plugin,
bool portMustBeUsed =
!portIsSideChain(plugin,
lilv_plugin_get_port_by_index(plugin, portNum)) &&
!portIsOptional(plugin,
lilv_plugin_get_port_by_index(plugin, portNum));
!meta.m_optional;
if (meta.m_type == Lv2Ports::Type::Audio && portMustBeUsed)
++audioChannels[meta.m_flow == Lv2Ports::Flow::Output
? outCount : inCount];
Expand Down Expand Up @@ -381,8 +380,7 @@ void Lv2Proc::createPort(std::size_t portNum)
new Lv2Ports::Audio(
static_cast<std::size_t>(
Engine::mixer()->framesPerPeriod()),
portIsSideChain(m_plugin, lilvPort),
portIsOptional(m_plugin, lilvPort)
portIsSideChain(m_plugin, lilvPort)
);
port = audio;
break;
Expand Down

0 comments on commit 3fa4b98

Please sign in to comment.