Commit Graph

112 Commits

Author SHA1 Message Date
Mike Choi
50c2242caa VST sync patch: compatibility fix for 64bit builds
It seems 64bit builds for some reason have problems with VST Sync feature on,
workaround seems to be converting VST sync patch from double to floats,
which does work both with 32 and 64bit builds. Double precision
seems to produce odd numbers with 64bit build. (tested on VirtualBox Linux
Mint 14.1 64 bit OS)
(cherry picked from commit 011f87e6e60cccd16f3783e9c4885e03d95c1e56)

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2013-02-27 17:29:00 +01:00
Mike Choi
0ef2997ece VST to host sync
This patch should bring VST to host synchronization for LMMS.
 (e.g. for plugins like dBlue Glitch, TAL Filters).

Synchronization is done via shared memory, missing song time
positions are reccalculated and added to PPQ position sync values
(SHM - common input interface for sync of all VST plugins)
2013-02-09 12:33:22 +01:00
Mike Choi
c1a2c6b1fa VST effects: secure master channel freezing
Master channel keeps freezing, when VST effects are placed directly
into Master channels FxChain, on slower computers.

Provided solution prolongs VST initialisation phase, by waiting on two extra messages,
which usually follows initialisation and are possibly not yet implemented well.

IdSampleRateInformation,
IdBufferSizeInformation

This seems to prevent Master channel freezes e.g. on VST effects like Tiny-Q.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2013-01-23 22:46:16 +01:00
Mike Choi
1c9c76f399 VST GUI fixes, improvements
Various fixes improvements:

+ Added support for VST parameters control for windows.
+ New `Close` button for VST parameter controls.
+ Faster GUI for all instruments, effects-loading, not only VSTs,
  and both one-instrument track window mode and normal window
  mode should be supported.
+ Better integration for VST GUIs on Linux, e.g. plugin window
  should not stay always on top of other windows.
+ VST GUI overlook should remain same with different wine setups
  ( except for whole virtual desktops emulations ).
+ VST effect control window merged with VST effect editor window
  should be more easier to control.
+ Little corections at effectviews model updates of instrument
  tracks effect chains.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2013-01-16 23:52:04 +01:00
Mike Choi
3cc01560be VST Automation: lock prevention
src/core/RemotePlugin.cpp @ RemotePlugin::process

Above function should be now more thread safe, but functionality remains.
This prevent lmms locks, when automation is connected to lmms VST plugin wrappers controler / knob on Linux.
On win32 build whenever is lmms wrapper parameter controler / knob  amended.

plugins/vst_base/VstPlugin.cpp @ VstPlugin::setParam
plugins/vst_base/RemoteVstPlugin.cpp @ RemoteVstPlugin::processMessage

In above functions we dont wait for message confirmation when parameter setter function finish, and dont send such confirmations.
This workaround prevent locks on Linux, whenever there is automation connected and if you try to move with VST plugin
(not via lmms plugins wrapper, but with VSTs internal window) than it freezes, on win32 build it will freeze whenever you connect
automation and than if you move your mouse above this VST plugin window.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2013-01-06 22:57:45 +01:00
Tobias Doerffel
60017ae6e3 RemoteVstPlugin: decreased locking overhead in getParameterDump() 2012-12-03 00:07:56 +01:00
Tobias Doerffel
890a8a4ba9 RemoteVstPlugin: new method pluginDispatchNoLocking() 2012-12-03 00:07:32 +01:00
Tobias Doerffel
f28601db5d RemoteVstPlugin: less verbose debug message 2012-12-02 22:09:28 +01:00
Tobias Doerffel
5f298c0c48 RemoteVstPlugin: coding style fixes 2012-12-02 22:09:15 +01:00
Tobias Doerffel
ef68156c71 RemoteVstPlugin: compile with -O3 as otherwise incorrect code is generated
There seems to be a bug in current MinGW GCC which leads to incorrect
code (crash for no obvious reason) in RemoteVstPlugin process.
2012-12-02 22:09:06 +01:00
Tobias Doerffel
2cac30f495 RemoteVstPlugin: use size_t for loop index to fix compiler warning 2012-12-02 19:01:37 +01:00
Tobias Doerffel
c4e29da412 RemoteVstPlugin: fixed out-of-bound array access 2012-12-02 19:01:09 +01:00
Tobias Doerffel
6817631c91 RemoteVstPlugin: more locking, range checking etc. 2012-11-26 20:49:31 +01:00
Tobias Doerffel
e43f34914f RemoteVstPlugin: renamed presetName() to programName() 2012-11-26 20:23:41 +01:00
Tobias Doerffel
bdaedcdf86 VstPlugin, RemoteVstPlugin: update program name via new idle update messages
Introduced new idle update messages for exchanging data periodically but
not inferring audio processing.
2012-11-26 20:16:06 +01:00
Tobias Doerffel
9d610e5108 RemoteVstPlugin: use pluginDispatch() everywhere for thread safety
Calling plugin dispatcher without lock is potentially dangerous.
2012-11-26 20:00:55 +01:00
Tobias Doerffel
0d80f0c569 VstPlugin, RemoteVstPlugin: save/restore current program of VST plugin
Not all plugins save current program in their chunk (or do not restore
it properly). We therefore have to save and restore the current program
manually.

Closes #3581879.
2012-11-26 19:30:26 +01:00
Tobias Doerffel
56b07e29c2 RemoteVstPlugin: send updates of current program name if changed
Send current program name back to host if current program has changed.
2012-11-26 19:18:20 +01:00
Tobias Doerffel
1b7ae1f7a9 RemotePlugin, VstPlugin: reorganized and partly rewrote program/preset related functions
The code for managing programs/presets of RemotePlugin instances was
very confusing, mainly within the VstPlugin and RemoteVstPlugin class.
I therefore started to reorganize and rewrite functions.
2012-11-26 19:18:07 +01:00
Tobias Doerffel
3842cb3d61 RemoteVstPlugin: fixed too short arrays for preset names
The dimension of preset name arrays was too small. Fixed this
by raising it from 30 to 64 characters.
2012-11-11 23:13:01 +01:00
Tobias Doerffel
03fcc1b5fc LVSL/RemoteVstPlugin: use big enough buffer when gathering preset names
The RemoteVstPlugin process crashed for plugins with lots of presets
as there was an overflow of the presName buffer. Chosing a bigger buffer
size fixes the problem.

Additionally initialize len variable in loadChunkFromPresetFile().
2012-02-01 23:26:28 +01:00
quadro
d57b20ff2f LVSL: improved preset support
Fixed various bugs and crashes.
2011-11-11 23:58:37 +01:00
Tobias Doerffel
63c1928f57 LVSL: fixed Win32 and Win64 build
Some minor tweaks were neccessary in order to properly build the updated
LVSL on Win32 and Win64.
2011-10-24 23:50:38 +02:00
quadro
4d645b335d LVSL: added support for (automatable) VST controls and VST presets
LMMS VST Support Layer has been greatly advanced as it now features
(automatable) VST controls as well as support for VST presets. This
still needs some work as it crashes with various plugins (e.g. z3ta+).

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2011-10-22 20:17:58 +02:00
Tobias Doerffel
65a0313807 Merge branch 'win64-vst'
* win64-vst:
  VST support layer: fixed non-working 64 bit VST plugins
  VST support layer: added 32 bit VST plugin support for Win64
  Win64Toolchain: added 32 bit compiler configuration
  ZynAddSubFX: use new RemotePlugin::init() method
  RemotePlugin: added support for running remote process multiple times
(cherry picked from commit 65c073ec63)
2010-12-26 11:25:54 +01:00
André Hentschel
1ea719c7c4 vst_base: Fix winelib build on x86-64 2010-11-04 17:09:35 -04:00
Tobias Doerffel
48891a7de3 VstPlugin: use guarded pointer for pluginWidget
The pluginWidget of a VstPlugin (i.e. the VST editor) might be destroyed
outside VstPlugin's control resulting in a dangling pointer. This leads
to crashes for example when changing the model of an EffectView where a
VST plugin is attached, i.e. when re-opening a InstrumentTrackWindow of
an InstrumentTrack with a VST effect inside.

This can be fixed easily by using QPointer.

Closes #3045102.
(cherry picked from commit f4b84a6058)
2010-08-15 12:44:27 +02:00
Tobias Doerffel
08c0916916 RemoteVstPlugin: silence compiler warning
Initialize variable of type DWORD with 0 instead of NULL.
(cherry picked from commit 5f33f1ea77)
2010-07-25 11:35:35 +02:00
Tobias Doerffel
f85898ba6e Plugins: export PluginDescriptors and lmms_plugin_main function
Various plugins were missing the PLUGIN_EXPORT declaration with their
PluginDescriptor instantiations and lmms_plugin_main implementation
which made some plugins not show up with latest Win32 build.
2010-07-23 22:16:06 +02:00
Tobias Doerffel
206715d82b RemoteVstPlugin: allocate buffer for chunk on heap rather than stack
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)
2009-12-06 01:04:11 +01:00
Tobias Doerffel
337e6f3389 VstPlugin: flush temporary data exchange file
VstPlugin creates a temporary file for exchanging data chunks of VST
plugins with the remote process. After calling QFile::write(...) data
has not neccessarily been written due to QFile's internal write buffer.
Therefore explicitely call QFile::flush() so all data is guaranteed
to be written.

Fixes problems with plugins which save small data chunks.
(cherry picked from commit 4b8ddcc14f)
2009-10-29 23:14:56 +01:00
Tobias Doerffel
132b7c7df4 RemoteVstPlugin: removed plugin dispatching in hostCallback
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)
2009-09-28 22:52:48 +02:00
Tobias Doerffel
1d5cb23385 File and class renames part 1
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)
2009-08-25 01:30:41 +02:00
Andrew Kelley
be91af0cb8 RemoteVstPlugin: add include directory
If libraries are being used from somewhere other than
/usr/include or /usr/local/include, building vst_remote would fail.
Now it checks CMAKE_INSTALL_PREFIX/include.
(cherry picked from commit 7d0c1ef6c2)
2009-08-14 15:35:26 +02:00
Paul Giblock
edc2cae4c2 Add Korean translation
(cherry picked from commit 2a69917d51)
2009-08-12 11:58:55 +02:00
Tobias Doerffel
edf2d4d104 Whole code base: various cleanups, removed SINGLE_SOURCE_COMPILE relicts
* cleaned up code and improved coding style
* removed old SINGLE_SOURCE_COMPILE macro relicts
* use QString::toUtf8() instead of QString::toAscii() wherever possible

(cherry picked from commit 0bb54199b0)
2009-08-05 17:17:57 +02:00
Tobias Doerffel
42b1584cbe RemotePlugin: added QSTR_TO_STDSTR macro and use it in LVSL/ZASF
QString::toStdString() is not aware of locale specific characters (it
just converts to ASCII). Therefore added new macro QSTR_TO_STDSTR which
converts a QString to std::string with UTF8 characters.

Use this new macro in LMMS VST Support Layer and ZynAddSubFX plugin.
This fixes for example VST plugins not being loaded when the path to
the DLL contains non-ASCII (e.g. cyrillic) characters.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit f3e13c4427)
2009-07-29 17:13:47 +02:00
Tobias Doerffel
29d0d2b43a RemoteVstPlugin: fixed typo in 4ad5add745
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)
2009-07-09 12:54:59 +02:00
Tobias Doerffel
6883e0479c RemoteVstPlugin: typedef VstMidiEventList
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)
2009-07-09 12:54:59 +02:00
Tobias Doerffel
598d1dc816 RemoteVstPlugin: don't process MIDI events in GUI thread
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)
2009-07-09 12:54:59 +02:00
Tobias Doerffel
9fc0d8962d RemoteVstPlugin: encapsulate locking in separate inline functions
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)
2009-07-09 12:54:59 +02:00
Tobias Doerffel
00ca278f2f RemoteVstPlugin: removed different threading models
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)
2009-07-09 12:43:57 +02:00
Tobias Doerffel
0424c5cec8 RemoteVstPlugin: prefer chunks over parameters for settings
When saving or restoring settings, prefer chunks over parameters.
This fixes some problems with plugins which get confused e.g. if you
restore individual parameters rather than the whole chunk.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit dffd9ecfbe)
2009-07-07 21:22:28 +02:00
Tobias Doerffel
c66fa25dfe RemoteVstPlugin: define O_BINARY to 0 on Linux
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)
2009-07-07 18:37:32 +02:00
Tobias Doerffel
c1f5075e16 RemoteVstPlugin: open file with O_BINARY when reading/writing chunks
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)
2009-07-07 17:09:41 +02:00
Tobias Doerffel
7c2b3e6240 RemoteVstPlugin: print number of inputs/outputs as debugg message
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)
2009-07-07 01:58:09 +02:00
Tobias Doerffel
d8c616afcf RemoteVstPlugin: reset m_inputs and m_outputs in updateInOutCount()
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)
2009-07-07 01:58:00 +02:00
Tobias Doerffel
4e81299729 RemoteVstPlugin: workaround for early host callbacks by some plugins
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)
2009-07-07 01:57:50 +02:00
Tobias Doerffel
7ef61b04d7 RemoteVstPlugin: thread-safe plugin dispatching
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)
2009-07-07 01:57:42 +02:00
Tobias Doerffel
33917e4340 RemoteVstPlugin: coding style fixes
Renamed class remoteVstPlugin to RemoteVstPlugin + other minor coding
style fixes.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit cca39513d0)
2009-07-07 01:57:32 +02:00