-
-
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
introduce CoreServices to decouple backend from QWidgets #3446
Conversation
// Create effect backends. We do this after creating EngineMaster to allow | ||
// effect backends to refer to controls that are produced by the engine. | ||
BuiltInBackend* pBuiltInBackend = new BuiltInBackend(m_pEffectsManager.get()); | ||
m_pEffectsManager->addEffectsBackend(pBuiltInBackend); | ||
#ifdef __LILV__ | ||
m_pLV2Backend = new LV2Backend(m_pEffectsManager.get()); | ||
// EffectsManager takes ownership | ||
m_pEffectsManager->addEffectsBackend(m_pLV2Backend); | ||
#else | ||
m_pLV2Backend = nullptr; | ||
#endif |
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.
Note that this mess is cleaned up in #2618
54a95da
to
f90e4ec
Compare
@@ -1489,15 +932,19 @@ void MixxxMainWindow::rebootMixxxView() { | |||
} | |||
|
|||
bool MixxxMainWindow::loadConfiguredSkin() { | |||
// TODO: use std::shared_ptr throughout skin widgets instead of these hacky get() calls |
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.
This would require changes in tons of files throughout the GUI code. Let's leave it for another PR.
Please review and merge quickly. This changes lots of files and will develop merge conflicts quickly. |
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.
How about using typedefs for all thosee pointer types instead of scattering std::shared_ptr everywhere in the code?
Thank you for taking over! I agree that we should reduce the changes in this initial step to a bar minimum. Just split the classes and hand out managed pointers. |
I'm not really a fan of this pattern. If the number of characters in the type name are a concern, I'd rather use |
8141956
to
b1bb003
Compare
Ok, I also don't have a strong opinion about this. |
6875322
to
528053c
Compare
528053c
to
af3c656
Compare
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.
Some comments.
#include "preferences/dlgpreferencepage.h" | ||
#include "preferences/settingsmanager.h" | ||
#include "preferences/usersettings.h" |
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.
Forward declaration of
class DlgPrefController;
below is not used.
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.
Please don't ask me to change code I did not touch. I am keeping this PR as small as possible to get it merged ASAP.
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.
OK. I don't mind. But it is only a matter of removing a line.
src/mixxx.cpp
Outdated
|
||
for (int i = 0; i < kAuxiliaryCount; ++i) { | ||
m_pPlayerManager->addAuxiliary(); | ||
for (const auto& group : m_pCoreServices->getPlayerManager()->getVisualPlayerGroups()) { |
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 at least assert if these rows of pointers is not null.
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.
I don't understand what you mean. This is a QStringList that is being iterated.
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.
Can you replace auto
with QString
to make that obvious?
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.
Good Idea.
I meant original:
DEBUG_ASSERT(m_pCoreServices && m_pCoreServices->getPlayerManager())
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.
Please don't suggest to combine multiple asserts with Ok, maybe a special case here. Still not recommended.&&
. Use separate statements instead.
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.
okay
6fee01f
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.
Asserting that m_pCoreServices isn't null would be pointless. The application would have crashed before that if it was.
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.
Yes, so the assert can be placed at the very beginning of the function.
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.
That seems superfluous, but okay, done:
2b1eb59
I don't know how to deal with this clazy error:
Neither |
I remember that Jan introduced temporary variables for these cases. |
CI passed. Merge? |
LGTM |
Thanks everyone for being quick with this review so it actually got merged without building up tons of conflicts. |
Another bug appeared: Tool tips are now enabled on every restart. Anyone else experiences that? |
std::shared_ptr<RecordingManager> getRecordingManager() const { | ||
return m_pRecordingManager; | ||
} | ||
|
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.
I think it needs #ifdef __BROADCAST__
with -DBROADCAST=off:
In file included from /var/tmp/portage/media-sound/mixxx-9999/work/mixxx-9999/src/mixxx.h:8,
from /var/tmp/portage/media-sound/mixxx-9999/work/mixxx-9999/src/mixxx.cpp:1:
/var/tmp/portage/media-sound/mixxx-9999/work/mixxx-9999/src/coreservices.h: In member function ‘std::shared_ptr mixxx::CoreServices::getBroadcastManager() const’:
/var/tmp/portage/media-sound/mixxx-9999/work/mixxx-9999/src/coreservices.h:64:16: error: ‘m_pBroadcastManager’ was not declared in this scope; did you mean ‘getBroadcastManager’?
64 | return m_pBroadcastManager;
| ^~~~~~~~~~~~~~~~~~~
| getBroadcastManager
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.
Yes. Right, I will take care.
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.
It looks like this PR is the source of a bunch of regressions, is there a plan to fix them? |
What are they? |
tooltips visibility & vinyl lead-in time not saved, a few skin COs not available for controllers |
The settings restoration is currently done in the preferences dialog. This was dropped accidentally with the introduction of coreservices in mixxxdj#3446. Strictly speaking it would be cleaner to not rely on a temporary widget here. For now this enures modplug tracker files can be loaded and play correctly after application startup.
The settings restoration is currently done in the preferences dialog. This was dropped accidentally with the introduction of coreservices in mixxxdj#3446. Strictly speaking it would be cleaner to not rely on a temporary widget here. For now this enures modplug tracker files can be loaded and play correctly after application startup.
The settings restoration is currently done in the preferences dialog. This was dropped accidentally with the introduction of coreservices in mixxxdj#3446. Strictly speaking it would be cleaner to not rely on a temporary widget here. For now this enures modplug tracker files can be loaded and play correctly after application startup.
introduce CoreServices to decouple backend from QWidgets
This is a prerequisite for using a QQuickWindow (or QOpenGLWindow) as Mixxx's GUI.
Inspired by #941.
TODO: