diff --git a/include/Song.h b/include/Song.h index 2897b2131de..d438aa61466 100644 --- a/include/Song.h +++ b/include/Song.h @@ -82,17 +82,12 @@ class LMMS_EXPORT Song : public TrackContainer constexpr static auto PlayModeCount = static_cast(PlayMode::Count); struct SaveOptions { - /** - * Should we discard MIDI ControllerConnections from project files? - */ - BoolModel discardMIDIConnections{false}; /** * Should we save the project as a project bundle? (with resources) */ BoolModel saveAsProjectBundle{false}; void setDefaultOptions() { - discardMIDIConnections.setValue(false); saveAsProjectBundle.setValue(false); } }; diff --git a/include/VersionedSaveDialog.h b/include/VersionedSaveDialog.h index 6d707cd51bd..834cff7dd28 100644 --- a/include/VersionedSaveDialog.h +++ b/include/VersionedSaveDialog.h @@ -42,7 +42,6 @@ class SaveOptionsWidget : public QWidget { SaveOptionsWidget(Song::SaveOptions &saveOptions); private: - LedCheckBox *m_discardMIDIConnectionsCheckbox; LedCheckBox *m_saveAsProjectBundleCheckbox; }; diff --git a/src/core/AutomatableModel.cpp b/src/core/AutomatableModel.cpp index 5ce259dc2b0..a6db08b7391 100644 --- a/src/core/AutomatableModel.cpp +++ b/src/core/AutomatableModel.cpp @@ -136,15 +136,12 @@ void AutomatableModel::saveSettings( QDomDocument& doc, QDomElement& element, co } } - // Skip saving MIDI connections if we're saving project and - // the discardMIDIConnections option is true. + // Skip saving MIDI connections if we're saving project auto controllerType = m_controllerConnection ? m_controllerConnection->getController()->type() : Controller::ControllerType::Dummy; - bool skipMidiController = Engine::getSong()->isSavingProject() - && Engine::getSong()->getSaveOptions().discardMIDIConnections.value(); - if (m_controllerConnection && controllerType != Controller::ControllerType::Dummy - && !(skipMidiController && controllerType == Controller::ControllerType::Midi)) + if (m_controllerConnection && (controllerType != Controller::ControllerType::Dummy + || controllerType != Controller::ControllerType::Midi)) { QDomElement controllerElement; diff --git a/src/gui/modals/VersionedSaveDialog.cpp b/src/gui/modals/VersionedSaveDialog.cpp index c8e1c682120..0451b00218b 100644 --- a/src/gui/modals/VersionedSaveDialog.cpp +++ b/src/gui/modals/VersionedSaveDialog.cpp @@ -180,15 +180,10 @@ bool VersionedSaveDialog::fileExistsQuery( QString FileName, QString WindowTitle SaveOptionsWidget::SaveOptionsWidget(Song::SaveOptions &saveOptions) { auto *layout = new QVBoxLayout(); - m_discardMIDIConnectionsCheckbox = new LedCheckBox(nullptr); - m_discardMIDIConnectionsCheckbox->setText(tr("Discard MIDI connections")); - m_discardMIDIConnectionsCheckbox->setModel(&saveOptions.discardMIDIConnections); - m_saveAsProjectBundleCheckbox = new LedCheckBox(nullptr); m_saveAsProjectBundleCheckbox->setText(tr("Save As Project Bundle (with resources)")); m_saveAsProjectBundleCheckbox->setModel(&saveOptions.saveAsProjectBundle); - layout->addWidget(m_discardMIDIConnectionsCheckbox); layout->addWidget(m_saveAsProjectBundleCheckbox); setLayout(layout); diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index be18fc9e4ca..f0b528bb7ac 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -861,8 +861,7 @@ void InstrumentTrack::saveTrackSpecificSettings( QDomDocument& doc, QDomElement // Save the midi port info if we are not in song saving mode, e.g. in // track cloning mode or if we are in song saving mode and the user // has chosen to discard the MIDI connections. - if (!Engine::getSong()->isSavingProject() || - !Engine::getSong()->getSaveOptions().discardMIDIConnections.value()) + if (!Engine::getSong()->isSavingProject()) { // Don't save auto assigned midi device connection bool hasAuto = m_hasAutoMidiDev;