11#include " core/atkaudio/atkaudio.h"
22
33#include < atkaudio/AudioProcessorGraphMT/RealtimeThreadPool.h>
4+ #include < atkaudio/Logging.h>
45#include < atkaudio/LookAndFeel.h>
56#include < atkaudio/ModuleInfrastructure/AudioServer/AudioServer.h>
67#include < atkaudio/ModuleInfrastructure/MidiServer/MidiServer.h>
@@ -54,10 +55,12 @@ juce::File atk::getSettingsFile(const juce::String& name)
5455
5556bool atk::create ()
5657{
58+ atk::logging::info (" LIFECYCLE" , " atk::create begin" );
59+
5760 auto & lifecycle = atk::ObsJucePluginFormatLifecycle::getInstance ();
5861 if (!lifecycle.initialize ())
5962 {
60- DBG ( " create: failed to initialize OBS JUCE format lifecycle" );
63+ atk::logging::error ( " LIFECYCLE " , " atk::create failed to initialize OBS JUCE lifecycle" );
6164 return false ;
6265 }
6366
@@ -83,6 +86,8 @@ bool atk::create()
8386 if (auto * threadPool = atk::RealtimeThreadPool::getInstance ())
8487 threadPool->initialize ();
8588
89+ atk::logging::info (" LIFECYCLE" , " atk::create completed" );
90+
8691 return true ;
8792}
8893
@@ -96,10 +101,12 @@ bool atk::startMessagePump(QObject* qtParent)
96101 auto & lifecycle = atk::ObsJucePluginFormatLifecycle::getInstance ();
97102 if (!lifecycle.startMessagePump (qtParent))
98103 {
99- DBG ( " startMessagePump: failed to start OBS JUCE format message pump " );
104+ atk::logging::error ( " LIFECYCLE " , " atk::startMessagePump failed" );
100105 return false ;
101106 }
102107
108+ atk::logging::info (" LIFECYCLE" , " atk::startMessagePump completed" );
109+
103110 return true ;
104111}
105112
@@ -115,6 +122,8 @@ bool atk::isShuttingDown()
115122
116123void atk::destroy ()
117124{
125+ atk::logging::info (" LIFECYCLE" , " atk::destroy begin" );
126+
118127 auto & lifecycle = atk::ObsJucePluginFormatLifecycle::getInstance ();
119128
120129 if (auto * midiServer = atk::MidiServer::getInstance ())
@@ -136,6 +145,8 @@ void atk::destroy()
136145 }
137146
138147 lifecycle.shutdown ();
148+
149+ atk::logging::info (" LIFECYCLE" , " atk::destroy completed" );
139150}
140151
141152void atk::update ()
@@ -156,7 +167,7 @@ void* atk::getQtMainWindowHandle()
156167 QWidget* mainQWidget = (QWidget*)obs_frontend_get_main_window ();
157168 if (!mainQWidget)
158169 {
159- DBG ( " getQtMainWindowHandle: obs_frontend_get_main_window() returned null" );
170+ atk::logging::warning ( " UI " , " getQtMainWindowHandle: obs_frontend_get_main_window returned null" );
160171 return nullptr ;
161172 }
162173
@@ -174,12 +185,11 @@ void* atk::getQtMainWindowHandle()
174185 if (nativeHandle)
175186 {
176187 g_qtMainWindowHandle = nativeHandle;
177- DBG (" getQtMainWindowHandle: Extracted native handle on first access" );
178- DBG (" Native handle: " + juce::String::toHexString ((juce::pointer_sized_int)nativeHandle));
188+ atk::logging::debug (" UI" , " getQtMainWindowHandle: extracted native handle" );
179189 }
180190 else
181191 {
182- DBG ( " getQtMainWindowHandle: Failed to extract native handle" );
192+ atk::logging::warning ( " UI " , " getQtMainWindowHandle: failed to extract native handle" );
183193 }
184194
185195 // Apply OBS theme colors to JUCE
@@ -191,7 +201,7 @@ void* atk::getQtMainWindowHandle()
191201 auto fgColour = juce::Colour (fgColor.red (), fgColor.green (), fgColor.blue ());
192202 atk::LookAndFeel::applyColorsToInstance (bgColour, fgColour);
193203
194- DBG ( " getQtMainWindowHandle: Applied OBS theme colors" );
204+ atk::logging::debug ( " UI " , " getQtMainWindowHandle: applied OBS theme colors" );
195205#endif
196206 }
197207
@@ -216,5 +226,5 @@ void atk::applyColors(uint8_t bgR, uint8_t bgG, uint8_t bgB, uint8_t fgR, uint8_
216226
217227void atk::logMessage (const juce::String& message)
218228{
219- DBG ( message);
229+ atk::logging::info ( " ATK " , message);
220230}
0 commit comments