1 |
persson |
1777 |
/*************************************************************************** |
2 |
|
|
* * |
3 |
|
|
* Copyright (C) 2008 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 LinuxSamplerVstProgram { |
33 |
|
|
public: |
34 |
|
|
LinuxSamplerVstProgram(); |
35 |
|
|
char name[kVstMaxProgNameLen + 1]; |
36 |
|
|
}; |
37 |
|
|
|
38 |
|
|
|
39 |
|
|
class LinuxSamplerEditor : public AEffEditor { |
40 |
|
|
public: |
41 |
|
|
LinuxSamplerEditor(AudioEffect* effect); |
42 |
|
|
bool open(void* ptr); |
43 |
|
|
void close(); |
44 |
|
|
bool getRect(ERect** rect); |
45 |
|
|
private: |
46 |
|
|
#ifdef WIN32 |
47 |
|
|
HANDLE ProcessHandle; |
48 |
|
|
LPTSTR Command; |
49 |
|
|
#endif |
50 |
|
|
}; |
51 |
|
|
|
52 |
|
|
|
53 |
|
|
class LinuxSamplerVst : public AudioEffectX, LinuxSampler::Plugin { |
54 |
|
|
public: |
55 |
|
|
LinuxSamplerVst(audioMasterCallback audioMaster); |
56 |
|
|
~LinuxSamplerVst(); |
57 |
|
|
|
58 |
|
|
void processReplacing(float** inputs, float** outputs, |
59 |
|
|
VstInt32 sampleframes); |
60 |
|
|
VstInt32 processEvents(VstEvents* events); |
61 |
|
|
|
62 |
|
|
void resume(); |
63 |
|
|
void setProgram(VstInt32 program); |
64 |
|
|
void setProgramName(char* name); |
65 |
|
|
void getProgramName(char* name); |
66 |
|
|
bool getProgramNameIndexed(VstInt32 category, VstInt32 index, char* text); |
67 |
|
|
|
68 |
|
|
void setSampleRate(float sampleRate); |
69 |
|
|
void setBlockSize(VstInt32 blockSize); |
70 |
|
|
|
71 |
|
|
bool getOutputProperties(VstInt32 index, VstPinProperties* properties); |
72 |
|
|
|
73 |
|
|
bool getEffectName(char* name); |
74 |
|
|
bool getVendorString(char* text); |
75 |
|
|
bool getProductString(char* text); |
76 |
|
|
VstInt32 getVendorVersion(); |
77 |
|
|
VstInt32 canDo(char* text); |
78 |
|
|
VstInt32 getChunk(void** data, bool isPreset); |
79 |
|
|
VstInt32 setChunk(void* data, VstInt32 byteSize, bool isPreset); |
80 |
|
|
|
81 |
|
|
private: |
82 |
|
|
static const int NbPrograms = 128; |
83 |
|
|
|
84 |
|
|
LinuxSamplerVstProgram* Programs; |
85 |
|
|
|
86 |
|
|
char* StateBuf; |
87 |
|
|
String SavedChunk; |
88 |
|
|
}; |
89 |
|
|
} |
90 |
|
|
|
91 |
|
|
#endif |