Merge pull request #1000 from grejppi/master-disableautoquit

Add option to keep effects running even without input
This commit is contained in:
Vesa V
2014-07-17 16:22:47 +03:00
4 changed files with 36 additions and 0 deletions

View File

@@ -163,6 +163,16 @@ public:
return( m_recentlyOpenedProjects );
}
const bool isAutoquitDisabled() const
{
return m_isAutoquitDisabled;
}
void setAutoquitDisabled( bool value )
{
m_isAutoquitDisabled = value;
}
void addRecentlyOpenedProject( const QString & _file );
const QString & value( const QString & _class,
@@ -209,6 +219,7 @@ private:
QString m_backgroundArtwork;
QStringList m_recentlyOpenedProjects;
bool m_isAutoquitDisabled;
typedef QVector<QPair<QString, QString> > stringPairVector;
typedef QMap<QString, stringPairVector> settingsMap;

View File

@@ -110,6 +110,7 @@ private slots:
void toggleAnimateAFP( bool _enabled );
void toggleNoteLabels( bool en );
void toggleDisplayWaveform( bool en );
void toggleDisableAutoquit( bool en );
private:

View File

@@ -31,6 +31,8 @@
#include "EffectControls.h"
#include "EffectView.h"
#include "config_mgr.h"
Effect::Effect( const Plugin::Descriptor * _desc,
Model * _parent,
@@ -131,6 +133,11 @@ Effect * Effect::instantiate( const QString& pluginName,
void Effect::checkGate( double _out_sum )
{
if( configManager::inst()->isAutoquitDisabled() )
{
return;
}
// Check whether we need to continue processing input. Restart the
// counter if the threshold has been exceeded.
if( _out_sum - gate() <= typeInfo<float>::minEps() )

View File

@@ -289,6 +289,15 @@ setupDialog::setupDialog( ConfigTabs _tab_to_open ) :
connect( displayWaveform, SIGNAL( toggled( bool ) ),
this, SLOT( toggleDisplayWaveform( bool ) ) );
ledCheckBox * disableAutoquit = new ledCheckBox(
tr( "Keep effects running even without input" ),
misc_tw );
labelNumber++;
disableAutoquit->move( XDelta, YDelta*labelNumber );
disableAutoquit->setChecked( configManager::inst()->isAutoquitDisabled() );
connect( disableAutoquit, SIGNAL( toggled( bool ) ),
this, SLOT( toggleDisableAutoquit( bool ) ) );
misc_tw->setFixedHeight( YDelta*labelNumber + HeaderSize );
@@ -813,6 +822,8 @@ void setupDialog::accept()
QString::number( m_printNoteLabels ) );
configManager::inst()->setValue( "ui", "displaywaveform",
QString::number( m_displayWaveform ) );
configManager::inst()->setValue( "ui", "disableautoquit",
QString::number( configManager::inst()->isAutoquitDisabled() ) );
configManager::inst()->setWorkingDir( m_workingDir );
@@ -1002,6 +1013,12 @@ void setupDialog::toggleDisplayWaveform( bool en )
}
void setupDialog::toggleDisableAutoquit( bool en )
{
configManager::inst()->setAutoquitDisabled( en );
}
void setupDialog::toggleOneInstrumentTrackWindow( bool _enabled )
{
m_oneInstrumentTrackWindow = _enabled;