123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208 |
- /*
- This file is part of QTau
- Copyright (C) 2013-2018 Tobias "Tomoko" Platen <tplaten@posteo.de>
- Copyright (C) 2013 digited <https://github.com/digited>
- Copyright (C) 2010-2013 HAL@ShurabaP <https://github.com/haruneko>
- QTau 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 3 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. If not, see <http://www.gnu.org/licenses/>.
- SPDX-License-Identifier: GPL-3.0+
- */
- #ifndef MAINWINDOW_H
- #define MAINWINDOW_H
- #include <QMainWindow>
- #include <QUrl>
- #include "PluginInterfaces.h"
- #include "Utils.h"
- class qtauController;
- class qtauSession;
- class qtauEvent;
- class qtauPiano;
- class qtauNoteEditor;
- class qtauMeterBar;
- class qtauDynDrawer;
- class qtauDynLabel;
- class qtauWaveform;
- class QAction;
- class QScrollBar;
- class QSlider;
- class QToolBar;
- class QTabWidget;
- class QTextEdit;
- class QToolBar;
- class QSplitter;
- class QComboBox;
- class QLabel;
- namespace Ui {
- class MainWindow;
- }
- class MainWindow : public QMainWindow
- {
- Q_OBJECT
-
- public:
- explicit MainWindow(QWidget *parent = 0);
- ~MainWindow();
- bool setController(qtauController &c, qtauSession &s);
- private:
- Ui::MainWindow *ui;
- private:
- void updateUndoRedoTexts();
- signals:
- void loadUST (QString fileName);
- void saveUST (QString fileName, bool rewrite);
- void saveAudio(QString fileName, bool rewrite);
- void loadAudio(QString fileName);
- void setVolume(int);
- public slots:
- void onLog(const QString&, ELog);
- void updateRecentFileActions();
- void onOpenUST();
- void onSaveUST();
- void onSaveUSTAs();
- void notesVScrolled(int);
- void notesHScrolled(int);
- void vertScrolled(int);
- void horzScrolled(int);
- void onEditorRMBScrolled(QPoint, QPoint);
- void onEditorRequestOffset(QPoint);
- void onPianoHeightChanged (int newHeight);
- void onNoteEditorWidthChanged(int newWidth);
- void onUndo();
- void onRedo();
- void onDelete();
- void onEditMode(bool);
- void onGridSnap(bool);
- void onQuantizeSelected(int);
- void onNotelengthSelected(int);
- void dynBtnLClicked();
- void dynBtnRClicked();
- void onTabSelected(int);
- void onZoomed(int);
- void onEditorZoomed(int);
- void onSingerSelected(int);
- void onDocReloaded();
- void onDocStatus(bool);
- void onUndoStatus(bool);
- void onRedoStatus(bool);
- void onDocEvent(qtauEvent*);
- void onTransportPositionChanged(float pos);
- void onMIDIImport();
- void onMIDIExport();
- void onActionJackTriggered();
- void onTempoSelectClicked();
- void markOverlappingNotes(quint64 id1,quint64 id2);
- void updateNoteColors();
- protected:
- qtauSession *_doc;
- qtauController *_ctrl;
- SNoteSetup _ns;
- QTabWidget *_tabs;
- QComboBox* _voiceNameCbo;
- qtauPiano *_piano;
- qtauNoteEditor *_noteEditor;
- qtauDynDrawer *_drawZone;
- qtauMeterBar *_meter;
- QAction* _recentFileActs[MAXRECENTFILES];
- QWidget *_wavePanel; // used to switch its visibility, hidden by default
- QWidget *_drawZonePanel;
- QSplitter *_editorSplitter;
- qtauDynLabel *_fgDynLbl;
- qtauDynLabel *_bgDynLbl;
- QScrollBar *_hscr;
- QScrollBar *_vscr;
- QSlider *_zoom;
- QComboBox* _singerSelect;
- QTextEdit *_logpad;
- QList<QToolBar*> _toolbars;
- void enableToolbars(bool enable = true);
- QColor _logTabTextColor;
- int _logNewMessages;
- bool _logHasErrors;
- bool _showNewLogNumber;
- QString _docName;
- QString _lastScoreDir;
- QString _lastAudioDir;
- QString _audioExt;
- //QLabel* _tempoLabel;
- //QLabel *_meterLabel;
- QMenu* _menuPlugins;
- void updateSetup();
- void dragEnterEvent (QDragEnterEvent*);
- void dragMoveEvent (QDragMoveEvent *);
- void dropEvent (QDropEvent *);
- void closeEvent (QCloseEvent *);
- private slots:
- void on_actionPhoneme_Transformation_triggered();
- void openRecentFile();
- void on_actionSave_Last_Play_triggered();
- void on_actionMusicXML_triggered();
- void on_actionUST_triggered();
- public:
- void addPluginAction(QAction*);
- struct selectionRange getSelectionRange();
- };
- #endif // MAINWINDOW_H
|