Skip to content

Commit f3de5f0

Browse files
committed
refactor: replace FIREqualizer with MultimodalEqualizer
1 parent ce09dd1 commit f3de5f0

File tree

5 files changed

+32
-13
lines changed

5 files changed

+32
-13
lines changed

src/MainWindow.ui

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
<item>
7575
<widget class="QStackedWidget" name="tabhost">
7676
<property name="currentIndex">
77-
<number>0</number>
77+
<number>3</number>
7878
</property>
7979
<widget class="QWidget" name="tabHostPage1">
8080
<layout class="QVBoxLayout" name="verticalLayout_6">
@@ -1257,12 +1257,32 @@
12571257
</property>
12581258
<item>
12591259
<property name="text">
1260-
<string>Minimum phase</string>
1260+
<string>FIR Minimum phase</string>
12611261
</property>
12621262
</item>
12631263
<item>
12641264
<property name="text">
1265-
<string>Linear phase</string>
1265+
<string>IIR 4 order</string>
1266+
</property>
1267+
</item>
1268+
<item>
1269+
<property name="text">
1270+
<string>IIR 6 order</string>
1271+
</property>
1272+
</item>
1273+
<item>
1274+
<property name="text">
1275+
<string>IIR 8 order</string>
1276+
</property>
1277+
</item>
1278+
<item>
1279+
<property name="text">
1280+
<string>IIR 10 order</string>
1281+
</property>
1282+
</item>
1283+
<item>
1284+
<property name="text">
1285+
<string>IIR 12 order</string>
12661286
</property>
12671287
</item>
12681288
</widget>

src/audio/base/DspHost.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ void DspHost::updateFirEqualizer(DspConfig *config)
144144
param[i] = (double)std::stod(v[i]);
145145
}
146146

147-
// TODO FIREqualizerAxisInterpolation(cast(this->_dsp), interpolationMode, filterType, param, param + 15);
147+
MultimodalEqualizerAxisInterpolation(cast(this->_dsp), interpolationMode, filterType, param, param + 15);
148148
}
149149

150150
void DspHost::updateVdc(DspConfig *config)
@@ -593,10 +593,10 @@ bool DspHost::update(DspConfig *config, bool ignoreCache)
593593
}
594594
break;
595595
case DspConfig::tone_enable:
596-
/*if(current.toBool())
597-
FIREqualizerEnable(cast(this->_dsp));
596+
if(current.toBool())
597+
MultimodalEqualizerDisable(cast(this->_dsp));
598598
else
599-
FIREqualizerDisable(cast(this->_dsp));*/ //TODO
599+
MultimodalEqualizerEnable(cast(this->_dsp), 1);
600600
break;
601601
case DspConfig::tone_eq:
602602
case DspConfig::tone_filtertype:

src/audio/pipewire/PipewireAudioService.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@ PipewireAudioService::PipewireAudioService()
1616

1717
mgr = std::make_unique<PwPipelineManager>();
1818
appMgr = std::make_unique<PwAppManager>(mgr.get());
19-
plugin = new PwJamesDspPlugin(mgr.get());
19+
plugin = new PwJamesDspPlugin(mgr.get(), this);
2020
effects = std::make_unique<FilterContainer>(mgr.get(), plugin, &AppConfig::instance());
2121

22-
plugin->setMessageHandler(std::bind(&IAudioService::handleMessage, this, std::placeholders::_1, std::placeholders::_2));
23-
2422
mgr.get()->new_default_sink_name.connect([=](const std::string& name) {
2523
util::debug("new default output device: " + name);
2624

src/audio/pipewire/PwJamesDspPlugin.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ void receivePrintfStdout(const char* msg, void* userdata) {
1212
}
1313
}
1414

15-
PwJamesDspPlugin::PwJamesDspPlugin(PwPipelineManager* pipe_manager)
15+
PwJamesDspPlugin::PwJamesDspPlugin(PwPipelineManager* pipe_manager, IAudioService* parent_service)
1616
: PwPluginBase("@PwJamesDspPlugin: ", "JamesDsp", pipe_manager)
1717
{
18+
setMessageHandler(std::bind(&IAudioService::handleMessage, parent_service, std::placeholders::_1, std::placeholders::_2));
1819
setPrintfStdOutHandler(receivePrintfStdout, this);
1920

2021
this->dsp = (JamesDSPLib*) malloc(sizeof(JamesDSPLib));

src/audio/pipewire/PwJamesDspPlugin.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33

44
#include "PwBasePlugin.h"
55
#include "IDspElement.h"
6+
#include "IAudioService.h"
67

78
extern "C" {
89
#include "jdsp_header.h"
910
}
1011

11-
1212
class PwJamesDspPlugin : public PwPluginBase, public IDspElement {
1313
public:
14-
PwJamesDspPlugin(PwPipelineManager* pipe_manager);
14+
PwJamesDspPlugin(PwPipelineManager* pipe_manager, IAudioService* parent_service);
1515
PwJamesDspPlugin(const PwJamesDspPlugin&) = delete;
1616
auto operator=(const PwJamesDspPlugin&) -> PwJamesDspPlugin& = delete;
1717
PwJamesDspPlugin(const PwJamesDspPlugin&&) = delete;

0 commit comments

Comments
 (0)