Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/preferences/dialog/dlgprefwaveform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ DlgPrefWaveform::DlgPrefWaveform(
&QCheckBox::clicked,
this,
&DlgPrefWaveform::slotSetWaveformOptionHighDetail);
connect(visualizeEqGainCheckBox,
&QCheckBox::clicked,
this,
&DlgPrefWaveform::slotSetVisualizeEq);
connect(defaultZoomComboBox,
QOverload<int>::of(&QComboBox::currentIndexChanged),
this,
Expand Down Expand Up @@ -280,6 +284,10 @@ void DlgPrefWaveform::slotUpdate() {
updateEnableUntilMark();
updateWaveformGeneralOptionsEnabled();

bool visualizeEqGain = m_pConfig->getValue(
ConfigKey("[Waveform]", "visualize_eq_gain"), true);
visualizeEqGainCheckBox->setChecked(visualizeEqGain);

frameRateSpinBox->setValue(factory->getFrameRate());
frameRateSlider->setValue(factory->getFrameRate());
endOfTrackWarningTimeSpinBox->setValue(factory->getEndOfTrackWarningTime());
Expand Down Expand Up @@ -618,6 +626,10 @@ void DlgPrefWaveform::slotSetNormalizeOverview(bool normalize) {
updateWaveformGainEnabled();
}

void DlgPrefWaveform::slotSetVisualizeEq(bool checked) {
WaveformWidgetFactory::instance()->setVisualizeEqGain(checked);
}

void DlgPrefWaveform::slotSetOverviewMinuteMarkers(bool draw) {
m_pConfig->setValue(ConfigKey("[Waveform]", "draw_overview_minute_markers"), draw);
m_pOverviewMinuteMarkersControl->forceSet(draw);
Expand Down
1 change: 1 addition & 0 deletions src/preferences/dialog/dlgprefwaveform.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class DlgPrefWaveform : public DlgPreferencePage, public Ui::DlgPrefWaveformDlg
slotSetWaveformOptions(allshader::WaveformRendererSignalBase::Option::HighDetail, checked);
}
#endif
void slotSetVisualizeEq(bool checked);
void slotSetWaveformOverviewType();
void slotSetDefaultZoom(int index);
void slotSetZoomSynchronization(bool checked);
Expand Down
9 changes: 8 additions & 1 deletion src/preferences/dialog/dlgprefwaveformdlg.ui
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,14 @@ Select from different types of displays for the waveform, which differ primarily
<string>High details</string>
</property>
</widget>
</item>
</item>
<item>
<widget class="QCheckBox" name="visualizeEqGainCheckBox">
<property name="text">
<string>Visualize EQ Gain</string>
</property>
</widget>
</item>
</layout>
</item>

Expand Down
13 changes: 12 additions & 1 deletion src/waveform/renderers/waveformrenderersignalbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,13 @@ void WaveformRendererSignalBase::setup(const QDomNode& node,
setHighVisualGain(highGain);
});

connect(pWaveformFactory,
&WaveformWidgetFactory::visualizeEqGainChanged,
this,
[this](bool value) { m_visualizeEqGain = value; });

m_visualizeEqGain = pWaveformFactory->visualizeEqGain();

setAllChannelVisualGain(pWaveformFactory->getVisualGain(BandIndex::AllBand));
setLowVisualGain(pWaveformFactory->getVisualGain(BandIndex::Low));
setMidVisualGain(pWaveformFactory->getVisualGain(BandIndex::Mid));
Expand All @@ -183,7 +190,11 @@ void WaveformRendererSignalBase::getGains(float* pAllGain,
CSAMPLE_GAIN lowVisualGain = 1.0, midVisualGain = 1.0, highVisualGain = 1.0;

// Only adjust low/mid/high gains if EQs are enabled.
if (m_pEQEnabled && m_pEQEnabled->get() > 0.0) {
if (!m_visualizeEqGain) {
lowVisualGain = m_lowVisualGain;
midVisualGain = m_midVisualGain;
highVisualGain = m_highVisualGain;
} else if (m_pEQEnabled && m_pEQEnabled->get() > 0.0) {
if (m_pLowFilterControlObject &&
m_pMidFilterControlObject &&
m_pHighFilterControlObject) {
Expand Down
2 changes: 2 additions & 0 deletions src/waveform/renderers/waveformrenderersignalbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ class WaveformRendererSignalBase : public QObject, public WaveformRendererAbstra
CSAMPLE_GAIN m_midVisualGain;
CSAMPLE_GAIN m_highVisualGain;

bool m_visualizeEqGain;

float m_axesColor_r, m_axesColor_g, m_axesColor_b, m_axesColor_a;
float m_signalColor_r, m_signalColor_g, m_signalColor_b;
float m_signalColor_h, m_signalColor_s, m_signalColor_v;
Expand Down
11 changes: 11 additions & 0 deletions src/waveform/waveformwidgetfactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,10 @@ bool WaveformWidgetFactory::setConfig(UserSettingsPointer config) {
bool zoomSync = m_config->getValue(ConfigKey("[Waveform]", "ZoomSynchronization"), m_zoomSync);
setZoomSync(zoomSync);

bool visualizeEqGain = m_config->getValue(
ConfigKey("[Waveform]", "visualize_eq_gain"), m_visualizeEqGain);
setVisualizeEqGain(visualizeEqGain);

int beatGridAlpha = m_config->getValue(ConfigKey("[Waveform]", "beatGridAlpha"), m_beatGridAlpha);
setDisplayBeatGridAlpha(beatGridAlpha);

Expand Down Expand Up @@ -664,6 +668,13 @@ void WaveformWidgetFactory::setZoomSync(bool sync) {
}
}

void WaveformWidgetFactory::setVisualizeEqGain(bool value) {
m_visualizeEqGain = value;
m_config->setValue(ConfigKey("[Waveform]", "visualize_eq_gain"), value);

emit visualizeEqGainChanged(value);
}

void WaveformWidgetFactory::setDisplayBeatGridAlpha(int alpha) {
m_beatGridAlpha = alpha;
if (m_waveformWidgetHolders.size() == 0) {
Expand Down
7 changes: 7 additions & 0 deletions src/waveform/waveformwidgetfactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ class WaveformWidgetFactory : public QObject,
void setZoomSync(bool sync);
int isZoomSync() const { return m_zoomSync;}

bool visualizeEqGain() const {
return m_visualizeEqGain;
};
void setVisualizeEqGain(bool value);

void setDisplayBeatGridAlpha(int alpha);
int getBeatGridAlpha() const { return m_beatGridAlpha; }

Expand Down Expand Up @@ -225,6 +230,7 @@ class WaveformWidgetFactory : public QObject,

void overviewNormalizeChanged();
void visualGainChanged(double allChannelGain, double lowGain, double midGain, double highGain);
void visualizeEqGainChanged(bool value);

void untilMarkShowBeatsChanged(bool value);
void untilMarkShowTimeChanged(bool value);
Expand Down Expand Up @@ -283,6 +289,7 @@ class WaveformWidgetFactory : public QObject,
int m_endOfTrackWarningTime;
double m_defaultZoom;
bool m_zoomSync;
bool m_visualizeEqGain;
double m_visualGain[BandCount];
bool m_overviewNormalized;

Expand Down