Commit Graph

700 Commits

Author SHA1 Message Date
Tobias Doerffel
908a917021 EnvelopeAndLfoParameters: moved global instances management into helper class
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)
2010-05-21 14:14:00 +02:00
Tobias Doerffel
488337f6eb Engine: introduced deleteHelper() function
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)
2010-05-21 14:13:11 +02:00
Tobias Doerffel
95b0c827d1 InlineAutomation: delete attached AutomationPattern immediately
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)
2010-05-21 14:11:55 +02:00
Tobias Doerffel
aa992e8e1b AutomationEditor: thread-safe handling of AutomationPattern pointer
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)
2010-05-21 14:11:32 +02:00
Tobias Doerffel
48bbfad53d EffectControl: store visibility information of attached EffectView
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)
2010-05-17 23:36:46 +02:00
Tobias Doerffel
7c16094811 Fixed spelling errors
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)
2010-01-25 23:27:43 +01:00
Tobias Doerffel
3348a4378f Base64: realize decode() as template function
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)
2009-12-26 01:09:56 +01:00
Tobias Doerffel
275eb7ac2b TrackContainer: fix Qt header includes
Always prefix Qt header includes with name of according module.
(cherry picked from commit bb57d53770)
2009-12-14 09:37:00 +01:00
Tobias Doerffel
d7ae99a5e8 TrackContentWidget: fixed background tile pixmap updating
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().
2009-12-07 01:38:17 +01:00
Tobias Doerffel
5309e7a374 AudioPulseAudio: fixed improper shutdown + free allocated resources
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)
2009-11-20 22:36:06 +01:00
Tobias Doerffel
1eb4c31607 SideBar: rewritten to use QToolBar instead of KMultiTabBar
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)
2009-10-31 13:38:17 +01:00
Tobias Doerffel
f7da4a0f7e InstrumentPlayHandle: do not process if InstrumentTrack is muted
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)
2009-09-15 23:51:00 +02:00
Tobias Doerffel
18a8ffc674 RemotePlugin: do not skip audio processing when debugging
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)
2009-08-29 00:09:57 +02:00
Tobias Doerffel
5ba1340ed0 Plugin: typedef DescriptorList + more const improvements
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)
2009-08-29 00:07:05 +02:00
Tobias Doerffel
ba4296136b Plugin::Descriptor::SubPluginFeatures: made some methods const
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)
2009-08-29 00:02:55 +02:00
Tobias Doerffel
c2f9fcd14f Plugin::Descriptor: renamed sub_plugin_features to subPluginFeatures
Renamed field sub_plugin_features to subPluginFeatures in
Plugin::Descriptor struct.
(cherry picked from commit e8c3c21f7f)
2009-08-29 00:02:47 +02:00
Tobias Doerffel
fc72b1a6a4 EffectSelectDialog: rewritten using Designer
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)
2009-08-29 00:02:20 +02:00
Tobias Doerffel
c32567ce2f Fixed mistakes made by sed-mass-replaces
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)
2009-08-29 00:01:24 +02:00
Tobias Doerffel
f4dbb2ff5c sed: s/( void )/(), s/FALSE/false/, s/TRUE/true
Replaced remaining occurences of old constants and superfluous "void"
on empty argument list of functions.
(cherry picked from commit 166701f9f3)
2009-08-25 01:42:20 +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
Tobias Doerffel
0503f5353f ControllerConnectionDialog: improved auto detect feature for controllers
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)
2009-08-14 15:38:05 +02:00
Tobias Doerffel
e2b1b5de60 MidiEvent: allow querying name of port which it came from
Added functionality to query the name of the source port of a MidiEvent
by calling MidiClient::sourcePortName( const MidiEvent & ).
(cherry picked from commit 5ec96a9483)
2009-08-14 15:37:57 +02:00
Tobias Doerffel
14930d0446 RemotePlugin: added missing include + coding style fixes
The header cstdlib is required for NULL pointer definition. Additionally
some minor coding style fixes.
(cherry picked from commit 2475cf982b)
2009-08-14 15:37:48 +02:00
Tobias Doerffel
a77688ee65 MidiWinMM: fixed typo that caused writablePorts() not being overloaded
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)
2009-08-14 15:37:36 +02:00
Tobias Doerffel
b8ebfbd06a Renamed MIDI and audio related classes/files to match new style
Renamed all MIDI and audio related classes/files to match new style.
Additionally various cleanups.
2009-08-13 00:52:21 +02:00
Paul Giblock
5138ed6722 Rename all Controller-family classes to new style
Adjust capitialization on all Controller-related classes to new
standards and update all calling code
(cherry picked from commit f1d60958f0)
2009-08-09 00:29:16 +02:00
Paul Giblock
e109f3e550 Make Controller-Rack resizable
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)
2009-08-08 10:30:10 +02:00
Tobias Doerffel
852976ed74 Panning: fixed wrong type-conversion in panningToMidi()
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)
2009-08-05 17:19:53 +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
54dadfcf48 MidiTime/Pattern: fixed divisions by zero with time sigs 1/16+
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)
2009-07-10 17:50:55 +02:00
Tobias Doerffel
91912e143a MidiPort: added realOutputChannel() returning zero-based MIDI channel
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)
2009-07-09 12:54:14 +02:00
Tobias Doerffel
f50d5ce943 RemotePlugin: refactored system feature configuration
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)
2009-07-07 01:59:14 +02:00
Tobias Doerffel
fb56b6757d Track.h: removed unused class declaration "bbTrack"
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)
2009-07-07 01:58:54 +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
Tobias Doerffel
c222c062c5 PianoRoll: fixed crash with detune tool
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)
2009-06-18 23:33:21 +02:00
Tobias Doerffel
7a632277b8 Renamed type noteVector to NoteVector
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)
2009-06-18 23:32:32 +02:00
Tobias Doerffel
0faaab4521 PlayHandle: use QList instead of QVector for PlayHandle array
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)
2009-06-17 10:43:51 +02:00
Tobias Doerffel
cafb24fe9a NotePlayHandle: cleanups, header dependency reductions etc.
* 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)
2009-06-15 16:40:22 +02:00
Tobias Doerffel
93a19e43f1 InstrumentTrack: new method silenceAllNotes()
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)
2009-06-11 01:19:33 +02:00
Tobias Doerffel
57c4a5abc5 MultimediaProject: splitted constructor for loading either file or data
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)
2009-06-11 01:16:30 +02:00
Tobias Doerffel
3d9dc25f0b InstrumentTrack: presetPreviewPlayHandle no longer a friend class
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)
2009-06-11 00:57:10 +02:00
Tobias Doerffel
4995b3a87c InstrumentTrackView: save and restore last position of window
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)
2009-04-18 18:29:14 +02:00
Tobias Doerffel
1f99455e67 RemotePlugin: allow waitForInitDone() without busy waiting
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)
2009-04-18 18:17:54 +02:00
Tobias Doerffel
c16d1be0a8 RemotePlugin: made lock() and unlock() methods public
Made RemotePlugin::lock() and RemotePlugin::unlock() public allowing
to use RemotePlugin class without subclassing it.
(cherry picked from commit 7200eb8158)
2009-04-18 18:17:38 +02:00
Tobias Doerffel
0edc0db7bd PianoView/PianoRoll: fixed keycodes for OS X
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)
2009-04-16 10:46:54 +02:00
Tobias Doerffel
52bab63548 RemotePlugin: never lock up if remote plugin died
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)
2009-04-14 00:40:17 +02:00
Tobias Doerffel
833610ea1c FileBrowser: added file type VstPluginFile
Added file type VstPluginFile in order to allow loading DLL files by
an according plugin directly from file browser.
(cherry picked from commit e0d352dc2c)
2009-04-14 00:05:07 +02:00
Tobias Doerffel
1ed140eec4 InstrumentTrack: fixed calculation in midiPitch()
InstrumentTrack::midiPitch() returned 16384 instead of 16383 if pitch
was set to +100 cents. This commit fixes the calculation.
(cherry picked from commit 76662a3a51)
2009-04-13 16:15:38 +02:00
Tobias Doerffel
2e1c7ce8a2 AudioJack: fixed lockup when getting zombified
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)
2009-04-07 00:16:12 +02:00