2018-10-07 03:40:25 +00:00
|
|
|
#pragma once
|
2016-05-03 01:16:26 +00:00
|
|
|
|
|
|
|
#include <memory>
|
2016-05-19 10:12:32 +00:00
|
|
|
#include <functional>
|
2016-05-20 06:17:02 +00:00
|
|
|
#include <vector>
|
2016-05-03 01:16:26 +00:00
|
|
|
|
2018-12-08 05:20:09 +00:00
|
|
|
namespace amuse {
|
2016-05-03 01:16:26 +00:00
|
|
|
class IBackendVoice;
|
2016-05-07 22:10:57 +00:00
|
|
|
class IBackendSubmix;
|
2016-05-03 01:16:26 +00:00
|
|
|
class Voice;
|
2016-05-07 22:10:57 +00:00
|
|
|
class Submix;
|
2016-05-20 06:17:02 +00:00
|
|
|
class Engine;
|
2016-05-03 01:16:26 +00:00
|
|
|
|
2016-05-11 04:48:08 +00:00
|
|
|
/** Same enum as boo for describing speaker-configuration */
|
2018-12-08 05:20:09 +00:00
|
|
|
enum class AudioChannelSet { Stereo, Quad, Surround51, Surround71, Unknown = 0xff };
|
2016-05-11 04:48:08 +00:00
|
|
|
|
2016-05-20 06:17:02 +00:00
|
|
|
/** Handle to MIDI-reader, implementation opaque */
|
2018-12-08 05:20:09 +00:00
|
|
|
class IMIDIReader {
|
2016-05-20 06:17:02 +00:00
|
|
|
public:
|
2018-12-08 05:20:09 +00:00
|
|
|
virtual ~IMIDIReader() = default;
|
|
|
|
virtual void pumpReader(double dt) = 0;
|
2016-05-20 06:17:02 +00:00
|
|
|
};
|
|
|
|
|
2016-05-19 05:55:10 +00:00
|
|
|
/** Client-implemented voice allocator */
|
2018-12-08 05:20:09 +00:00
|
|
|
class IBackendVoiceAllocator {
|
2016-05-03 01:16:26 +00:00
|
|
|
public:
|
2018-12-08 05:20:09 +00:00
|
|
|
virtual ~IBackendVoiceAllocator() = default;
|
2016-05-03 01:16:26 +00:00
|
|
|
|
2018-12-08 05:20:09 +00:00
|
|
|
/** Amuse obtains a new voice from the platform this way */
|
|
|
|
virtual std::unique_ptr<IBackendVoice> allocateVoice(Voice& clientVox, double sampleRate, bool dynamicPitch) = 0;
|
2016-05-07 22:10:57 +00:00
|
|
|
|
2018-12-08 05:20:09 +00:00
|
|
|
/** Amuse obtains a new submix from the platform this way */
|
|
|
|
virtual std::unique_ptr<IBackendSubmix> allocateSubmix(Submix& clientSmx, bool mainOut, int busId) = 0;
|
2016-05-11 04:48:08 +00:00
|
|
|
|
2018-12-08 05:20:09 +00:00
|
|
|
/** Amuse obtains a list of all MIDI devices this way */
|
|
|
|
virtual std::vector<std::pair<std::string, std::string>> enumerateMIDIDevices() = 0;
|
2016-05-20 06:17:02 +00:00
|
|
|
|
2018-12-08 05:20:09 +00:00
|
|
|
/** Amuse obtains an interactive MIDI-in connection from the OS this way */
|
|
|
|
virtual std::unique_ptr<IMIDIReader> allocateMIDIReader(Engine& engine) = 0;
|
2016-05-20 06:17:02 +00:00
|
|
|
|
2018-12-08 05:20:09 +00:00
|
|
|
/** Amuse obtains speaker-configuration from the platform this way */
|
|
|
|
virtual AudioChannelSet getAvailableSet() = 0;
|
2016-05-14 04:46:39 +00:00
|
|
|
|
2018-12-08 05:20:09 +00:00
|
|
|
/** Set volume of main mix out */
|
|
|
|
virtual void setVolume(float vol) = 0;
|
2016-07-14 06:16:00 +00:00
|
|
|
|
2018-12-08 05:20:09 +00:00
|
|
|
/** Amuse registers for key callback events from the mixing engine this way */
|
|
|
|
virtual void setCallbackInterface(Engine* engine) = 0;
|
2016-05-03 01:16:26 +00:00
|
|
|
};
|
2018-12-08 05:20:09 +00:00
|
|
|
} // namespace amuse
|