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

Method loadSettings

plugins/VstEffect/VstEffectControls.cpp:62–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60
61
62void VstEffectControls::loadSettings( const QDomElement & _this )
63{
64 //m_effect->closePlugin();
65 //m_effect->openPlugin( _this.attribute( "plugin" ) );
66 m_effect->m_pluginMutex.lock();
67 if( m_effect->m_plugin != NULL )
68 {
69 m_vstGuiVisible = _this.attribute( "guivisible" ).toInt();
70
71 m_effect->m_plugin->loadSettings( _this );
72
73 const QMap<QString, QString> & dump = m_effect->m_plugin->parameterDump();
74 paramCount = dump.size();
75 char paramStr[35];
76 knobFModel = new FloatModel *[ paramCount ];
77 QStringList s_dumpValues;
78 for( int i = 0; i < paramCount; i++ )
79 {
80 sprintf( paramStr, "param%d", i );
81 s_dumpValues = dump[ paramStr ].split( ":" );
82
83 knobFModel[i] = new FloatModel( 0.0f, 0.0f, 1.0f, 0.01f, this, QString::number(i) );
84 knobFModel[i]->loadSettings( _this, paramStr );
85
86 if( !( knobFModel[ i ]->isAutomated() ||
87 knobFModel[ i ]->controllerConnection() ) )
88 {
89 knobFModel[ i ]->setValue(LocaleHelper::toFloat(s_dumpValues.at(2)));
90 knobFModel[ i ]->setInitValue(LocaleHelper::toFloat(s_dumpValues.at(2)));
91 }
92
93#if QT_VERSION < 0x050000
94 connect( knobFModel[i], SIGNAL( dataChanged( Model * ) ),
95 this, SLOT( setParameter( Model * ) ), Qt::DirectConnection );
96#else
97 connect( knobFModel[i], &FloatModel::dataChanged, this,
98 [this, i]() { setParameter( knobFModel[i] ); }, Qt::DirectConnection);
99#endif
100 }
101
102 }
103 m_effect->m_pluginMutex.unlock();
104}
105
106
107

Callers

nothing calls this directly

Calls 7

toFloatFunction · 0.85
setInitValueMethod · 0.80
lockMethod · 0.45
sizeMethod · 0.45
isAutomatedMethod · 0.45
setValueMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected