Olive
vsthost.h
Go to the documentation of this file.
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 #include <QDialog>
36 
37 class VSTHost : public Effect {
38  Q_OBJECT
39 public:
40  VSTHost(ClipPtr 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:
52 
53  void loadPlugin();
54  void freePlugin();
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
void custom_load(QXmlStreamReader &stream)
Definition: vsthost.cpp:332
QDialog * dialog
Definition: vsthost.h:66
Definition: vsthost.h:37
void resumePlugin()
Definition: vsthost.cpp:234
Definition: effect.h:169
bool canPluginDo(char *canDoString)
Definition: vsthost.cpp:242
QByteArray data_cache
Definition: vsthost.h:68
Definition: effect.h:50
void uncheck_show_button()
Definition: vsthost.cpp:370
ModulePtr modulePtr
Definition: vsthost.h:73
float ** outputs
Definition: vsthost.h:65
void startPlugin()
Definition: vsthost.cpp:218
std::shared_ptr< Clip > ClipPtr
Definition: cacher.h:28
void show_interface(bool show)
Definition: vsthost.cpp:354
void change_plugin()
Definition: vsthost.cpp:374
QPushButton * show_interface_btn
Definition: vsthost.h:67
float ** inputs
Definition: vsthost.h:64
Definition: vestige.h:275
~VSTHost()
Definition: vsthost.cpp:282
void loadPlugin()
Definition: vsthost.cpp:108
void freePlugin()
Definition: vsthost.cpp:184
void process_audio(double timecode_start, double timecode_end, quint8 *samples, int nb_bytes, int channel_count)
Definition: vsthost.cpp:296
void processAudio(long numFrames)
Definition: vsthost.cpp:246
EffectField * file_field
Definition: vsthost.h:51
void suspendPlugin()
Definition: vsthost.cpp:238
Definition: effectfield.h:43
VSTHost(ClipPtr c, const EffectMeta *em)
Definition: vsthost.cpp:255
dispatcherFuncPtr dispatcher
Definition: vsthost.h:55
void save(QXmlStreamWriter &stream)
Definition: vsthost.cpp:342
intptr_t(* dispatcherFuncPtr)(AEffect *effect, int32_t opCode, int32_t index, int32_t value, void *ptr, float opt)
Definition: vsthost.h:33
AEffect * plugin
Definition: vsthost.h:56
bool configurePluginCallbacks()
Definition: vsthost.cpp:197
void stopPlugin()
Definition: vsthost.cpp:228