LadspaEffect/Controls: fixed non-working global channel link checkbox

The global channel link checkbox did not work as expected as of the
M/V-split during 0.3.x -> 0.4.x development. Connected the slot
responsible for updating individual ports after toggling checkbox and
fixed the logic behind.

Closes #2964800.
(cherry picked from commit ace2266529)
This commit is contained in:
Tobias Doerffel
2010-05-21 01:04:10 +02:00
parent c59fe081ee
commit 566a3334aa
2 changed files with 16 additions and 13 deletions

View File

@@ -1,8 +1,8 @@
/*
* LadspaControls.cpp - model for LADSPA-plugin controls
* LadspaControls.cpp - model for LADSPA plugin controls
*
* Copyright (c) 2008-2010 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* Copyright (c) 2008-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
@@ -22,7 +22,6 @@
*
*/
#include <QtXml/QDomElement>
#include "LadspaEffect.h"
@@ -35,6 +34,10 @@ LadspaControls::LadspaControls( LadspaEffect * _eff ) :
m_noLink( false ),
m_stereoLinkModel( true, this )
{
connect( &m_stereoLinkModel, SIGNAL( dataChanged() ),
this, SLOT( updateLinkStatesFromGlobal() ) );
multi_proc_t controls = m_effect->getPortControls();
m_controlCount = controls.count();
@@ -163,7 +166,7 @@ void LadspaControls::linkPort( Uint16 _port, bool _state )
void LadspaControls::updateChannelLinkState()
void LadspaControls::updateLinkStatesFromGlobal()
{
if( m_stereoLinkModel.value() )
{
@@ -183,10 +186,10 @@ void LadspaControls::updateChannelLinkState()
m_controls[0][port]->setLink( false );
}
}
else
{
m_noLink = false;
}
// if global channel link state has changed, always ignore link
// status of individual ports in the future
m_noLink = false;
}

View File

@@ -1,8 +1,8 @@
/*
* ladspa_controls.h - model for LADSPA-plugin controls
* LadspaControls.h - model for LADSPA plugin controls
*
* Copyright (c) 2008-2010 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* Copyright (c) 2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
@@ -61,7 +61,7 @@ public:
protected slots:
void updateChannelLinkState();
void updateLinkStatesFromGlobal();
void linkPort( Uint16 _port, bool _state );