Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
audio_engine_application.h
1// SPDX-FileCopyrightText: © 2024 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#include <csignal>
5
6#include <QCoreApplication>
7#include <QLocalServer>
8#include <QLocalSocket>
9
10#include "engine-process/ipc_message.h"
11#include "juce_wrapper.h"
12
13using namespace Qt::StringLiterals;
14
15namespace zrythm::engine
16{
17class AudioEngineJuceApplicationWrapper : public juce::JUCEApplicationBase
18{
19};
20
21class AudioEngineApplication : public juce::JUCEApplication
22{
23public:
24 AudioEngineApplication ();
25 ~AudioEngineApplication () override;
26
27 void initialise (const juce::String &command_line) override;
28 void shutdown () override { }
29 const juce::String getApplicationName () override { return "ZrythmEngine"; }
30 const juce::String getApplicationVersion () override { return "1.0"; }
31 bool moreThanOneInstanceAllowed () override { return false; }
32 void anotherInstanceStarted (const juce::String &commandLine) override { }
33 void systemRequestedQuit () override { }
34 void suspended () override { }
35 void resumed () override { }
36 void unhandledException (
37 const std::exception *,
38 const juce::String &sourceFilename,
39 int lineNumber) override
40 {
41 }
42
43 static bool is_audio_engine_process ()
44 {
45 return qApp->applicationName () == u"ZrythmEngine"_s;
46 }
47
48private:
49 void setup_ipc ();
50
51 void post_exec_initialization ();
52
53#if 0
54private Q_SLOTS:
55 void onNewConnection ();
56 void onDataReceived ();
57#endif
58
59private:
60 std::unique_ptr<backward::SignalHandling> signal_handling_;
61 QLocalServer * server_ = nullptr;
62 QLocalSocket * client_connection_ = nullptr;
63 std::unique_ptr<QCoreApplication> qt_app_;
64};
65}