11#if TRACKTION_ENABLE_REWIRE
13namespace tracktion {
inline namespace engine
23 static void initialise (
Engine&);
28 static ReWireSystem* getInstanceIfActive();
32 static bool isReWireEnabled (
Engine&,
bool returnCurrentState =
true);
33 static void setReWireEnabled (
Engine&,
bool);
35 static const char* getReWireLibraryName();
36 static const char* getReWireFolderName();
37 static const char* getPropellerheadFolderName();
38 static int getRequiredVersionNumMajor();
39 static int getRequiredVersionNumMinor();
43 bool tryToCloseAllOpenDevices();
58 void timerCallback()
override;
64class ReWirePlugin :
public Plugin,
69 ReWirePlugin (PluginCreationInfo);
72 static const char* getPluginName() {
return NEEDS_TRANS(
"ReWire Device"); }
75 static const char* xmlTypeName;
77 void initialiseFully()
override;
79 juce::String getPluginType()
override {
return xmlTypeName; }
81 void initialise (
const PluginInitialisationInfo&)
override;
82 void deinitialise()
override;
85 int getNumOutputChannelsGivenInputs (
int)
override {
return 2; }
87 void prepareForNextBlock (TimePosition editTime)
override;
88 void applyToBuffer (
const PluginRenderContext&)
override;
90 juce::String getSelectableDescription()
override {
return TRANS(
"ReWire Filter"); }
92 bool takesMidiInput()
override {
return true; }
93 bool takesAudioInput()
override {
return true; }
94 bool producesAudioWhenNoAudioInput()
override {
return true; }
95 bool canBeAddedToClip()
override {
return false; }
96 bool needsConstantBufferSize()
override {
return true; }
98 bool hasNameForMidiNoteNumber (
int note,
int midiChannel,
juce::String& name)
override;
99 bool hasNameForMidiProgram (
int,
int,
juce::String&)
override {
return false; }
101 void timerCallback()
override;
105 ReWireSystem::Device* device =
nullptr;
114 bool updateBusesAndChannels();
115 void openExternalUI();
116 bool isUIRunning() const noexcept {
return uiIsRunning; }
121 void setMidiBus (
int busNum);
122 void setMidiChannel (
int channel);
126 int channelIndexL = 0, channelIndexR = 0;
127 bool uiIsRunning =
false;
130 void valueTreeChanged()
override;
131 void handleAsyncUpdate()
override;
#define TRANS(stringLiteral)
#define NEEDS_TRANS(stringLiteral)
juce::String getName(LaunchQType t)
Retuns the name of a LaunchQType for display purposes.