I'm porting over a C++/Qt application from Windows. On Windows, the program runs as a service. It's discouraged from programs running as a service to also interact with the user and display GUI elements.
Therefore, my program has two parts. The first part runs as a service daemon and plays audio in the background. The program starts up when the computer starts up. The second program, which starts up when any user logs in (Via Start Menu->All Users->Startup), communicates via local socket with the service daemon to display a GUI pop-up when the audio is playing.
Moving over to MacOS, what is the best practice to utilize the same program?
Should I merge both programs into one and run it as root via launchd and have the one daemon display GUI as well as play audio?
Or should I rather keep it as two programs like it is now - root daemon playing audio and find a way that the second program can automatically execute when each user logs in?