diff --git a/src/core/song.cpp b/src/core/song.cpp index c1d02e7b8..670ba34e1 100644 --- a/src/core/song.cpp +++ b/src/core/song.cpp @@ -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() ) diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index 2a08515b7..1b30c56c6 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -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" );