Loading...
Searching...
No Matches
juce_MixerAudioSource.h
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2022 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
The code included in this file is provided under the terms of the ISC license
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
To use, copy, modify, and/or distribute this software for any purpose with or
without fee is hereby granted provided that the above copyright notice and
this permission notice appear in all copies.
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
//==============================================================================
class JUCE_API MixerAudioSource : public AudioSource
{
public:
//==============================================================================
MixerAudioSource();
~MixerAudioSource() override;
//==============================================================================
void addInputSource (AudioSource* newInput, bool deleteWhenRemoved);
void removeInputSource (AudioSource* input);
void removeAllInputs();
//==============================================================================
void prepareToPlay (int samplesPerBlockExpected, double sampleRate) override;
void releaseResources() override;
void getNextAudioBlock (const AudioSourceChannelInfo&) override;
private:
//==============================================================================
Array<AudioSource*> inputs;
BigInteger inputsToDelete;
CriticalSection lock;
AudioBuffer<float> tempBuffer;
double currentSampleRate;
int bufferSizeExpected;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MixerAudioSource)
};
} // namespace juce
juce::Array
Definition juce_Array.h:56
juce::AudioBuffer
Definition juce_AudioSampleBuffer.h:34
juce::AudioSource::AudioSource
AudioSource()=default
juce::BigInteger
Definition juce_BigInteger.h:39
juce::CriticalSection
Definition juce_CriticalSection.h:43
juce::MixerAudioSource::removeInputSource
void removeInputSource(AudioSource *input)
Definition juce_MixerAudioSource.cpp:60
juce::MixerAudioSource::getNextAudioBlock
void getNextAudioBlock(const AudioSourceChannelInfo &) override
Definition juce_MixerAudioSource.cpp:128
juce::MixerAudioSource::MixerAudioSource
MixerAudioSource()
Definition juce_MixerAudioSource.cpp:26
juce::MixerAudioSource::removeAllInputs
void removeAllInputs()
Definition juce_MixerAudioSource.cpp:84
juce::MixerAudioSource::addInputSource
void addInputSource(AudioSource *newInput, bool deleteWhenRemoved)
Definition juce_MixerAudioSource.cpp:37
juce::MixerAudioSource::prepareToPlay
void prepareToPlay(int samplesPerBlockExpected, double sampleRate) override
Definition juce_MixerAudioSource.cpp:102
juce::MixerAudioSource::releaseResources
void releaseResources() override
Definition juce_MixerAudioSource.cpp:115
juce::AudioSourceChannelInfo
Definition juce_AudioSource.h:33