Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions AppSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,7 @@ struct EngineSettings
int ltcInputGain = 100;
int thruInputGain = 100;
int ltcOutputGain = 100;
bool ltcHoldOnPause = false;
int thruOutputGain = 100;

// Audio BPM detection (for non-DJ sources)
Expand Down Expand Up @@ -1284,6 +1285,7 @@ struct EngineSettings
obj->setProperty("ltcInputGain", ltcInputGain);
obj->setProperty("thruInputGain", thruInputGain);
obj->setProperty("ltcOutputGain", ltcOutputGain);
obj->setProperty("ltcHoldOnPause", ltcHoldOnPause);
obj->setProperty("thruOutputGain", thruOutputGain);

obj->setProperty("audioBpmEnabled", audioBpmEnabled);
Expand Down Expand Up @@ -1412,6 +1414,7 @@ struct EngineSettings
ltcInputGain = clampGain(getInt("ltcInputGain", 100));
thruInputGain = clampGain(getInt("thruInputGain", 100));
ltcOutputGain = clampGain(getInt("ltcOutputGain", 100));
ltcHoldOnPause = getBool("ltcHoldOnPause", false);
thruOutputGain = clampGain(getInt("thruOutputGain", 100));

audioBpmEnabled = getBool("audioBpmEnabled", false);
Expand Down Expand Up @@ -1695,6 +1698,7 @@ struct AppSettings
es.ltcInputGain = clampGain(getInt("ltcInputGain", 100));
es.thruInputGain = clampGain(getInt("thruInputGain", 100));
es.ltcOutputGain = clampGain(getInt("ltcOutputGain", 100));
es.ltcHoldOnPause = getBool("ltcHoldOnPause", false);
es.thruOutputGain = clampGain(getInt("thruOutputGain", 100));

es.audioBpmEnabled = getBool("audioBpmEnabled", false);
Expand Down
6 changes: 5 additions & 1 deletion LtcOutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ class LtcOutput : private juce::AudioIODeviceCallback
}
bool isPaused() const { return paused.load(std::memory_order_relaxed); }

void setHoldOnPause(bool h) { holdOnPause.store(h, std::memory_order_relaxed); }
bool getHoldOnPause() const { return holdOnPause.load(std::memory_order_relaxed); }

void setOutputGain(float gain) { outputGain.store(juce::jlimit(0.0f, 2.0f, gain), std::memory_order_relaxed); }
float getOutputGain() const { return outputGain.load(std::memory_order_relaxed); }

Expand All @@ -144,6 +147,7 @@ class LtcOutput : private juce::AudioIODeviceCallback
std::atomic<uint64_t> packedPendingTc { 0 };
std::atomic<FrameRate> pendingFps { FrameRate::FPS_25 };
std::atomic<bool> paused { false };
std::atomic<bool> holdOnPause { false };
std::atomic<float> outputGain { 1.0f };
std::atomic<float> peakLevel { 0.0f };
std::atomic<double> pitchMultiplier { 1.0 };
Expand Down Expand Up @@ -307,7 +311,7 @@ class LtcOutput : private juce::AudioIODeviceCallback
if (outputChannelData[ch])
std::memset(outputChannelData[ch], 0, sizeof(float) * (size_t)numSamples);

if (paused.load(std::memory_order_relaxed))
if (paused.load(std::memory_order_relaxed) && !holdOnPause.load(std::memory_order_relaxed))
return;

int selCh = selectedChannel.load(std::memory_order_relaxed);
Expand Down
24 changes: 24 additions & 0 deletions MainComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1690,6 +1690,16 @@ MainComponent::MainComponent()
rightContent.addAndMakeVisible(mtrLtcOutput); mtrLtcOutput.setMeterColour(accentPurple);
sldLtcOutputGain.onValueChange = [this] { if (!syncing) { currentEngine().getLtcOutput().setOutputGain((float)sldLtcOutputGain.getValue() / 100.0f); saveSettings(); } };

rightContent.addAndMakeVisible(btnLtcHoldOnPause);
styleOutputToggle(btnLtcHoldOnPause, accentPurple);
btnLtcHoldOnPause.onClick = [this]
{
if (syncing) return;
if (isShowLocked()) { btnLtcHoldOnPause.setToggleState(!btnLtcHoldOnPause.getToggleState(), juce::dontSendNotification); return; }
currentEngine().getLtcOutput().setHoldOnPause(btnLtcHoldOnPause.getToggleState());
saveSettings();
};

rightContent.addAndMakeVisible(lblOutputLtcStatus); styleLabel(lblOutputLtcStatus); lblOutputLtcStatus.setColour(juce::Label::textColourId, accentPurple);
rightContent.addAndMakeVisible(sldLtcOffset); styleOffsetSlider(sldLtcOffset);
rightContent.addAndMakeVisible(lblLtcOffset); lblLtcOffset.setText("LTC OFFSET:", juce::dontSendNotification); styleLabel(lblLtcOffset);
Expand Down Expand Up @@ -2247,6 +2257,7 @@ void MainComponent::syncUIFromEngine()
sldLtcInputGain.setValue(eng.getLtcInput().getInputGain() * 100.0f, juce::dontSendNotification);
sldThruInputGain.setValue(eng.getLtcInput().getPassthruGain() * 100.0f, juce::dontSendNotification);
sldLtcOutputGain.setValue(eng.getLtcOutput().getOutputGain() * 100.0f, juce::dontSendNotification);
btnLtcHoldOnPause.setToggleState(eng.getLtcOutput().getHoldOnPause(), juce::dontSendNotification);
if (eng.getAudioThru())
sldThruOutputGain.setValue(eng.getAudioThru()->getOutputGain() * 100.0f, juce::dontSendNotification);

Expand Down Expand Up @@ -4181,6 +4192,7 @@ void MainComponent::loadAndApplyNonAudioSettings()
eng.getLtcInput().setInputGain((float)es.ltcInputGain / 100.0f);
eng.getLtcInput().setPassthruGain((float)es.thruInputGain / 100.0f);
eng.getLtcOutput().setOutputGain((float)es.ltcOutputGain / 100.0f);
eng.getLtcOutput().setHoldOnPause(es.ltcHoldOnPause);
if (eng.getAudioThru())
eng.getAudioThru()->setOutputGain((float)es.thruOutputGain / 100.0f);

Expand Down Expand Up @@ -4526,6 +4538,7 @@ void MainComponent::flushSettings()
es.ltcInputGain = (int)(eng.getLtcInput().getInputGain() * 100.0f);
es.thruInputGain = (int)(eng.getLtcInput().getPassthruGain() * 100.0f);
es.ltcOutputGain = (int)(eng.getLtcOutput().getOutputGain() * 100.0f);
es.ltcHoldOnPause = eng.getLtcOutput().getHoldOnPause();
if (eng.getAudioThru())
es.thruOutputGain = (int)(eng.getAudioThru()->getOutputGain() * 100.0f);

Expand Down Expand Up @@ -5278,6 +5291,7 @@ void MainComponent::updateDeviceSelectorVisibility()
cmbAudioOutputDevice.setVisible(showLtcConfig); lblAudioOutputDevice.setVisible(showLtcConfig);
cmbAudioOutputChannel.setVisible(showLtcConfig); lblAudioOutputChannel.setVisible(showLtcConfig);
sldLtcOutputGain.setVisible(showLtcConfig); lblLtcOutputGain.setVisible(showLtcConfig);
btnLtcHoldOnPause.setVisible(showLtcConfig);
mtrLtcOutput.setVisible(showLtcConfig);
sldLtcOffset.setVisible(showLtcConfig); lblLtcOffset.setVisible(showLtcConfig);
lblOutputLtcStatus.setVisible(eng.isOutputLtcEnabled());
Expand Down Expand Up @@ -5675,6 +5689,15 @@ void MainComponent::setupOscInputServer()
{
eng.generatorPause();
}
else if (cmd == "/stc/gen/jog")
{
float deltaSec = msg.getFloat(0, 0.0f);
if (deltaSec != 0.0f)
{
double newMs = eng.getGeneratorCurrentMs() + (double)deltaSec * 1000.0;
eng.setGeneratorPosition(newMs);
}
}
else if (cmd == "/stc/gen/stop")
{
eng.generatorStop();
Expand Down Expand Up @@ -6806,6 +6829,7 @@ void MainComponent::resized()
layCombo(lblAudioOutputDevice, cmbAudioOutputDevice, rp);
layCombo(lblAudioOutputChannel, cmbAudioOutputChannel, rp);
laySlider(lblLtcOutputGain, sldLtcOutputGain, rp);
if (btnLtcHoldOnPause.isVisible()) btnLtcHoldOnPause.setBounds(rp.removeFromTop(btnH));
if (mtrLtcOutput.isVisible()) layMeter(mtrLtcOutput, rp);
if (sldLtcOffset.isVisible()) laySlider(lblLtcOffset, sldLtcOffset, rp);
}
Expand Down
1 change: 1 addition & 0 deletions MainComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@ class MainComponent : public juce::Component,
juce::ComboBox cmbAudioOutputDevice; juce::Label lblAudioOutputDevice;
juce::ComboBox cmbAudioOutputChannel; juce::Label lblAudioOutputChannel;
GainSlider sldLtcOutputGain; juce::Label lblLtcOutputGain;
juce::ToggleButton btnLtcHoldOnPause { "HOLD ON PAUSE" };
LevelMeter mtrLtcOutput;
juce::ComboBox cmbThruOutputDevice; juce::Label lblThruOutputDevice;
juce::ComboBox cmbThruOutputChannel; juce::Label lblThruOutputChannel;
Expand Down