bugfixes and improvements

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@440 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2006-12-18 16:05:08 +00:00
parent 64aa78c4f6
commit f7009c3afd
12 changed files with 190 additions and 65 deletions

View File

@@ -52,7 +52,7 @@ bassBoosterControlDialog::bassBoosterControlDialog( QWidget * _parent,
m_freqKnob->setLabel( tr( "FREQ" ) );
m_freqKnob->setHintText( tr( "Frequency:" ) + " ", "Hz" );
connect( m_freqKnob, SIGNAL( valueChanged( float ) ),
this, SLOT( changeFrequency( float ) ) );
this, SLOT( changeFrequency( void ) ) );
m_gainKnob = new knob( knobBright_26, this, tr( "Gain" ), eng(), NULL );
m_gainKnob->setRange( 0.1f, 5.0f, 0.1f );
@@ -60,7 +60,7 @@ bassBoosterControlDialog::bassBoosterControlDialog( QWidget * _parent,
m_gainKnob->setLabel( tr( "GAIN" ) );
m_gainKnob->setHintText( tr( "Gain:" ) + " ", "" );
connect( m_gainKnob, SIGNAL( valueChanged( float ) ),
this, SLOT( changeGain( float ) ) );
this, SLOT( changeGain( void ) ) );
m_ratioKnob = new knob( knobBright_26, this, tr( "Ratio" ), eng(),
NULL );
@@ -69,49 +69,69 @@ bassBoosterControlDialog::bassBoosterControlDialog( QWidget * _parent,
m_ratioKnob->setLabel( tr( "RATIO" ) );
m_ratioKnob->setHintText( tr( "Ratio:" ) + " ", "" );
connect( m_ratioKnob, SIGNAL( valueChanged( float ) ),
this, SLOT( changeRatio( float ) ) );
this, SLOT( changeRatio( void ) ) );
l->addWidget( m_freqKnob );
l->addWidget( m_gainKnob );
l->addWidget( m_ratioKnob );
updateEffect();
changeFrequency();
changeGain();
changeRatio();
}
void bassBoosterControlDialog::changeFrequency( float )
void bassBoosterControlDialog::changeFrequency( void )
{
updateEffect();
m_effect->m_bbFX.leftFX().setSelectivity( m_freqKnob->value() );
m_effect->m_bbFX.rightFX().setSelectivity( m_freqKnob->value() );
}
void bassBoosterControlDialog::changeGain( float )
void bassBoosterControlDialog::changeGain( void )
{
updateEffect();
m_effect->m_bbFX.leftFX().setGain( m_gainKnob->value() );
m_effect->m_bbFX.rightFX().setGain( m_gainKnob->value() );
}
void bassBoosterControlDialog::changeRatio( float )
void bassBoosterControlDialog::changeRatio( void )
{
updateEffect();
m_effect->m_bbFX.leftFX().setRatio( m_ratioKnob->value() );
m_effect->m_bbFX.rightFX().setRatio( m_ratioKnob->value() );
}
/*
void bassBoosterControlDialog::updateEffect( void )
{
// TODO: try to preserve effect and just change params
m_effect->m_bbFX = effectLib::bassBoost<>( m_freqKnob->value(),
m_gainKnob->value(), m_ratioKnob->value() );
//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() );
}
*/

View File

@@ -55,14 +55,12 @@ public:
private slots:
void changeFrequency( float );
void changeGain( float );
void changeRatio( float );
void changeFrequency( void );
void changeGain( void );
void changeRatio( void );
private:
void updateEffect( void );
bassBoosterEffect * m_effect;
knob * m_freqKnob;
knob * m_gainKnob;

View File

@@ -1,6 +1,6 @@
/*
* plucked_string_sytn.h - declaration of class pluckedStringSynth which
* is a synth for plucked string-sounds
* plucked_string_synth.h - declaration of class pluckedStringSynth which
* is a synth for plucked string-sounds
*
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*

View File

@@ -88,8 +88,8 @@ plugin::descriptor vestige_plugin_descriptor =
QPixmap * vestigeInstrument::s_artwork = NULL;
vestigeInstrument::vestigeInstrument( instrumentTrack * _channel_track ) :
instrument( _channel_track, &vestige_plugin_descriptor ),
vestigeInstrument::vestigeInstrument( instrumentTrack * _instrument_track ) :
instrument( _instrument_track, &vestige_plugin_descriptor ),
specialBgHandlingWidget( PLUGIN_NAME::getIconPixmap( "artwork" ) ),
m_plugin( NULL ),
m_pluginMutex()
@@ -153,6 +153,11 @@ vestigeInstrument::vestigeInstrument( instrumentTrack * _channel_track ) :
connect( note_off_all_btn, SIGNAL( clicked() ), this,
SLOT( noteOffAll() ) );
for( int i = 0; i < NOTES; ++i )
{
m_noteStates[i] = OFF;
}
// now we need a play-handle which cares for calling play()
instrumentPlayHandle * iph = new instrumentPlayHandle( this );
eng()->getMixer()->addPlayHandle( iph );
@@ -163,9 +168,6 @@ vestigeInstrument::vestigeInstrument( instrumentTrack * _channel_track ) :
vestigeInstrument::~vestigeInstrument()
{
// this single call automates the rest of cleanup like trashing our
// play-handle and so on
invalidate();
closePlugin();
}
@@ -339,8 +341,18 @@ void vestigeInstrument::playNote( notePlayHandle * _n, bool )
m_pluginMutex.lock();
if( _n->totalFramesPlayed() == 0 && m_plugin != NULL )
{
m_plugin->enqueueMidiEvent( midiEvent( NOTE_ON, 0,
getInstrumentTrack()->masterKey( _n ),
const int k = getInstrumentTrack()->masterKey( _n );
if( m_noteStates[k] > OFF )
{
m_plugin->enqueueMidiEvent( midiEvent( NOTE_OFF, 0,
k, 0 ), 0 );
m_noteStates[k] = IGNORE_NEXT_NOTEOFF;
}
else
{
m_noteStates[k] = ON;
}
m_plugin->enqueueMidiEvent( midiEvent( NOTE_ON, 0, k,
_n->getVolume() ), _n->framesAhead() );
}
m_pluginMutex.unlock();
@@ -354,9 +366,17 @@ void vestigeInstrument::deleteNotePluginData( notePlayHandle * _n )
m_pluginMutex.lock();
if( m_plugin != NULL )
{
m_plugin->enqueueMidiEvent( midiEvent( NOTE_OFF, 0,
getInstrumentTrack()->masterKey( _n ),
const int k = getInstrumentTrack()->masterKey( _n );
if( m_noteStates[k] == ON )
{
m_plugin->enqueueMidiEvent( midiEvent( NOTE_OFF, 0, k,
0 ), 0 );
m_noteStates[k] = OFF;
}
else if( m_noteStates[k] == IGNORE_NEXT_NOTEOFF )
{
m_noteStates[k] = ON;
}
}
m_pluginMutex.unlock();
}

View File

@@ -103,6 +103,14 @@ private:
static QPixmap * s_artwork;
enum states
{
OFF,
ON,
IGNORE_NEXT_NOTEOFF
} ;
states m_noteStates[NOTES];
remoteVSTPlugin * m_plugin;
QMutex m_pluginMutex;