mirror of
https://github.com/AxioDL/amuse.git
synced 2025-12-08 21:17:49 +00:00
Initial Amuse AudioUnit frontend architecture
This commit is contained in:
56
AudioUnit/AudioUnitBackend.hpp
Normal file
56
AudioUnit/AudioUnitBackend.hpp
Normal file
@@ -0,0 +1,56 @@
|
||||
#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"
|
||||
|
||||
namespace amuse
|
||||
{
|
||||
|
||||
/** Backend MIDI event reader for controlling sequencer with external hardware / software */
|
||||
class AudioUnitBackendMIDIReader : public BooBackendMIDIReader
|
||||
{
|
||||
friend class AudioUnitBackendVoiceAllocator;
|
||||
public:
|
||||
AudioUnitBackendMIDIReader(Engine& engine)
|
||||
: BooBackendMIDIReader(engine, "AudioUnit MIDI") {}
|
||||
};
|
||||
|
||||
/** Backend voice allocator implementation for AudioUnit mixer */
|
||||
class AudioUnitBackendVoiceAllocator : public BooBackendVoiceAllocator
|
||||
{
|
||||
friend class AudioUnitBackendMIDIReader;
|
||||
public:
|
||||
AudioUnitBackendVoiceAllocator(boo::IAudioVoiceEngine& booEngine)
|
||||
: BooBackendVoiceAllocator(booEngine) {}
|
||||
};
|
||||
|
||||
void RegisterAudioUnit();
|
||||
|
||||
}
|
||||
|
||||
@interface AmuseAudioUnit : AUAudioUnit
|
||||
{
|
||||
std::unique_ptr<boo::IAudioVoiceEngine> m_booBackend;
|
||||
std::experimental::optional<amuse::AudioUnitBackendVoiceAllocator> m_voxAlloc;
|
||||
std::experimental::optional<amuse::Engine> m_engine;
|
||||
AUAudioUnitBusArray* m_outs;
|
||||
}
|
||||
@end
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif // __AMUSE_AUDIOUNIT_BACKEND_HPP__
|
||||
Reference in New Issue
Block a user