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

New context menu automation items #7317

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

szeli1
Copy link
Contributor

@szeli1 szeli1 commented Jun 13, 2024

closes #3112

This PR adds new context menu options for automatableModels to improve the automation workflow.

These options are the following:

  • "add automation node" - adds an automation node with the model's value to a clip at the song playback position. If there is no clip connected to the model, a new track will be added with a clip that is automatically connected to the model.
  • "add automation node to new clip" - first, but it adds a new clip if possible before adding an automation node.
  • "update closest automation node" - replaces the value of the closest node to the playback position.
  • "remove closest automation node" - deletes the closest node to the playback position.

In my view these options will make the automation system faster to use.

Copy link
Contributor

@Rossmaxx Rossmaxx left a comment

Choose a reason for hiding this comment

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

I see quite a few beginner mistakes here. Pointed out those. Nothing major, just bad practices. Also look into the codefactor blank line one.

include/AutomatableModel.h Outdated Show resolved Hide resolved
src/gui/AutomatableModelView.cpp Outdated Show resolved Hide resolved
src/gui/AutomatableModelView.cpp Outdated Show resolved Hide resolved
@szeli1 szeli1 requested a review from Rossmaxx June 13, 2024 17:11
Copy link
Contributor

@Rossmaxx Rossmaxx left a comment

Choose a reason for hiding this comment

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

Do you need that else there?

include/AutomatableModel.h Outdated Show resolved Hide resolved
@Rossmaxx
Copy link
Contributor

There's lots more nesting going on. I am a bit tired to nitpick everything

@szeli1
Copy link
Contributor Author

szeli1 commented Jun 13, 2024

There's lots more nesting going on. I am a bit tired to nitpick everything

Feel free to nitpick. I'm open to learn new things.

@szeli1 szeli1 requested review from Rossmaxx and messmerd June 13, 2024 19:08
Copy link
Contributor

@Veratil Veratil left a comment

Choose a reason for hiding this comment

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

First pass of changes that should be made.
EDIT: Looks like my page didn't refresh with the latest commits for some reason. Not sure why. 🤔

src/gui/AutomatableModelView.cpp Outdated Show resolved Hide resolved
src/gui/AutomatableModelView.cpp Outdated Show resolved Hide resolved
src/gui/AutomatableModelView.cpp Outdated Show resolved Hide resolved
src/gui/AutomatableModelView.cpp Outdated Show resolved Hide resolved
src/gui/AutomatableModelView.cpp Outdated Show resolved Hide resolved
src/gui/AutomatableModelView.cpp Outdated Show resolved Hide resolved
src/gui/AutomatableModelView.cpp Outdated Show resolved Hide resolved
src/gui/AutomatableModelView.cpp Outdated Show resolved Hide resolved
src/gui/AutomatableModelView.cpp Outdated Show resolved Hide resolved
src/gui/AutomatableModelView.cpp Outdated Show resolved Hide resolved
@szeli1
Copy link
Contributor Author

szeli1 commented Jun 13, 2024

EDIT: Looks like my page didn't refresh with the latest commits for some reason. Not sure why. 🤔

Because I pushed the changes right before when you completed your review.

@szeli1 szeli1 requested a review from Veratil June 13, 2024 19:34
Copy link
Contributor

@Rossmaxx Rossmaxx left a comment

Choose a reason for hiding this comment

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

More nitpicks.

include/AutomatableModelView.h Outdated Show resolved Hide resolved
include/AutomatableModelView.h Show resolved Hide resolved
src/gui/AutomatableModelView.cpp Outdated Show resolved Hide resolved
src/gui/AutomatableModelView.cpp Show resolved Hide resolved
src/gui/AutomatableModelView.cpp Outdated Show resolved Hide resolved
{
// getting nearest node
// in the clip that starts before this
for (auto it = clipBefore->getTimeMap().begin(); it != clipBefore->getTimeMap().end(); ++it)
Copy link
Contributor

Choose a reason for hiding this comment

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

Range based loop here.

Copy link
Contributor Author

@szeli1 szeli1 Jun 21, 2024

Choose a reason for hiding this comment

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

This loop can not be replaced, because it would be a pointer to a typename Tnode instead of a key.
Qt provides a key() function that finds a key for a given T, but that is not optimized.

Qt documentation:

This function can be slow linear time, because QMap's internal data structure is optimized for fast lookup by key, not by value.

@szeli1 szeli1 requested a review from Rossmaxx June 21, 2024 19:27
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.

Knob Context Menu: New Automation Track
4 participants