1 |
/*************************************************************************** |
2 |
* * |
3 |
* Copyright (C) 2008 - 2012 Andreas Persson * |
4 |
* * |
5 |
* This program is free software; you can redistribute it and/or modify * |
6 |
* it under the terms of the GNU General Public License as published by * |
7 |
* the Free Software Foundation; either version 2 of the License, or * |
8 |
* (at your option) any later version. * |
9 |
* * |
10 |
* This program is distributed in the hope that it will be useful, * |
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
13 |
* GNU General Public License for more details. * |
14 |
* * |
15 |
* You should have received a copy of the GNU General Public License * |
16 |
* along with this program; if not, write to the Free Software * |
17 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * |
18 |
* MA 02110-1301 USA * |
19 |
***************************************************************************/ |
20 |
|
21 |
#ifndef LS_PLUGINVST_H |
22 |
#define LS_PLUGINVST_H |
23 |
|
24 |
#include "../../drivers/Plugin.h" |
25 |
|
26 |
#include <audioeffectx.h> |
27 |
#include <aeffeditor.h> |
28 |
|
29 |
|
30 |
namespace { |
31 |
|
32 |
class LinuxSamplerEditor : public AEffEditor { |
33 |
public: |
34 |
LinuxSamplerEditor(AudioEffect* effect); |
35 |
~LinuxSamplerEditor(); |
36 |
bool open(void* ptr); |
37 |
void close(); |
38 |
bool getRect(ERect** rect); |
39 |
private: |
40 |
#ifdef WIN32 |
41 |
HANDLE ProcessHandle; |
42 |
LPTSTR Command; |
43 |
#else |
44 |
pid_t pid; |
45 |
#endif |
46 |
static String FindFantasia(); |
47 |
}; |
48 |
|
49 |
|
50 |
class LinuxSamplerVst : public AudioEffectX, LinuxSampler::Plugin { |
51 |
public: |
52 |
LinuxSamplerVst(audioMasterCallback audioMaster); |
53 |
~LinuxSamplerVst(); |
54 |
|
55 |
void processReplacing(float** inputs, float** outputs, |
56 |
VstInt32 sampleframes); |
57 |
VstInt32 processEvents(VstEvents* events); |
58 |
|
59 |
void resume(); |
60 |
void setProgram(VstInt32 program); |
61 |
void setProgramName(char* name); |
62 |
void getProgramName(char* name); |
63 |
bool getProgramNameIndexed(VstInt32 category, VstInt32 index, char* text); |
64 |
|
65 |
void setSampleRate(float sampleRate); |
66 |
void setBlockSize(VstInt32 blockSize); |
67 |
|
68 |
bool getOutputProperties(VstInt32 index, VstPinProperties* properties); |
69 |
|
70 |
bool getEffectName(char* name); |
71 |
bool getVendorString(char* text); |
72 |
bool getProductString(char* text); |
73 |
VstInt32 getVendorVersion(); |
74 |
VstInt32 canDo(char* text); |
75 |
VstInt32 getChunk(void** data, bool isPreset); |
76 |
VstInt32 setChunk(void* data, VstInt32 byteSize, bool isPreset); |
77 |
|
78 |
private: |
79 |
char* StateBuf; |
80 |
String SavedChunk; |
81 |
}; |
82 |
} |
83 |
|
84 |
#endif |