several fixes regarding effects and their integration into M/V-architecture

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/branches/lmms-mv@646 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-01-05 00:16:49 +00:00
parent 00d2d4a5d3
commit 7e67f12f16
19 changed files with 104 additions and 73 deletions

View File

@@ -4,7 +4,7 @@
* arp_and_chords_tab_widget.cpp - widget for use in arp/chord-tab of
* instrument-track-window
*
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*

View File

@@ -3,7 +3,7 @@
/*
* bb_editor.cpp - basic main-window for editing of beats and basslines
*
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*

View File

@@ -3,7 +3,7 @@
/*
* effect_chain.cpp - class for processing and effects chain
*
* Copyright (c) 2006-2007 Danny McRae <khjklujn/at/users.sourceforge.net>
* Copyright (c) 2006-2008 Danny McRae <khjklujn/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -32,7 +32,7 @@
effectChain::effectChain( void ) :
m_bypassed( TRUE )
m_enabledModel( FALSE, FALSE, TRUE )
{
}
@@ -78,7 +78,7 @@ void FASTCALL effectChain::moveDown( effect * _effect )
for( effect_list_t::iterator it = m_effects.begin();
it != m_effects.end(); it++, i++ )
{
if( (*it) == _effect )
if( *it == _effect )
{
break;
}
@@ -101,7 +101,7 @@ void FASTCALL effectChain::moveUp( effect * _effect )
for( effect_list_t::iterator it = m_effects.begin();
it != m_effects.end(); it++, i++ )
{
if( (*it) == _effect )
if( *it == _effect )
{
break;
}
@@ -119,7 +119,7 @@ void FASTCALL effectChain::moveUp( effect * _effect )
bool FASTCALL effectChain::processAudioBuffer( surroundSampleFrame * _buf,
const fpp_t _frames )
{
if( m_bypassed )
if( m_enabledModel.value() == FALSE )
{
return( FALSE );
}
@@ -127,7 +127,7 @@ bool FASTCALL effectChain::processAudioBuffer( surroundSampleFrame * _buf,
for( effect_list_t::iterator it = m_effects.begin();
it != m_effects.end(); it++ )
{
more_effects |= (*it)->processAudioBuffer( _buf, _frames );
more_effects |= ( *it )->processAudioBuffer( _buf, _frames );
}
return( more_effects );
}
@@ -137,7 +137,7 @@ bool FASTCALL effectChain::processAudioBuffer( surroundSampleFrame * _buf,
void effectChain::startRunning( void )
{
if( m_bypassed )
if( m_enabledModel.value() == FALSE )
{
return;
}
@@ -145,7 +145,7 @@ void effectChain::startRunning( void )
for( effect_list_t::iterator it = m_effects.begin();
it != m_effects.end(); it++ )
{
(*it)->startRunning();
( *it )->startRunning();
}
}
@@ -154,7 +154,7 @@ void effectChain::startRunning( void )
bool effectChain::isRunning( void )
{
if( m_bypassed )
if( m_enabledModel.value() == FALSE )
{
return( FALSE );
}
@@ -164,7 +164,7 @@ bool effectChain::isRunning( void )
for( effect_list_t::iterator it = m_effects.begin();
it != m_effects.end() || !running; it++ )
{
running = (*it)->isRunning() && running;
running = ( *it )->isRunning() && running;
}
return( running );
}

View File

@@ -4,7 +4,7 @@
* effect_tab_widget.cpp - tab-widget in channel-track-window for setting up
* effects
*
* Copyright (c) 2006-2007 Danny McRae <khjklujn/at/users.sourceforge.net>
* Copyright (c) 2006-2008 Danny McRae <khjklujn/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -52,6 +52,7 @@ effectTabWidget::effectTabWidget( instrumentTrack * _track,
m_track( dynamic_cast<track *>( _track ) ),
m_port( _port )
{
m_port->getEffects()->m_enabledModel.setTrack( m_track );
setupWidget();
}
@@ -65,6 +66,7 @@ effectTabWidget::effectTabWidget( QWidget * _parent,
m_track( dynamic_cast<track *>( _track ) ),
m_port( _port )
{
m_port->getEffects()->m_enabledModel.setTrack( m_track );
setupWidget();
}
@@ -81,9 +83,7 @@ effectTabWidget::~effectTabWidget()
void effectTabWidget::setupWidget( void )
{
m_effectsGroupBox = new groupBox( tr( "EFFECTS CHAIN" ), this );
m_effectsGroupBox->model()->setTrack( m_track );
connect( m_effectsGroupBox, SIGNAL( toggled( bool ) ),
this, SLOT( setBypass( bool ) ) );
m_effectsGroupBox->setModel( &m_port->getEffects()->m_enabledModel );
m_effectsGroupBox->setGeometry( 2, 2, 242, 244 );
m_rack = new rackView( m_effectsGroupBox, m_track, m_port );
@@ -101,8 +101,8 @@ void effectTabWidget::setupWidget( void )
void effectTabWidget::saveSettings( QDomDocument & _doc, QDomElement & _this )
{
_this.setAttribute( "fxdisabled",
!m_effectsGroupBox->model()->value() );
_this.setAttribute( "fxenabled",
m_port->getEffects()->m_enabledModel.value() );
m_rack->saveState( _doc, _this );
}
@@ -112,8 +112,8 @@ void effectTabWidget::saveSettings( QDomDocument & _doc, QDomElement & _this )
void effectTabWidget::loadSettings( const QDomElement & _this )
{
m_effectsGroupBox->model()->setValue(
!_this.attribute( "fxdisabled" ).toInt() );
m_port->getEffects()->m_enabledModel.setValue(
_this.attribute( "fxenabled" ).toInt() );
QDomNode node = _this.firstChild();
while( !node.isNull() )
@@ -149,14 +149,6 @@ void effectTabWidget::addEffect( void )
void effectTabWidget::setBypass( bool _state )
{
m_port->getEffects()->setBypass( !_state );
}
#include "effect_tab_widget.moc"
#endif

View File

@@ -3,7 +3,7 @@
/*
* engine.cpp - implementation of LMMS' engine-system
*
* 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
*

View File

@@ -4,7 +4,7 @@
* envelope_tab_widget.cpp - widget for use in envelope/lfo/filter-tab of
* instrument-track-window
*
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*

View File

@@ -3,7 +3,7 @@
/*
* mmp.cpp - implementation of class multimediaProject
*
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -571,6 +571,20 @@ void multimediaProject::upgrade( void )
}
}
if( version < "0.4.0-svn20080104" )
{
QDomNodeList list = elementsByTagName( "fx" );
for( int i = 0; !list.item( i ).isNull(); ++i )
{
QDomElement el = list.item( i ).toElement();
if( el.hasAttribute( "fxdisabled" ) &&
el.attribute( "fxdisabled" ).toInt() == 0 )
{
el.setAttribute( "fxenabled", 1 );
}
}
}
if( !m_head.hasAttribute( "mastervol" ) )
{
m_head.setAttribute( "mastervol", 100 );

View File

@@ -3,7 +3,7 @@
/*
* group_box.cpp - groupbox for LMMS
*
* Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*