Olive
vsthost.h
1 /***
2 
3  Olive - Non-Linear Video Editor
4  Copyright (C) 2019 Olive Team
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 
19 ***/
20 
21 #ifndef VSTHOSTWIN_H
22 #define VSTHOSTWIN_H
23 
24 #ifndef NOVST
25 
26 #include "project/effect.h"
27 
28 #include "io/crossplatformlib.h"
29 
30 #include "include/vestige.h"
31 
32 // Plugin's dispatcher function
33 typedef intptr_t (*dispatcherFuncPtr)(AEffect *effect, int32_t opCode, int32_t index, int32_t value, void *ptr, float opt);
34 
35 class QDialog;
36 
37 class VSTHost : public Effect {
38  Q_OBJECT
39 public:
40  VSTHost(Clip* c, const EffectMeta* em);
41  ~VSTHost();
42  void process_audio(double timecode_start, double timecode_end, quint8* samples, int nb_bytes, int channel_count);
43 
44  void custom_load(QXmlStreamReader& stream);
45  void save(QXmlStreamWriter& stream);
46 private slots:
47  void show_interface(bool show);
48  void uncheck_show_button();
49  void change_plugin();
50 private:
51  EffectField* file_field;
52 
53  void loadPlugin();
54  void freePlugin();
55  dispatcherFuncPtr dispatcher;
56  AEffect* plugin;
57  bool configurePluginCallbacks();
58  void startPlugin();
59  void stopPlugin();
60  void resumePlugin();
61  void suspendPlugin();
62  bool canPluginDo(char *canDoString);
63  void processAudio(long numFrames);
64  float** inputs;
65  float** outputs;
66  QDialog* dialog;
67  QPushButton* show_interface_btn;
68  QByteArray data_cache;
69 
70 #if defined(__APPLE__)
71  CFBundleRef bundle;
72 #else
73  ModulePtr modulePtr;
74 #endif
75 };
76 
77 #endif
78 
79 #endif // VSTHOSTWIN_H
Definition: vsthost.h:37
Definition: effect.h:166
Definition: effect.h:47
Definition: vestige.h:275
Definition: clip.h:53
Definition: effectfield.h:43