Skip to content

Commit

Permalink
Silence warnings for expected invalid keys.
Browse files Browse the repository at this point in the history
This fixes lp1942350 a regression from mixxxdj#4229
  • Loading branch information
daschuer committed Sep 1, 2021
1 parent 6f4fc8e commit 70fac19
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/control/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,11 @@ QSharedPointer<ControlDoublePrivate> ControlDoublePrivate::getControl(
bool bPersist,
double defaultValue) {
if (!key.isValid()) {
qWarning() << "ControlDoublePrivate::getControl returning nullptr"
<< "for invalid ConfigKey" << key;
DEBUG_ASSERT(flags.testFlag(ControlFlag::AllowInvalidKey));
if (!flags.testFlag(ControlFlag::AllowInvalidKey)) {
qWarning() << "ControlDoublePrivate::getControl returning nullptr"
<< "for invalid ConfigKey" << key;
DEBUG_ASSERT(!"Unexpected invalid key");
}
return nullptr;
}

Expand Down
3 changes: 3 additions & 0 deletions src/control/controlpotmeter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ ControlPotmeter::ControlPotmeter(const ConfigKey& key,
double defaultValue)
: ControlObject(key, bIgnoreNops, bTrack, bPersist, defaultValue),
m_controls(key) {
qDebug() << "111" << key;
setRange(dMinValue, dMaxValue, allowOutOfBounds);
double default_value = dMinValue + 0.5 * (dMaxValue - dMinValue);
setDefaultValue(default_value);
Expand Down Expand Up @@ -65,6 +66,8 @@ PotmeterControls::PotmeterControls(const ConfigKey& key)
// PotmeterControls is a member variable of the associated ControlPotmeter
// and the push-button controls are parented to the PotmeterControls.

qDebug() << "xxxx" << key;

ControlPushButton* controlUp = new ControlPushButton(
ConfigKey(key.group, QString(key.item) + "_up"));
controlUp->setParent(this);
Expand Down
2 changes: 2 additions & 0 deletions src/engine/enginemaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ EngineMaster::EngineMaster(
m_pMasterLatency = new ControlObject(ConfigKey(group, "latency"), true, true);
m_pMasterAudioBufferSize = new ControlObject(ConfigKey(group, "audio_buffer_size"));
m_pAudioLatencyOverloadCount = new ControlObject(ConfigKey(group, "audio_latency_overload_count"), true, true);
qDebug() << "000" << group;
m_pAudioLatencyUsage = new ControlPotmeter(ConfigKey(group, "audio_latency_usage"), 0.0, 0.25);
qDebug() << "222" << group;
m_pAudioLatencyOverload = new ControlPotmeter(ConfigKey(group, "audio_latency_overload"), 0.0, 1.0);

// Master sync controller
Expand Down

0 comments on commit 70fac19

Please sign in to comment.