Commit Graph

1106 Commits

Author SHA1 Message Date
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
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
5cd54b3f20 PianoRoll: removed unused variable
Removed unused variable volumeHandles in
PianoRoll::computeSelectedNotes(bool) which as a side-effect also fixes

/usr/include/qt4/QtCore/qvector.h: In member function ‘void PianoRoll::computeSelectedNotes(bool)’:
/usr/include/qt4/QtCore/qvector.h:421: warning: dereferencing pointer ‘<anonymous>’ does break strict-aliasing rules
/usr/include/qt4/QtCore/qvector.h:114: note: initialized from here
(cherry picked from commit 24353ca248)
2009-05-16 17:02:02 +02:00
Tobias Doerffel
1c38473255 NotePlayHandle: use public method for accessing pitch model
Do not use private m_pitchModel member variable of InstrumentTrack even
if NotePlayHandle is a friend class. Instead use the already existing
InstrumentTrack::pitchModel() method.
(cherry picked from commit 9dcb62c630)
2009-05-16 17:01:57 +02:00
Achim Settelmeier
2f5dd60fd9 MainWindow: fixed problems with maximized window-state when using FVWM2
Added a workaround for FVWM2 as showMaximized() does not work with it
unless the window is already visible.
(cherry picked from commit 515f0243b9)
2009-05-05 23:36:25 +02:00
Tobias Doerffel
cbc4c7c0aa Pass main window as parent for progress dialog when loading project
Make progress dialog when loading project a proper sub-window of LMMS
by passing main window as parent to constructor of QProgressDialog.
Fixes default window icon and additional taskbar item.
(cherry picked from commit 6929caa777)
2009-05-04 23:26:15 +02:00
Tobias Doerffel
8201a19d4c Added universal codebase for dragging plugin-specific presets
Added new stringPairDrag type "pluginpresetfile", allowing to drag
and drop any kind of plugin-specific preset files everywhere in the
program. Adopted changes in ZynAddSubFX plugin.
(cherry picked from commit ccb65f4b40)
2009-05-03 16:11:01 +02:00
Tobias Doerffel
6b0c083ce5 LadspaControl: set name property for tempoSyncKnobModel
For each model but the tempoSyncKnobModel the name property was properly
passed to the according constructor. This made time-based knobs in LADSPA
effects have no internal name, e.g. there were blank captions in the
knob's context menu or empty titles when used in combination with
automation patterns.
(cherry picked from commit ebd3d26531)
2009-05-03 15:33:39 +02:00
Tobias Doerffel
f687591986 EffectView: always check whether effect has a control dialog
Do not add empty subwindows for effects that do not have a control
dialog at all (i.e. Effect::getControlCount() == 0). Also check whether
creation of control dialog was successful. Fixes possible crashes if
something went wrong with the effect (e.g. loading VST effect failed).
(cherry picked from commit 9cced2957c)
2009-05-03 15:16:42 +02:00
Tobias Doerffel
ed02d1d501 InstrumentTrackWindow: clear focus on closeEvent
When closing an InstrumentTrackWindow make sure it doesn't still have
keyboard focus (looks like a bug in Qt) and set focus on
trackLabelButton instead (closes #2780590).
(cherry picked from commit 12d26ed0aa)
2009-04-25 16:41:42 +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
e0a26a35fc PianoRoll: do not make notes disappear under certain circumstances
When starting LMMS, loading an existing project and opening a pattern
with notes inside in piano roll, moving single notes showed unexpected
behaviour, i.e. the according note has been moved somewhere unreachable.

I tracked this down to a missing initialization of m_moveBoundary*
variables. Adding a few lines fixes the issue (closes #2632909).
(cherry picked from commit efb335cea7)
2009-04-17 15:13:44 +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
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
9dee41c017 Plugin: try to load all shared libraries first
Try to load all shared libraries before resolving any symbols. Fixes
problems with plugins that are linked against other shared libraries
located in LMMS' plugin directory.
(cherry picked from commit 9a4b4f3cfe)
2009-04-14 00:05:00 +02:00
Tobias Doerffel
e7b2cfc9f8 InstrumentTrack::masterKey(): fixed miscalculation
Global master pitch wasn't taken into account correctly when calculating
master key of a given key. Made MIDI based instruments behave in the
opposite direction regarding pitch when changing global master pitch.

Thanks to Skiessi for pointing out this issue.
(cherry picked from commit 6e30ae3369)
2009-04-09 00:20:44 +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
Tobias Doerffel
99807eeb98 SongEditor: fixed horizontal scrollbar with Qt 4.5
Due to optimizations in the graphics subsystem of Qt 4.5
songEditor::paintEvent() didn't get called regularly anymore and thus
the range of the horizontal scrollbar didn't get updated at all.

This commit makes the GUI track all changes related to the length of
the song.
(cherry picked from commit ff010da5ee)
2009-04-06 00:10:39 +02:00
Tobias Doerffel
af8862fd2a 3rdparty/libsamplerate: updated to version 0.1.7
Updated 3rdparty libsamplerate to version 0.1.7 and bumped requirement
to system's libsamplerate to version 0.1.7.

Besides minor stuff, version 0.1.7 has one important fix:

  * src/src_sinc.c
  Fix a segfault which occurs when memcpy is passed a bad length parameter.
  This bug has zero security implications beyond the ability to cause a
  program hitting this bug to exit immediately with a segfault.
(cherry picked from commit ca5588f747)
2009-03-27 01:40:15 +01:00
Tobias Doerffel
1046c7afb8 Oscillator: reverted recent fix for PM
As of acaaea8204 a samplerate dependent
ratio has been added into calculation of the local phase. This however is
wrong for PM.
(cherry picked from commit 2547bf8d57)
2009-03-22 15:18:55 +01:00
Tobias Doerffel
a850c1dd43 Oscillator: fixed samplerate dependence of FM/PM
When doing FM/PM, the value of sub-oscillator is globally/locally added to
phase. However when doing this, a ratio between fixed default samplerate and
actual samplerate needs to be taken into account in the phase calculation.

This commit fixes missounding render output when rendering projects with
FM/PM inside at higher samplerates. (Thanks to Skiessi for his ladspa2.mmpz
which clearly brought up this bug)
(cherry picked from commit acaaea8204)
2009-03-21 10:34:58 +01:00
Tobias Doerffel
7931d65a89 AutomationPatternView: fixed painting of automation data
At low pixels/tact ratio automation was not drawn properly due to miscalculation
of x2 variable. This patch fixes this by adding 1 to x2.
(cherry picked from commit 9ea3c6660d)
2009-03-16 17:50:00 +01:00
Tobias Doerffel
ec07aef5ac Fixed various types to be suffixed with "_t".
This commit ensures that all defined data types in include/lmms_basics.h are
suffxed with "_t" to keep consistency as well as to fix issues on systems
with older STL/libstdc++.
(cherry picked from commit 7449c4f731)
2009-03-15 21:50:38 +01:00
Tobias Doerffel
49ffdcd5bc MidiPort: subscribe writable rather than readable port when settings
When loading MidiPort settings, erroneously readable port was subscribed rather
than writable port. This commit fixes the issue.
(cherry picked from commit d981b32480)
2009-03-14 19:13:48 +01:00
Tobias Doerffel
c0c729412b MidiPortMenu: minor coding style fixes
(cherry picked from commit bd9be061a0)
2009-03-14 19:13:23 +01:00
Tobias Doerffel
4dbb6a20bd FX-Fader: added accessibleName property for FX faders for not displaying
an empty titlebar in context-menu
(cherry picked from commit c24b923b78)

Conflicts:

	src/gui/fx_mixer_view.cpp
2009-03-14 16:10:13 +01:00
Tobias Doerffel
efbe9c94c0 Various fixes for better OpenBSD compatibility (thanks to Jacob Meuser)
(cherry picked from commit 46097b72d7)

Conflicts:

	src/core/main.cpp
2009-03-12 19:35:49 +01:00
Tobias Doerffel
ab35c12552 AutomationPattern: save and restore length of AutomationPattern to avoid
confusions with the previous auto-resize behaviour
(cherry picked from commit 03bf853a4d)
2009-03-12 19:06:07 +01:00
Tobias Doerffel
2b033627e6 MIDI subsystem: fixed misspelled "writeable" into "writable", minor
coding style fixes
(cherry picked from commit 94d13e84ca)
2009-03-12 01:11:55 +01:00
Tobias Doerffel
76252b461b MidiPort: properly emit portChanged signals when loading settings - fixes
MidiPortMenu showing devices not checked although actually connected
(cherry picked from commit 782156cf70)
2009-03-12 01:11:48 +01:00
Tobias Doerffel
0f40a68e75 TrackContainerView: when dragging a preset file into TrackContainerView
load complete track settings rather than just track specific settings -
fixes an issue where the track name was not loaded from the dragged preset
(cherry picked from commit 5976ab5ce2)
2009-03-09 22:48:15 +01:00
Tobias Doerffel
a6fbb8bb2d PatternView: if volume of a step is 95 it was not possible to increase
it to 100 by scrolling up (closes #2656024)

Backported from fa3d004f42 (master)
2009-03-04 19:02:18 +01:00
Tobias Doerffel
12ba546419 NotePlayHandle: call instrumentTrack::deleteNotePluginData() before
invalidating itself in instrumentTrack's m_notes array - fixes
recording with instruments that under certain circumstances call
notePlayHandle::noteOff() on their own (e.g. Kicker)

Backported from 6e4cc7b270 (master)
2009-02-27 14:20:36 +01:00
Tobias Doerffel
a2c0960810 PeakController: always check for m_peakEffect != NULL before using it as
sometimes it keeps NULL due to bugs in PeakController and
PeakControllerEffect deletion (closes #2616486)
2009-02-26 16:25:03 +01:00
Tobias Doerffel
9b533f055a rewrote timing of fading animation for not postponing updates of hidden fadeButton until it becomes visible (stable backport)
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/branches/lmms/stable-0.4@2058 0778d3d1-df1d-0410-868b-ea421aaaa00d
2009-02-19 15:03:23 +00:00
Tobias Doerffel
168b65dfae make sure all buttons in trackOperationsWidget have focus-policy set to Qt::NoFocus in order to make space play song even if you clicked e.g. a mute-button (closes #2486211) (stable backport)
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/branches/lmms/stable-0.4@2057 0778d3d1-df1d-0410-868b-ea421aaaa00d
2009-02-19 15:02:41 +00:00
Tobias Doerffel
625c947d7a move timeLine marker in Piano Roll and autoscroll when recording while playing song (closes #2486334) (stable backport)
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/branches/lmms/stable-0.4@2054 0778d3d1-df1d-0410-868b-ea421aaaa00d
2009-02-19 14:27:42 +00:00
Tobias Doerffel
264ad268ba more record-accompany fixes (stable backport)
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/branches/lmms/stable-0.4@2052 0778d3d1-df1d-0410-868b-ea421aaaa00d
2009-02-19 13:57:22 +00:00