MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ ensure_audio_channels()

void MayaFlux::Buffers::TokenUnitManager::ensure_audio_channels ( ProcessingToken  token,
uint32_t  channel_count 
)

Ensures an audio unit exists and resizes it to the specified channel count.

Parameters
tokenProcessing domain
channel_countMinimum channel count to ensure

Definition at line 189 of file TokenUnitManager.cpp.

192{
193 auto& unit = get_or_create_audio_unit(token);
194 if (channel_count > unit.channel_count) {
195 std::lock_guard<std::mutex> lock(m_manager_mutex);
196 unit.resize_channels(channel_count, unit.buffer_size, token);
197 }
198}
static MayaFlux::Nodes::ProcessingToken token
Definition Timers.cpp:8
std::mutex m_manager_mutex
Mutex for thread-safe access to all unit maps.
RootAudioUnit & get_or_create_audio_unit(ProcessingToken token)
Gets or creates a root audio unit for the specified token.

References get_or_create_audio_unit(), m_manager_mutex, and token.

Referenced by ensure_and_get_audio_unit(), and MayaFlux::Buffers::BufferAccessControl::ensure_audio_channels().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: