MayaFlux 0.4.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 191 of file TokenUnitManager.cpp.

194{
195 auto& unit = get_or_create_audio_unit(token);
196 if (channel_count > unit.channel_count) {
197 std::lock_guard<std::mutex> lock(m_manager_mutex);
198 unit.resize_channels(channel_count, unit.buffer_size, token);
199 }
200}
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(), and m_manager_mutex.

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: