Loading...
Searching...
No Matches
score-plugin-js/JS/ApplicationPlugin.hpp
1#pragma once
2#include <score/plugins/application/GUIApplicationPlugin.hpp>
3
4#include <core/application/ApplicationSettings.hpp>
5
6#include <QFileInfo>
7#include <QQmlComponent>
8#include <QQmlContext>
9#include <QQmlEngine>
10
11#include <thread>
12
13namespace ossia::net
14{
15struct network_context;
16using network_context_ptr = std::shared_ptr<network_context>;
17}
18class QQuickWindow;
19namespace JS
20{
22 : public QObject
24{
25public:
27
28 void on_createdDocument(score::Document& doc) override;
29
30 ~ApplicationPlugin() override;
31 void afterStartup() override;
32 void on_newDocument(score::Document& doc) override;
33
34 QQmlEngine m_engine;
35 QQmlEngine m_dummyEngine;
36 QQmlComponent* m_comp{};
37 QQuickWindow* m_window{};
38
39 std::atomic_bool m_processMessages{};
40 std::thread m_asioThread;
41 ossia::net::network_context_ptr m_asioContext;
42};
43}
Definition score-plugin-js/JS/ApplicationPlugin.hpp:24
void afterStartup() override
afterStartup Called after all the documents have been created / loaded
Definition score-plugin-js/JS/ApplicationPlugin.cpp:101
void on_createdDocument(score::Document &doc) override
on_createdDocument Will be called after either on_newDocument or on_loadedDocument was called on ever...
Definition score-plugin-js/JS/ApplicationPlugin.cpp:73
void on_newDocument(score::Document &doc) override
on_newDocument Will be called only when a new, empty document is created; classes inheriting from Ser...
Definition score-plugin-js/JS/ApplicationPlugin.cpp:61
The Document class is the central part of the software.
Definition Document.hpp:51
Used to extend the software with application-wide data.
Definition GUIApplicationPlugin.hpp:89
Specializes ApplicationContext with the QMainWindow.
Definition GUIApplicationContext.hpp:15