Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions include/Song.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,12 @@ class LMMS_EXPORT Song : public TrackContainer
constexpr static auto PlayModeCount = static_cast<std::size_t>(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);
}
};
Expand Down
1 change: 0 additions & 1 deletion include/VersionedSaveDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class SaveOptionsWidget : public QWidget {
SaveOptionsWidget(Song::SaveOptions &saveOptions);

private:
LedCheckBox *m_discardMIDIConnectionsCheckbox;
LedCheckBox *m_saveAsProjectBundleCheckbox;
};

Expand Down
9 changes: 3 additions & 6 deletions src/core/AutomatableModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
5 changes: 0 additions & 5 deletions src/gui/modals/VersionedSaveDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions src/tracks/InstrumentTrack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down