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

Cue context menu for scrolling waveform #2783

Merged
merged 22 commits into from
May 16, 2020

Conversation

hacksdump
Copy link
Contributor

@hacksdump hacksdump commented May 12, 2020

Adds context menu to hot cues on the scrolling waveform just like WOverview. Right-click on the label to invoke the context menu.

TODOs:

  • Disallow opening context menu when a track is playing.

  • Open context menu when right-clicking in the vicinity of marker line.

  • Highlight cue mark on hover.

@Be-ing Be-ing changed the base branch from master to 2.3 May 12, 2020 22:38
@Be-ing Be-ing added this to the 2.3.0 milestone May 12, 2020
@uklotzde
Copy link
Contributor

uklotzde commented May 12, 2020

Please rebase and retarget on master. The commit history contains unrelated commits.

@Be-ing Should this really be added to 2.3?

@hacksdump
Copy link
Contributor Author

Should I rebase to mixxxdj:2.3 or master?

@uklotzde
Copy link
Contributor

@hacksdump Not sure. I just saw the unrelated commits and then later noticed that @Be-ing retargeted the PR to 2.3 which might have caused them.

Since this is a new "feature" master would be more appropriate imo.

@daschuer daschuer changed the base branch from 2.3 to master May 13, 2020 00:04
@daschuer
Copy link
Member

Yes, new feature=master. I have changed the target branch.

@Be-ing
Copy link
Contributor

Be-ing commented May 13, 2020

This was already planned to go to 2.3 before cutting the 2.3 branch.

@daschuer
Copy link
Member

We need to get used to the new dead line based release strategy.
"Only one last feature" was the source of the delay of 2.3.

2.2 was release 11 Jan 2019. If we would have stopped to add features to 2.3, it would have been release in Juli 2019. Now we would have had released 2.4, a 2.5 beta and we where considering shiny new features for 2.6.

@Be-ing
Copy link
Contributor

Be-ing commented May 13, 2020

I think we should have a discussion about why 2.3 took so long. But this PR is not the place for that.

@uklotzde
Copy link
Contributor

Try to rebase onto 2.3. If this works without conflicts we could decide after the review if it is safe to merge into 2.3.

src/waveform/renderers/waveformwidgetrenderer.cpp Outdated Show resolved Hide resolved
src/waveform/renderers/waveformwidgetrenderer.cpp Outdated Show resolved Hide resolved
src/waveform/renderers/waveformwidgetrenderer.h Outdated Show resolved Hide resolved
src/waveform/waveformmarklabel.h Outdated Show resolved Hide resolved
src/widget/wcuemenupopup.h Outdated Show resolved Hide resolved
src/widget/wwaveformviewer.cpp Outdated Show resolved Hide resolved
@hacksdump hacksdump marked this pull request as ready for review May 13, 2020 23:20
@hacksdump hacksdump changed the title [WIP] Cue context menu for scrolling waveform Cue context menu for scrolling waveform May 14, 2020
@Be-ing
Copy link
Contributor

Be-ing commented May 15, 2020

Good work! The color change when hovering the mark is a nice detail that makes this feature easier to discover. There are a few minor ways to make the code a little easier to understand. We can use the same general approach to add right click menus for beats, downbeats, phrases, and section markers. Hopefully we can reuse some of this code too.

@uklotzde
Copy link
Contributor

Code is almost ready, only some minor comments. This feature would be a nice addition for 2.3 to complete the cue improvements and extensions. Let's keep 2.3 as the target.

@uklotzde
Copy link
Contributor

wwaveformviewer.h seems to be missing an #include directive? The SCons builds fail.

@hacksdump
Copy link
Contributor Author

We can use the same general approach to add right click menus for beats, downbeats, phrases, and section markers. Hopefully we can reuse some of this code too.

This functionality to find if a point lies in/near a cue marker, beat, downbeat, phrase marker will be quite common. Can this be abstracted to a new parent class?
For this PR, I was thinking of moving this functionality to WaveformMark so that it can be commonly used by WOverview and WaveformWidgetRenderer. Suggestions?

@Be-ing
Copy link
Contributor

Be-ing commented May 15, 2020

For this PR, I was thinking of moving this functionality to WaveformMark so that it can be commonly used by WOverview and WaveformWidgetRenderer. Suggestions?

Seems like a good idea to me.

@uklotzde
Copy link
Contributor

i.e. git rebase --onto 2.3 8b9cfed18cec1ad57c880a056a75bc1bde3969c4^

@Holzhaus
Copy link
Member

Or <hash>~1 which also works on windows.

@hacksdump hacksdump force-pushed the scrolling-waveform-cue-context-menu branch from 22b1915 to c8e7506 Compare May 15, 2020 20:55
@hacksdump
Copy link
Contributor Author

Thanks. I just deleted other commits. Would have been easier to just rebase to my first commit. Fixed the scons build as well. Let's wait for CI builds.

@uklotzde
Copy link
Contributor

Or <hash>~1 which also works on windows.

Of course, both ^ and ~1 are equivalent.

@uklotzde
Copy link
Contributor

Works, nice feature 👍

@Be-ing
Copy link
Contributor

Be-ing commented May 15, 2020

There is a merge conflict since #2663 was merged. Fix that and also please use the new utility function introduced in that PR for showing CueMenuPopup in the scrolling waveform.

@uklotzde
Copy link
Contributor

I have merged #2663. A minor merge conflict needs to be resolved and we could use mixxx::widgethelper::mapPopupToScreen() for this new popup menu.

@uklotzde
Copy link
Contributor

Race condition while commenting on this PR ;)

@hacksdump
Copy link
Contributor Author

we could use mixxx::widgethelper::mapPopupToScreen() for this new popup menu.

Writing this explicitly for every child of QMenu seems cumbersome. Every menu needs to be within mixxx boundaries.
I was thinking something along the lines of creating a new QMenu derivative which redefines the popup function and then using this class instead of QMenu to create our menus.

For this PR, I will just change WWaveformViewer in similar manner to WOverview.

Comment on lines 86 to 92
m_pCueMenuPopup->popup(event->globalPos());
QPoint cueMenuTopLeft = mixxx::widgethelper::mapPopupToScreen(
windowHandle()->screen()->size(),
event->globalPos(),
m_pCueMenuPopup->size());
m_pCueMenuPopup->popup(cueMenuTopLeft);
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need to bother going back and changing this commit, but for the future please make merge commits the bare minimum required to resolve conflicts and get it to build and run, then add new changes in following commits.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got that. Shouldn't have combined it into the merge resolution commit. Will keep that in mind.

@uklotzde
Copy link
Contributor

Pre-commit warnings are unrelated. LGTM.

Do we agree to merge this into 2.3?

@uklotzde
Copy link
Contributor

Great. Thank you for contributing these UX improvements, Harshit! Working on this PR was a pleasure and also a constructive collaboration among everyone involved.

@uklotzde uklotzde merged commit a440c5a into mixxxdj:2.3 May 16, 2020
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.

5 participants