| 89 | } |
| 90 | |
| 91 | MainWindow::MainWindow(std::weak_ptr<Configuration> config, QString filePath, bool isFirstLaunch, QWidget *parent) : |
| 92 | QMainWindow(parent), |
| 93 | ui(new Ui::MainWindow), |
| 94 | config_(config), |
| 95 | palette_(std::make_shared<ColorPalette>()), |
| 96 | bt_(std::make_shared<BambooTracker>(config)), |
| 97 | comStack_(std::make_shared<QUndoStack>(this)), |
| 98 | fileHistory_(std::make_shared<FileHistory>()), |
| 99 | scciDll_(std::make_shared<QLibrary>("scci")), |
| 100 | c86ctlDll_(std::make_shared<QLibrary>("c86ctl")), |
| 101 | instDialogMan_(std::make_shared<InstrumentEditorManager>()), |
| 102 | renamingInstItem_(nullptr), |
| 103 | renamingInstEdit_(nullptr), |
| 104 | isModifiedForNotCommand_(false), |
| 105 | hasLockedWigets_(false), |
| 106 | isEditedPattern_(true), |
| 107 | isEditedOrder_(false), |
| 108 | isEditedInstList_(false), |
| 109 | isSelectedPattern_(false), |
| 110 | isSelectedOrder_(false), |
| 111 | hasShownOnce_(false), |
| 112 | firstViewUpdateRequest_(false), |
| 113 | octUpSc_(nullptr), |
| 114 | octDownSc_(nullptr), |
| 115 | focusPtnSc_(this), |
| 116 | focusOdrSc_(this), |
| 117 | focusInstSc_(this), |
| 118 | playAndStopSc_(nullptr), |
| 119 | playStepSc_(nullptr), |
| 120 | goPrevOdrSc_(nullptr), |
| 121 | goNextOdrSc_(nullptr), |
| 122 | prevInstSc_(nullptr), |
| 123 | nextInstSc_(nullptr), |
| 124 | incPtnSizeSc_(nullptr), |
| 125 | decPtnSizeSc_(nullptr), |
| 126 | incEditStepSc_(nullptr), |
| 127 | decEditStepSc_(nullptr), |
| 128 | prevSongSc_(nullptr), |
| 129 | nextSongSc_(nullptr), |
| 130 | jamVolUpSc_(nullptr), |
| 131 | jamVolDownSc_(nullptr), |
| 132 | bankJamMidiCtrl_(false) |
| 133 | { |
| 134 | ui->setupUi(this); |
| 135 | |
| 136 | if (config.lock()->getMainWindowX() == -1) { // When unset |
| 137 | QRect rec = geometry(); |
| 138 | rec.moveCenter(QGuiApplication::screens().at(0)->geometry().center()); |
| 139 | setGeometry(rec); |
| 140 | config.lock()->setMainWindowX(x()); |
| 141 | config.lock()->setMainWindowY(y()); |
| 142 | } |
| 143 | else { |
| 144 | move(config.lock()->getMainWindowX(), config.lock()->getMainWindowY()); |
| 145 | } |
| 146 | if (isFirstLaunch) { |
| 147 | const QHash<QString, NoteNotationSystem> defNoteSysMap = { |
| 148 | { "English", NoteNotationSystem::ENGLISH }, |
nothing calls this directly
no test coverage detected