It's a bad style to manage global instances of an object in the object
itself. Therefore introduced a nested helper class which manages all
instances of EnvelopeAndLfoParameters globally. It is now responsible
for global reset/triggers of LFOs. In contrast to previous state, this
is now done thread-safe. Fixes crashes for example while importing
MIDI files.
(cherry picked from commit 5f6c42f19c)
The new deleteHelper() template function takes a pointer, saves it
to a temporary, sets the passed pointer to NULL and then deletes the
object it was referring to before. This way we can spot bugs caused by
undesired references to global objects at shutdown more easily.
(cherry picked from commit fe7d5e3d5a)
It was not safe to immediately delete the AutomationPattern attached to
an InlineAutomation object before commit "InlineAutomation: delete
attached AutomationPattern immediately" as the AutomationPattern
destructor sometimes fiddles around with AutomationEditor (GUI!).
However this has changed now and this enables us to delete the
AutomationPattern immediately. This fixes some random crashes with
scheduling AutomationPatterns for later deletion.
Closes#2982696.
(cherry picked from commit a9abdc3e75)
It was not possible to call any of the functions of AutomationEditor
from threads other than the main GUI thread as the m_pattern pointer
was not protected by a mutex. It is however desired to be able to call
for example AutomationEditor::setCurrentPattern(...) from different
threads (mainly required when deleting AutomationPatterns in other
threads). Thus made this method and all accesses to the m_pattern
pointer thread-safe.
(cherry picked from commit afba8a7ad4)
For some effects it is helpful to know whether their attached EffectView
is visible or not. This mainly concerns effects that actually do not
touch the sound data but analyze it and display the results.
(cherry picked from commit 9c9bca7098)
Fixed some spelling errors found by Lintian while checking the Debian
package of LMMS. Thanks to Patrick Winnertz for pointing out this issue.
(cherry picked from commit 9fd3dacb67)
In Base64::decode() we mess around with pointers so it's more type-safe
to realize everything as a template function. This also silences compiler
warning about dereferencing type-punned pointer in Vibed plugin.
(cherry picked from commit 81cea79c38)
The background tile pixmap used to draw the background of
TrackContentWidgets was only updated on size changes but not on
changes of zoom level in according editor. Fix this by updating
background pixmaps in trackContainerView::setPixelsPerTact().
There have been some problems with the threading logic in the
AudioPulseAudio backend resulting in an endless loop when quitting LMMS.
Furthermore allocated PulseAudio resources were not freed properly.
Thanks to Armin Kazmi <armin.kazmi@tu-dortmund.de> for pointing out
this issue.
(cherry picked from commit 168805745e)
Rewrote implementation of class SideBar to use QToolBar instead of
KMultiTabBar. We can style the SideBar now easily via CSS and do not
have to ship 3rd party KDE code with LMMS. Also the QToolBar based
SideBar integrates much better into the according widget style.
Furthermore renamed SideBar related classes and files to match new
coding style.
(cherry picked from commit 822a22ca37)
While regular instruments were excluded from processing when muted
this did not happen for InstrumentPlayHandle-based instruments. Muting
for exampling tracks with VSTi's inside did not decrease CPU usage.
Checking whether related InstrumentTrack is muted before calling
Instrument::play() fixes this issue.
Closes#2857426.
(cherry picked from commit 6940d19969)
If DEBUG_REMOTE_PLUGIN was set, RemotePlugin::process() always returned
as RemotePlugin::isRunning() returned false. Fix this by always
returning true when debugging.
(cherry picked from commit ee63a13f2d)
Instead of writing QVector<Plugin::Descriptor> everywhere, mix up
iterators etc. centrally define Plugin::DescriptorList and use it
everywhere.
Additionally made pointers to Plugin::Descriptor and
Plugin::Descriptor::SubPluginFeatures::Key const in various places
so we can use ConstIterator everywhere when iterating through
Plugin::DescriptorList.
(cherry picked from commit 2287eca802)
We can safely make fillDescriptionWidget() and listSubPluginKeys()
const methods. Furthermore descriptor pointer to listSubPluginKeys()
can be const as well. Might allow more optimizations by the compiler.
(cherry picked from commit 1c76c77d22)
All of the GUI code of EffectSelectDialog has been replaced by an
according UI file. Also merged EffectListWidget class into
EffectSelectDialog to further simplify logic.
(cherry picked from commit cb85bfc906)
Some variables got renamed the way the shouldn't. Doesn't have any
functional impact but fix it for the sake of cosmetics.
(cherry picked from commit d7365e4cf3)
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)
When opening up the ControllerConnectionDialog by default auto detect
is enabled and all MIDI input devices are selected. Upon the first
event all devices but the one the event came from get unchecked. This
eases the process of assigning MIDI controls to software controls.
(cherry picked from commit 27f5d20e05)
Added functionality to query the name of the source port of a MidiEvent
by calling MidiClient::sourcePortName( const MidiEvent & ).
(cherry picked from commit 5ec96a9483)
The MidiClient::writablePorts() method was not overloaded properly in
MidiWinMM implementation due to a typo. This should fix list of output
devices being empty on win32.
(cherry picked from commit 40c56de898)
Per request, make the Controller-rack vertically sizable. This is also
part of our effort to slowly deprecate old fixed-positioning code in
favor of layouts.
(cherry picked from commit bb76ba5121)
Casting to panning_t in calculation in panningToMidi() leads to
integer overflows and thus to miscalculations. This resulted for
example in wrong panning during note preview when editing panning
of a note in PianoRoll. Casting to int instead fixes the issue.
(cherry picked from commit 6e3e1513c7)
* 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)
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)
Setting time signatures 1/16+ lead to divisions by zero in two places.
Fixed this by adding according qMax() call (closes#2818125).
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit cb72bf2260)
MidiPort::outputChannelModel is ranged from 1 to 16 for displaying
user-friendly values. However internally MIDI channels are ranged from
0 to 15. Therefore added realOutputChannel() which returns zero-based
MIDI channel which should be used everywhere except for the GUI.
Fixes MIDI events being sent to VST plugins on channel 2 instead of
channel 1. Makes some more VST plugins actually usable.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit 4f249400ac)
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>
(cherry picked from commit 2ef5dffec0)
The class forward declaration for "bbTrack" is neither used nor
required, therefore remove it.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit 913aa5a6e8)
Renamed class remoteVstPlugin to RemoteVstPlugin + other minor coding
style fixes.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit cca39513d0)
When clicking at an invalid position with the detune tool, LMMS could
crash as an invalid iterator was referenced (closes#2808589).
Furthermore renamed PianoRoll::ModeOpen to PianoRoll::ModeEditDetuning.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit 9ca93040de)
Renamed type noteVector to NoteVector as well as ::iterator to
::Iterator and ::const_iterator to ::ConstIterator.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit e12476f79c)
Use QList instead of QVector when using a set of PlayHandle's. QList
has faster insert/remove operations and in most cases we iterate through
the array using iterators so there's no performance drop.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit 2cc49b8010)
* do not include instrument_track.h in note_play_handle.h by making
two functions non-inline
* renamed notePlayHandleVector / constNotePlayHandleVector to
NotePlayHandleList / ConstNotePlayHandleList and changed typedef
to QList (which has faster insert- and remove-operations).
* removed unused method willFinishThisPeriod()
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit 08ea133aa2)
Added new method silenceAllNotes() which is a replacement for
invalidateAllMyNPH() and also resets m_runningMidiNotes array.
silenceAllNotes() is now used in destructor as well.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit 3c9859da9f)
The old constructor treated the string argument either as filename or
as raw XML data, depending on 2nd parameter. This is a mess and quickly
leads to confusion.
Now we have two constructors taking either a filename as string or a
QByteArray with XML data. Loading actual data has been separated into
MultimediaProject::loadData( const QByteArray & ).
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit 5a00ebd360)
For a long time presetPreviewPlayHandle has been a friend class of
InstrumentTrack as it had to modify MidiPort settings. However the
InstrumentTrack's MidiPort is now accessible via getMidiPort() so
there's no need for keeping presetPreviewPlayHandle a friend class
anymore.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit a6090ebe23)
When closing a InstrumentTrackWindow save its position so it can be
restored later when showing it. Fixes windows always popping up
somewhere else when toggling instrument track button repeatedly.
(cherry picked from commit 232c1de404)
An additional parameter to waitForInitDone() allows to disable busy
waiting which could be desired in various places to avoid deadlocks.
(cherry picked from commit 1802b91e55)
Made RemotePlugin::lock() and RemotePlugin::unlock() public allowing
to use RemotePlugin class without subclassing it.
(cherry picked from commit 7200eb8158)
This patch enables the usage of PC keyboard for playing instrument piano
or piano roll on OS X by evaluating nativeVirtualKey rather than
nativeScanCode.
(cherry picked from commit 6f0388be7c)
Up to now there were insufficient checks whether the remote plugin
has died and so the result usually has been a complete lock-up of LMMS
(especially when using buggy VST plugins or similiar). By adding
according checks to remotePlugin::lock() and remotePlugin::unlock()
as well as remotePluginBase::waitForMessage() those lock-ups are gone.
(cherry picked from commit 656b195cfd)
Added file type VstPluginFile in order to allow loading DLL files by
an according plugin directly from file browser.
(cherry picked from commit e0d352dc2c)
InstrumentTrack::midiPitch() returned 16384 instead of 16383 if pitch
was set to +100 cents. This commit fixes the calculation.
(cherry picked from commit 76662a3a51)
This commit fixes lockup of the whole audio engine as soon as LMMS'
JACK backend got zombified due to longer delays (e.g. when audio engine
is blocked while loading a project). Restart JACK backend in such cases
and show an according message to the user.
Furthermore this commit includes various cleanups and improvements.
(cherry picked from commit b4e38e3978)