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

Lib overview column #79

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

Lib overview column #79

wants to merge 17 commits into from

Conversation

ronso0
Copy link
Owner

@ronso0 ronso0 commented Sep 24, 2024

  • pass signal colors to WaveformOverviewRenderer, get rid of static colors for OverviewDelegate
  • "mono-mixdown", painted bottom -> top
  • normalization / ReplayGain? incl. instant update when Normalize or Visual Gain settings are changed in preferences

TODO

  • cleanup / optimize draw functions in WaveformOverviewRenderer

@ronso0 ronso0 force-pushed the lib-overview-column-ro branch 3 times, most recently from e74b62a to 9394e6f Compare September 25, 2024 19:29
Repository owner deleted a comment from coveralls Sep 25, 2024
@ronso0 ronso0 force-pushed the lib-overview-column-ro branch 2 times, most recently from c372752 to 6469090 Compare September 26, 2024 17:25
Copy link

@ninomp ninomp left a comment

Choose a reason for hiding this comment

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

I left a few minor comments.

Regarding mono overview waveforms, I personally prefer to see the same stereo waveform in both WOverview and OverviewDelegate, but I understand your desire. Maybe we should make this an option in the preferences? However, I think such an option should affect WOverview too, so we would have consistent UI.

src/coreservices.cpp Outdated Show resolved Hide resolved
&Track::waveformSummaryUpdated,
this,
[trackId]() {
OverviewCache::instance()->onTrackSummaryChanged(trackId);
Copy link

Choose a reason for hiding this comment

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

I'm concerned this makes library tightly coupled with UI.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Well, I understand you're only concerned about the place where the connection to OverviewCache is established?
This is just a shortcut, I moved it to CoreServices.

// Create pixmap, GUI thread only
QPixmap pixmap = QPixmap::fromImage(res.image);
if (!pixmap.isNull() && !res.resizedToSize.isEmpty()) {
// we have to be sure that res.cover.hash is unique
Copy link

Choose a reason for hiding this comment

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

This comment needs to be updated (it is still mentioning 'cover').

Copy link
Owner Author

Choose a reason for hiding this comment

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

done

CMakeLists.txt Outdated
src/waveform/renderers/glwaveformrenderbackground.cpp
src/waveform/renderers/glvsynctestrenderer.cpp
src/waveform/renderers/waveformmark.cpp
src/waveform/renderers/waveformmarkrange.cpp
src/waveform/renderers/waveformmarkset.cpp
src/waveform/overviews/waveformoverviewrenderer.cpp
Copy link

Choose a reason for hiding this comment

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

I believe this line needs to be just below the overviewtype.cpp to be in alphabetical order.

Copy link

@ninomp ninomp left a comment

Choose a reason for hiding this comment

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

I just tested this and this works and looks quite good.

LGTM

@ywwg
Copy link

ywwg commented Sep 27, 2024

smoke testing, it works great, fast, looks BEAUTIFUL

image

Comment on lines 45 to 47
// TODO Lock to prevent interferences when this is called repeatedly when
// Normalize or VisualGainAll value are changed in quick succession?
// TODO use QMultihash::key_value_iterator to collect keys and values?
Copy link

Choose a reason for hiding this comment

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

do you want to do this checking / cleanup in this PR?

Copy link
Owner Author

Choose a reason for hiding this comment

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

I'm not sure how to proceed and if that's the best place to react on normalize/visual gain changes.
A locker here would basically ignore the last change notification.
Maybe we should listen to changes in OverviewDelegate and trigger a tracks view update. OverviewCache then reads the normalize/visual gain values, compares with the stored values and, if necessary, clears cached images and re-requests them one by one.

Copy link
Owner Author

Choose a reason for hiding this comment

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

I reworked this slot, please check if that makes sense.

Copy link

@ywwg ywwg Oct 7, 2024

Choose a reason for hiding this comment

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

I regret that I have been promoted past the point of expertise in a lot of areas of the Mixxx codebase 😅 . This is a credit to y'all and the work that you've done to make the codebase better, but it means I'm not very good at reviewing the details any more.

But, traditionally, if a signal can be pinged many times, the signals themselves should be stuffed into a queue of some sort that is processed on a ticker (could be 50ms, this is low priority) and can be deduped.

so:

  • onNormalizeOrVisualGainChanged() -> spam calls into queue (necessary to lock queue, or use threadsafe queue)
  • onticker() { lock queue; dedupe queue without popping; pop 1 item and process it; unlock queue}

You have to protect against queue overload (first-run with 10000 tracks being processed), so I would say only process things that are visible.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Haha...

Thanks for the advice!
This was rather about identical "changed" signals, either from the gain spinbox or the normalize checkbox in the preferences.
So, yeah, a queue/wait/discard mechanism like here mixxxdj@abfcc99 would suffice probably.

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

Successfully merging this pull request may close these issues.

3 participants