add [ChannelX],loaded ControlObject#1082
Conversation
Previously, controller mappings and skins had to use track_samples to detect if a deck was loaded. This is not obvious and was often a point of confusion for people new to Mixxx.
| this, SLOT(slotEjectTrack(double)), | ||
| Qt::DirectConnection); | ||
|
|
||
| m_pTrackLoaded = new ControlPushButton(ConfigKey(m_group, "loaded")); |
| // Set play here, to signal the user that the play command is adopted | ||
| m_playButton->set((double)m_bPlayAfterLoading); | ||
| m_pTrackSamples->set(0); // Stop renderer | ||
| m_pTrackLoaded->set(1); |
There was a problem hiding this comment.
It's not loaded at this point -- this signals CachingReader to load the track and see if it's valid.
We should set to zero here, then 1 in slotTrackLoaded (line 519, where we set track_samples).
There was a problem hiding this comment.
Whoops, that's what I meant to do.
| this, SLOT(slotEjectTrack(double)), | ||
| Qt::DirectConnection); | ||
|
|
||
| m_pTrackLoaded = new ControlPushButton(ConfigKey(m_group, "track_loaded")); |
There was a problem hiding this comment.
I think this is not a PushButton just
new ControlObject() fits better
Since this is a read only type, you should use:
connectValueChangeRequest
and setAndConfirm
like here:
There was a problem hiding this comment.
please delete m_pTrackLoaded in the destructor.
(Or lift the whole bunch of COs in this file to std:uniqu_ptr())
| TrackPointer pOldTrack = m_pCurrentTrack; | ||
|
|
||
| m_pause.lock(); | ||
| m_pTrackLoaded->set(1); |
There was a problem hiding this comment.
The user might think that all other track related COs are valid after TrackLoaded is 1.0.
So setting the CO should be the very last action.
| m_dSlipRate = 0; | ||
| // Reset the pitch value for the new track. | ||
| m_pause.unlock(); | ||
| m_pTrackLoaded->setAndConfirm(1); |
There was a problem hiding this comment.
If it's after pause.unlock() then the engine could view these COs in an inconsistent state -- best to stick it above the unlock.
| this, SLOT(slotEjectTrack(double)), | ||
| Qt::DirectConnection); | ||
|
|
||
| m_pTrackLoaded = new ControlObject(ConfigKey(m_group, "track_loaded"), 0, 1); |
There was a problem hiding this comment.
Why dont-ignore-nops (0) and track (1)? (also better to use true/false instead of ints)
There was a problem hiding this comment.
I'm confused. This is read-only, it ignores all writes.
There was a problem hiding this comment.
Right, I'm asking why you're passing values for the 2nd and 3rd args here (2nd arg is ignore-nops, and 3rd arg is to enable tracking). Maybe they're left over from it being a potmeter or something? You can leave off all but the first for a ControlObject.
There was a problem hiding this comment.
Yeah, they're left over from it being a ControlPushButton. I'll remove them.
|
Nice, thanks! |
|
Added to wiki |
Previously, controller mappings and skins had to use track_samples to detect if a deck was loaded. This is not obvious and was often a point of confusion for people new to Mixxx.