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>
Starting with Qt 4.5 there were minor graphical glitches in
TrackContentWidget. Fix this by not setting Qt::WA_OpaquePaintEvent
attribute.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
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>
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>
When pasing notes via Ctrl+V somehow the edit-tool was left in an
undefined state. Therefore explicitely switch back to draw mode so
user can move pasted notes (closes#2808607).
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Now that we fixed RemotePlugin support on OS X, we can enable build of
ZynAddSubFX on OS X. Some GUI threading issues still have to be solved
though.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Variuos features (native/Qt semaphores/shared memory) are now
configured by macros like USE_QT_SHMEM and USE_QT_SEMAPHORES. This
allows central and individual configuration of features according to
the platform to build for at the beginning of the file.
Finally makes RemotePlugin work on OS X by not using native semaphores
rather than QSystemSemaphore's.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
In InstrumentTrack::play(...) the local variable "bb_track" always
was either undefined or NULL due to a lost call (probably during M/V
architecture switch) to bbTrack::findBBTrack(...). This could lead to
crashes and/or misbehaviour when playing frozen patterns in BB tracks.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
The class forward declaration for "bbTrack" is neither used nor
required, therefore remove it.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
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>
Added new DEBUG_REMOTE_PLUGIN macro. If it is set, the process won't
be launched. Instead important information are printed allowing the
developer to run the process with according parameters in a debugger.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
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>
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>
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>
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>
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>
Commit e3fa8762ef introduced a crash
in destructor of InstrumentTrack when using IPH based instruments.
Therefore explicitely remove all play handles after calling
silenceAllNotes().
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
This commit allows finer control of which kind of PlayHandles get
removed in Mixer::removePlayHandles().
This is now used by InstrumentTrack which only removes NotePlayHandles
in InstrumentTrack::silenceAllNotes(). Fixes broken preview of resources
loaded by IPH-based instruments.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
When compiling with GCC always allocate a temporary buffer for
resampling on stack rather than doing an expensive heap allocation.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
A type name for ResourceItem::PluginSpecificResource was missing in the
s_typeNames map. Therefore the type property of such resources was not
saved properly and had to be guessed each time at startup.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Dropped separate ResourceItem type "TypeSoundFont" as theres no benefit
from distinguishing it from other plugin-specific files. Soundfonts now
are treated as TypePluginSpecificResource.
Furthermore some minor coding style cleanups.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Added dynamic generation of icons for plugin specific resources by
drawing the logo of the according plugin onto an empty-sheet-icon.
After generation, cache the result so this expensive operation only
has to be done once.
Furthermore also cache pixmaps for individual ResourceItem types for
not having to load and scale pixmaps for each item.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Always return name extension in lower case so we can easily match it
somewhere else or use it as key for hash tables.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Added generic drag'n'drop support for all instrument views. All
resources supported by the according instrument now can be dropped
onto instrument view without any extra code in actual instrument.
Additionally renamed some files and classes related to InstrumentView
class to match new style.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Added two new buttons "Manage locations" and "Show piano". The first
one will open a resource location management dialog while the latter
one toggles visibility of the preview piano below.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Adapted VeSTige plugin to new resource framework support in plugin
base class.
Furthermore some coding style improvements.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Adapted Sf2Player plugin to new resource framework support in plugin
base class.
Furthermore some coding style improvements.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Adapted MidiImport plugin to new resource framework support in plugin
base class. Files for PatMan or soundfonts for Sf2Player are now
relocated using resources framework.
Furthermore some coding style improvements.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Some initial work on saving hash of default soundfont rather than a
filename. Doesn't work yet but will be improved with rewritten setup
dialog.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Up to now plugin-specific resources (e.g. ZynAddSubFX presets) were
not previewed or loaded into a track container. This now works by
adding TypePluginSpecificResource to the according switch-block.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Dynamically extend the map of file types by plugin-processed file types.
Furthermore renamed type TypePluginSpecificPreset to
TypePluginSpecificResource.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Adapted PatMan to new resource framework support in plugin
base class.
Furthermore some coding style improvements.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Removed unused class PresetPreviewPlayHandle with all its sub- and
helper-classes. Lots of dirty code this way gets cleaned up/removed.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Remove deprecated FileBrowser from LMMS as everything is now managed by
ResourceBrowser. This will allow further removal of deprecated
technologies.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Replaced deprecated (duplicate) code for loading various kind of files
with ResourceAction-based code.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Added new class ResourceAction which centralizes functionality of all
actions related to ResourceItems. This includes loading projects,
samples, presets, plugin-specific presets etc.
Using this new class we can avoid duplicate functionality in
ResourcePreviewer, ResourceBrowser, TrackContainerView, InstrumentTrack
etc.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Replaced deprecated Plugin::loadFile(QString) method by
Plugin::loadResource(ResourceItem), a future interface to be adapted
by invididual plugins.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Added new method ResourceItem::nameExtension() which returns the
extension of the name of an item (e.g. a filename extension such as
"wav" or similiar).
Added new type ResourceItemList, a QList of ResourceItem pointers.
Furthermore some coding style improvements.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Added new method ResourceDB::matchItems() which returns a list of item
which somehow match the given list of keywords.
Furthermore renamed ItemList to ItemHashMap to better reflect actual
container type.
Additionally some coding style improvements.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Do not build the ZynAddSubFX plugin on OS X until a proper replacement
for unnamed semaphores (which for whatever reason are not supported on
OS X) has been implemented. Using the win32 code (QSystemSemaphore)
could be an option but needs testing.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
There were various (trivial) problems with settings of the build system
which prevented LMMS from being built on OS X.
Thanks to Daniel Klaffenbach for providing his Mac for development
purposes.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Added support for dropping ResourceItems on a TrackContainerView. Now
it's possible to drag samples, presets and soundfonts from the new
ResourceBrowser into Song Editor or BB Editor (code needs to be ported
to new Song Editor later).
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Added itemByHash() method to ResourceDB class allowing safe access to
an item identified with an according hash. If there's no item associated
with the hash, NULL is being returned.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Make sure preview is stopped as soon as a drag operation starts. This
is done by overloading QAbstractItemView::startDrag() and emit a signal
from there which is connected to an according slot in ResourceBrowser.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>