mirror of
https://github.com/LMMS/lmms.git
synced 2026-01-25 06:48:55 -05:00
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.
183 lines
3.8 KiB
C++
183 lines
3.8 KiB
C++
/*
|
|
* MainWindow.h - declaration of class MainWindow, the main window of LMMS
|
|
*
|
|
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
|
*
|
|
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2 of the License, or (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public
|
|
* License along with this program (see COPYING); if not, write to the
|
|
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
* Boston, MA 02110-1301 USA.
|
|
*
|
|
*/
|
|
|
|
#ifndef MAIN_WINDOW_H
|
|
#define MAIN_WINDOW_H
|
|
|
|
#include <QtCore/QBasicTimer>
|
|
#include <QtCore/QTimer>
|
|
#include <QtCore/QList>
|
|
#include <QMainWindow>
|
|
|
|
class QAction;
|
|
class QDomElement;
|
|
class QGridLayout;
|
|
class QMdiArea;
|
|
|
|
class configManager;
|
|
class PluginView;
|
|
class toolButton;
|
|
|
|
|
|
class MainWindow : public QMainWindow
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
QMdiArea* workspace()
|
|
{
|
|
return m_workspace;
|
|
}
|
|
|
|
QWidget* toolBar()
|
|
{
|
|
return m_toolBar;
|
|
}
|
|
|
|
int addWidgetToToolBar( QWidget * _w, int _row = -1, int _col = -1 );
|
|
void addSpacingToToolBar( int _size );
|
|
|
|
|
|
// every function that replaces current file (e.g. creates new file,
|
|
// opens another file...) has to call this before and may only process
|
|
// if this function returns true
|
|
bool mayChangeProject();
|
|
|
|
|
|
void clearKeyModifiers();
|
|
|
|
bool isCtrlPressed()
|
|
{
|
|
return m_keyMods.m_ctrl;
|
|
}
|
|
|
|
bool isShiftPressed()
|
|
{
|
|
return m_keyMods.m_shift;
|
|
}
|
|
|
|
bool isAltPressed()
|
|
{
|
|
return m_keyMods.m_alt;
|
|
}
|
|
|
|
static void saveWidgetState( QWidget * _w, QDomElement & _de );
|
|
static void restoreWidgetState( QWidget * _w, const QDomElement & _de );
|
|
|
|
|
|
public slots:
|
|
void resetWindowTitle();
|
|
|
|
void emptySlot();
|
|
void enterWhatsThisMode();
|
|
void createNewProject();
|
|
void createNewProjectFromTemplate( QAction * _idx );
|
|
void openProject();
|
|
bool saveProject();
|
|
bool saveProjectAs();
|
|
bool saveProjectAsNewVersion();
|
|
void showSettingsDialog();
|
|
void aboutLMMS();
|
|
void help();
|
|
void toggleAutomationEditorWin();
|
|
void toggleBBEditorWin( bool forceShow = false );
|
|
void toggleSongEditorWin();
|
|
void toggleProjectNotesWin();
|
|
void toggleFxMixerWin();
|
|
void togglePianoRollWin();
|
|
void toggleControllerRack();
|
|
|
|
void updatePlayPauseIcons();
|
|
|
|
void undo();
|
|
void redo();
|
|
|
|
|
|
protected:
|
|
virtual void closeEvent( QCloseEvent * _ce );
|
|
virtual void focusOutEvent( QFocusEvent * _fe );
|
|
virtual void keyPressEvent( QKeyEvent * _ke );
|
|
virtual void keyReleaseEvent( QKeyEvent * _ke );
|
|
virtual void timerEvent( QTimerEvent * _ev );
|
|
|
|
|
|
private:
|
|
MainWindow();
|
|
MainWindow( const MainWindow & );
|
|
virtual ~MainWindow();
|
|
|
|
void finalize();
|
|
|
|
void toggleWindow( QWidget *window, bool forceShow = false );
|
|
|
|
|
|
QMdiArea * m_workspace;
|
|
|
|
QWidget * m_toolBar;
|
|
QGridLayout * m_toolBarLayout;
|
|
|
|
QMenu * m_templatesMenu;
|
|
QMenu * m_recentlyOpenedProjectsMenu;
|
|
int m_custom_templates_count;
|
|
|
|
struct keyModifiers
|
|
{
|
|
keyModifiers() :
|
|
m_ctrl( false ),
|
|
m_shift( false ),
|
|
m_alt( false )
|
|
{
|
|
}
|
|
bool m_ctrl;
|
|
bool m_shift;
|
|
bool m_alt;
|
|
} m_keyMods;
|
|
|
|
QMenu * m_toolsMenu;
|
|
QList<PluginView *> m_tools;
|
|
|
|
QBasicTimer m_updateTimer;
|
|
QTimer m_autoSaveTimer;
|
|
|
|
|
|
friend class engine;
|
|
|
|
|
|
private slots:
|
|
void browseHelp();
|
|
void fillTemplatesMenu();
|
|
void openRecentlyOpenedProject( QAction * _action );
|
|
void showTool( QAction * _idx );
|
|
void updateRecentlyOpenedProjectsMenu();
|
|
|
|
|
|
void autoSave();
|
|
|
|
signals:
|
|
void periodicUpdate();
|
|
|
|
} ;
|
|
|
|
#endif
|
|
|