Skip to content

Commit

Permalink
refactor(enginemixer): Do not use potmeter for audio_latency_* COs
Browse files Browse the repository at this point in the history
  • Loading branch information
Holzhaus committed Sep 19, 2023
1 parent e65d8c1 commit e5fe0f3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 47 deletions.
13 changes: 4 additions & 9 deletions src/engine/enginemixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,13 @@ EngineMixer::EngineMixer(
true,
true); // reported latency (sometimes correct)
m_pAudioLatencyOverloadCount = new ControlObject(
ConfigKey(
kAppGroup, QStringLiteral("audio_latency_overload_count")),
true,
true);
ConfigKey(kAppGroup, QStringLiteral("audio_latency_overload_count")));
m_pAudioLatencyOverloadCount->addAlias(ConfigKey(
kLegacyGroup, QStringLiteral("audio_latency_overload_count")));
m_pAudioLatencyUsage = new ControlPotmeter(
ConfigKey(kAppGroup, QStringLiteral("audio_latency_usage")),
0.0,
0.25);
m_pAudioLatencyUsage = new ControlObject(
ConfigKey(kAppGroup, QStringLiteral("audio_latency_usage")));
m_pAudioLatencyUsage->addAlias(ConfigKey(kLegacyGroup, QStringLiteral("audio_latency_usage")));
m_pAudioLatencyOverload = new ControlPotmeter(
m_pAudioLatencyOverload = new ControlObject(
ConfigKey(kAppGroup, QStringLiteral("audio_latency_overload")),
0.0,
1.0);
Expand Down
4 changes: 2 additions & 2 deletions src/engine/enginemixer.h
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@ class EngineMixer : public QObject, public AudioSource {
ControlObject* m_pMainSampleRate;
ControlObject* m_pMainLatency;
ControlObject* m_pAudioLatencyOverloadCount;
ControlPotmeter* m_pAudioLatencyUsage;
ControlPotmeter* m_pAudioLatencyOverload;
ControlObject* m_pAudioLatencyUsage;
ControlObject* m_pAudioLatencyOverload;
EngineTalkoverDucking* m_pTalkoverDucking;
EngineDelay* m_pMainDelay;
EngineDelay* m_pHeadDelay;
Expand Down
20 changes: 0 additions & 20 deletions src/test/co_dumps/co_dump_inital.csv
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
[QuickEffectRack1_[Channel2]_Effect1],parameter5_toggle,0
[Channel3],hotcue_6_set,0
[Channel4],beatloop_16_enabled,0
[App],audio_latency_overload_set_minus_one,0
[QuickEffectRack1_[Channel3]_Effect1],parameter1_set_zero,0
[QuickEffectRack1_[Channel3]_Effect1],parameter7_toggle,0
[EffectRack1_EffectUnit3_Effect2],parameter4_minus_toggle,0
Expand Down Expand Up @@ -1088,7 +1087,6 @@
[Sampler4],hotcue_8_gotoandplay,0
[EffectRack1_EffectUnit4_Effect1],parameter14_link_type,0
[Channel4],pitch_set_default,0
[App],audio_latency_overload_up_small,0
[EffectRack1_EffectUnit1_Effect4],parameter10_loaded,0
[Channel4],hotcue_37_goto,0
[Sampler3],hotcue_21_position,-1
Expand Down Expand Up @@ -1423,7 +1421,6 @@
[QuickEffectRack1_[Channel2]_Effect1],parameter9_up,0
[Sampler2],beatlooproll_64_activate,0
[EffectRack1_EffectUnit4_Effect3],parameter2_type,0
[App],audio_latency_usage_down_small,0
[Auxiliary2],VuMeterL_set_default,0
[Channel1],hotcue_18_goto,0
[Sampler1],hotcue_36_clear,0
Expand Down Expand Up @@ -2330,7 +2327,6 @@
[EffectRack1_EffectUnit1_Effect1],parameter1_link_inverse,0
[Channel4],loop_move_8_forward,0
[Sampler1],hotcue_21_goto,0
[App],audio_latency_usage_set_default,0
[Sampler3],waveform_zoom_minus_toggle,0
[EffectRack1_EffectUnit2_Effect4],parameter8_down_small,0
[Channel2],loop_move_64_backward,0
Expand Down Expand Up @@ -4506,7 +4502,6 @@
[EqualizerRack1_[Channel3]_Effect1],parameter4_down,0
[Sampler2],rateSearch_up_small,0
[EffectRack1_EffectUnit3_Effect2],parameter12_minus_toggle,0
[App],audio_latency_usage_up,0
[Channel1],beatjump_0.25_forward,0
[Channel4],hotcue_36_activate_preview,0
[Sampler1],hotcue_35_clear,0
Expand Down Expand Up @@ -4740,7 +4735,6 @@
[QuickEffectRack1_[Channel4]_Effect1],parameter5_link_type,0
[Sampler1],beatloop_0.0625_toggle,0
[EqualizerRack1_[Channel2]_Effect1],parameter1_down_small,0
[App],audio_latency_overload_set_default,0
[Sampler2],hotcue_28_activate_preview,0
[EffectRack1_EffectUnit4_Effect3],button_parameter12_type,0
[EqualizerRack1_[Channel3]_Effect1],parameter1_set_minus_one,0
Expand Down Expand Up @@ -5067,7 +5061,6 @@
[EqualizerRack1_[Channel2]_Effect1],parameter13_down,0
[EqualizerRack1_[Channel4]_Effect1],parameter1_down_small,0
[Sampler1],hotcue_7_goto,0
[App],audio_latency_overload_up,0
[EqualizerRack1_[Channel3]_Effect1],effect_selector,0
[EffectRack1_EffectUnit3_Effect1],button_parameter12_loaded,0
[Channel4],beatloop_1_activate,0
Expand Down Expand Up @@ -5868,7 +5861,6 @@
[EqualizerRack1_[Channel4]_Effect1],parameter4_up,0
[Channel1],hotcue_26_enabled,0
[EffectRack1_EffectUnit3_Effect1],button_parameter14_type,0
[App],audio_latency_usage_minus_toggle,0
[Channel2],reloop_exit,0
[EffectRack1_EffectUnit1_Effect3],button_parameter14_type,0
[EffectRack1_EffectUnit1_Effect4],parameter16_set_minus_one,0
Expand Down Expand Up @@ -7013,7 +7005,6 @@
[EffectRack1_EffectUnit3_Effect4],parameter7_set_minus_one,0
[Sampler1],rate_up_small,0
[App],num_auxiliaries,4
[App],audio_latency_overload_down_small,0
[EffectRack1_EffectUnit3_Effect3],parameter15_set_minus_one,0
[EqualizerRack1_[Channel1]_Effect1],parameter7_down,0
[EffectRack1_EffectUnit3_Effect4],parameter1_set_one,0
Expand Down Expand Up @@ -7141,7 +7132,6 @@
[EffectRack1_EffectUnit2_Effect4],parameter14_set_zero,0
[Channel2],beatloop_0.0625_enabled,0
[QuickEffectRack1_[Channel2]_Effect1],button_parameter14_type,0
[App],audio_latency_overload_down,0
[Sampler2],beatloop_0.03125_enabled,0
[Sampler2],loop_move_0.03125_forward,0
[QuickEffectRack1_[Channel1]_Effect1],parameter3_link_type,3
Expand Down Expand Up @@ -7585,7 +7575,6 @@
[Sampler1],loop_move_16_forward,0
[Sampler1],VuMeterR_up,0
[EffectRack1_EffectUnit4_Effect3],parameter5_minus_toggle,0
[App],audio_latency_usage_set_zero,0
[Channel3],hotcue_25_enabled,0
[Channel3],hotcue_36_gotoandplay,0
[EffectRack1_EffectUnit2_Effect3],parameter3_minus_toggle,0
Expand Down Expand Up @@ -8427,7 +8416,6 @@
[EffectRack1_EffectUnit2_Effect2],parameter9_up_small,0
[EffectRack1_EffectUnit4_Effect1],parameter10_loaded,0
[QuickEffectRack1_[Channel2]_Effect1],button_parameter6_loaded,0
[App],audio_latency_overload_set_zero,0
[Sampler2],beatloop_0.5_activate,0
[Channel2],hotcue_1_clear,0
[QuickEffectRack1_[Channel1]_Effect1],parameter7_up,0
Expand Down Expand Up @@ -9775,7 +9763,6 @@
[EqualizerRack1_[Channel4]_Effect1],parameter7_up,0
[Microphone],pregain_set_zero,0
[EffectRack1_EffectUnit4_Effect3],parameter11_down_small,0
[App],audio_latency_usage_set_minus_one,0
[Sampler4],hotcue_15_gotoandstop,0
[QuickEffectRack1_[Channel4]],next_chain,0
[Sampler2],hotcue_8_clear,0
Expand Down Expand Up @@ -10042,7 +10029,6 @@
[Microphone2],VuMeterR_set_default,0
[Channel3],hotcue_4_gotoandplay,0
[Sampler3],hotcue_28_set,0
[App],audio_latency_usage_down,0
[EffectRack1_EffectUnit2],super1_set_default,0
[EqualizerRack1_[Channel2]_Effect1],parameter3_up,0
[QuickEffectRack1_[Channel3]_Effect1],parameter11_up,0
Expand Down Expand Up @@ -10869,7 +10855,6 @@
[Sampler1],beatloop_8,0
[Sampler3],hotcue_1_clear,0
[EffectRack1_EffectUnit4_Effect1],parameter11_set_minus_one,0
[App],audio_latency_overload_toggle,0
[Sampler1],beatloop_4,0
[Sampler1],hotcue_22_activate,0
[Sampler3],hotcue_10_activate,0
Expand Down Expand Up @@ -12291,7 +12276,6 @@
[EffectRack1_EffectUnit2_Effect4],parameter13_down,0
[QuickEffectRack1_[Channel2]_Effect1],parameter13_down_small,0
[EffectRack1_EffectUnit2_Effect1],parameter10_minus_toggle,0
[App],audio_latency_usage_set_one,0
[Sampler4],playposition_set_minus_one,0
[EffectRack1_EffectUnit4_Effect2],parameter8_set_one,0
[EqualizerRack1_[Master]_Effect1],button_parameter15_type,0
Expand Down Expand Up @@ -12733,7 +12717,6 @@
[Channel1],beats_adjust_slower,0
[Sampler4],playposition_set_one,0
[Auxiliary3],PeakIndicator_down_small,0
[App],audio_latency_overload_minus_toggle,0
[Sampler1],waveform_zoom_set_one,0
[Auxiliary4],VuMeterR_toggle,0
[Sampler3],hotcue_4_enabled,0
Expand Down Expand Up @@ -12857,7 +12840,6 @@
[Sampler2],beatloop_2_toggle,0
[EffectRack1_EffectUnit2_Effect4],button_parameter11_loaded,0
[QuickEffectRack1_[Channel2]_Effect1],parameter8_up,0
[App],audio_latency_usage_up_small,0
[PreviewDeck1],PeakIndicator_up,0
[QuickEffectRack1_[Channel4]],mix_up,0
[EqualizerRack1_[Master]_Effect1],parameter2_toggle,0
Expand Down Expand Up @@ -14303,7 +14285,6 @@
[Sampler3],hotcue_10_activate_preview,0
[EffectRack1_EffectUnit4_Effect1],parameter15_type,0
[EffectRack1_EffectUnit3_Effect1],button_parameter3_type,0
[App],audio_latency_overload_set_one,0
[Channel3],VuMeter_set_default,0
[Playlist],AutoDjAddBottom,0
[Microphone3],VuMeterL_set_minus_one,0
Expand Down Expand Up @@ -14879,7 +14860,6 @@
[Channel3],hotcue_32_gotoandplay,0
[EffectRack1_EffectUnit3_Effect1],parameter13_set_default,0
[EffectRack1_EffectUnit4_Effect4],parameter15_minus_toggle,0
[App],audio_latency_usage_toggle,0
[QuickEffectRack1_[Channel2]_Effect1],parameter4_loaded,0
[Sampler4],hotcue_10_clear,0
[PreviewDeck1],hotcue_29_gotoandstop,0
Expand Down
16 changes: 0 additions & 16 deletions src/test/controlobjectaliastest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,28 +69,12 @@ TEST_F(ControlObjectAliasTest, EngineMixer) {
ConfigKey(kLegacyGroup, QStringLiteral("audio_latency_usage")));
EXPECT_DOUBLE_EQ(audioLatencyUsage.get(), audioLatencyUsageLegacy.get());

// `audio_latency_usage` is a ControlPotMeter control. Check if its
// additional COs are also aliased correctly.
auto audioLatencyUsageSetOne = ControlProxy(
ConfigKey(kAppGroup, QStringLiteral("audio_latency_usage_set_one")));
auto audioLatencyUsageSetOneLegacy = ControlProxy(
ConfigKey(kLegacyGroup, QStringLiteral("audio_latency_usage_set_one")));
EXPECT_DOUBLE_EQ(audioLatencyUsageSetOne.get(), audioLatencyUsageSetOneLegacy.get());

auto audioLatencyOverload = ControlProxy(
ConfigKey(kAppGroup, QStringLiteral("audio_latency_overload")));
auto audioLatencyOverloadLegacy = ControlProxy(
ConfigKey(kLegacyGroup, QStringLiteral("audio_latency_overload")));
EXPECT_DOUBLE_EQ(audioLatencyOverload.get(), audioLatencyOverloadLegacy.get());

// `audio_latency_overload` is a ControlPotMeter control. Check if its
// additional COs are also aliased correctly.
auto audioLatencyOverloadSetOne = ControlProxy(
ConfigKey(kAppGroup, QStringLiteral("audio_latency_overload_set_one")));
auto audioLatencyOverloadSetOneLegacy = ControlProxy(
ConfigKey(kLegacyGroup, QStringLiteral("audio_latency_overload_set_one")));
EXPECT_DOUBLE_EQ(audioLatencyOverloadSetOne.get(), audioLatencyOverloadSetOneLegacy.get());

auto audioLatencyOverloadCount = ControlProxy(ConfigKey(
kAppGroup, QStringLiteral("audio_latency_overload_count")));
auto audioLatencyOverloadCountLegacy = ControlProxy(ConfigKey(
Expand Down

0 comments on commit e5fe0f3

Please sign in to comment.