1 /** 2 * Copyright: Copyright Auburn Sounds 2015-2016 3 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0) 4 * Authors: Guillaume Piolat 5 */ 6 module dplug.host.host; 7 8 interface IPluginHost 9 { 10 /// Process some audio. 11 /// `setSampleRate` and `setMaxBufferSize` must be called before use. 12 /// samples must <= the maximum buffer size asked in 13 void processAudioFloat(float** inputs, float** ouputs, int samples); 14 15 /// Sets the desired sampleRate 16 void setSampleRate(float sampleRate); 17 18 /// Sets the maximum buffer size 19 void setMaxBufferSize(int samples); 20 21 /// Sets a parameter's value. 22 void setParameter(int paramIndex, float normalizedValue); 23 24 /// Returns: Normalized value for parameter. 25 float getParameter(int paramIndex); 26 27 /// Loads a preset. 28 void loadPreset(int presetIndex); 29 30 /// Serialize state of the plugin. 31 ubyte[] saveState(); 32 33 /// Restore state of the plugin. 34 void restoreState(ubyte[] chunk); 35 36 /// Gets current "program" index. 37 int getCurrentProgram(); 38 39 /// Free all resources associated with the plugin host. 40 void close(); 41 42 /// Get plugin information 43 string getProductString(); 44 45 ///ditto 46 string getEffectName(); 47 48 ///ditto 49 string getVendorString(); 50 51 /// Opens the editor window. 52 /// On Windows, pass a HWND 53 /// On Mac, a NSView 54 void openUI(void* windowHandle); 55 56 /// Closes the editor. 57 void closeUI(); 58 59 /// Gets the UI size. 60 int[2] getUISize(); 61 } 62 63