-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
WTrackMenu: Add menu entry for (re)analyzing tracks #4806
Conversation
Thank you for working on this feature! I think it makes sense to squash the two commits, why have a commit with a noop menu action. |
The reanalyze action automatically clears the beatgrid and adds the selected tracks to the analysis queue.
631d1b8
to
9f14d5c
Compare
Done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for starting to on work on this feature!
Adding a new top-level entry to the already crowded context menu would not be my first choice. Ideas how to restructure the menu are welcome. I don't have any.
src/widget/wtrackmenu.cpp
Outdated
@@ -2140,6 +2168,12 @@ bool WTrackMenu::featureIsEnabled(Feature flag) const { | |||
TrackModel::Capability::RemoveCrate); | |||
case Feature::Metadata: | |||
return m_pTrackModel->hasCapabilities(TrackModel::Capability::EditMetadata); | |||
case Feature::Reanalyze: | |||
// TODO: Do we actually need the EditMetadata capability here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When analyzing tracks their metadata needs to be updated for storing the results. Clearing the beat grid beforehand doesn't really matter imho.
TrackModel::Capability::Analyze
should already imply TrackModel::Capability::EditMetadata
. These capability flags are inconsistent and overlapping in their meaning. Everyone just extended it to keep it working. Unrelated, has to be resolved separately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clearing the beat grid beforehand doesn't really matter imho.
Yes, it does. Otherwise the beats where not reanalyzed inmy tests.
void WTrackMenu::addToAnalysis() { | ||
const TrackIdList trackIds = getTrackIds(); | ||
if (trackIds.empty()) { | ||
qWarning() << "No tracks selected for analysis"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably use qInfo() for all these kind of log messages. I am aware that you simply copied it from existing code.
I think there are different use cases for (re-)analyzing which require different reset actions:
Could the different use cases be served with dialog incl. checkboxes for required reset actions? Even with "Remeber choices for this session" checkbox?
I agree Analyze is not really "urgent" enough to be a top-level action. Could anything go wrong when trying to reset beats? Beats could be locked for some of many selected tracks.. then re-analysis would be pointless (the result irritating/unexpected) without UI feedback. I'm aware my proposals require quite some work to test / implement 😬 |
While I agree that the menu is pretty crowded, burying analysis in a submenu IMO negates the convenience that this patch is intended to bring to a certain degree. I'd actually argue that Analysis would make sense as a new top-level menu, given that analysis is a pretty prominent action a user takes on his tracks (and rather underrepresented in the UI currently). Additionally, there are several 'flavors' of analysis that a user might want to perform on-the-fly, that could fit into a top-level analysis menu:
The latter two points would be out-of-scope for this PR, but planning ahead would make sense IMO. |
The first two already justify having an Analyze menu (not Analyze action + Analyze menu) instead of the dialog + checkbox I proposed. |
Is re-analyzing because of messed up beat grid the most common use case? If not I can think of manual reset the desired properties first. On the other hand all other features are pretty much read only and can be re-analyzed without a risk. The use case of reanalyze after editing the track sound itself is special, because it is probably desired to move the waveform along with cue points and beat-grid. This is not a core topic for this PR. So for now I vote for this solution:
The next step would be to verify the offset, before Re-Analyze a new beat-grid, else the waveform and cue point will not match the nevw beatgrid. Later we may add:
|
I would like to keep per-track constant/variable analysis out of this PR, since that seems to be quite a bit more complex to implement. Also I wouldn't do anything super fancy either in this PR, to keep the scope manageable, perhaps just an Analysis menu with two entries
And everything else could be determined in the future? |
That sounds reasonable In this case it would be:
|
...for consistency, since it doesn't include the EditMetadata capability either.
This not just adds the tracks to the queue, it also starts the analyze, which is the main part of the use case. What about this:
Than we can change it later to:
|
I think calling it 'BPM' would be a bit misleading since it would analyze all other (missing) properties too. The mental model behind 'Add to Queue' is that the analyzer is already running (similar to dragging tracks into the 'analyzer' in the sidebar which to me is a queueing operation). Since that might not match the technical side of things, I agree that we probably want a better name. |
Maybe my proposed alternative is not the best. How will your proposal look like if we add the const / non const thing? Your proposal would be translated like this:
IMHO the queue thing sounds like exposing an implementation detail to me. I can also think of moving the BPM part to the Adjust BPM menu
|
Hm, I agree that the German translation is quite verbose, but would still prefer to keep analysis-related things in a single menu. What do you think about:
adding
or similar in the future? By the way, this got me thinking whether resetting the key (only on "Reanalyze") might be useful too (in case it was manually changed)? |
That works for me as well. I would keep the key out of this game for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tank you. |
In an effort to make analysis more convenient, this branch adds a new submenu to the
WTrackMenu
for analyzing tracks (previously the user had to drag-n-drop the tracks to the analyzer queue in the sidebar):Feel free to comment and make suggestions, this is my first actual code contribution to Mixxx so I am not super familiar with the codebase yet. :)