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+
6773void 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
8086void PipewireAudioService::reloadLiveprog ()
8187{
82- plugin. get () ->host ()->reloadLiveprog ();
88+ plugin->host ()->reloadLiveprog ();
8389}
8490
8591void 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
116122DspStatus PipewireAudioService::status ()
117123{
118- return plugin. get () ->status ();
124+ return plugin->status ();
119125}
120126
121127#include < iostream>
122128void 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 {
0 commit comments