#ifndef __AMUSE_AUDIOUNIT_BACKEND_HPP__ #define __AMUSE_AUDIOUNIT_BACKEND_HPP__ #ifdef __APPLE__ #include #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101100 #define AMUSE_HAS_AUDIO_UNIT 1 #include #include "optional.hpp" #include "amuse/BooBackend.hpp" #include "amuse/Engine.hpp" #include "amuse/IBackendVoice.hpp" #include "amuse/IBackendSubmix.hpp" #include "amuse/IBackendVoiceAllocator.hpp" #import "AudioGroupFilePresenter.hpp" @class AudioUnitViewController; namespace amuse { /** Backend voice allocator implementation for AudioUnit mixer */ class AudioUnitBackendVoiceAllocator : public BooBackendVoiceAllocator { public: AudioUnitBackendVoiceAllocator(boo::IAudioVoiceEngine& booEngine) : BooBackendVoiceAllocator(booEngine) {} }; void RegisterAudioUnit(); } @interface AmuseAudioUnit : AUAudioUnit { @public AudioUnitViewController* m_viewController; std::unique_ptr m_booBackend; std::experimental::optional m_voxAlloc; std::experimental::optional m_engine; AudioGroupFilePresenter* m_filePresenter; AUAudioUnitBus* m_outBus; AUAudioUnitBusArray* m_outs; } - (nullable id)initWithComponentDescription:(AudioComponentDescription)componentDescription error:(NSError * __nullable * __nonnull)outError viewController:(AudioUnitViewController* __nonnull)vc; - (void)requestAudioGroup:(AudioGroupToken*)group; @end #endif #endif #endif // __AMUSE_AUDIOUNIT_BACKEND_HPP__