Skip to content

Enabled the piano roll and automation editor buttons only when not empty#8285

Open
clemetayer wants to merge 1 commit intoLMMS:masterfrom
clemetayer:empty_song_editor_access_control
Open

Enabled the piano roll and automation editor buttons only when not empty#8285
clemetayer wants to merge 1 commit intoLMMS:masterfrom
clemetayer:empty_song_editor_access_control

Conversation

@clemetayer
Copy link

This PR aims to resolve issue #1132 by enabling the piano roll and automation editor only if they have associated data.

Changes

  • Enable/disable the piano roll and automation editor depending on whether they have associated data

Notes

  • I'm new and don't have much experience with QT/C++, so I kept the dev simple.
    • By the way, I find the documentation good for a newcomer. I was able to quickly start compiling/testing (on Linux Mint).
  • I didn't use a formatter because it made too many changes compared to what I actually changed. Please let me know if I made any formatting mistakes.
  • I thought about only displaying these buttons if they have data, but that tended to result in a weird display and broke the keyboard shortcuts.
  • currentClipChanged from AutomationEditorWindow was not enough to handle all cases. So I also had to integrate currentClipChanged from AutomationEditor.

Questions

  • I'm not sure if accessing automationEditor directly via getGUI()->automationEditor()->m_editor is a good idea. Is there a better way to do this?
  • Should I add tests to my dev or is that overkill?

@Monospace-V
Copy link
Member

#6295 created an empty clip on the first instrument if there were no clips already, but was unfortunately reverted. You might be interested in looking at that pr and its approaches, the follow-up issue and reverting pr, and other possible approaches to the basic problem of a button able to open up an empty box.

@Monospace-V
Copy link
Member

Monospace-V commented Mar 1, 2026

#6295 created an empty clip on the first instrument if there were no clips already, but was unfortunately reverted.

My concern is that your approach, unlike the current approach or #6295, may not indicate to users that there is any possible way to use the piano roll or that it even exists.

@clemetayer
Copy link
Author

The "No valid clip" window can still appear, especially in the same scenario as #8148 (I think this is the revert linked to #6295 you mentionned ?), but it will only appear if you previously had opened at least one clip and kept the window opened somewhere.

However, I do agree that seeing these two buttons disabled by default might be confusing for newcomers. Maybe I should change the tooltip to make it clearer ?

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.

2 participants