Ensure that no MIDI information (connected inputs, outputs, etc.) is
stored in presets. This main fix can be found in
`InstrumentTrack::saveTrackSpecificSettings` where the state of the
MIDI ports are now only saved if we are not in preset mode.
The remaining changes are concered with a refactoring of the code
that's related to saving and loading presets.
The refactoring mainly revolves around the removal of the member
`m_simpleSerializingMode` and the method `setSimpleSerializing` in
`Track`.
This is accomplished by introducing two new methods `saveTrack` and
`loadTrack`. These methods have a similar interface to `saveSettings`
and `loadSettings` but they additionally contain a boolean which
indicates if a preset is saved/loaded or a whole track. Both new
methods contain the previous code of `saveSettings` and `loadSettings`.
The latter two now only delegate to the new methods assuming that the
full track is to be stored/loaded if called via the overridden methods
`saveSettings` and `loadSettings`.
The methods `savePreset` and `loadPreset` are added as well. They call
`saveTrack` and `loadTrack` with the preset boolean set to `true`.
These methods are now used by all places in the code where presets are
saved or loaded which makes the code more readable. Clients also do not
need to know any implementation details of `Track`, e.g. like having to
call `setSimpleSerializing`.
Adjust `saveTrackSpecificSettings` so that it also passes information
of whether a preset or a whole track is stored. This leads to changes
in the interfaces of `AutomationTrack`, `InstrumentTrack`,
`PatternTrack` and `SampleTrack`. Only the implementation of
`InstrumentTrack` uses the new information though.
This PR places all LMMS symbols into namespaces to eliminate any potential future name collisions between LMMS and third-party modules.
Also, this PR changes back `LmmsCore` to `Engine`, reverting c519921306 .
Co-authored-by: allejok96 <allejok96@gmail.com>
* Update ringbuffer submodule to fix includes
* Remove cyclic includes
* Remove Qt include prefixes
* Include C++ versions of C headers
E.g.: assert.h -> cassert
* Move CLIP_BORDER_WIDTH into ClipView
This allows to remove includes to TrackView.h in ClipView cpp files.
* Elliminate useless includes
This improves the include structure by elliminating includes that are
not used. Most of this was done by using `include-what-you-use` with
`CMAKE_C_INCLUDE_WHAT_YOU_USE` and `CMAKE_CXX_INCLUDE_WHAT_YOU_USE`
set to (broken down here):
```
include-what-you-use;
-Xiwyu;--mapping_file=/usr/share/include-what-you-use/qt5_11.imp;
-Xiwyu;--keep=*/xmmintrin.h;
-Xiwyu;--keep=*/lmmsconfig.h;
-Xiwyu;--keep=*/weak_libjack.h;
-Xiwyu;--keep=*/sys/*;
-Xiwyu;--keep=*/debug.h;
-Xiwyu;--keep=*/SDL/*;
-Xiwyu;--keep=*/alsa/*;
-Xiwyu;--keep=*/FL/x.h;
-Xiwyu;--keep=*/MidiApple.h;
-Xiwyu;--keep=*/MidiWinMM.h;
-Xiwyu;--keep=*/AudioSoundIo.h
```
* Fixup: Remove empty #if-#ifdef pairs
* Remove LMMS_HAVE_STD(LIB|INT)_H
* Rebase BaraMGB's Knife
Co-authored-by: Steffen Baranowsky <BaraMGB@freenet.de>
* Draw marker
* Refactoring and shift mode
* Allow resizing
* Add Icon
* Fix stuck marker on RMB, remove unnecessary cast
* Remove redundant line, more const
* Fix
* Review fixes
* Only perform split logic for SampleTCO
* Add unquantizedModHeld function
* missed one
* Don't use copy/paste
* Don't use copy/paste
* More git troubles
* Fix undo
* git dammit
* Cleaner solution?
* Set cursor, add copy assignment to SampleBuffer
* Add TODO comment
* Make it build
* Fixes from review
* Make splitTCO virtual
* Make splitTCO more generic
Co-authored-by: IanCaio <iancaio_dev@hotmail.com>
* Prevent resizing of MIDI clips in knife mode
* Fix move/resize and rework box select via ctrl
* Apply suggestions from code review.
Co-authored-by: IanCaio <iancaio_dev@hotmail.com>
* Don't show inaccurate/useless/empty text float in knife mode
* Addresses Github review
- Fixes a typo where QWidget::mousePressEvent was being called
inside mouseReleaseEvent.
- Avoids unnecessarily disabling journalling on the Split
action, since it doesn't require it.
* Revert format changes in Track
* Revert format changes in Track.h
* Revert formatting changes in Track.cpp
Co-authored-by: Hyunjin Song <tteu.ingog@gmail.com>
Co-authored-by: IanCaio <iancaio_dev@hotmail.com>
* Automatic formatting changes
* Add copy constructor and assignemnt to SampleBuffer
* Add copy constructor to SampleTCO
* Delete SampleTCO copy assignment, initial work on SampleBuffer swap method
* SampleBuffer: Finish(?) swap and use it for copy assignment, lock for read in copy constructor
* Don't forget to unlock in copy assignment!
* Formatting changes
* Lock ordering in swap
* Fix leak and constness
Co-authored-by: Dominic Clark <mrdomclark@gmail.com>
* Fix multiplication style, ensure lock is held when necessary
... by switching from an initializer list to manual assignments.
* Fixes from review
* Avoid more undefined behavior
* Update src/tracks/SampleTrack.cpp
Co-authored-by: Dominic Clark <mrdomclark@gmail.com>
* Fixes createTCO method on some classes
Classes that inherit from "Track", also inherit the createTCO method. That method takes a MidiTime position as an argument, but except on the class SampleTrack that argument was ignored. That lead to unnecessary calls to TCO->movePosition after creating a TCO in many parts of the codebase (making the argument completely redundant) and even to a bug on the BBEditor, caused by a call to createTCO that expected the position to be set on the constructor (see issue #5673).
That PR adds code to move the TCO to the appropriate position inside the constructor of the classes that didn't have it, fixes the code style on the SampleTrack createTCO method and removes the now unneeded calls to movePosition from source files on src/ and plugins/. On Track::loadSettings there was a call to saveJournallingState(false) followed immediately by restoreJournallingState() which was deleted because it's redundant (probably a left over from copying the code from pasteSelection?).
* Fix code style issues
Fixes code style issues on some files (except for ones where the current statements already had a different code style. In those the used code style was kept for consistency).
* Fixes more code style issues
* Fixes code style issues on the parameter name
Fixes code style issue on the parameter name of createTCO, where _pos was supposed to be just pos. The existing code had the old style and I ended up replicating it on the other methods.
* Code style fixes
Fixes code style in the changed lines.
* Fixes bug with dragging to negative positions
There was a bug (already present before this PR) where dragging
a selection before MidiTime 0 would result in some TCOs being placed on
negative positions. This PR fixes this bug by applying the following
changes:
1) TrackContentObject::movePosition now moves the TCO to
positions equal or above 0 only.
2) Because of the previous change, I removed the line that
calculated the max value between 0 and the new position on
TrackContentObjectView::mouseMoveEvent when dragging a single TCO (and
added a line updating the value to the real new position of the TCO so
the label displays the position correctly).
3) Unrelated to this bug, but removed an unnecessary call to
TrackContentWidget::changePosition on the left resize of sample TCOs
because it will already be called when movePosition triggers the
positionChanged signal.
4) Added some logic to the TrackContentWidget::pasteSelection
method to find the left most TCO being pasted and make sure that the
offset is corrected so it doesn't end up on a negative position (similar
to the logic for the MoveSelection action).
5) Removed another line that calculated the max between 0 and
the new position on Track::removeBar since it's now safe to call
movePosition with negative values.
* Uses std::max instead of a conditional statement
As suggested by Spekular, we use std::max instead of a
conditional statement to correct the value of offset if it positions a
TCO on a negative position.
* implements drag and drop samples to sampletracks
* clean up / take care of timeLineWidget heigth in songeditor
* unused memeber removed
* clean up
* Update include/TrackContainerView.h
Co-Authored-By: Spekular <Spekular@users.noreply.github.com>
* Update src/gui/TrackContainerView.cpp
Co-Authored-By: Spekular <Spekular@users.noreply.github.com>
* Update src/gui/TrackContainerView.cpp
Co-Authored-By: Spekular <Spekular@users.noreply.github.com>
* Update src/gui/editors/SongEditor.cpp
Co-Authored-By: Spekular <Spekular@users.noreply.github.com>
* load AFP if we don't drop on a sample track
* take care of timeLineWidget size changes
* clean up
* consolidate some code
* requested changes by code review
* move logic to SampleTrackView
* clean up
* clean up
* clean up
Moving empty destructors out of the .cpp files and into headers
allows them to be devirtualized in certain cases.
(When the compiler can't "see" a function in a header, it must largely
assume it's some black box that the linker will resolve.)
While we're at it, use C++11's `= default` to define empty virtual
desturctors for us.
For some classes (e.g., Piano), nothing is derived from it, so we can
mark the class as final and remove any explicit virtual dtor.
There are many other places where this can be done, but this is a large
enough patch as-is.
* play sampletracks from any song position
* take care of TCO length
* TCOs shouldn't be updated when SE window is resized
* take care of zooming level
* takes care on all song position changes and mute/solo tracks now
* playes the sample only within the buffer limits
* takes care of time signature changes
* some minor code improvements (zapashcanon)
* loopback one tick earlier
* minor code changes
* get rid off clicks by resize and scrolling song editor
* removes playhandle by remove TCO
* minor bugs on manipulating TCOs in Song Editor
* update on add sample by playing
* white spaces 1
LMMS now properly builds and runs with Qt5. Various deprecated functions
had to be replaced like QString::toAscii()/fromAscii(). Also occurences
of FALSE/TRUE have been replaced with false/true.
LmmsStyle now derives from QProxyStyle and sets a style instance as base
style (Plastique for Qt4, Fusion for Qt5).
MOC files are not included anymore but added as regular source files.
What's missing is support for embedding VST plugins into a subwindow
inside LMMS on Linux/X11 due to missing QX11EmbedContainer class in Qt5.
Build instructions can be found in INSTALL.Qt5
Minimum version requirement for Qt4 has been raised to 4.6.0 for best
API compatibility between Qt4 and Qt5.
The MIDI event handling in InstrumentTrack was complex and buggy. It has
been simplified now such that processInEvent() tries to handle note on,
note off and key pressure events. The actions taken should result in
equivalent calls to processOutEvent() by NotePlayHandle instances. The
processOutEvent() function sends according MIDI events to the attached
instruments. All unhandled MIDI events are directly forwarded to the
instrument in processInEvent().
It's possible that some corner-cases are not handled yet with the new code
and we have regressions now.
Furthermore renamed midiTime/midiEvent to MidiTime/MidiEvent to match
coding style.
Closes#72.