28 #ifndef ASYNC_AUDIO_SELECTOR_INCLUDED 29 #define ASYNC_AUDIO_SELECTOR_INCLUDED 203 STATE_IDLE, STATE_WRITING, STATE_STOPPED, STATE_FLUSHING
207 typedef std::map<Async::AudioSource *, Branch *> BranchMap;
209 BranchMap m_branch_map;
210 Branch * m_selected_branch;
211 StreamState m_stream_state;
215 void selectBranch(
Branch *branch);
216 Branch *selectedBranch(
void)
const {
return m_selected_branch; }
217 void selectHighestPrioActiveBranch(
bool clear_if_no_active);
218 int branchWriteSamples(
const float *samples,
int count);
219 void branchFlushSamples(
void);
void addSource(AudioSource *source)
Add an audio source to the selector.
virtual void allSamplesFlushed(void)
The registered sink has flushed all samples.
AudioSelector(void)
Default constuctor.
void removeSource(AudioSource *source)
Remove a previously added audio source from the selector.
bool autoSelectEnabled(AudioSource *source) const
Find out if auto select is enabled or not for the given source.
This file contains the base class for an audio source.
~AudioSelector(void)
Destructor.
void disableAutoSelect(AudioSource *source)
Disable autoselection on the given source.
void selectSource(AudioSource *source)
Select one of the previously added audio sources.
void setFlushWait(AudioSource *source, bool flush_wait)
Set if this souce want to wait for allSamplesFlushed.
virtual void resumeOutput(void)
Resume audio output to the sink.
void setSelectionPrio(AudioSource *source, int prio)
Set the prio to be used for selection.
Namespace for the asynchronous programming classes.
The base class for an audio source.
This class is used to select one of many audio streams.
void enableAutoSelect(AudioSource *source, int prio)
Enable autoselection on the given source.