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

Method loadSettings

src/core/EffectChain.cpp:77–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75
76
77void EffectChain::loadSettings( const QDomElement & _this )
78{
79 clear();
80
81 // TODO This method should probably also lock the mixer
82
83 m_enabledModel.loadSettings( _this, "enabled" );
84
85 const int plugin_cnt = _this.attribute( "numofeffects" ).toInt();
86
87 QDomNode node = _this.firstChild();
88 int fx_loaded = 0;
89 while( !node.isNull() && fx_loaded < plugin_cnt )
90 {
91 if( node.isElement() && node.nodeName() == "effect" )
92 {
93 QDomElement effectData = node.toElement();
94
95 const QString name = effectData.attribute( "name" );
96 EffectKey key( effectData.elementsByTagName( "key" ).item( 0 ).toElement() );
97
98 Effect* e = Effect::instantiate( name.toUtf8(), this, &key );
99
100 if( e != NULL && e->isOkay() && e->nodeName() == node.nodeName() )
101 {
102 e->restoreState( effectData );
103 }
104 else
105 {
106 delete e;
107 e = new DummyEffect( parentModel(), effectData );
108 }
109
110 m_effects.push_back( e );
111 ++fx_loaded;
112 }
113 node = node.nextSibling();
114 }
115
116 emit dataChanged();
117}
118
119
120

Callers

nothing calls this directly

Calls 3

isNullMethod · 0.80
nodeNameMethod · 0.45
restoreStateMethod · 0.45

Tested by

no test coverage detected