split off effectControlDialog into effectControlDialog and effectControls, made work with M/V as well as rewritten effect-framework, fixed bug in songEditor-engine
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/branches/lmms-mv@664 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
@@ -11,7 +11,7 @@ AM_CXXFLAGS := $(AM_CXXFLAGS) $(QT_CXXFLAGS) -DPLUGIN_NAME="bassbooster"
|
||||
$(MOC) -o $@ $<
|
||||
|
||||
|
||||
MOC_FILES = ./bassbooster_control_dialog.moc
|
||||
MOC_FILES = ./bassbooster_controls.moc
|
||||
|
||||
BUILT_SOURCES = $(MOC_FILES) ./embedded_resources.h
|
||||
EMBEDDED_RESOURCES = $(wildcard *png)
|
||||
@@ -30,6 +30,8 @@ pkglib_LTLIBRARIES= libbassbooster.la
|
||||
|
||||
libbassbooster_la_SOURCES = bass_booster.cpp \
|
||||
bass_booster.h \
|
||||
bassbooster_controls.cpp \
|
||||
bassbooster_controls.h \
|
||||
bassbooster_control_dialog.cpp \
|
||||
bassbooster_control_dialog.h
|
||||
|
||||
|
||||
@@ -54,7 +54,8 @@ plugin::descriptor bassbooster_plugin_descriptor =
|
||||
bassBoosterEffect::bassBoosterEffect( model * _parent,
|
||||
const descriptor::subPluginFeatures::key * _key ) :
|
||||
effect( &bassbooster_plugin_descriptor, _parent, _key ),
|
||||
m_bbFX( effectLib::fastBassBoost<>( 70.0f, 1.0f, 2.8f ) )
|
||||
m_bbFX( effectLib::fastBassBoost<>( 70.0f, 1.0f, 2.8f ) ),
|
||||
m_bbControls( this )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "effect_lib.h"
|
||||
#include "engine.h"
|
||||
#include "main_window.h"
|
||||
#include "bassbooster_control_dialog.h"
|
||||
#include "bassbooster_controls.h"
|
||||
|
||||
|
||||
|
||||
@@ -45,23 +45,25 @@ public:
|
||||
virtual ~bassBoosterEffect();
|
||||
virtual bool FASTCALL processAudioBuffer( surroundSampleFrame * _buf,
|
||||
const fpp_t _frames );
|
||||
inline virtual QString nodeName( void ) const
|
||||
|
||||
virtual effectControls * getControls( void )
|
||||
{
|
||||
return( "bassboostereffect" );
|
||||
return( &m_bbControls );
|
||||
}
|
||||
|
||||
virtual inline effectControlDialog * createControlDialog( track * )
|
||||
/* inline virtual QString nodeName( void ) const
|
||||
{
|
||||
return( new bassBoosterControlDialog(
|
||||
NULL /*engine::getMainWindow()->workspace()*/,
|
||||
this ) );
|
||||
}
|
||||
return( "bassboostereffect" );
|
||||
}*/
|
||||
|
||||
|
||||
private:
|
||||
effectLib::monoToStereoAdaptor<effectLib::fastBassBoost<> > m_bbFX;
|
||||
|
||||
friend class bassBoosterControlDialog;
|
||||
bassBoosterControls m_bbControls;
|
||||
|
||||
friend class bassBoosterControls;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* bassbooster_control_dialog.cpp - control-dialog for bassbooster-effect
|
||||
*
|
||||
* Copyright (c) 2006-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -25,126 +25,35 @@
|
||||
|
||||
#include <QtGui/QLayout>
|
||||
|
||||
#include "bass_booster.h"
|
||||
#include "knob.h"
|
||||
#include "bassbooster_control_dialog.h"
|
||||
#include "bassbooster_controls.h"
|
||||
|
||||
|
||||
|
||||
bassBoosterControlDialog::bassBoosterControlDialog( QWidget * _parent,
|
||||
bassBoosterEffect * _eff ) :
|
||||
effectControlDialog( _parent, _eff ),
|
||||
m_effect( _eff )
|
||||
bassBoosterControlDialog::bassBoosterControlDialog(
|
||||
bassBoosterControls * _controls ) :
|
||||
effectControlDialog( _controls )
|
||||
{
|
||||
QHBoxLayout * l = new QHBoxLayout( this );
|
||||
|
||||
m_freqKnob = new knob( knobBright_26, this, tr( "Frequency" ), NULL );
|
||||
m_freqKnob->setRange( 50.0f, 200.0f, 1.0f );
|
||||
m_freqKnob->setInitValue( 100.0f );
|
||||
m_freqKnob->setLabel( tr( "FREQ" ) );
|
||||
m_freqKnob->setHintText( tr( "Frequency:" ) + " ", "Hz" );
|
||||
connect( m_freqKnob, SIGNAL( valueChanged( float ) ),
|
||||
this, SLOT( changeFrequency( void ) ) );
|
||||
knob * freqKnob = new knob( knobBright_26, this, tr( "Frequency" ) );
|
||||
freqKnob->setModel( &_controls->m_freqModel );
|
||||
freqKnob->setLabel( tr( "FREQ" ) );
|
||||
freqKnob->setHintText( tr( "Frequency:" ) + " ", "Hz" );
|
||||
|
||||
m_gainKnob = new knob( knobBright_26, this, tr( "Gain" ), NULL );
|
||||
m_gainKnob->setRange( 0.1f, 5.0f, 0.1f );
|
||||
m_gainKnob->setInitValue( 1.0f );
|
||||
m_gainKnob->setLabel( tr( "GAIN" ) );
|
||||
m_gainKnob->setHintText( tr( "Gain:" ) + " ", "" );
|
||||
connect( m_gainKnob, SIGNAL( valueChanged( float ) ),
|
||||
this, SLOT( changeGain( void ) ) );
|
||||
knob * gainKnob = new knob( knobBright_26, this, tr( "Gain" ) );
|
||||
gainKnob->setModel( &_controls->m_gainModel );
|
||||
gainKnob->setLabel( tr( "GAIN" ) );
|
||||
gainKnob->setHintText( tr( "Gain:" ) + " ", "" );
|
||||
|
||||
m_ratioKnob = new knob( knobBright_26, this, tr( "Ratio" ), NULL );
|
||||
m_ratioKnob->setRange( 0.1f, 10.0f, 0.1f );
|
||||
m_ratioKnob->setInitValue( 2.0f );
|
||||
m_ratioKnob->setLabel( tr( "RATIO" ) );
|
||||
m_ratioKnob->setHintText( tr( "Ratio:" ) + " ", "" );
|
||||
connect( m_ratioKnob, SIGNAL( valueChanged( float ) ),
|
||||
this, SLOT( changeRatio( void ) ) );
|
||||
knob * ratioKnob = new knob( knobBright_26, this, tr( "Ratio" ) );
|
||||
ratioKnob->setModel( &_controls->m_ratioModel );
|
||||
ratioKnob->setLabel( tr( "RATIO" ) );
|
||||
ratioKnob->setHintText( tr( "Ratio:" ) + " ", "" );
|
||||
|
||||
l->addWidget( m_freqKnob );
|
||||
l->addWidget( m_gainKnob );
|
||||
l->addWidget( m_ratioKnob );
|
||||
|
||||
changeFrequency();
|
||||
changeGain();
|
||||
changeRatio();
|
||||
l->addWidget( freqKnob );
|
||||
l->addWidget( gainKnob );
|
||||
l->addWidget( ratioKnob );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void bassBoosterControlDialog::changeFrequency( void )
|
||||
{
|
||||
m_effect->m_bbFX.leftFX().setFrequency( m_freqKnob->value() );
|
||||
m_effect->m_bbFX.rightFX().setFrequency( m_freqKnob->value() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void bassBoosterControlDialog::changeGain( void )
|
||||
{
|
||||
m_effect->m_bbFX.leftFX().setGain( m_gainKnob->value() );
|
||||
m_effect->m_bbFX.rightFX().setGain( m_gainKnob->value() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void bassBoosterControlDialog::changeRatio( void )
|
||||
{
|
||||
m_effect->m_bbFX.leftFX().setRatio( m_ratioKnob->value() );
|
||||
m_effect->m_bbFX.rightFX().setRatio( m_ratioKnob->value() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
void bassBoosterControlDialog::updateEffect( void )
|
||||
{
|
||||
//m_effect->m_bbFX = effectLib::bassBoost<>( m_freqKnob->value(),
|
||||
// m_gainKnob->value(), m_ratioKnob->value() );
|
||||
m_effect->m_bbFX = effectLib::monoToStereoAdaptor<
|
||||
effectLib::bassBoost<> >(
|
||||
effectLib::bassBoost<>( m_freqKnob->value(),
|
||||
m_gainKnob->value(), m_ratioKnob->value(),
|
||||
m_effect->m_bbFX.leftFX() ),
|
||||
effectLib::bassBoost<>( m_freqKnob->value(),
|
||||
m_gainKnob->value(), m_ratioKnob->value(),
|
||||
m_effect->m_bbFX.rightFX() )
|
||||
);
|
||||
m_effect->m_bbFX.leftFX().setSelectivity( m_freqKnob->value() );
|
||||
m_effect->m_bbFX.rightFX().setSelectivity( m_freqKnob->value() );
|
||||
m_effect->m_bbFX.leftFX().setGain( m_gainKnob->value() );
|
||||
m_effect->m_bbFX.rightFX().setGain( m_gainKnob->value() );
|
||||
m_effect->m_bbFX.leftFX().setRatio( m_ratioKnob->value() );
|
||||
m_effect->m_bbFX.rightFX().setRatio( m_ratioKnob->value() );
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
void FASTCALL bassBoosterControlDialog::loadSettings(
|
||||
const QDomElement & _this )
|
||||
{
|
||||
m_freqKnob->setValue( _this.attribute( "freq" ).toFloat() );
|
||||
m_gainKnob->setValue( _this.attribute( "gain" ).toFloat() );
|
||||
m_ratioKnob->setValue( _this.attribute( "ratio" ).toFloat() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void FASTCALL bassBoosterControlDialog::saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _this )
|
||||
{
|
||||
_this.setAttribute( "freq", m_freqKnob->value() );
|
||||
_this.setAttribute( "gain", m_gainKnob->value() );
|
||||
_this.setAttribute( "ratio", m_ratioKnob->value() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
#include "bassbooster_control_dialog.moc"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* bassbooster_control_dialog.h - control-dialog for bassbooster-effect
|
||||
*
|
||||
* Copyright (c) 2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -27,45 +27,18 @@
|
||||
|
||||
#include "effect_control_dialog.h"
|
||||
|
||||
class knob;
|
||||
class bassBoosterEffect;
|
||||
|
||||
class bassBoosterControls;
|
||||
|
||||
|
||||
class bassBoosterControlDialog : public effectControlDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
bassBoosterControlDialog( QWidget * _parent, bassBoosterEffect * _eff );
|
||||
bassBoosterControlDialog( bassBoosterControls * _controls );
|
||||
virtual ~bassBoosterControlDialog()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void FASTCALL saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent );
|
||||
virtual void FASTCALL loadSettings( const QDomElement & _this );
|
||||
inline virtual QString nodeName( void ) const
|
||||
{
|
||||
return( "bassboostercontrols" );
|
||||
}
|
||||
|
||||
virtual ch_cnt_t getControlCount( void )
|
||||
{
|
||||
return( 3 );
|
||||
}
|
||||
|
||||
|
||||
private slots:
|
||||
void changeFrequency( void );
|
||||
void changeGain( void );
|
||||
void changeRatio( void );
|
||||
|
||||
|
||||
private:
|
||||
bassBoosterEffect * m_effect;
|
||||
knob * m_freqKnob;
|
||||
knob * m_gainKnob;
|
||||
knob * m_ratioKnob;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
||||
103
plugins/bass_booster/bassbooster_controls.cpp
Normal file
103
plugins/bass_booster/bassbooster_controls.cpp
Normal file
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* bassbooster_controls.cpp - controls for bassbooster-effect
|
||||
*
|
||||
* 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "bassbooster_controls.h"
|
||||
#include "bass_booster.h"
|
||||
|
||||
|
||||
|
||||
bassBoosterControls::bassBoosterControls( bassBoosterEffect * _eff ) :
|
||||
effectControls( _eff ),
|
||||
m_effect( _eff ),
|
||||
m_freqModel( 100.0f, 50.0f, 200.0f, 1.0f, this ),
|
||||
m_gainModel( 1.0f, 0.1f, 5.0f, 0.05f, this ),
|
||||
m_ratioModel( 2.0f, 0.1f, 10.0f, 0.1f, this )
|
||||
{
|
||||
connect( &m_freqModel, SIGNAL( dataChanged( void ) ),
|
||||
this, SLOT( changeFrequency( void ) ) );
|
||||
|
||||
connect( &m_gainModel, SIGNAL( dataChanged( void ) ),
|
||||
this, SLOT( changeGain( void ) ) );
|
||||
|
||||
connect( &m_ratioModel, SIGNAL( dataChanged( void ) ),
|
||||
this, SLOT( changeRatio( void ) ) );
|
||||
|
||||
changeFrequency();
|
||||
changeGain();
|
||||
changeRatio();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void bassBoosterControls::changeFrequency( void )
|
||||
{
|
||||
m_effect->m_bbFX.leftFX().setFrequency( m_freqModel.value() );
|
||||
m_effect->m_bbFX.rightFX().setFrequency( m_freqModel.value() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void bassBoosterControls::changeGain( void )
|
||||
{
|
||||
m_effect->m_bbFX.leftFX().setGain( m_gainModel.value() );
|
||||
m_effect->m_bbFX.rightFX().setGain( m_gainModel.value() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void bassBoosterControls::changeRatio( void )
|
||||
{
|
||||
m_effect->m_bbFX.leftFX().setRatio( m_ratioModel.value() );
|
||||
m_effect->m_bbFX.rightFX().setRatio( m_ratioModel.value() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void bassBoosterControls::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
m_freqModel.setValue( _this.attribute( "freq" ).toFloat() );
|
||||
m_gainModel.setValue( _this.attribute( "gain" ).toFloat() );
|
||||
m_ratioModel.setValue( _this.attribute( "ratio" ).toFloat() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void bassBoosterControls::saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _this )
|
||||
{
|
||||
_this.setAttribute( "freq", m_freqModel.value() );
|
||||
_this.setAttribute( "gain", m_gainModel.value() );
|
||||
_this.setAttribute( "ratio", m_ratioModel.value() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
#include "bassbooster_controls.moc"
|
||||
|
||||
79
plugins/bass_booster/bassbooster_controls.h
Normal file
79
plugins/bass_booster/bassbooster_controls.h
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* bassbooster_controls.h - controls for bassbooster-effect
|
||||
*
|
||||
* 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
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _BASSBOOSTER_CONTROLS_H
|
||||
#define _BASSBOOSTER_CONTROLS_H
|
||||
|
||||
#include "effect_controls.h"
|
||||
#include "bassbooster_control_dialog.h"
|
||||
#include "knob.h"
|
||||
|
||||
|
||||
class bassBoosterEffect;
|
||||
|
||||
|
||||
class bassBoosterControls : public effectControls
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
bassBoosterControls( bassBoosterEffect * _eff );
|
||||
virtual ~bassBoosterControls()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
inline virtual QString nodeName( void ) const
|
||||
{
|
||||
return( "bassboostercontrols" );
|
||||
}
|
||||
|
||||
virtual ch_cnt_t getControlCount( void )
|
||||
{
|
||||
return( 3 );
|
||||
}
|
||||
|
||||
virtual effectControlDialog * createView( void )
|
||||
{
|
||||
return( new bassBoosterControlDialog( this ) );
|
||||
}
|
||||
|
||||
|
||||
private slots:
|
||||
void changeFrequency( void );
|
||||
void changeGain( void );
|
||||
void changeRatio( void );
|
||||
|
||||
|
||||
private:
|
||||
bassBoosterEffect * m_effect;
|
||||
knobModel m_freqModel;
|
||||
knobModel m_gainModel;
|
||||
knobModel m_ratioModel;
|
||||
|
||||
friend class bassBoosterControlDialog;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user