Commit Graph

1910 Commits

Author SHA1 Message Date
SecondFlight
4585a07673 Allow renaming of FX mixer channels with the F2 and enter keys. (#4348)
* Add f2 as a FX mixer rename shortcut. Enter doesn't work yet.

* Add both enter keys, remove code duplication

* Fix renaming with enter/return

* Clean up
2018-05-13 17:15:32 -04:00
Premik
e8b69b9700 Zooming with mouse wheel center (#3835)
* Horizontal mouse-wheel zooming. Ensure zoom center is always on the current mouse position.

* Horizontal zoom using mouse wheel center on the mouse position. For the SongEditor too.

* Wheel center on the Automation editor too.
2018-05-10 00:45:45 +02:00
Matt Kline
68c9d227d0 Default some empty destructors
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.
2018-05-06 16:34:08 -07:00
Hyunin Song
8a41def616 Merge branch 'stable-1.2'
# Conflicts:
#       .circleci/config.yml
#       .travis/osx..install.sh
#       CMakeLists.txt
#       plugins/zynaddsubfx/zynaddsubfx
#       plugins/zynaddsubfx/zynaddsubfx/src/DSP/FFTwrapper.h
#       plugins/zynaddsubfx/zynaddsubfx/src/Misc/QtXmlWrapper.cpp
#       plugins/zynaddsubfx/zynaddsubfx/src/Params/PADnoteParameters.cpp
#       plugins/zynaddsubfx/zynaddsubfx/src/Synth/OscilGen.cpp
#       src/CMakeLists.txt
#       src/core/Track.cpp
#       src/tracks/Pattern.cpp
2018-05-01 09:59:07 +09:00
Matt Kline
ebed0296b3 Axe atomic int (#4326)
* ThreadableJob: Move from AtomicInt to std::atomic

This is the first in a series of commits that migrates away from
AtomicInt towards the C++11 standard library types.
This would allow the removal of AtomicInt and related Qt
version-specific code.

While we're at it, also make ProcessingState an `enum class` so that
it's not implicitly convertible to integers.

* LocklessAllocator: Switch from AtomicInt to std::atomic_int

If it looks like some assignments around the Compare & Swap loops went
missing, it's because compare_exchange_weak() updates the first argument
to the current value when it fails (i.e., returns false).

* BufferManager: Remove extra AtomicInt include

* MixerWorkerThread: AtomicInt to std::atomic_int

* NotePlayHandle: AtomicInt to std::atomic_int

* Remove AtomicInt.h

* Move from QAtomicPointer to std::atomic<T*>

This removes some #ifdef trickery that was being used to get
load-acquire and store-release from Qt5 and "plain" (presumably
sequentially-consistent) loads and stores from Qt4.
2018-04-28 12:54:46 -07:00
Lukas W
d42a685007 Refactoring: Remove duplicate code (#4310) 2018-04-25 18:49:39 +02:00
Matt Kline
ffccd6ddd2 Use atomics to count shared_object without locks
C++11 (and subsequent C++ standards) provide portable ways to issue
atomic hardware instructions, which allow multiple threads to load,
store, and modify integers without taking a lock. The standard also
defines a memory model that lets you express the ordering guarantees
around these atomic operations. (x86 is relatively strongly-ordered, but
many other common architectures, such as ARM, are free to reorder loads
and stores unless told not to.)

This patch removes the lock from shared_object and replaces it with the
standard thread-safe reference counting implementation used in
C++'s std::shared_ptr, Rust's std::sync::Arc, and many others.

Additional resources on the topic:
https://assets.bitbashing.io/papers/concurrency-primer.pdf
https://www.youtube.com/watch?v=ZQFzMfHIxng
2018-04-25 12:50:44 +02:00
Hussam Eddin Alhomsi
f7a0553e6a Responsive "Effects chain" & "User controller" LEDs (#4297) 2018-04-24 11:25:49 +03:00
Colin Wallace
3401de4a83 Use themed file dialogs everywhere. (#4298)
Previously lmms used themed dialogs for project saving/opening, but not
when editing settings (edit -> settings).

With this change, the settings editor also uses themed dialogs.
2018-04-20 19:01:11 -07:00
Colin Wallace
da126bfb5c Use range-based for loops + fix const correctness 2018-04-17 09:17:33 +02:00
Tres Finocchiaro
ae0dd21df3 Upgrade Calf LADSPA plugins to 0.90 (#3987)
Upgrade Calf LADSPA plugins to 0.90
2018-04-15 21:38:37 -04:00
Hussam Eddin Alhomsi
e554a4c4b0 Better behavior when left-clicking a TCO (#4290)
Instead of calling MouseMoveEvent(), the TCO's "text float" text and position are updated.
This prevents left-clicking the right edge of a resizable TCO from decreasing its size.

Also, removed an unused variable: m_oldTime
2018-04-11 13:39:43 +03:00
Tres Finocchiaro
9af7821eb1 Add PerfLog (#3974)
Add `PerfTime` class representing a point in CPU time and `PerfLogTimer`, used for measuring and logging a time period. Used in `ProjectRenderer::run()
2018-04-03 13:37:25 +02:00
Colin Wallace
ca3a7f3015 Remove unused method and extraneous state from AutomatableModelView (#4258)
* Remove DataType.

An AutomatableModel should not need to know what concrete type it is.
Use virtual methods and implement them in the derived class instead of
testing the type in the base class.

* Remove unused method

* Remove m_hasLinkedModels

We can compute it on-the-fly with very little cost, and doing so
simplifies the code.

* Remove extra 'public:'

Probably a remnant of merging master
2018-03-28 00:03:10 -07:00
Colin Wallace
56b4740146 Copy/paste model values to system clipboard
Previously they were copy/pasted internally, and not visible across LMMS
instances.
2018-03-20 00:43:15 -07:00
Colin Wallace
7593b2ee58 Replace macro magic with a template base class 2018-03-20 00:42:21 -07:00
Colin Wallace
b706ee208d Replace more instances new/delete with owning types (#4245)
* Use owning types when possible.

Note: the QByteArray s is detached to mimic previous behavior;
detach() guarantees that the QByteArray uniquely owns its data, since
otherwise it's COW. This may be relevant in case Plugin:instantiate
modifies s.data() -- this way the original QString is safe.

* Make m_filter a unique_ptr.

* Make m_activeRenderer a unique_ptr

* use std::string instead of strcpy + buffers
2018-03-15 18:46:55 -07:00
Colin Wallace
45f9fc03c2 Make *ModelView a templated type instead of macro-based class.
Among other things, this makes it easier to grep for FloatModelView,
BoolModelView, IntModelView in the code base.
2018-03-13 20:57:34 -07:00
Colin Wallace
ec3c9cdf10 Only use specific std:: items we need.
Also, fix `using std::unique_ptr` to `using std::make_unique` in
stdshims.h
2018-03-11 09:07:00 -07:00
Colin Wallace
ba278becbd Don't use #pragma; don't redefine make_unique if using C++14 2018-03-10 23:29:22 -08:00
Colin Wallace
a9d097cad9 Prefer emplace_back; take argument by value.
We copy the QString, so it makes sense to accept it by value and _move_
it into the collection instead. This causes the caller to move any
rvalue QString into the function, and then the QString is never actually
copied at all.
2018-03-10 16:08:21 -08:00
Colin Wallace
876615e3a3 Warn when compiling with C++14 or greater. 2018-03-10 00:28:58 -08:00
Colin Wallace
0f993895d4 Fix missing includes 2018-03-09 23:48:07 -08:00
Colin Wallace
fd871e46c9 refactor: Use unique_ptr for memory management 2018-03-09 23:03:19 -08:00
Tres Finocchiaro
d2c370a953 Enable FPE on Mac (#4213)
Allow #3687 to work on Mac
2018-03-09 11:41:17 -05:00
Hyunin Song
0a5d056bdb Merge branch 'stable-1.2'
# Conflicts:
        #       .travis/osx..install.sh
        #       .travis/osx..script.sh
        #       cmake/linux/package_linux.sh.in
        #       data/locale/en.ts
        #       src/core/CMakeLists.txt
        #       src/core/ProjectRenderer.cpp
        #       src/gui/FileBrowser.cpp
2018-03-07 23:54:28 +09:00
Hyunjin Song
926b6542ae Don't restore audio device during exporting (#4083)
Fixes deadlock on multi-track export with SDL
2018-03-02 13:28:56 +09:00
DomClark
d0b3be7f00 Wait for reply when updating sample rate 2018-01-17 15:56:01 +09:00
Michael Gregorius
9acff89ad3 Remove Song's dependency to MainWindow
Finally remove Song's dependency to MainWindow by moving the window
title update which is triggered due to a changed project file name from
the class Song into MainWindow.

Implementation details:
Add a new signal projectFileNameChanged to Song and connect the new slot
method MainWindow::onProjectFileNameChanged to it. Update the window
title whenever the slot is triggered.

Add a new private method Song::setProjectFileName which sets the project
file name and emits the signal (only if the file name really changes).
Call setProjectFileName everywhere where m_fileName was manipulated
directly. This is done to ensure that the signal can be potentially
emitted in all relevant situations.

Remove the calls to gui->mainWindow from
Song::createNewProjectFromTemplate.

These changes finally remove the include to "MainWindow.h". The include
for "ConfigManager.h" was previously done implicitly through the include
of "MainWindow.h" and therefore had to be added explicitly after the
latter is removed.
2017-12-26 00:33:11 +01:00
Michael Gregorius
b79999a6bf Move some window title updates from Song into MainWindow
Move the window title updates which are triggered due to a changed
modify state from Song to MainWindow.

Implementation details:
Add a new signal modified to Song and connect the new slot method
MainWindow::onSongModified to it.

Currently only the window title is updated in the slot. It is only
updated if the code is executed from the GUI main thread. This
implementation was taken over from the original implementation of
Song::setModified. The assumption here seems to be that the Song might
also be set as modified from other threads (which is a bad design).

Add a new private method Song::setModified(bool) and replace all direct
manipulations of m_modified in Song by calls to this method. This is done
to ensure that the signal can be emitted in all these cases. Make
Song::setModified() delegates to Song::setModified(bool) for the same
reason.

Other changes:
Slightly refactor MainWindow::resetWindowTitle to get rid of an
unnecessary if statement.
2017-12-26 00:33:11 +01:00
Michael Gregorius
07caf85bf5 Remove GUI related code from Song::stop
Add the new signal Song::stopped which is emitted when the song is
stopped. Connect the new slot method MainWindow::onSongStopped to that
signal. Remove all GUI updates from Song::stop and handle them in
MainWindow::onSongStopped.
2017-12-26 00:33:11 +01:00
Michael Gregorius
7fa62266a9 Move showing of save result dialog out of Song
Move the showing of save result dialogs, e.g. "The project XYZ is now
saved.", from the class Song into the class MainWindow.

Implementation details:
Add three new methods guiSaveProject, guiSaveProjectAs and
handleSaveResult to MainWindow. The first two correspond to the methods
with the same name in Song which don't do anything GUI related anymore.
The GUI related actions are instead implemented in the two new methods
in MainWindow. The method handleSaveResult shows the dialogs for
successful and failed saves, updates the list of recent files and the
title bar of the main window.

This commit also fixes a problem in Song::guiSaveProject where a failed
saved without a GUI would still have returned true, i.e. success.
2017-12-26 00:33:11 +01:00
Michael Gregorius
6a716ef985 Move import functionality from Song to MainWindow
Move the functionality of the method Song::importProject into the
MainWindow as it mainly consists of GUI related actions.

Add a new method Song::setLoadOnLauch to ensure that the boolean
Song::m_loadOnLaunch is still set at the end of the import.
2017-12-26 00:33:11 +01:00
Michael Gregorius
78d65ccc3a Move song export and track export from Song into MainWindow
The code to export a song and the tracks of a song mainly consisted of
GUI code. Therefore it was moved completely into MainWindow.

Add two new slots and a method that does the actual work to MainWindow.
Make both slots delegate to the worker method.
2017-12-26 00:33:11 +01:00
Michael Gregorius
989db1dc9b Move GUI dependencies out of Song::exportProjectMidi
Move all GUI dependencies out of Song::exportProjectMidi and move them
into the MainWindow.

Show the GUI in the new slot method MainWindow::onExportProjectMidi and
delegate to Song::exportProjectMidi once the file name has been
determined. The file name is given as a parameter to
Song::exportProjectMidi which still contains the business logic of
exporting the data.
2017-12-26 00:33:11 +01:00
Hyunin Song
59cfcf41a7 Merge branch 'stable-1.2'
# Conflicts:
#	.travis/linux..before_install.sh
#	.travis/linux..install.sh
#	.travis/linux..script.sh
#	cmake/linux/package_linux.sh.in
#	include/AudioWeakJack.def
#	plugins/vst_base/CMakeLists.txt
#	plugins/zynaddsubfx/zynaddsubfx
2017-12-20 14:16:16 +09:00
Lukas W
7c71bc657c Merge pull request #3786 from LMMS/fix/qt5-vst
Add all the Qt5 Linux VST implementations
2017-12-18 22:15:45 +01:00
tresf
5174bdaa0d Spaces to tabs 2017-12-11 10:46:19 -05:00
David Carlier
a653d01ac8 Few code fixes since we re dealing with C++11 2017-12-09 07:55:30 +00:00
Hyunjin Song
dd4a73eb4b Fix various bugs when using JACK (#4005)
* Fix crash on closing
* Fix audio rendering artifacts
* Make LMMS work properly after rendering
2017-12-03 11:27:49 +09:00
Tres Finocchiaro
d711b8b55e Add Carla Support to AppImage (#4026)
Build AppImage with Carla support
* Disables HiDPI support in the AppImages
* Ignores deprecated jack usage
* Fix Carla compilation warnings
* Detects carla prefix in AppRun
2017-12-01 13:19:44 -05:00
Lukas W
4ff5eba0f9 Merge pull request #4010 from LMMS/fix/sendEvent-assert
Fix sendEvent assert
2017-11-27 20:43:02 +01:00
Lukas W
7019cabb51 Merge branch 'stable-1.2' into fix/qt5-vst 2017-11-25 12:36:34 +01:00
Lukas W
a96771bb2d Add Q_OBJECT to FloatModel, IntModel, BoolModel 2017-11-24 13:48:36 +01:00
Lukas W
c9c22e4a0e shared_object: Use deleteLater in unref for thread safety
This makes unref safe when it's not called from within the object's thread.

Fixes #4009
2017-11-24 13:30:15 +01:00
Lukas W
aa1406bac9 Merge pull request #4000 from LMMS/fix/msvc
MSVC fixes
2017-11-24 11:58:12 +01:00
Hyunin Song
90b1fb57f0 Merge brnach 'stable-1.2' 2017-11-24 09:56:08 +09:00
Lukas W
3c9a1bbe5e Fix Clang compilation with gig 2017-11-22 20:38:10 +01:00
Lukas W
8f3ab4b1b0 Merge branch 'master' into fix/msvc
# Conflicts:
#	plugins/LadspaEffect/CMakeLists.txt
#	plugins/Xpressive/Xpressive.cpp
#	plugins/opl2/CMakeLists.txt
#	plugins/papu/CMakeLists.txt
#	plugins/xpressive/CMakeLists.txt
#	src/CMakeLists.txt
2017-11-22 17:34:22 +01:00
Lukas W
852708863a Fix Linux compilation issues caused by MSVC fixes 2017-11-22 16:36:51 +01:00