1 /*************************************************************************** 2 ** ** 3 ** Polyphone, a soundfont editor ** 4 ** Copyright (C) 2013-2020 Davy Triponney ** 5 ** ** 6 ** This program is free software: you can redistribute it and/or modify ** 7 ** it under the terms of the GNU General Public License as published by ** 8 ** the Free Software Foundation, either version 3 of the License, or ** 9 ** (at your option) any later version. ** 10 ** ** 11 ** This program is distributed in the hope that it will be useful, ** 12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 14 ** GNU General Public License for more details. ** 15 ** ** 16 ** You should have received a copy of the GNU General Public License ** 17 ** along with this program. If not, see http://www.gnu.org/licenses/. ** 18 ** ** 19 **************************************************************************** 20 ** Author: Davy Triponney ** 21 ** Website/Contact: https://www.polyphone-soundfonts.com ** 22 ** Date: 01.01.2013 ** 23 ***************************************************************************/ 24 25 #ifndef EDITOR_H 26 #define EDITOR_H 27 28 #include <QMainWindow> 29 #include "basetypes.h" 30 class AbstractInputParser; 31 32 namespace Ui { 33 class Editor; 34 } 35 36 class Editor : public QMainWindow 37 { 38 Q_OBJECT 39 40 public: 41 explicit Editor(QWidget *parent = nullptr); 42 ~Editor(); 43 44 /// Initialize the editor with a parser that can extract data and build a soundfont 45 void initialize(AbstractInputParser * input); 46 47 /// Index of the soundfont created getSf2Index()48 int getSf2Index() { return _sf2Index; } 49 50 /// Notify that a change has been made somewhere 51 void update(QString editingSource); 52 53 signals: 54 void tabTitleChanged(QString title); 55 void filePathChanged(QString filePath); 56 void recorderDisplayChanged(bool isDisplayed); 57 void keyboardDisplayChanged(bool isDisplayed); 58 59 private slots: 60 void inputProcessed(); 61 void onSelectionChanged(IdList ids); 62 void displayOptionChanged(int displayOption); 63 64 private: 65 void updateTitleAndPath(); 66 67 Ui::Editor *ui; 68 int _sf2Index; 69 }; 70 71 #endif // EDITOR_H 72