amuse/AudioUnit/AudioUnitBackend.hpp

58 lines
1.6 KiB
C++
Raw Normal View History

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