* Give our threads names
It helps with debugging.
* Use Q_OBJECT macro to automatically name threads.
By default, QThread sets its name based on the Qt meta class. To get an
accurate metaclass, the class which inherits QThread must declare
Q_OBJECT in its header. Futhermore, Qt's MOC requires that a Qt type be
the primary base class when declaring Q_OBJECT, hence the order of
base classes has been rearranged for some classes.
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.
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.
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.
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.
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.
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.
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.
Don't auto-save while playing by default. On weaker machines (xp?) we
see glitches so better turn this on after need.
Remove the last of Limited Sessin which was removed in 290556e.
Until now windows/widgets that were invisible during the call to
MainWindow::saveWidgetState had their size stored as (0, 0). This
resulted in problems when the default template was created with
invisible windows because in new projects these windows then opened up
at a very small size.
This patch fixes the problem by introducing a new parameter of type
QSize to MainWindow::saveWidgetState. It can be used to communicate the
size that should be stored in case the widget that calls the method is
invisible. The code of most callers (PianoRollWindow, SongEditor, etc.)
has been updated to use good default sizes.
There is a new tool button that can be used to turn the metronome on and
off. Per default the metronome is turned off. When enabled the metronome
will during on song playback, pattern playback and BB playback. During
export it is ignored.
A new icon was added as well.
The state is currently stored in the Mixer. It might make sense to put
the metronome configuration in its own class in the future. The state is
currently not stored in the file but this might be a good choice for now
until a better place is found for the metronome data.
Also removed some repeated calls to Engine::getSong() and
Engine::fxMixer().
A new option to save a project as the default template is now available
in the file menu. If the default template already exists the user is
asked whether he wants to overwrite it.
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 engine class as the component instance manager is the wrong place to
control the play/pause buttons. Instead emit a signal in the Song class
and update the buttons in a slot in MainWindow. This fixes problems with
GUI/pixmap operations happening outside the GUI thread when exporting a
project.
Closes#435.