Skip to content

Feature/wasm remote 2#1288

Closed
Toine-ddt wants to merge 20 commits into
ossia:masterfrom
Toine-ddt:feature/wasm-remote2
Closed

Feature/wasm remote 2#1288
Toine-ddt wants to merge 20 commits into
ossia:masterfrom
Toine-ddt:feature/wasm-remote2

Conversation

@Toine-ddt

Copy link
Copy Markdown

No description provided.

Comment thread .gitmodules Outdated
url = https://github.com/Vidvox/hap
[submodule "3rdparty/qml-remote"]
path = 3rdparty/qml-remote
url = https://github.com/ossia/qml-remote.git

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

let's remove that part, we don't want this as a submodule

"RemoteControl/DocumentPlugin.hpp"
"i-score-remote/RemoteApplication.hpp"
"score_plugin_remotecontrol.hpp"
"RemoteControl/Http_server.hpp"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you name that file HttpServer in line with the rest of score ?

"${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/)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we won't need that: the remote's .wasm file is not supposed to be built as part of score but in a different repo which will be in the package manager


protected:
void on_createdDocument(score::Document& doc) override;
Http_server m_server;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

HttpServer

{
auto const address2 = net::ip::make_address("0.0.0.0");
auto const port = static_cast<unsigned short>(std::atoi("8080"));
auto const m_docRoot = std::make_shared<std::string>("./src/plugins/score-plugin-remotecontrol/CMakeFiles/score_plugin_remotecontrol.dir/RemoteControl/build-wasm/");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this line only works on the build computer.
instead we have to look for it in the user library which is where it will be installed on the user's computer:

#include <Library/LibrarySettings.hpp>
#include <score/application/ApplicationContext.hpp>

QString chemin_vers_dossier_packages = score::AppContext().settings<Library::Settings::Model>().getPackagesPath();

auto const port = static_cast<unsigned short>(std::atoi("8080"));
auto const m_docRoot = std::make_shared<std::string>("./src/plugins/score-plugin-remotecontrol/CMakeFiles/score_plugin_remotecontrol.dir/RemoteControl/build-wasm/");
// auto const m_docRoot = std::make_shared<std::string>("./src/plugins/score-plugin-remotecontrol/CMakeFiles/score_plugin_remotecontrol.dir/RemoteControl/build-wasm/");
std::string packagesPath = score::AppContext().settings<Library::Settings::Model>().getPackagesPath().toUtf8().constData();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

getPackagesPath().toStdString() :-)

auto const m_docRoot = std::make_shared<std::string>("./src/plugins/score-plugin-remotecontrol/CMakeFiles/score_plugin_remotecontrol.dir/RemoteControl/build-wasm/");
// auto const m_docRoot = std::make_shared<std::string>("./src/plugins/score-plugin-remotecontrol/CMakeFiles/score_plugin_remotecontrol.dir/RemoteControl/build-wasm/");
std::string packagesPath = score::AppContext().settings<Library::Settings::Model>().getPackagesPath().toUtf8().constData();
QDebug << "packagesPath :" << packagesPath;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No need for the QDebug anymore (.. does that compile ? it's supposed to be qDebug())

auto const address2 = net::ip::make_address("0.0.0.0");
auto const port = static_cast<unsigned short>(std::atoi("8080"));
auto const m_docRoot = std::make_shared<std::string>("./src/plugins/score-plugin-remotecontrol/CMakeFiles/score_plugin_remotecontrol.dir/RemoteControl/build-wasm/");
// auto const m_docRoot = std::make_shared<std::string>("./src/plugins/score-plugin-remotecontrol/CMakeFiles/score_plugin_remotecontrol.dir/RemoteControl/build-wasm/");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the comment can go


std::thread m_serverThread;
int m_listenSocket{};
std::string buildWasmPath;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

m_ prefix for members

@Toine-ddt

Copy link
Copy Markdown
Author

done @jcelerier

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
Copy Markdown
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 ?

@jcelerier

Copy link
Copy Markdown
Member

superseded by #2104

@jcelerier jcelerier closed this Jul 9, 2026
@jcelerier

Copy link
Copy Markdown
Member

(@thibaudk were all my comments here taken into account ? )

@thibaudk

thibaudk commented Jul 9, 2026

Copy link
Copy Markdown
Member

(@thibaudk were all my comments here taken into account ? )

In the process of

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants