feat: refactor player proxy and create separated track proxy#14516
Conversation
c89e096 to
227b78f
Compare
dd27b8e to
c8b0b01
Compare
JoergAtGithub
left a comment
There was a problem hiding this comment.
How does this scale with thousands of tracks in a table? How many track proxies would exist in this case?
|
Thank you for your review!
It's working great. The reason for this is that |
ywwg
left a comment
There was a problem hiding this comment.
can you generate a code coverage report for your changes? As part of the new QML world we should aim for very coverage, which will prevent a lot of the UI bugs we get with the current barely-tested XML system.
If we do not have a good testing framework in place, we don't have to make one for this change, but we should start thinking about how to create one.
| &QmlPlayerProxy::loadTrackRequested, | ||
| this, | ||
| [this, group](TrackPointer track, | ||
| #ifdef __STEM__ |
There was a problem hiding this comment.
why are we ifdeffing stems? Can we assume that by the time QML exists, every build will have stems? if so, then I'm ok making stems a prerequisite for building qml. (but not if this would force everyone to have stems turned on)
There was a problem hiding this comment.
QML is already expected to be enabled for controller screens rendering, since 2.6. We could expect that both QML and STEM might be stable enough when we reach 3.0 to remove these two flags tho, but for now they are needed.
There was a problem hiding this comment.
@ywwg Do you agree with keeping these ifdefs for now?
Code coverage is included already (
I have a PR that that adds UI/E2E testing for QML . It is pretty much ready but it didn't pick much traction yet. |
the PR is marked as draft, I generally don't look at PRs that are not ready for review |
|
(but that doesn't really make a difference, I am not qualified to review QML code anyway) |
Swiftb0y
left a comment
There was a problem hiding this comment.
couple more comments, this is looking good
|
|
||
| class QmlPlayerProxy : public QObject { | ||
| Q_OBJECT | ||
| Q_PROPERTY(QmlTrackProxy* currentTrack READ currentTrack NOTIFY trackChanged) |
There was a problem hiding this comment.
should we also add a setter that dispatches to loadTrack directly for symmetry?
There was a problem hiding this comment.
I'm not sure. The rationale for not adding it is that loading a track is a non trivial operation (due to complexity and disruptive side effects it may have), and properties in QML may easily suffer a bug due to property binding. That's why I kept the loadTrack as a method, which you must explicitly call, instead having the risk of that implicit magic side effects
There was a problem hiding this comment.
right, but doesn't the problem still apply when the function is called from for example a signal handler? IMO the QmlProxy needs to make sure to debounce these calls appropriately.
There was a problem hiding this comment.
Yes exactly, the difference is that this requires an explicit call (e.g onSignal => loadTrack(...)) where if you do assignation, it could then auto load a track when the binded property changes. Perhaps we could interate on that? If we realise it makes sense to use the setter, it should be pretty trivial to add.
There was a problem hiding this comment.
Right, but you can also easily bind to onPropertyChanged (for some Property) which would also get fired multiple times. So regardless of whether we have the setter or not, the loadTrack member function needs debouncing. wdyt?
There was a problem hiding this comment.
Right, I think I understood now, so you mean we should for example discard subsequent request to load file if QmlPlayerProxy has already emitted the load signal to the player manager and is waiting for it to proceeded?
If I got it right this time, and since this is an existing limitation, are you happy with me creating a follow issue for this?
There was a problem hiding this comment.
Right, I think I understood now, so you mean we should for example discard subsequent request to load file if QmlPlayerProxy has already emitted the load signal to the player manager and is waiting for it to proceeded?
Yes, exactly.
If I got it right this time, and since this is an existing limitation
Is it? I thought the CO does have some safety checks to avoid this.
There was a problem hiding this comment.
Yes, I meant it is already a problem in QMLPlayerProxy, and I'm only moving the code around here
There was a problem hiding this comment.
Ah, I see. Yeah sure. Lets file an issue and move on.
|
Please squash and resolve merge conflict, then we can merge. |
093a32e to
6504636
Compare
6504636 to
2aeee0a
Compare
This allows QML to interact with a track without depending of the player