Merge pull request #658 from grejppi/master-fxrange

InstrumentTrack: fix FX channel range
This commit is contained in:
Tobias Doerffel
2014-04-29 16:19:05 +02:00
2 changed files with 16 additions and 11 deletions

View File

@@ -871,6 +871,8 @@ void song::createNewProjectFromTemplate( const QString & _template )
// load given song
void song::loadProject( const QString & _file_name )
{
QDomNode node;
m_loadingProject = true;
clearProject();
@@ -912,7 +914,19 @@ void song::loadProject( const QString & _file_name )
//Backward compatibility for LMMS <= 0.4.15
PeakController::initGetControllerBySetting();
QDomNode node = dataFile.content().firstChild();
// Load mixer first to be able to set the correct range for FX channels
node = dataFile.content().firstChildElement( engine::fxMixer()->nodeName() );
if( !node.isNull() )
{
engine::fxMixer()->restoreState( node.toElement() );
if( engine::hasGUI() )
{
// refresh FxMixerView
engine::fxMixerView()->refreshDisplay();
}
}
node = dataFile.content().firstChild();
while( !node.isNull() )
{
if( node.isElement() )
@@ -925,15 +939,6 @@ void song::loadProject( const QString & _file_name )
{
restoreControllerStates( node.toElement() );
}
else if( node.nodeName() == engine::fxMixer()->nodeName() )
{
engine::fxMixer()->restoreState( node.toElement() );
if( engine::hasGUI() )
{
// refresh FxMixerView
engine::fxMixerView()->refreshDisplay();
}
}
else if( engine::hasGUI() )
{
if( node.nodeName() == engine::getControllerRackView()->nodeName() )

View File

@@ -703,7 +703,7 @@ void InstrumentTrack::loadTrackSpecificSettings( const QDomElement & thisElement
m_panningModel.loadSettings( thisElement, "pan" );
m_pitchRangeModel.loadSettings( thisElement, "pitchrange" );
m_pitchModel.loadSettings( thisElement, "pitch" );
m_effectChannelModel.setRange( 0, INT_MAX );
m_effectChannelModel.setRange( 0, engine::fxMixer()->numChannels()-1 );
m_effectChannelModel.loadSettings( thisElement, "fxch" );
m_baseNoteModel.loadSettings( thisElement, "basenote" );