Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automation scroll limited by song editor #5254

Closed
tecknixia opened this issue Oct 19, 2019 · 6 comments · Fixed by #5469
Closed

Automation scroll limited by song editor #5254

tecknixia opened this issue Oct 19, 2019 · 6 comments · Fixed by #5469

Comments

@tecknixia
Copy link
Contributor

tecknixia commented Oct 19, 2019

If you create a one block segment for an automation track in the song editor, then open and edit that segment. Then you zoom out along the x axis, draw a long pattern, then zoom back in... you are prevented from scrolling to the right to see the rest of the pattern you drew.

It seems that the range of view along the x axis is determined by the length of the segment in the song editor.

The left side of the window seems to always stop at the 2nd measure, and the right side depends on the amount of zoom. In the song editor, if you change the size of the segment to take up 4 blocks, then in Automation Editor, the scroll will stop at the 5th measure. So, you can still edit beyond the range of the segment, but the left side of the window won't go past the end of the segment's range.

automationScrollIssue

May possibly affect:
#4804
#4563

@tecknixia
Copy link
Contributor Author

Also, the same problem with "select all".

When select mode is updated and re-enabled, Ctrl+A only selects the amount shown in the song editor, instead of selecting everything.

automationSelectAll

@Veratil
Copy link
Contributor

Veratil commented Oct 25, 2019

Looks like the updateLength function isn't called (properly?) unless it's a HiddenAutomationTrack.

diff --git a/src/core/AutomationPattern.cpp b/src/core/AutomationPattern.cpp
index e36838d80..b740f6a19 100644
--- a/src/core/AutomationPattern.cpp
+++ b/src/core/AutomationPattern.cpp
@@ -225,10 +225,10 @@ MidiTime AutomationPattern::putValue( const MidiTime & time,
 
        // we need to maximize our length in case we're part of a hidden
        // automation track as the user can't resize this pattern
-       if( getTrack() && getTrack()->type() == Track::HiddenAutomationTrack )
-       {
+       // if( getTrack() && getTrack()->type() == Track::HiddenAutomationTrack )
+       // {
                updateLength();
-       }
+       // }
 
        emit dataChanged();
 

I played around and did this change above and it looks like it solved the general issue of not being able to scroll further (it updates the length and you can watch it grow in the Song Editor, too). Although upon connecting a new object since it has a single point the length becomes near 0, so that's probably something that needs to be addressed otherwise.

@tecknixia
Copy link
Contributor Author

tecknixia commented Oct 31, 2019

Which would be better, completely removing the if statement or using if (getTrack())?

Also, should probably do this in both putValue() and removeValue().

I also noticed, as long as there are no notes drawn in the Piano Roll, the segment in the song editor is dark. It would be nice to have the Automation Editor work the same way.

@Veratil
Copy link
Contributor

Veratil commented Oct 31, 2019

I believe completely removing the if would be best as long as it's not needed anymore.

Yes this should be in both put and remove.

Should be a change to a paintEvent most likely.

@PhysSong
Copy link
Member

@Veratil Could you revive this abandoned issue by opening a pull request?

@Veratil
Copy link
Contributor

Veratil commented Apr 26, 2020

@Veratil Could you revive this abandoned issue by opening a pull request?

Sure, it's been a while since I looked at that section of the code, so I'll double check things. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants