Commit Graph

54 Commits

Author SHA1 Message Date
Lukas W
966bf1c6de Use CMake GenerateExportHeader 2018-07-07 11:20:54 +02:00
Hussam al-Homsi
6d46bd473f Remove "What's This?" and update tooltips (#4128) 2018-06-06 01:50:11 +03:00
Colin Wallace
a3cdda04c0 Give our threads names (#4356)
* 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.
2018-05-24 18:01:51 -07: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
Dominic Clark
9407e84ffa Stop some autosave crashes (#3841) 2017-10-01 22:01:38 +02:00
DomClark
fe98a9aa43 Fix some VST deadlocks/hangs 2017-09-08 23:14:52 +02:00
Oskar Wallgren
2e841e4917 Fixes to recover file system (#3722)
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.
2017-07-30 11:43:48 +02:00
Steffen Baranowsky
fc6d844a92 saves the correct subwindow size when it is hidden (#3589)
* saves the correct subwindow size when it is hidden

* remove invisible size from saveWidgetState()
2017-06-13 12:31:21 +02:00
Oskar Wallgren
290556e43d Remove Limited Session 2017-05-13 14:58:14 +02:00
grejppi
9e85d7c66e update all copyright headers to the proper url (#3326) 2017-02-06 02:41:15 +02:00
Oskar Wallgren
cfb2c7201f Auto save timer setting 2016-03-02 07:25:19 +01:00
Oskar Wallgren
9e8020719c Recovery file fixes 2016-01-19 14:04:08 +01:00
Michael Gregorius
7881e0315d Fixes the storage of the windows state for invisible windows
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.
2015-09-17 17:48:37 +02:00
Michael Gregorius
5b2e77b444 Improved metronome (on/off during song, pattern and bb playback)
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().
2015-08-29 15:04:41 +02:00
Michael Gregorius
bc1a416cd1 Added an option to save a project as the default template
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.
2015-08-16 16:18:38 +02:00
Colin Wallace
be564efb1e Add missing EXPORT directives for new SubWindow class 2015-06-15 23:41:08 +00:00
Colin Wallace
908591ba7d Have MainWindow and others make use of the new SubWindow class 2015-06-15 03:32:25 +00:00
Tres Finocchiaro
6428c7a9c8 Merge pull request #1915 from Wallacoloo/master
Provide status messages on splash screen when loading (#1696)
2015-04-27 18:40:36 +00:00
Colin Wallace
035f48fb1d Grey out edit->undo/redo actions if there's nothing left to undo/redo 2015-04-25 22:15:12 +00:00
Colin Wallace
44c42d9d38 Provide status messages on splash screen when loading (#1696) 2015-04-02 08:23:14 +00:00
Christopher L. Simons
95c7d72a90 Added 'bool stopPlayback' parameter to MainWindow::mayChangeProject() to preserve old behavior outside of 'Open project dialog' case; fixes #1384 2015-03-10 07:41:13 -04:00
Raine M. Ekman
96882f44d5 Added view menu
To be reviewed and reverted if undesired.

Based on https://sourceforge.net/p/lmms/patches/38/

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2015-02-17 23:37:44 +01:00
Amadeus Folego
edebf5d7da Refactor loading song errors notification 2015-01-13 00:18:36 -02:00
Lukas W
56055b36b0 Merge branch 'master' into ed_refac
Conflicts:
	src/gui/editors/PianoRoll.cpp
2015-01-11 13:25:55 +01:00
Daniel Winzen
4a55e1c46a Performance and other fixes 2015-01-09 20:17:07 +01:00
Amadeus Folego
d20e83e2f7 Fix exporting class for windows build 2015-01-09 04:27:18 -02:00
Lukas W
1ee93409d1 Move Engine' GUI code to new GuiApplication class 2014-12-17 23:25:55 +01:00
Christopher L. Simons
ca973b9369 Upon toggling off a window, now attempting to focus SongEditor, then any other visible editors, or finally the parent window if all editors are hidden. 2014-12-06 03:46:41 -05:00
Lukas W
5f4cdac802 Merge branch 'master' into rename
Conflicts:
	src/core/Song.cpp
	src/gui/LfoControllerDialog.cpp
	src/tracks/InstrumentTrack.cpp
2014-11-26 11:45:55 +01:00
Lukas W
1bbf7455a4 Rename a lot… 2014-11-26 10:09:49 +01:00
Lukas W
e045f1dd19 Rename fixes 2014-11-26 01:12:57 +01:00
Vesa V
435c64cc70 Merge pull request #1285 from grindhold/issue_55
Issue 55
2014-11-25 21:20:21 +02:00
Lukas W
8e8879f735 Merge stable-1.1
Conflicts:
	include/ConfigManager.h
	include/MidiTime.h
	include/string_pair_drag.h
	src/gui/string_pair_drag.cpp
	src/gui/widgets/rubberband.cpp
2014-11-10 19:26:59 +01:00
grindhold
27a136fe03 added capability to collect multiple errormessages and display them at once 2014-11-10 10:35:07 +01:00
Umcaruje
6fb923cba2 Correct the program name and site in the descriptions. 2014-11-04 22:56:50 +01:00
Vesa
fa9674521e Merge branch 'stable-1.1'
Conflicts:
	src/core/main.cpp
	src/gui/MainWindow.cpp
2014-11-02 07:46:32 +02:00
Lukas W
100a67cd3c Rename configManager to ConfigManager 2014-11-02 01:02:33 +01:00
Lukas W
c682567e4b Ask for saving changes before opening recent project
Fixes #1065
2014-10-31 13:35:54 +01:00
Tobias Doerffel
4cee046909 Added initial Qt5 support
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.
2014-08-14 17:34:49 +02:00
Tobias Doerffel
41c154dc95 Control play/pause buttons in slot of MainWindow via signal in Song class
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.
2014-03-18 20:39:52 +01:00
Tobias Doerffel
b45c0c5f02 MainWindow: coding style improvements 2014-03-18 20:39:01 +01:00
Lukas W
84a6d0bf02 Add "Save as new version" action to project menu
Use Shortcut Ctrl+Alt+S. Part of issue #86
2014-01-24 15:45:13 +01:00
Lukas W
0bbfd907ae MainWindow: Moved FileDialog to own subclass 2014-01-24 15:37:26 +01:00
Lukas W
f073c6d11b Added two standard paths to file open/save dialog
In particular Desktop and Downloads have been added.
Also introduced a new function to create a file dialog
in order to prevent code duplication.
2014-01-22 17:52:02 +01:00