Skip to content

Allow export of only the selected notes#7991

Merged
michaelgregorius merged 2 commits intoLMMS:masterfrom
michaelgregorius:7985-ExportOnlySelectedNotesFromPianoRoll
Jul 6, 2025
Merged

Allow export of only the selected notes#7991
michaelgregorius merged 2 commits intoLMMS:masterfrom
michaelgregorius:7985-ExportOnlySelectedNotesFromPianoRoll

Conversation

@michaelgregorius
Copy link
Contributor

@michaelgregorius michaelgregorius commented Jul 5, 2025

User can now choose if they only want to export the selected notes when exporting a MIDI clip as an xpt or xptz file in the piano roll.

The export dialog now has a check box which lets users choose to only export the selected notes:

Image

Technical details

Add the new public method exportToXML to MidiClip. Compared to saveSettings it has an additional parameter onlySelectedNotes which controls which notes are exported. The default is to export all notes. The method saveSettings now simply delegates to exportToXML using the default.

PianoRollWindow::exportMidiClip now adds a check box to the export dialog which lets users select if they only want to export the selected notes or all notes. The default is to export all notes. The method now uses the new method exportToXML for the export and passes the state of the check box into the method.

User can now choose if they only want to export the selected notes when
exporting a MIDI clip as an `xpt` or `xptz` file in the piano roll.

## Technical details
Add the new public method `exportToXML` to `MidiClip`. Compared to
`saveSettings` it has an additional parameter `onlySelectedNotes` which
controls which notes are exported. The default is to export all notes.
The method `saveSettings` now simply delegates to `exportToXML` using the
default.

`PianoRollWindow::exportMidiClip` now adds a check box to the export
dialog which lets users select if they only want to export the selected
notes or all notes. The default is to export all notes. The method now
uses the new method `exportToXML` for the export and passes the state of
the check box into the method.
Copy link
Member

@regulus79 regulus79 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks fine. I tested it a bit, and it seems to work as expected.

Change the text from "Only selected notes" to "Export only selected notes" so that it becomes clearer what the checkbox affects/controls.
@michaelgregorius
Copy link
Contributor Author

With commit 7251627 I have changed the checkbox text from "Only selected notes" to "Export only selected notes" so that it becomes clearer what the checkbox affects/controls. Otherwise nothing has changed.

@michaelgregorius michaelgregorius merged commit 5c7131a into LMMS:master Jul 6, 2025
11 checks passed
@michaelgregorius michaelgregorius deleted the 7985-ExportOnlySelectedNotesFromPianoRoll branch July 6, 2025 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Export only selected notes as xml instead of exporting all notes, regardless if selected or not.

2 participants