Commit Graph

1900 Commits

Author SHA1 Message Date
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
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
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
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
9b2e3fc262 TrackContentWidget: fix graphical glitches with Qt 4.5
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>
(cherry picked from commit 1015868e1f)
2009-07-07 21:22:20 +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
d555db6109 PianoRoll: switch back to draw note after pasting notes
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>
(cherry picked from commit cf7539caaf)
2009-07-07 10:49:09 +02:00
Tobias Doerffel
a0b198fb38 ZynAddSubFX/FLTK: updated to SVN revision 6826
Updated FLTK to SVN revision 6826 of branch-1.3:

- Corrected const methods of Fl_Text_{Buffer|Display|Selection}
  to be declared const, corrected an Fl_Text_Buffer attrib. typo
- Fixed OpenGL shared context handling (STR #2135)
- Fixed gray-scale images with alpha channel (STR #2105)
- Fixed unexpected shortcut behavior for Win32 (STR #2199)
- Fixed documentation for Fl_Progress (STR #2209)

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit 0de2949aed)
2009-07-07 02:13:05 +02:00
Tobias Doerffel
c0f221e984 ZynAddSubFX: now build on OS X as well
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>
(cherry picked from commit ea376e90fe)
2009-07-07 01:59:22 +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
3c80a079a2 InstrumentTrack: fixed muting of frozen patterns in BB tracks
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>
(cherry picked from commit fb58dc00ab)
2009-07-07 01:59:04 +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
8fd507bcff RemotePlugin: added DEBUG_REMOTE_PLUGIN macro
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>
(cherry picked from commit 33ce491caf)
2009-07-07 01:58:44 +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
Tobias Doerffel
1e0acbef85 RemoteVstPlugin: fixed threading issues with saving/restoring chunks
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)
2009-07-07 01:57:23 +02:00
Tobias Doerffel
798c179b58 RemoteVstPlugin: added more NULL checks
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)
2009-07-07 01:57:12 +02:00
Tobias Doerffel
12aaffe149 VstBase: initial support for saving/restoring chunks
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)
2009-07-07 01:56:39 +02:00
Tobias Doerffel
cfe9c35f41 Sf2Player: allocate temporary buffer on stack if possible
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>
(cherry picked from commit d1353247d9)
2009-07-05 16:43:03 +02:00
Tobias Doerffel
fa21cf10a9 Do not build ZynAddSubFX on OS X
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>
(cherry picked from commit fd9d2b0e61)
2009-06-28 23:43:50 +02:00
Tobias Doerffel
35eeb55704 Various fixes for properly building on OS X
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>
(cherry picked from commit ed30985aa4)
2009-06-28 23:43:44 +02:00
Tobias Doerffel
facab0c2d8 AutomationEditor: set pen for painter outside inner loop
Set pen for drawing automation pattern outside of inner loop. This
might save some CPU cycles.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit ddf3d3dc66)
2009-06-22 22:14:03 +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
87e44aa241 Pattern: properly advance iterator when removing notes
We must not keep the iterator at the same position when erasing notes
from the m_notes array. This usually is not a problem when using QVector
but we might switch to QList somewhen later.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit 2d5dfc7b15)
2009-06-18 23:07:43 +02:00
Tobias Doerffel
0098ff874a NotePlayHandle: fixed crash at playback of subnotes
Commit 08ea133aa2 uncovered a flaw in
NotePlayHandle::play(...). When iterating over subnotes for each subnote
after playing it, we check whether it is finished. If this is true, the
according subnote gets erased from the m_subNotes array. However we have
to set the subnote iterator to what QList::erase(...) returns instead of
keeping it where it was before. This accidentally worked when using
QVector as type for NotePlayHandle arrays but caused a crash now that
we're using QList.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit 0d6ba6291b)
2009-06-18 23:07:31 +02:00
Tobias Doerffel
621512a7b7 Song: reset window title after creating new project from template
Reset window title when creating new project from template (after
actually loading template file). Furthermore do not reset window title
at the beginning of load process anymore.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit cf0a91637b)
2009-06-18 23:07:22 +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
33dd77f55c MMP: detect compressed files rather than guessing by extension
Detect whether a given file is compressed by first trying to parse
its content as XML data. If it failed, try to uncompress and
parse again. This is more flexible than just looking whether the
filename extension is "mmpz".

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit c0794d0c41)
2009-06-15 16:28:09 +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
5bb9af15ab RemoteVstPlugin: use SplittedThreading model for Proteus VX
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)
2009-06-02 00:51:29 +02:00
Tobias Doerffel
66147bebf0 ZynAddSubFX: fixed compilation failure of FLTK if glibc >= 2.10
Fixed compilation failure of FLTK on systems with glibc newer than
version 2.9 where the signature of scandir(...) has changed.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit dc539d88de)
2009-06-01 00:56:27 +02:00
Tobias Doerffel
6b71db0640 ZynAddSubFX: fixed compilation failure of FLTK
Fixed compilation failure of FLTK on broken systems where strchr()
takes a non-const char pointer.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit 3003163e9b)
2009-06-01 00:56:20 +02:00
Tobias Doerffel
0c8fdec27c MinGW cross compiling script: fixed invocation of cmake
Fixed invocation of cmake in the MinGW cross compiling script so it
works properly when doing an out-of-tree build (which should be the
default way of building LMMS).

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit 8c50e0ef9a)
2009-05-31 18:57:32 +02:00
Tobias Doerffel
ca5ba2971b ZynAddSubFX: processed UI files with Fluid from FLTK 1.3 branch
Processed all Fluid UI files with Fluid from FLTK 1.3 branch so the
generated code is up to date.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit 5b1900c4d0)
2009-05-31 18:56:01 +02:00
Tobias Doerffel
e0bb2cd043 ZynAddSubFX: integrated FLTK 1.3.0 branch from SVN
Integrated FLTK 1.3.0 branch from SVN which brings UTF8 support and
fully integrated Xft support (SVN rev. 6791).

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit 8affa66c61)
2009-05-31 18:55:49 +02:00
Tobias Doerffel
41efb51518 TrackView: do not set Qt::WA_OpaquePaintEvent attribute
Due to optimizations in Qt 4.5 setting Qt::WA_OpaquePaintEvent attribute
for TrackView widgets caused a line of distorted pixels at the bottom of
the left part so do not set this attribute anymore (closes #2795861).
(cherry picked from commit cdcc158c03)
2009-05-25 13:48:27 +02:00
Tobias Doerffel
168a68c1b3 ControllerConnection: fixed segfault when finalizing invalid controller
In ControllerConnection::finalizeConnections() we did not check whether
the current controller ID really exists in Song's controller array.
Fixes segfault when loading projects with screwed controller settings.
(cherry picked from commit 6d77f83ae9)
2009-05-19 18:37:11 +02:00
Tobias Doerffel
6066209ef3 lmms.rc.in: advanced copyright notice
Advanced copyright notice in lmms.rc.in which is used as resource file
when building win32 executable.
(cherry picked from commit 34e607f5bb)
2009-05-18 14:35:36 +02:00