-
-
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
isAudible() #3772
isAudible() #3772
Changes from 1 commit
b49cd3e
ddc1664
4f7f9f7
92dcf85
bd64b26
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,6 +105,8 @@ class EngineMaster : public QObject, public AudioSource { | |
return m_pEngineSideChain; | ||
} | ||
|
||
CSAMPLE_GAIN getMasterGain(int channelIndex); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. const |
||
|
||
struct ChannelInfo { | ||
ChannelInfo(int index) | ||
: m_pChannel(NULL), | ||
|
@@ -123,7 +125,7 @@ class EngineMaster : public QObject, public AudioSource { | |
}; | ||
|
||
struct GainCache { | ||
CSAMPLE m_gain; | ||
CSAMPLE_GAIN m_gain; | ||
bool m_fadeout; | ||
}; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
#include "engine/controls/bpmcontrol.h" | ||
#include "engine/controls/ratecontrol.h" | ||
#include "engine/enginebuffer.h" | ||
#include "engine/enginemaster.h" | ||
#include "moc_synccontrol.cpp" | ||
#include "track/track.h" | ||
#include "util/assert.h" | ||
|
@@ -171,6 +172,11 @@ bool SyncControl::isPlaying() const { | |
return m_pPlayButton->toBool(); | ||
} | ||
|
||
bool SyncControl::isAudible() const { | ||
qDebug() << "isAudible" << m_audible << getGroup(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove this debug log |
||
return m_audible; | ||
} | ||
|
||
double SyncControl::adjustSyncBeatDistance(double beatDistance) const { | ||
// Similar to adjusting the target beat distance, when we report our beat | ||
// distance we need to adjust it by the master bpm adjustment factor. If | ||
|
@@ -353,7 +359,7 @@ void SyncControl::trackBeatsUpdated(mixxx::BeatsPointer pBeats) { | |
} | ||
|
||
void SyncControl::slotControlPlay(double play) { | ||
m_pEngineSync->notifyPlaying(this, play > 0.0); | ||
m_pEngineSync->notifyPlaying(this, play > 0.0 && m_audible); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This changes the semantics SyncControll::isPlaying() and is inconsistent. |
||
} | ||
|
||
void SyncControl::slotVinylControlChanged(double enabled) { | ||
|
@@ -438,6 +444,18 @@ void SyncControl::setLocalBpm(double local_bpm) { | |
} | ||
} | ||
|
||
void SyncControl::updateAudible() { | ||
int channelIndex = m_pChannel->getChannelIndex(); | ||
if (channelIndex >= 0) { | ||
CSAMPLE_GAIN gain = getEngineMaster()->getMasterGain(channelIndex); | ||
bool newAudible = gain > CSAMPLE_GAIN_ZERO ? true : false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Overly complicated. Remove the ternary operator. |
||
if (m_audible != newAudible) { | ||
m_audible = newAudible; | ||
m_pEngineSync->notifyPlaying(this, m_pPlayButton->toBool() && m_audible); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here semantic change that causes an inconsistency. Audible, Playing or a mixture of both? |
||
} | ||
} | ||
} | ||
|
||
void SyncControl::slotRateChanged() { | ||
double bpm = m_pLocalBpm ? m_pLocalBpm->get() * m_pRateRatio->get() : 0.0; | ||
if (kLogger.traceEnabled()) { | ||
|
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.
Checking the lower bound first is more common