Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve mono compatibility with LADSPA plugins #7674

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions include/AudioDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ class AudioDevice
virtual void unregisterPort( AudioPort * _port );
virtual void renamePort( AudioPort * _port );


inline bool supportsCapture() const
{
return m_supportsCapture;
Expand All @@ -76,11 +75,6 @@ class AudioDevice
return m_sampleRate;
}

ch_cnt_t channels() const
{
return m_channels;
}

void processNextBuffer();

virtual void startProcessing()
Expand Down Expand Up @@ -109,6 +103,11 @@ class AudioDevice
void clearS16Buffer( int_sample_t * _outbuf,
const fpp_t _frames );

ch_cnt_t channels() const
{
return m_channels;
}

inline void setSampleRate( const sample_rate_t _new_sr )
{
m_sampleRate = _new_sr;
Expand Down
3 changes: 1 addition & 2 deletions plugins/LadspaBrowser/LadspaDescription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ LadspaDescription::LadspaDescription( QWidget * _parent,
QList<QString> pluginNames;
for (const auto& plugin : plugins)
{
ch_cnt_t audioDeviceChannels = Engine::audioEngine()->audioDev()->channels();
if (_type != LadspaPluginType::Valid || manager->getDescription(plugin.second)->inputChannels <= audioDeviceChannels)
if (_type != LadspaPluginType::Valid || manager->getDescription(plugin.second)->inputChannels <= DEFAULT_CHANNELS)
{
pluginNames.push_back(plugin.first);
m_pluginKeys.push_back(plugin.second);
Expand Down
3 changes: 1 addition & 2 deletions plugins/LadspaEffect/LadspaEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,8 @@ void LadspaEffect::pluginInstantiation()
Ladspa2LMMS * manager = Engine::getLADSPAManager();

// Calculate how many processing units are needed.
const ch_cnt_t lmms_chnls = Engine::audioEngine()->audioDev()->channels();
int effect_channels = manager->getDescription( m_key )->inputChannels;
setProcessorCount( lmms_chnls / effect_channels );
setProcessorCount(DEFAULT_CHANNELS / effect_channels);

// get inPlaceBroken property
m_inPlaceBroken = manager->isInplaceBroken( m_key );
Expand Down
2 changes: 1 addition & 1 deletion plugins/LadspaEffect/LadspaSubPluginFeatures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void LadspaSubPluginFeatures::listSubPluginKeys(
for( l_sortable_plugin_t::const_iterator it = plugins.begin();
it != plugins.end(); ++it )
{
if( lm->getDescription( ( *it ).second )->inputChannels <= Engine::audioEngine()->audioDev()->channels() )
if (lm->getDescription((*it).second)->inputChannels <= DEFAULT_CHANNELS)
{
_kl.push_back( ladspaKeyToSubPluginKey( _desc, ( *it ).first, ( *it ).second ) );
}
Expand Down
Loading