* do not show messages about missing plugins when previewing presets (closes #2110203)

* clear effect view before loading settings in effectChain



git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1612 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-09-16 12:31:14 +00:00
parent 540c71922d
commit 6785d3b436
9 changed files with 58 additions and 12 deletions

View File

@@ -1,3 +1,20 @@
2008-09-16 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
* plugins/ladspa_effect/ladspa_effect.cpp:
* include/engine.h:
* include/effect_rack_view.h:
* include/effect_chain.h:
* src/core/effect_chain.cpp:
* src/core/preset_preview_play_handle.cpp:
* src/core/engine.cpp:
* src/gui/widgets/effect_rack_view.cpp:
- do not show messages about missing plugins when previewing
presets (closes #2110203)
- clear effect view before loading settings in effectChain
* CMakeLists.txt:
improved out-of-tree builds
2008-09-14 Csaba Hruska <csaba.hruska/at/gmail.com>
* src/core/audio/audio_portaudio.cpp:

View File

@@ -27,15 +27,16 @@
#define _EFFECT_CHAIN_H
#include "mv_base.h"
#include "journalling_object.h"
#include "serializing_object.h"
#include "mixer.h"
#include "automatable_model.h"
class effect;
class effectChain : public journallingObject, public model
class effectChain : public model, public serializingObject
{
Q_OBJECT
public:
effectChain( model * _parent );
virtual ~effectChain();
@@ -68,6 +69,10 @@ private:
friend class effectRackView;
signals:
void aboutToClear( void );
} ;
#endif

View File

@@ -45,10 +45,9 @@ public:
effectRackView( effectChain * _model, QWidget * _parent = NULL );
virtual ~effectRackView();
void clearViews( void );
public slots:
void clearViews( void );
void moveUp( effectView * _view );
void moveDown( effectView * _view );
void deletePlugin( effectView * _view );

View File

@@ -60,6 +60,16 @@ public:
return( s_hasGUI );
}
static void setSuppressMessages( bool _on )
{
s_suppressMessages = _on;
}
static bool suppressMessages( void )
{
return !s_hasGUI || s_suppressMessages;
}
// core
static mixer * getMixer( void )
{
@@ -151,6 +161,7 @@ public:
private:
static bool s_hasGUI;
static bool s_suppressMessages;
static float s_framesPerTick;
// core

View File

@@ -71,9 +71,13 @@ ladspaEffect::ladspaEffect( model * _parent,
ladspa2LMMS * manager = engine::getLADSPAManager();
if( manager->getDescription( m_key ) == NULL )
{
QMessageBox::warning( 0, "Effect",
"Unknown LADSPA plugin requested: " + m_key.second,
QMessageBox::Ok, QMessageBox::NoButton );
if( !engine::suppressMessages() )
{
QMessageBox::warning( 0, tr( "Effect" ),
tr( "Unknown LADSPA plugin %1 requested." ).
arg( m_key.second ),
QMessageBox::Ok, QMessageBox::NoButton );
}
setOkay( FALSE );
return;
}

View File

@@ -1,5 +1,3 @@
#ifndef SINGLE_SOURCE_COMPILE
/*
* effect_chain.cpp - class for processing and effects chain
*
@@ -38,6 +36,7 @@
effectChain::effectChain( model * _parent ) :
model( _parent ),
serializingObject(),
m_enabledModel( FALSE, NULL, tr( "Effects enabled" ) )
{
}
@@ -253,7 +252,9 @@ bool effectChain::isRunning( void )
void effectChain::clear( void )
{
m_enabledModel.setValue( FALSE );
emit aboutToClear();
m_enabledModel.setValue( false );
for( int i = 0; i < m_effects.count(); ++i )
{
delete m_effects[i];
@@ -262,4 +263,6 @@ void effectChain::clear( void )
}
#endif
#include "moc_effect_chain.cxx"

View File

@@ -45,7 +45,8 @@
#include "song.h"
bool engine::s_hasGUI = TRUE;
bool engine::s_hasGUI = true;
bool engine::s_suppressMessages = false;
float engine::s_framesPerTick;
mixer * engine::s_mixer = NULL;
fxMixer * engine::s_fxMixer = NULL;

View File

@@ -120,6 +120,8 @@ presetPreviewPlayHandle::presetPreviewPlayHandle( const QString & _preset_file,
const bool j = engine::getProjectJournal()->isJournalling();
engine::getProjectJournal()->setJournalling( FALSE );
engine::setSuppressMessages( true );
if( _load_by_plugin )
{
instrument * i = s_previewTC->previewInstrumentTrack()->
@@ -145,6 +147,8 @@ presetPreviewPlayHandle::presetPreviewPlayHandle( const QString & _preset_file,
mmp.content().firstChild().toElement() );
}
engine::setSuppressMessages( false );
// make sure, our preset-preview-track does not appear in any MIDI-
// devices list, so just disable receiving/sending MIDI-events at all
s_previewTC->previewInstrumentTrack()->m_midiPort.setMode(

View File

@@ -246,6 +246,8 @@ void effectRackView::modelChanged( void )
{
clearViews();
m_effectsGroupBox->setModel( &fxChain()->m_enabledModel );
connect( fxChain(), SIGNAL( aboutToClear() ),
this, SLOT( clearViews() ) );
update();
}