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

Method update

src/audio/base/DspHost.cpp:509–712  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

507}
508
509bool DspHost::update(DspConfig *config, bool ignoreCache)
510{
511 util::debug("Config update started");
512
513 QMetaEnum e = QMetaEnum::fromType<DspConfig::Key>();
514
515 bool refreshReverb = false;
516 bool refreshCrossfeed = false;
517 bool refreshConvolver = false;
518 bool refreshLiveprog = false;
519 bool refreshGraphicEq = false;
520 bool refreshVdc = false;
521 bool refreshCompander = false;
522 bool refreshStereoWide = false;
523
524#ifdef DEBUG_FPE
525 feenableexcept(FE_ALL_EXCEPT & ~FE_INEXACT & ~FE_INVALID);
526#endif
527
528 for (int k = 0; k < e.keyCount(); k++)
529 {
530 DspConfig::Key key = (DspConfig::Key) e.value(k);
531 DspConfig::Type type = config->type(key);
532
533 if(type == DspConfig::Type::Unknown)
534 {
535 // Value uninitialized, skip
536 continue;
537 }
538
539 bool isCached = false;
540 QVariant cached = _cache->get<QVariant>(key, &isCached, false);
541 QVariant current = config->get<QVariant>(key);
542 if((isCached && cached == current) && !ignoreCache)
543 {
544 // Value unchanged, skip
545 continue;
546 }
547
548 QString serialization;
549 QDebug(&serialization) << current;
550 Log::debug("Property changed: " + QVariant::fromValue(key).toString() + " -> " + serialization);
551
552 switch(key)
553 {
554 case DspConfig::bass_enable:
555 if(current.toBool())
556 BassBoostEnable(cast(this->_dsp));
557 else
558 BassBoostDisable(cast(this->_dsp));
559 break;
560 case DspConfig::bass_maxgain:
561 BassBoostSetParam(cast(this->_dsp), current.toFloat());
562 break;
563 case DspConfig::compander_enable:
564 if(current.toBool())
565 CompressorEnable(cast(this->_dsp), 1);
566 else

Callers 2

slideOutMethod · 0.45
slideOutInMethod · 0.45

Calls 15

BassBoostEnableFunction · 0.85
castFunction · 0.85
BassBoostDisableFunction · 0.85
BassBoostSetParamFunction · 0.85
CompressorEnableFunction · 0.85
CompressorDisableFunction · 0.85
CrossfeedEnableFunction · 0.85
CrossfeedDisableFunction · 0.85
ReverbEnableFunction · 0.85
ReverbDisableFunction · 0.85
JamesDSPSetPostGainFunction · 0.85

Tested by

no test coverage detected