In the documentation for AUAudioUnitBusArray
, there is this passage:
Some audio units (e.g. mixers) support variable numbers of busses, via subclassing.
I tried to implement this by subclassing AUAudioUnitBusArray
, creating my own internal array to store the buses, and overriding isCountChangeable
to true
and setBusCount
to now increase the number of buses if the count is less than the current count. However, I don't think this will work because AUAudioUnitBus
has several properties that I can't set such as ownerAudioUnit
and index
. I would also have to change all the observer functions like addObserver(toAllBusses:forKeyPath:options:context:)
, which seems overkill for a class that is designed for subclassing.
I know about replaceBusses(busArray:)
but wouldn't that override the current buses in the bus array since it's copying them?