JUCE: MixerAudioSource Class Reference

JUCE

- Main Page
- Related Pages
- Topics
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Loading...
Searching...
No Matches
Public Member Functions | List of all members
MixerAudioSource Class Reference
juce_audio_basics » sources

An AudioSource that mixes together the output of a set of other AudioSources. More...

`#include <juce_MixerAudioSource.h>`

Inheritance diagram for MixerAudioSource:

## Public Member Functions
| MixerAudioSource ()
| Creates a MixerAudioSource.
| ~MixerAudioSource () override
| Destructor.
void | addInputSource (AudioSource *newInput, bool deleteWhenRemoved)
| Adds an input source to the mixer.
void | removeInputSource (AudioSource *input)
| Removes an input source.
void | removeAllInputs ()
| Removes all the input sources.
void | prepareToPlay (int samplesPerBlockExpected, double sampleRate) override
| Implementation of the AudioSource method.
void | releaseResources () override
| Implementation of the AudioSource method.
void | getNextAudioBlock (const AudioSourceChannelInfo &) override
| Implementation of the AudioSource method.
Public Member Functions inherited from AudioSource
virtual | ~AudioSource ()=default
| Destructor.

## Additional Inherited Members
Protected Member Functions inherited from AudioSource
| AudioSource ()=default
| Creates an AudioSource.

## Detailed Description

An AudioSource that mixes together the output of a set of other AudioSources.

Input sources can be added and removed while the mixer is running as long as their prepareToPlay() and releaseResources() methods are called before and after adding them to the mixer.

## Constructor & Destructor Documentation

## ◆ MixerAudioSource()

MixerAudioSource::MixerAudioSource | ( |  | ) |

Creates a MixerAudioSource.

## ◆ ~MixerAudioSource()

MixerAudioSource::~MixerAudioSource | ( |  | ) |
| override

Destructor.

## Member Function Documentation

## ◆ addInputSource()

void MixerAudioSource::addInputSource | ( | AudioSource * | newInput,
|  | bool | deleteWhenRemoved
| ) |  |

Adds an input source to the mixer.

If the mixer is running you'll need to make sure that the input source is ready to play by calling its prepareToPlay() method before adding it. If the mixer is stopped, then its input sources will be automatically prepared when the mixer's prepareToPlay() method is called.

Parameters

  newInput | the source to add to the mixer
  deleteWhenRemoved | if true, then this source will be deleted when no longer needed by the mixer.

## ◆ removeInputSource()

void MixerAudioSource::removeInputSource | ( | AudioSource * | input | ) |

Removes an input source.

If the source was added by calling addInputSource() with the deleteWhenRemoved flag set, it will be deleted by this method.

## ◆ removeAllInputs()

void MixerAudioSource::removeAllInputs | ( |  | ) |

Removes all the input sources.

Any sources which were added by calling addInputSource() with the deleteWhenRemoved flag set will be deleted by this method.

## ◆ prepareToPlay()

void MixerAudioSource::prepareToPlay | ( | int | samplesPerBlockExpected,
|  | double | sampleRate
| ) |  |
| overridevirtual

Implementation of the AudioSource method.

This will call prepareToPlay() on all its input sources.

Implements AudioSource.

## ◆ releaseResources()

void MixerAudioSource::releaseResources | ( |  | ) |
| overridevirtual

Implementation of the AudioSource method.

This will call releaseResources() on all its input sources.

Implements AudioSource.

## ◆ getNextAudioBlock()

void MixerAudioSource::getNextAudioBlock | ( | const AudioSourceChannelInfo & |  | ) |
| overridevirtual

Implementation of the AudioSource method.

Implements AudioSource.

The documentation for this class was generated from the following file:

- juce_MixerAudioSource.h