Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/wasm remote 2 #1288

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
*.zip
build-*
AppRun*
*.AppImage
*.txz
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@
url = https://github.com/jcelerier/snappy
[submodule "3rdparty/hap"]
path = 3rdparty/hap
url = https://github.com/Vidvox/hap
url = https://github.com/Vidvox/hap
1 change: 1 addition & 0 deletions 3rdparty/qml-remote
Submodule qml-remote added at e4427b
7 changes: 6 additions & 1 deletion src/plugins/score-plugin-remotecontrol/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ set(HDRS
"RemoteControl/DocumentPlugin.hpp"
"i-score-remote/RemoteApplication.hpp"
"score_plugin_remotecontrol.hpp"
"RemoteControl/HttpServer.hpp"
)
set(SRCS
"${CMAKE_CURRENT_SOURCE_DIR}/RemoteControl/Settings/Model.cpp"
Expand All @@ -41,12 +42,16 @@ set(SRCS
"${CMAKE_CURRENT_SOURCE_DIR}/RemoteControl/ApplicationPlugin.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/RemoteControl/DocumentPlugin.cpp"

"${CMAKE_CURRENT_SOURCE_DIR}/RemoteControl/HttpServer.cpp"

"${CMAKE_CURRENT_SOURCE_DIR}/score_plugin_remotecontrol.cpp"
)

#file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/RemoteControl/build-wasm/ DESTINATION ${CMAKE_BINARY_DIR}/src/plugins/score-plugin-remotecontrol/CMakeFiles/score_plugin_remotecontrol.dir/RemoteControl/build-wasm/)

add_library(${PROJECT_NAME} ${SRCS} ${HDRS} ${QRCS})

target_link_libraries(${PROJECT_NAME} PUBLIC score_plugin_scenario score_plugin_js ${QT_PREFIX}::WebSockets)
target_link_libraries(${PROJECT_NAME} PUBLIC score_plugin_scenario score_plugin_js ${QT_PREFIX}::WebSockets ossia)

setup_score_plugin(${PROJECT_NAME})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,27 @@

#include <RemoteControl/ApplicationPlugin.hpp>
#include <RemoteControl/DocumentPlugin.hpp>


namespace RemoteControl
{
ApplicationPlugin::ApplicationPlugin(const score::GUIApplicationContext& app)
: GUIApplicationPlugin{app}
{
}

ApplicationPlugin::~ApplicationPlugin()
{
std::remove((m_server.m_buildWasmPath + "remote.html").c_str());
std::rename((m_server.m_buildWasmPath + "remote.html~").c_str(), (m_server.m_buildWasmPath + "remote.html").c_str());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... what is happening here ?

}

void ApplicationPlugin::on_createdDocument(score::Document& doc)
{
doc.model().addPluginModel(new DocumentPlugin{
doc.context(), &doc.model()});

m_server.start_thread();
}

}
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
#pragma once
#include <score/plugins/application/GUIApplicationPlugin.hpp>

#include <RemoteControl/HttpServer.hpp>
namespace RemoteControl
{
class ApplicationPlugin final : public score::GUIApplicationPlugin
{
public:
ApplicationPlugin(const score::GUIApplicationContext& app);
~ApplicationPlugin();

protected:
void on_createdDocument(score::Document& doc) override;
HttpServer m_server;
};
}
Loading