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

single waveformwidget class for all allshader waveform widget types #2

Conversation

m0dB
Copy link

@m0dB m0dB commented May 21, 2024

Use a single allshader::WaveformWidget class for all the allshader Waveform widget types.

Note how I automatically deal with adding the slip renderer layers.

I also did some cleanup in WaveformWidgetFactory, some related with / required by this change to use a single allshader::WaveformWidget. I also introduced a struct WaveformWidgetVars, to be used instead of having to add multiple static functions (static bool useGL, etc), but I only use this for the allshader::WaveformWidget for now.

Copy link

@Swiftb0y Swiftb0y left a comment

Choose a reason for hiding this comment

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

small syntax nitpick, rest is good enough. Thank you.

Comment on lines +165 to +171
WaveformWidgetVars WaveformWidget::vars() {
WaveformWidgetVars result;
result.m_useGL = true;
result.m_useGLES = true;
result.m_useGLSL = true;
result.m_category = WaveformWidgetCategory::AllShader;
return result;
Copy link

@Swiftb0y Swiftb0y May 22, 2024

Choose a reason for hiding this comment

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

Suggested change
WaveformWidgetVars WaveformWidget::vars() {
WaveformWidgetVars result;
result.m_useGL = true;
result.m_useGLES = true;
result.m_useGLSL = true;
result.m_category = WaveformWidgetCategory::AllShader;
return result;
WaveformWidgetVars WaveformWidget::defaultVars() {
return { .m_useGL = true,
.m_useGLES = true,
.m_useGLSL = true,
.m_category = WaveformWidgetCategory::AllShader
};

Comment on lines +235 to +237
void addHandle(
QHash<WaveformWidgetType::Type, QList<WaveformWidgetBackend>>&
collectedHandles,

Choose a reason for hiding this comment

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

I don't like the out-parameter here, but we can clean that up some time else.

Copy link
Author

Choose a reason for hiding this comment

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

I agree, I was thinking to put all this in a class with the QHash as a member. I'll add a TODO so we don't forget about it.

Copy link
Owner

Choose a reason for hiding this comment

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

Just referencing mixxxdj/mixxx#13245 for tracking

@ywwg
Copy link

ywwg commented May 22, 2024

@acolombier up to you to review / merge :)

@m0dB
Copy link
Author

m0dB commented May 22, 2024

@acolombier I think you can merge this already. I will create a follow-up PR with the suggestions from @Swiftb0y when I have a moment.

acolombier
acolombier approved these changes May 22, 2024
@acolombier acolombier merged commit 5c3551d into acolombier:feat/simplify-waveform-combobox May 22, 2024
1 check passed
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.

4 participants