-
-
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
passthrough: stop rendering waveforms, disable Cue/Play indicators #4793
Conversation
7c618c6
to
af8f13c
Compare
src/engine/enginebuffer.cpp
Outdated
m_visualPlayPos->setInvalid(); | ||
if (!m_passthroughWasEnabled) { | ||
// Disable CUE and Play indicators | ||
m_pCueControl->resetIndicators(); |
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 we move this block to slotPassthroughChanged() and get rid of m_passthroughWasEnabled?
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 👍
af8f13c
to
f58a2ed
Compare
src/engine/enginebuffer.cpp
Outdated
m_pPassthroughEnabledControl->connectValueChanged(this, | ||
&EngineBuffer::slotPassthroughChanged, | ||
Qt::DirectConnection); | ||
m_passthroughEnabled = false; |
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.
Why false
instead of m_pPassthroughEnabledControl->toBool()
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.
The EngineDeck constructor creates the "passthrough" ControlPushButton and instantiates EngineBuffer, so "passthrough" is still false here.
Anyway, you're right, someone may change it so "passthrough" is initiated true
then this wouldn't match.
src/engine/enginebuffer.h
Outdated
@@ -343,7 +343,8 @@ class EngineBuffer : public EngineObject { | |||
// This ControlProxys is created as parent to this and deleted by | |||
// the Qt object tree. This helps that they are deleted by the creating | |||
// thread, which is required to avoid segfaults. | |||
ControlProxy* m_pPassthroughEnabled; | |||
ControlProxy* m_pPassthroughEnabledControl; | |||
bool m_passthroughEnabled; |
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.
Why store and manage a redundant state instead of simply accessing the current state through m_pPassthroughEnabledControl->toBool()
?
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.
IIRC reading a bool member is faster than querying a control on every call?
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.
If this would be necessary then ControlProxy
should instead store a local copy of the value, but not all using code again and again.
I never understood how all the ControlThing
s are intended to be used safely and correctly.
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.
There is almost no overhead on a 64 bit system, except the function call. On a 32 bit system a ring buffer is used, which causes one indirection when reading and some ring maimtannance when writing.
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.
No overhead, so I drop the bool.
Thank you both for your review. |
f58a2ed
to
1b0fb5e
Compare
fixed, rebased. |
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.
LGTM Thank you.
When loading a track while passthrough is active the waveforms are cleared.
(makes lp:1567645 Waveform gain changes if passthrough is enabled obsolete)
This is only the minimal fix
withoutwith minimal UI changes. The complete solution is in #4794