Move code related to push-to-remote into a central file

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2022-12-29 12:16:43 +00:00
parent cebb66f290
commit b71acc9f22
No known key found for this signature in database
GPG key ID: CDBAA37ABC74FBA0
15 changed files with 278 additions and 211 deletions

View file

@ -21,13 +21,6 @@
#include <string>
#ifdef HAVE_LIBLO
// # define REMOTE_HOST "localhost"
# define REMOTE_HOST "192.168.51.1"
# define REMOTE_HOST_PORT "2228"
# include "extra/Thread.hpp"
#endif
#ifdef DISTRHO_OS_WASM
# ifdef STATIC_BUILD
# define CARDINAL_WASM_WELCOME_TEMPLATE_FILENAME "welcome-wasm-mini.vcv"
@ -85,21 +78,17 @@ void saveAsDialogUncompressed();
void appendSelectionContextMenu(rack::ui::Menu* menu);
void openBrowser(const std::string& url);
bool connectToRemote();
bool isRemoteConnected();
bool isRemoteAutoDeployed();
void setRemoteAutoDeploy(bool autoDeploy);
void deployToRemote();
void sendScreenshotToRemote(const char* screenshot);
} // namespace patchUtils
// -----------------------------------------------------------------------------------------------------------
#if defined(HAVE_LIBLO) && defined(HEADLESS) && DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
// && defined(HEADLESS)
#if defined(HAVE_LIBLO)
# define CARDINAL_INIT_OSC_THREAD
#endif
typedef void* lo_server_thread;
START_NAMESPACE_DISTRHO
class CardinalBasePlugin;
@ -107,22 +96,16 @@ class CardinalBaseUI;
struct CardinalPluginContext;
struct Initializer
#ifdef CARDINAL_INIT_OSC_THREAD
: public Thread
#endif
{
#ifdef CARDINAL_INIT_OSC_THREAD
lo_server oscServer = nullptr;
CardinalBasePlugin* oscPlugin = nullptr;
lo_server_thread oscServerThread = nullptr;
CardinalBasePlugin* remotePluginInstance = nullptr;
#endif
std::string templatePath;
std::string factoryTemplatePath;
Initializer(const CardinalBasePlugin* plugin, const CardinalBaseUI* ui);
~Initializer();
#ifdef CARDINAL_INIT_OSC_THREAD
void run() override;
#endif
};
#ifndef HEADLESS