Skip to content

Commit 40dfd5c

Browse files
committed
Fix include issue
1 parent a119219 commit 40dfd5c

3 files changed

Lines changed: 19 additions & 14 deletions

File tree

src/audio/pipewire/PipewireAudioService.cpp

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include <glibmm.h>
22

33
#include "PipewireAudioService.h"
4+
#include "PwJamesDspPlugin.h"
45

56
#include "PwPipelineManager.h"
67
#include "DspHost.h"
@@ -16,10 +17,10 @@ PipewireAudioService::PipewireAudioService()
1617

1718
mgr = std::make_unique<PwPipelineManager>();
1819
appMgr = std::make_unique<PwAppManager>(mgr.get());
19-
plugin = std::make_unique<PwJamesDspPlugin>(mgr.get());
20-
effects = std::make_unique<FilterContainer>(mgr.get(), plugin.get(), &AppConfig::instance());
20+
plugin = new PwJamesDspPlugin(mgr.get());
21+
effects = std::make_unique<FilterContainer>(mgr.get(), plugin, &AppConfig::instance());
2122

22-
plugin.get()->setMessageHandler([this](DspHost::Message msg, std::any value){
23+
plugin->setMessageHandler([this](DspHost::Message msg, std::any value){
2324
switch(msg)
2425
{
2526
case DspHost::EelCompilerResult: {
@@ -64,28 +65,33 @@ PipewireAudioService::PipewireAudioService()
6465
});
6566
}
6667

68+
PipewireAudioService::~PipewireAudioService()
69+
{
70+
delete plugin;
71+
}
72+
6773
void PipewireAudioService::update(DspConfig *config)
6874
{
69-
auto* ptr = plugin.get()->host();
75+
auto* ptr = plugin->host();
7076

7177
if(ptr == nullptr)
7278
{
7379
util::error("PipewireAudioService::update: PwJamesDspPlugin is NULL. Cannot update configuration.");
7480
return;
7581
}
7682

77-
plugin.get()->host()->update(config);
83+
plugin->host()->update(config);
7884
}
7985

8086
void PipewireAudioService::reloadLiveprog()
8187
{
82-
plugin.get()->host()->reloadLiveprog();
88+
plugin->host()->reloadLiveprog();
8389
}
8490

8591
void PipewireAudioService::reloadService()
8692
{
8793
effects.get()->disconnect_filters();
88-
plugin.get()->host()->updateFromCache();
94+
plugin->host()->updateFromCache();
8995
effects.get()->connect_filters();
9096
}
9197

@@ -115,15 +121,15 @@ std::vector<IOutputDevice> PipewireAudioService::sinkDevices()
115121

116122
DspStatus PipewireAudioService::status()
117123
{
118-
return plugin.get()->status();
124+
return plugin->status();
119125
}
120126

121127
#include <iostream>
122128
void PipewireAudioService::enumerateLiveprogVariables()
123129
{
124130

125131
// TODO
126-
auto vars = plugin.get()->host()->enumEelVariables();
132+
auto vars = plugin->host()->enumEelVariables();
127133

128134
for(const auto& var : vars)
129135
{

src/audio/pipewire/PipewireAudioService.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@
55
#include "FilterContainer.h"
66
#include "PwAppManager.h"
77
#include "IAudioService.h"
8-
#include "config/AppConfig.h"
98

10-
#include "PwJamesDspPlugin.h"
119
#include "IOutputDevice.h"
1210

1311
#include <memory>
1412
#include <QObject>
1513

16-
class PwAudioProcessingThread;
14+
class PwJamesDspPlugin;
1715

1816
class PipewireAudioService : public IAudioService
1917
{
@@ -22,6 +20,7 @@ class PipewireAudioService : public IAudioService
2220

2321
public:
2422
PipewireAudioService();
23+
~PipewireAudioService();
2524

2625
public slots:
2726
void update(DspConfig* config) override;
@@ -40,7 +39,7 @@ public slots:
4039
std::unique_ptr<PwPipelineManager> mgr;
4140
std::unique_ptr<PwAppManager> appMgr;
4241
std::unique_ptr<FilterContainer> effects;
43-
std::unique_ptr<PwJamesDspPlugin> plugin;
42+
PwJamesDspPlugin* plugin;
4443

4544
};
4645

src/audio/pipewire/PwJamesDspPlugin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class PwJamesDspPlugin : public PwPluginBase, public IDspElement {
2727

2828
DspStatus status() override;
2929

30-
JamesDSPLib* dsp;
30+
JamesDSPLib* dsp;
3131
};
3232

3333
#endif

0 commit comments

Comments
 (0)