MCPcopy Create free account
hub / github.com/Audio4Linux/JDSP4Linux / canLoadDefaults

Method canLoadDefaults

src/data/EelParser.cpp:160–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158}
159
160bool EELParser::canLoadDefaults()
161{
162 if (!isFileLoaded())
163 {
164 return false;
165 }
166
167 for(auto* prop : std::as_const(properties))
168 {
169 if(prop->getType() == EELPropertyType::NumberRange)
170 {
171 auto* nr = dynamic_cast<EELNumberRangeProperty<float>*>(prop);
172
173 if(prop->hasDefault() && qFloatCompare(nr->getDefault(), nr->getValue()) == false)
174 {
175 return true;
176 }
177 }
178 else if(prop->getType() == EELPropertyType::List)
179 {
180 auto* nr = dynamic_cast<EELListProperty*>(prop);
181
182 if(prop->hasDefault() && nr->getDefault() != nr->getValue())
183 {
184 return true;
185 }
186 }
187 }
188
189 return false;
190}
191
192bool EELParser::isFileLoaded()
193{

Callers 1

loadPropertiesMethod · 0.80

Calls 5

qFloatCompareFunction · 0.85
hasDefaultMethod · 0.80
getDefaultMethod · 0.80
getTypeMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected