| 75 | |
| 76 | |
| 77 | void 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 |
nothing calls this directly
no test coverage detected