Skip to content

Commit

Permalink
fix audio layer record bug
Browse files Browse the repository at this point in the history
  • Loading branch information
benkuper committed May 7, 2024
1 parent 7c56d3c commit fc542be
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Modules/juce_organicui
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,9 @@ void ChataigneAudioLayer::setAudioModule(AudioModule* newModule)
audioLayerListeners.call(&ChataigneAudioLayerListener::targetAudioModuleChanged, this);
}

void ChataigneAudioLayer::updateSelectedOutChannels()
void ChataigneAudioLayer::updateSelectedOutChannelsInternal()
{
AudioLayer::updateSelectedOutChannels();
updateInputConnections();
updateInputConnections(false);
}

void ChataigneAudioLayer::updateInputConnections(bool updatePlayConfig)
Expand Down Expand Up @@ -215,7 +214,7 @@ void ChataigneAudioLayer::onContainerParameterChanged(Parameter* p)
{
AudioLayer::onContainerParameterChanged(p);

if (p == arm) updateInputConnections();
//if (p == arm) updateSelectedOutChannels();
}

void ChataigneAudioLayer::sequenceCurrentTimeChanged(Sequence* s, float prevTime, bool evaluateSkippedData)
Expand All @@ -230,6 +229,7 @@ void ChataigneAudioLayer::sequencePlayStateChanged(Sequence* s)
{
if (arm->boolValue() && currentProcessor != nullptr)
{
updateSelectedOutChannels();
timeAtStartRecord = sequence->currentTime->floatValue();
((ChataigneAudioLayerProcessor*)currentProcessor)->startRecording();
}
Expand Down Expand Up @@ -377,6 +377,7 @@ void ChataigneAudioLayerProcessor::processBlock(AudioBuffer<float>& buffer, Midi
{
const GenericScopedLock sl(writerLock);
activeWriter.load()->write(buffer.getArrayOfReadPointers(), buffer.getNumSamples());
LOG("Input rms :" << buffer.getMagnitude(0, 0, buffer.getNumSamples()));
}

recorderListeners.call(&RecorderListener::recordingUpdated, buffer, buffer.getNumSamples());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class ChataigneAudioLayer :
virtual void clearItem() override;

void setAudioModule(AudioModule * newModule);
void updateSelectedOutChannels() override;
void updateSelectedOutChannelsInternal() override;
void updateInputConnections(bool updatePlayConfig = true);
AudioLayerProcessor* createAudioLayerProcessor() override;

Expand Down

0 comments on commit fc542be

Please sign in to comment.