Merge https://github.com/LMMS/lmms into bugs_283_303
This commit is contained in:
@@ -2,6 +2,7 @@ ADD_SUBDIRECTORY(Amplifier)
|
||||
ADD_SUBDIRECTORY(audio_file_processor)
|
||||
ADD_SUBDIRECTORY(BassBooster)
|
||||
ADD_SUBDIRECTORY(bit_invader)
|
||||
ADD_SUBDIRECTORY(DualFilter)
|
||||
ADD_SUBDIRECTORY(dynamics_processor)
|
||||
ADD_SUBDIRECTORY(flp_import)
|
||||
ADD_SUBDIRECTORY(HydrogenImport)
|
||||
|
||||
3
plugins/DualFilter/CMakeLists.txt
Normal file
3
plugins/DualFilter/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(dualfilter DualFilter.cpp DualFilterControls.cpp DualFilterControlDialog.cpp MOCFILES DualFilterControls.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
153
plugins/DualFilter/DualFilter.cpp
Normal file
153
plugins/DualFilter/DualFilter.cpp
Normal file
@@ -0,0 +1,153 @@
|
||||
/*
|
||||
* DualFilter.cpp - A native dual filter effect plugin with two parallel filters
|
||||
*
|
||||
* Copyright (c) 2014 Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>
|
||||
* Copyright (c) 2006-2014 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 "DualFilter.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
#include "basic_filters.h"
|
||||
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
Plugin::Descriptor PLUGIN_EXPORT dualfilter_plugin_descriptor =
|
||||
{
|
||||
STRINGIFY( PLUGIN_NAME ),
|
||||
"Dual Filter",
|
||||
QT_TRANSLATE_NOOP( "pluginBrowser", "A native amplifier plugin" ),
|
||||
"Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>",
|
||||
0x0100,
|
||||
Plugin::Effect,
|
||||
new PluginPixmapLoader( "logo" ),
|
||||
NULL,
|
||||
NULL
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
DualFilterEffect::DualFilterEffect( Model* parent, const Descriptor::SubPluginFeatures::Key* key ) :
|
||||
Effect( &dualfilter_plugin_descriptor, parent, key ),
|
||||
m_dfControls( this )
|
||||
{
|
||||
m_filter1 = new basicFilters<2>( engine::mixer()->processingSampleRate() );
|
||||
m_filter2 = new basicFilters<2>( engine::mixer()->processingSampleRate() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
DualFilterEffect::~DualFilterEffect()
|
||||
{
|
||||
delete m_filter1;
|
||||
delete m_filter2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
bool DualFilterEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames )
|
||||
{
|
||||
if( !isEnabled() || !isRunning () )
|
||||
{
|
||||
return( false );
|
||||
}
|
||||
|
||||
double outSum = 0.0;
|
||||
const float d = dryLevel();
|
||||
const float w = wetLevel();
|
||||
|
||||
m_filter1->setFilterType( m_dfControls.m_filter1Model.value() );
|
||||
m_filter2->setFilterType( m_dfControls.m_filter2Model.value() );
|
||||
|
||||
if( m_dfControls.m_enabled1Model.value() ) m_filter1->calcFilterCoeffs( m_dfControls.m_cut1Model.value(), m_dfControls.m_res1Model.value() );
|
||||
if( m_dfControls.m_enabled2Model.value() ) m_filter2->calcFilterCoeffs( m_dfControls.m_cut2Model.value(), m_dfControls.m_res2Model.value() );
|
||||
|
||||
// buffer processing loop
|
||||
for( fpp_t f = 0; f < frames; ++f )
|
||||
{
|
||||
sample_t s[2] = { 0.0f, 0.0f }; // mix
|
||||
sample_t s1[2] = { buf[f][0], buf[f][1] }; // filter 1
|
||||
sample_t s2[2] = { buf[f][0], buf[f][1] }; // filter 2
|
||||
|
||||
// get mix amounts for wet signals of both filters
|
||||
const float mix1 = 1.0f - ( ( m_dfControls.m_mixModel.value( f ) + 1.0f ) / 2.0f );
|
||||
const float mix2 = ( ( m_dfControls.m_mixModel.value( f ) + 1.0f ) / 2.0f );
|
||||
|
||||
// update filter 1
|
||||
if( m_dfControls.m_enabled1Model.value() )
|
||||
{
|
||||
s1[0] = m_filter1->update( s1[0], 0 );
|
||||
s1[1] = m_filter1->update( s1[1], 1 );
|
||||
|
||||
// apply gain
|
||||
s1[0] *= ( m_dfControls.m_gain1Model.value( f ) / 100.0f );
|
||||
s1[1] *= ( m_dfControls.m_gain1Model.value( f ) / 100.0f );
|
||||
|
||||
// apply mix
|
||||
s[0] += ( s1[0] * mix1 );
|
||||
s[1] += ( s1[1] * mix1 );
|
||||
}
|
||||
|
||||
// update filter 2
|
||||
if( m_dfControls.m_enabled2Model.value() )
|
||||
{
|
||||
s2[0] = m_filter2->update( s2[0], 0 );
|
||||
s2[1] = m_filter2->update( s2[1], 1 );
|
||||
|
||||
//apply gain
|
||||
s2[0] *= ( m_dfControls.m_gain2Model.value( f ) / 100.0f );
|
||||
s2[1] *= ( m_dfControls.m_gain2Model.value( f ) / 100.0f );
|
||||
|
||||
// apply mix
|
||||
s[0] += ( s2[0] * mix2 );
|
||||
s[1] += ( s2[1] * mix2 );
|
||||
}
|
||||
|
||||
// do another mix with dry signal
|
||||
buf[f][0] = d * buf[f][0] + w * s[0];
|
||||
buf[f][1] = d * buf[f][1] + w * s[1];
|
||||
outSum += buf[f][0]*buf[f][0] + buf[f][1]*buf[f][1];
|
||||
}
|
||||
|
||||
checkGate( outSum / frames );
|
||||
|
||||
return isRunning();
|
||||
}
|
||||
|
||||
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
// necessary for getting instance out of shared lib
|
||||
Plugin * PLUGIN_EXPORT lmms_plugin_main( Model* parent, void* data )
|
||||
{
|
||||
return new DualFilterEffect( parent, static_cast<const Plugin::Descriptor::SubPluginFeatures::Key *>( data ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
56
plugins/DualFilter/DualFilter.h
Normal file
56
plugins/DualFilter/DualFilter.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* DualFilter.h - dual filter effect-plugin
|
||||
*
|
||||
* Copyright (c) 2014 Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>
|
||||
* Copyright (c) 2006-2014 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 DUALFILTER_H
|
||||
#define DUALFILTER_H
|
||||
|
||||
#include "Effect.h"
|
||||
#include "DualFilterControls.h"
|
||||
#include "basic_filters.h"
|
||||
|
||||
class DualFilterEffect : public Effect
|
||||
{
|
||||
public:
|
||||
DualFilterEffect( Model* parent, const Descriptor::SubPluginFeatures::Key* key );
|
||||
virtual ~DualFilterEffect();
|
||||
virtual bool processAudioBuffer( sampleFrame* buf, const fpp_t frames );
|
||||
|
||||
virtual EffectControls* controls()
|
||||
{
|
||||
return &m_dfControls;
|
||||
}
|
||||
|
||||
private:
|
||||
DualFilterControls m_dfControls;
|
||||
|
||||
basicFilters<2> * m_filter1;
|
||||
basicFilters<2> * m_filter2;
|
||||
|
||||
friend class DualFilterControls;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
86
plugins/DualFilter/DualFilterControlDialog.cpp
Normal file
86
plugins/DualFilter/DualFilterControlDialog.cpp
Normal file
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* DualFilterControlDialog.cpp - control dialog for dual filter effect
|
||||
*
|
||||
* Copyright (c) 2014 Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>
|
||||
* Copyright (c) 2006-2014 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 <QtGui/QLayout>
|
||||
|
||||
#include "DualFilterControlDialog.h"
|
||||
#include "DualFilterControls.h"
|
||||
#include "embed.h"
|
||||
#include "led_checkbox.h"
|
||||
#include "combobox.h"
|
||||
#include "tooltip.h"
|
||||
#include "gui_templates.h"
|
||||
|
||||
#define makeknob( name, x, y, model, label, hint, unit ) \
|
||||
knob * name = new knob( knobBright_26, this); \
|
||||
name -> move( x, y ); \
|
||||
name ->setModel( &controls-> model ); \
|
||||
name ->setLabel( tr( label ) ); \
|
||||
name ->setHintText( tr( hint ) + " ", unit );
|
||||
|
||||
|
||||
|
||||
DualFilterControlDialog::DualFilterControlDialog( DualFilterControls* controls ) :
|
||||
EffectControlDialog( controls )
|
||||
{
|
||||
setAutoFillBackground( true );
|
||||
QPalette pal;
|
||||
pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap( "artwork" ) );
|
||||
setPalette( pal );
|
||||
setFixedSize( 150, 220 );
|
||||
|
||||
makeknob( cut1Knob, 33, 30, m_cut1Model, "FREQ", "Cutoff frequency", "Hz" )
|
||||
makeknob( res1Knob, 75, 30, m_res1Model, "RESO", "Resonance", "" )
|
||||
makeknob( gain1Knob, 117, 30, m_gain1Model, "GAIN", "Gain", "%" )
|
||||
makeknob( mixKnob, 62, 100, m_mixModel, "MIX", "Mix", "" )
|
||||
makeknob( cut2Knob, 33, 145, m_cut2Model, "FREQ", "Cutoff frequency", "Hz" )
|
||||
makeknob( res2Knob, 75, 145, m_res2Model, "RESO", "Resonance", "" )
|
||||
makeknob( gain2Knob, 117, 145, m_gain2Model, "GAIN", "Gain", "%" )
|
||||
|
||||
gain1Knob-> setVolumeKnob( true );
|
||||
gain2Knob-> setVolumeKnob( true );
|
||||
|
||||
ledCheckBox * enabled1Toggle = new ledCheckBox( "", this,
|
||||
tr( "Filter 1 enabled" ), ledCheckBox::Green );
|
||||
ledCheckBox * enabled2Toggle = new ledCheckBox( "", this,
|
||||
tr( "Filter 2 enabled" ), ledCheckBox::Green );
|
||||
|
||||
enabled1Toggle -> move( 5, 30 );
|
||||
enabled1Toggle -> setModel( &controls -> m_enabled1Model );
|
||||
toolTip::add( enabled1Toggle, tr( "Click to enable/disable Filter 1" ) );
|
||||
enabled2Toggle -> move( 5, 145 );
|
||||
enabled2Toggle -> setModel( &controls -> m_enabled2Model );
|
||||
toolTip::add( enabled2Toggle, tr( "Click to enable/disable Filter 2" ) );
|
||||
|
||||
comboBox * m_filter1ComboBox = new comboBox( this );
|
||||
m_filter1ComboBox->setGeometry( 5, 70, 140, 22 );
|
||||
m_filter1ComboBox->setFont( pointSize<8>( m_filter1ComboBox->font() ) );
|
||||
m_filter1ComboBox->setModel( &controls->m_filter1Model );
|
||||
|
||||
comboBox * m_filter2ComboBox = new comboBox( this );
|
||||
m_filter2ComboBox->setGeometry( 5, 185, 140, 22 );
|
||||
m_filter2ComboBox->setFont( pointSize<8>( m_filter2ComboBox->font() ) );
|
||||
m_filter2ComboBox->setModel( &controls->m_filter2Model );
|
||||
}
|
||||
45
plugins/DualFilter/DualFilterControlDialog.h
Normal file
45
plugins/DualFilter/DualFilterControlDialog.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* DualFilterControlDialog.h - control dialog for dual filter effect
|
||||
*
|
||||
* Copyright (c) 2014 Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>
|
||||
* Copyright (c) 2006-2014 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 DUALFILTER_CONTROL_DIALOG_H
|
||||
#define DUALFILTER_CONTROL_DIALOG_H
|
||||
|
||||
#include "EffectControlDialog.h"
|
||||
|
||||
|
||||
class DualFilterControls;
|
||||
|
||||
|
||||
class DualFilterControlDialog : public EffectControlDialog
|
||||
{
|
||||
public:
|
||||
DualFilterControlDialog( DualFilterControls* controls );
|
||||
virtual ~DualFilterControlDialog()
|
||||
{
|
||||
}
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
162
plugins/DualFilter/DualFilterControls.cpp
Normal file
162
plugins/DualFilter/DualFilterControls.cpp
Normal file
@@ -0,0 +1,162 @@
|
||||
/*
|
||||
* DualFilterControls.cpp - controls for dual filter effect
|
||||
*
|
||||
* Copyright (c) 2014 Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>
|
||||
* Copyright (c) 2008-2014 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 <QtXml/QDomElement>
|
||||
|
||||
#include "DualFilterControls.h"
|
||||
#include "DualFilter.h"
|
||||
#include "engine.h"
|
||||
#include "song.h"
|
||||
#include "basic_filters.h"
|
||||
#include "embed.h"
|
||||
|
||||
DualFilterControls::DualFilterControls( DualFilterEffect* effect ) :
|
||||
EffectControls( effect ),
|
||||
m_effect( effect ),
|
||||
|
||||
m_enabled1Model( true, this, tr( "Filter 1 enabled" ) ),
|
||||
m_filter1Model( this, tr( "Filter 1 type" ) ),
|
||||
m_cut1Model( 7000.0f, 1.0f, 14000.0f, 1.0f, this, tr( "Cutoff 1 frequency" ) ),
|
||||
m_res1Model( 0.5, basicFilters<0>::minQ(), 10.0, 0.01, this, tr( "Q/Resonance 1" ) ),
|
||||
m_gain1Model( 100.0f, 0.0f, 200.0f, 0.1f, this, tr( "Gain 1" ) ),
|
||||
|
||||
m_mixModel( 0.0f, -1.0f, 1.0f, 0.01f, this, tr( "Mix" ) ),
|
||||
|
||||
m_enabled2Model( true, this, tr( "Filter 2 enabled" ) ),
|
||||
m_filter2Model( this, tr( "Filter 2 type" ) ),
|
||||
m_cut2Model( 7000.0f, 1.0f, 14000.0f, 1.0f, this, tr( "Cutoff 2 frequency" ) ),
|
||||
m_res2Model( 0.5, basicFilters<0>::minQ(), 10.0, 0.01, this, tr( "Q/Resonance 2" ) ),
|
||||
m_gain2Model( 100.0f, 0.0f, 200.0f, 0.1f, this, tr( "Gain 2" ) )
|
||||
{
|
||||
connect( &m_enabled1Model, SIGNAL( dataChanged() ), this, SLOT( changeControl() ) );
|
||||
connect( &m_filter1Model, SIGNAL( dataChanged() ), this, SLOT( changeControl() ) );
|
||||
connect( &m_cut1Model, SIGNAL( dataChanged() ), this, SLOT( changeControl() ) );
|
||||
connect( &m_res1Model, SIGNAL( dataChanged() ), this, SLOT( changeControl() ) );
|
||||
connect( &m_gain1Model, SIGNAL( dataChanged() ), this, SLOT( changeControl() ) );
|
||||
|
||||
connect( &m_mixModel, SIGNAL( dataChanged() ), this, SLOT( changeControl() ) );
|
||||
|
||||
connect( &m_enabled2Model, SIGNAL( dataChanged() ), this, SLOT( changeControl() ) );
|
||||
connect( &m_filter2Model, SIGNAL( dataChanged() ), this, SLOT( changeControl() ) );
|
||||
connect( &m_cut2Model, SIGNAL( dataChanged() ), this, SLOT( changeControl() ) );
|
||||
connect( &m_res2Model, SIGNAL( dataChanged() ), this, SLOT( changeControl() ) );
|
||||
connect( &m_gain2Model, SIGNAL( dataChanged() ), this, SLOT( changeControl() ) );
|
||||
|
||||
m_filter1Model.addItem( tr( "LowPass" ), new PixmapLoader( "filter_lp" ) );
|
||||
m_filter1Model.addItem( tr( "HiPass" ), new PixmapLoader( "filter_hp" ) );
|
||||
m_filter1Model.addItem( tr( "BandPass csg" ), new PixmapLoader( "filter_bp" ) );
|
||||
m_filter1Model.addItem( tr( "BandPass czpg" ), new PixmapLoader( "filter_bp" ) );
|
||||
m_filter1Model.addItem( tr( "Notch" ), new PixmapLoader( "filter_notch" ) );
|
||||
m_filter1Model.addItem( tr( "Allpass" ), new PixmapLoader( "filter_ap" ) );
|
||||
m_filter1Model.addItem( tr( "Moog" ), new PixmapLoader( "filter_lp" ) );
|
||||
m_filter1Model.addItem( tr( "2x LowPass" ), new PixmapLoader( "filter_2lp" ) );
|
||||
m_filter1Model.addItem( tr( "RC LowPass 12dB" ), new PixmapLoader( "filter_lp" ) );
|
||||
m_filter1Model.addItem( tr( "RC BandPass 12dB" ), new PixmapLoader( "filter_bp" ) );
|
||||
m_filter1Model.addItem( tr( "RC HighPass 12dB" ), new PixmapLoader( "filter_hp" ) );
|
||||
m_filter1Model.addItem( tr( "RC LowPass 24dB" ), new PixmapLoader( "filter_lp" ) );
|
||||
m_filter1Model.addItem( tr( "RC BandPass 24dB" ), new PixmapLoader( "filter_bp" ) );
|
||||
m_filter1Model.addItem( tr( "RC HighPass 24dB" ), new PixmapLoader( "filter_hp" ) );
|
||||
m_filter1Model.addItem( tr( "Vocal Formant Filter" ), new PixmapLoader( "filter_hp" ) );
|
||||
|
||||
m_filter2Model.addItem( tr( "LowPass" ), new PixmapLoader( "filter_lp" ) );
|
||||
m_filter2Model.addItem( tr( "HiPass" ), new PixmapLoader( "filter_hp" ) );
|
||||
m_filter2Model.addItem( tr( "BandPass csg" ), new PixmapLoader( "filter_bp" ) );
|
||||
m_filter2Model.addItem( tr( "BandPass czpg" ), new PixmapLoader( "filter_bp" ) );
|
||||
m_filter2Model.addItem( tr( "Notch" ), new PixmapLoader( "filter_notch" ) );
|
||||
m_filter2Model.addItem( tr( "Allpass" ), new PixmapLoader( "filter_ap" ) );
|
||||
m_filter2Model.addItem( tr( "Moog" ), new PixmapLoader( "filter_lp" ) );
|
||||
m_filter2Model.addItem( tr( "2x LowPass" ), new PixmapLoader( "filter_2lp" ) );
|
||||
m_filter2Model.addItem( tr( "RC LowPass 12dB" ), new PixmapLoader( "filter_lp" ) );
|
||||
m_filter2Model.addItem( tr( "RC BandPass 12dB" ), new PixmapLoader( "filter_bp" ) );
|
||||
m_filter2Model.addItem( tr( "RC HighPass 12dB" ), new PixmapLoader( "filter_hp" ) );
|
||||
m_filter2Model.addItem( tr( "RC LowPass 24dB" ), new PixmapLoader( "filter_lp" ) );
|
||||
m_filter2Model.addItem( tr( "RC BandPass 24dB" ), new PixmapLoader( "filter_bp" ) );
|
||||
m_filter2Model.addItem( tr( "RC HighPass 24dB" ), new PixmapLoader( "filter_hp" ) );
|
||||
m_filter2Model.addItem( tr( "Vocal Formant Filter" ), new PixmapLoader( "filter_hp" ) );
|
||||
|
||||
connect( engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( updateFilters() ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void DualFilterControls::changeControl()
|
||||
{
|
||||
engine::getSong()->setModified();
|
||||
}
|
||||
|
||||
|
||||
void DualFilterControls::updateFilters()
|
||||
{
|
||||
delete m_effect->m_filter1;
|
||||
delete m_effect->m_filter2;
|
||||
m_effect->m_filter1 = new basicFilters<2>( engine::mixer()->processingSampleRate() );
|
||||
m_effect->m_filter2 = new basicFilters<2>( engine::mixer()->processingSampleRate() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DualFilterControls::loadSettings( const QDomElement& _this )
|
||||
{
|
||||
m_enabled1Model.loadSettings( _this, "enabled1" );
|
||||
m_filter1Model.loadSettings( _this, "filter1" );
|
||||
m_cut1Model.loadSettings( _this, "cut1" );
|
||||
m_res1Model.loadSettings( _this, "res1" );
|
||||
m_gain1Model.loadSettings( _this, "gain1" );
|
||||
|
||||
m_mixModel.loadSettings( _this, "mix" );
|
||||
|
||||
m_enabled2Model.loadSettings( _this, "enabled2" );
|
||||
m_filter2Model.loadSettings( _this, "filter2" );
|
||||
m_cut2Model.loadSettings( _this, "cut2" );
|
||||
m_res2Model.loadSettings( _this, "res2" );
|
||||
m_gain2Model.loadSettings( _this, "gain2" );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void DualFilterControls::saveSettings( QDomDocument& _doc, QDomElement& _this )
|
||||
{
|
||||
m_enabled1Model.saveSettings( _doc, _this, "enabled1" );
|
||||
m_filter1Model.saveSettings( _doc, _this, "filter1" );
|
||||
m_cut1Model.saveSettings( _doc, _this, "cut1" );
|
||||
m_res1Model.saveSettings( _doc, _this, "res1" );
|
||||
m_gain1Model.saveSettings( _doc, _this, "gain1" );
|
||||
|
||||
m_mixModel.saveSettings( _doc, _this, "mix" );
|
||||
|
||||
m_enabled2Model.saveSettings( _doc, _this, "enabled2" );
|
||||
m_filter2Model.saveSettings( _doc, _this, "filter2" );
|
||||
m_cut2Model.saveSettings( _doc, _this, "cut2" );
|
||||
m_res2Model.saveSettings( _doc, _this, "res2" );
|
||||
m_gain2Model.saveSettings( _doc, _this, "gain2" );
|
||||
}
|
||||
|
||||
|
||||
|
||||
#include "moc_DualFilterControls.cxx"
|
||||
|
||||
90
plugins/DualFilter/DualFilterControls.h
Normal file
90
plugins/DualFilter/DualFilterControls.h
Normal file
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* DualFilterControls.h - controls for dual filter -effect
|
||||
*
|
||||
* Copyright (c) 2014 Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>
|
||||
* Copyright (c) 2008-2014 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 DUALFILTER_CONTROLS_H
|
||||
#define DUALFILTER_CONTROLS_H
|
||||
|
||||
#include "EffectControls.h"
|
||||
#include "DualFilterControlDialog.h"
|
||||
#include "knob.h"
|
||||
#include "ComboBoxModel.h"
|
||||
|
||||
class DualFilterEffect;
|
||||
|
||||
|
||||
class DualFilterControls : public EffectControls
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
DualFilterControls( DualFilterEffect* effect );
|
||||
virtual ~DualFilterControls()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
inline virtual QString nodeName() const
|
||||
{
|
||||
return "DualFilterControls";
|
||||
}
|
||||
|
||||
virtual int controlCount()
|
||||
{
|
||||
return 11;
|
||||
}
|
||||
|
||||
virtual EffectControlDialog* createView()
|
||||
{
|
||||
return new DualFilterControlDialog( this );
|
||||
}
|
||||
|
||||
|
||||
private slots:
|
||||
void changeControl();
|
||||
void updateFilters();
|
||||
|
||||
private:
|
||||
DualFilterEffect* m_effect;
|
||||
|
||||
BoolModel m_enabled1Model;
|
||||
ComboBoxModel m_filter1Model;
|
||||
FloatModel m_cut1Model;
|
||||
FloatModel m_res1Model;
|
||||
FloatModel m_gain1Model;
|
||||
|
||||
FloatModel m_mixModel;
|
||||
|
||||
BoolModel m_enabled2Model;
|
||||
ComboBoxModel m_filter2Model;
|
||||
FloatModel m_cut2Model;
|
||||
FloatModel m_res2Model;
|
||||
FloatModel m_gain2Model;
|
||||
|
||||
friend class DualFilterControlDialog;
|
||||
friend class DualFilterEffect;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
BIN
plugins/DualFilter/artwork.png
Normal file
BIN
plugins/DualFilter/artwork.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 39 KiB |
@@ -151,6 +151,11 @@ public:
|
||||
|
||||
virtual QString nodeName() const;
|
||||
|
||||
virtual Flags flags() const
|
||||
{
|
||||
return IsSingleStreamed;
|
||||
}
|
||||
|
||||
virtual f_cnt_t desiredReleaseFrames() const
|
||||
{
|
||||
return 0; //4048;
|
||||
|
||||
Reference in New Issue
Block a user