It's not a good idea to allocate the buffer for VST chunk data on the
stack as chunks might become quite big (several megabytes) and thus
could cause a stack overflow. Fix this by using new/delete.
(cherry picked from commit 5f241e6374)
There's no need to call plugin dispatcher in hostCallback. It makes
plugins like Garritan Personal Orchestra 4 lock up. After removing
these calls the affected plugins work.
(cherry picked from commit 44e25a6ad5)
Most files and most of the core classes and their methods have been
renamed to match new coding style conventions:
391 files changed, 25400 insertions(+), 25598 deletions(-)
Furthermore splitted some files where model and view classes were
declared or implemented together in the same file.
Should be tested thoroughly as I might have missed renaming some virtual
methods or SIGNAL/SLOT parameters.
(cherry picked from commit 8c9a9dd14c)
Commit 4ad5add745 introduced a typo which
lead to compilation failure. This commit fixes it.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit c4c94985a6)
Added a typedef for VstMidiEventList so actual type does not have
to be hard-coded each time in the code.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit 4ad5add745)
Don't process MIDI events in GUI thread as this might corrupt MIDI
event array if both GUI and processing thread access it. Fixes
possible crashes.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit e7ab8e5670)
Locking the plugin is now achieved by calling RemoteVstPlugin::lock()
and RemoteVstPlugin::unlock().
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit 2240d6644d)
Different threading models aren't used anymore as SplittedThreadingModel
after all recent improvements works fine for all plugins tested so far.
It even shows that a lot more VST plugins are running now properly.
Therefore all support for TraditionalThreadingModel has been removed
which greatly simplifies code and makes it much more maintainable.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit 41c9318be8)
O_BINARY flag is not supported on Linux, therefore define it to 0.
Fixes compilation failure on Linux.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit d6a451bdf5)
When writing chunk to file or read it back from file, open file with
O_BINARY flag. Otherwise on win32 for example line endings (\n) are
converted (\r\n) and with real binary data this screws up things.
Thanks to Oleg Sharonov for pointing this out.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit 48a3d4ebe4)
When input/output count changes, always print new number of inputs and
outputs as debugg message.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit 5838f63d0b)
Reset m_inputs and m_outputs to NULL after deleting the memory they're
pointing to. Fixes possible crash if new input or output count is 0
and the count changes again later.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit 206d906c10)
Some plugins call host callback from within their main function,
causing RemoteVstPlugin::m_plugin not to be set yet. Therefore
explicitely set RemoteVstPlugin::m_plugin if it's NULL. Makes plugins
by Wallander Instruments (and possibly others as well) work.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit 38f7552ce4)
Plugin dispatcher was called without any protection from various threads
leading to regular crashes or deadlocks within the plugin. The plugin
dispatching is now encapsulated into one central function which protects
the dispatcher by a mutex.
Furthermore improved handling of audioMasterIdle and
audioMasterUpdateDisplay in host callback by posting a message to GUI
thread asking for idle processing instead of directly calling plugin
dispatcher.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit e65b282166)
Renamed class remoteVstPlugin to RemoteVstPlugin + other minor coding
style fixes.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit cca39513d0)
Saving and restoring chunks from/to plugin seems to work now after a
few tweaks regarding memory-allocation and threading (according
functions need to be called from withing GUI thread). However needs the
new code some testing (especially whether it breaks previously working
plugins).
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit db878b664d)
Check for m_plugin being NULL in RemoteVstPlugin::inputCount(),
RemoteVstPlugin::outputCount() and RemoteVstPlugin::pluginVersion().
Makes various VST's load properly now.
Thanks to Oleg Sharonov for pointing this out.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit 9b5c0d19f8)
Some VST plugins save their state as chunks rather than parameters.
According code to save/restore those chunks has been taken from FST 1.9.
However restore currently is disabled as it mostly fails for whatever
reason.
(cherry picked from commit 0abd4aad70)
Proteus VX requires SplittedThreading model in order to run properly.
Issues with actually working UI interaction still need to be worked
out although it rather looks like a bug in WINE.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit b3c5d498e2)
Removed obsolete warning about setting realtime. It's neither important
nor will calling printf()/fprintf() in a RemotePlugin print anything in
LMMS' console output.
(cherry picked from commit 337afffbf1)
Removed the newline character at the end of the uniqueID array, decreased
array size to 5 and initialize last element with 0 after sprintf() call.
(cherry picked from commit 7d1a357076)
For some reason, building remote_vst_plugin.cpp with recent
wineg++/gcc-multilib on 64 bit platforms causes undefined symbols:
remote_vst_plugin-JzpHs6.o: In function `std::list<VstMidiEvent, std::allocator<VstMidiEvent> >::_M_insert(std::_List_iterator<VstMidiEvent>, VstMidiEvent const&)':
remote_vst_plugin.cpp:(.text._ZNSt4listI12VstMidiEventSaIS0_EE9_M_insertESt14_List_iteratorIS0_ERKS0_[std::list<VstMidiEvent, std::allocator<VstMidiEvent> >::_M_insert(std::_List_iterator<VstMidiEvent>, VstMidiEvent const&)]+0x35): undefined reference to `std::_List_node_base::hook(std::_List_node_base*)'
Replacing std::list with std::vector for queueing MIDI events seems to
fix this issue. Consider this as a workaround rather than constructive fix.
(cherry picked from commit c0ff1aa95c)
Most of the MDA VST plugins require the SplittedThreading model in order
to run properly. All plugins whose unique ID starts with "mda" will be
driven with the SplittedThreading model.
(cherry picked from commit 96fb6f5a38)