MCPcopy Create free account
hub / github.com/LMMS/lmms / loadTrackSpecificSettings

Method loadTrackSpecificSettings

src/tracks/InstrumentTrack.cpp:757–833  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

755
756
757void InstrumentTrack::loadTrackSpecificSettings( const QDomElement & thisElement )
758{
759 silenceAllNotes( true );
760
761 lock();
762
763 m_volumeModel.loadSettings( thisElement, "vol" );
764 m_panningModel.loadSettings( thisElement, "pan" );
765 m_pitchRangeModel.loadSettings( thisElement, "pitchrange" );
766 m_pitchModel.loadSettings( thisElement, "pitch" );
767 m_effectChannelModel.setRange( 0, Engine::fxMixer()->numChannels()-1 );
768 if ( !m_previewMode )
769 {
770 m_effectChannelModel.loadSettings( thisElement, "fxch" );
771 }
772 m_baseNoteModel.loadSettings( thisElement, "basenote" );
773 m_useMasterPitchModel.loadSettings( thisElement, "usemasterpitch");
774
775 // clear effect-chain just in case we load an old preset without FX-data
776 m_audioPort.effects()->clear();
777
778 QDomNode node = thisElement.firstChild();
779 while( !node.isNull() )
780 {
781 if( node.isElement() )
782 {
783 if( m_soundShaping.nodeName() == node.nodeName() )
784 {
785 m_soundShaping.restoreState( node.toElement() );
786 }
787 else if( m_noteStacking.nodeName() == node.nodeName() )
788 {
789 m_noteStacking.restoreState( node.toElement() );
790 }
791 else if( m_arpeggio.nodeName() == node.nodeName() )
792 {
793 m_arpeggio.restoreState( node.toElement() );
794 }
795 else if( m_midiPort.nodeName() == node.nodeName() )
796 {
797 m_midiPort.restoreState( node.toElement() );
798 }
799 else if( m_audioPort.effects()->nodeName() == node.nodeName() )
800 {
801 m_audioPort.effects()->restoreState( node.toElement() );
802 }
803 else if( node.nodeName() == "instrument" )
804 {
805 delete m_instrument;
806 m_instrument = NULL;
807 m_instrument = Instrument::instantiate( node.toElement().attribute( "name" ), this );
808 m_instrument->restoreState( node.firstChildElement() );
809
810 emit instrumentChanged();
811 }
812 // compat code - if node-name doesn't match any known
813 // one, we assume that it is an instrument-plugin
814 // which we'll try to load

Callers

nothing calls this directly

Calls 11

fxMixerFunction · 0.85
effectsMethod · 0.80
isNullMethod · 0.80
lockFunction · 0.50
classNodeNameFunction · 0.50
unlockFunction · 0.50
loadSettingsMethod · 0.45
setRangeMethod · 0.45
clearMethod · 0.45
nodeNameMethod · 0.45
restoreStateMethod · 0.45

Tested by

no test coverage detected