@@ -121,6 +121,8 @@ EngineMixer::EngineMixer(UserSettingsPointer pConfig,
121121 ConfigKey (EngineXfader::kXfaderConfigKey , " xFaderReverse" ))),
122122 m_pHeadSplitEnabled(std::make_unique<ControlPushButton>(
123123 ConfigKey (group, " headSplit" ), true, 0.0)),
124+ m_pMainPfl(std::make_unique<ControlPushButton>(
125+ ConfigKey (kMainGroup , " pfl" ))),
124126
125127 m_pKeylockEngine(std::make_unique<ControlObject>(
126128 ConfigKey (kAppGroup , QStringLiteral(" keylock_engine" )),
@@ -190,6 +192,8 @@ EngineMixer::EngineMixer(UserSettingsPointer pConfig,
190192
191193 m_pHeadSplitEnabled->setButtonMode (mixxx::control::ButtonMode::Toggle);
192194 m_pHeadSplitEnabled->set (0.0 );
195+ m_pMainPfl->setButtonMode (mixxx::control::ButtonMode::Toggle);
196+ m_pMainPfl->set (1.0 );
193197
194198 // zero out otherwise uninitialized buffers
195199 m_head.clear ();
@@ -386,12 +390,15 @@ void EngineMixer::process(const std::size_t bufferSize) {
386390
387391 // Compute headphone mix
388392 // Head phone left/right mix
389- CSAMPLE pflMixGainInHeadphones = 1 ;
390- CSAMPLE mainMixGainInHeadphones = 0 ;
393+ CSAMPLE_GAIN pflMixGainInHeadphones = 1 ;
394+ CSAMPLE_GAIN mainMixGainInHeadphones = 0 ;
391395 if (mainEnabled) {
392396 const auto cf_val = static_cast <CSAMPLE_GAIN >(m_pHeadMix->get ());
397+ bool mainPlf = m_pMainPfl->toBool ();
393398 pflMixGainInHeadphones = 0 .5f * (-cf_val + 1 .0f );
394- mainMixGainInHeadphones = 0 .5f * (cf_val + 1 .0f );
399+ if (mainPlf) {
400+ mainMixGainInHeadphones = 0 .5f * (cf_val + 1 .0f );
401+ }
395402 // qDebug() << "head val " << cf_val << ", head " << chead_gain
396403 // << ", main " << mainGain;
397404 }
0 commit comments