Skip to content

feat: improve screen rendering framework#13737

Merged
Swiftb0y merged 2 commits intomixxxdj:mainfrom
acolombier:feat/improve-screen-rendering-framework
Oct 27, 2024
Merged

feat: improve screen rendering framework#13737
Swiftb0y merged 2 commits intomixxxdj:mainfrom
acolombier:feat/improve-screen-rendering-framework

Conversation

@acolombier
Copy link
Copy Markdown
Member

This is a refactor largely inspired from the work in #13459 to simplify the hook system used for screen rendering.

Comment thread src/controllers/controller.h Outdated
Comment thread src/test/controllerscriptenginelegacy_test.cpp Outdated
Comment thread src/controllers/scripting/legacy/controllerscriptenginelegacy.cpp Outdated
Comment thread src/qml/qmlmixxxcontroller.h
Comment thread src/qml/qmlmixxxcontroller.h Outdated
@acolombier acolombier mentioned this pull request Oct 16, 2024
4 tasks
@acolombier acolombier force-pushed the feat/improve-screen-rendering-framework branch from c6fd897 to 99fed94 Compare October 17, 2024 00:33
Copy link
Copy Markdown
Member

@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.

only remaining complaint from me tbh

Comment thread src/controllers/scripting/legacy/controllerscriptenginelegacy.h Outdated
@acolombier acolombier force-pushed the feat/improve-screen-rendering-framework branch from f114197 to 9b2aafa Compare October 20, 2024 00:28
Comment thread src/test/controllerscriptenginelegacy_test.cpp Outdated
Comment thread src/controllers/scripting/legacy/controllerscriptenginelegacy.cpp Outdated
Comment on lines +61 to +63
#ifdef MIXXX_USE_QML
m_rootItems.clear();
#endif
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

does it work without the explicit .clear()? Ideally RAII would take care of this fully by itself.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It will probably work, but I preferred to make it explicit so if something was to crash when deallocating the screen, it still happens as part of the test hooks

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

makes sense. It was more of a general question whether this would be needed in production code.

}

return rootItem;
return std::unique_ptr<mixxx::qml::QmlMixxxControllerScreen>(rootItem);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think in order to truly benefit from resource safety here, the unique_ptr wrapping needs to be done on the return value of qmlComponent.createWithInitialProperties (directly in the same statement) (potentially after a qobject_cast). I don't want to force you to do it, but I don't have the time right now. If you're up for it, feel free to do it now and if not, remind me on sunday and I will file a PR against your branch.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I did try to give this a go but could not get around doing the dynamic_cast for the unique_ptr. Are you happy to address that as a follow up PR? I know you are busy lately, so I wouldn't want to add too much to your todolist, but also keen to close that PR ASAP to move forward with S4 Mk3 if we want it to hit the 2.6 deadline.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yeah I'm just worried about forgetting about it. But you're right, lets postpone for now.

Copy link
Copy Markdown
Member

@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.

LGTM. Thank you for the cleanup. Please rebase.

@acolombier acolombier force-pushed the feat/improve-screen-rendering-framework branch from c192b8a to 533cedb Compare October 21, 2024 22:46
@acolombier
Copy link
Copy Markdown
Member Author

Merge?

@Swiftb0y
Copy link
Copy Markdown
Member

yup, sorry. I've been busy until now.

@Swiftb0y Swiftb0y merged commit 701a6ec into mixxxdj:main Oct 27, 2024
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.

2 participants