Use F7 key as "deploy to MOD" action, make it visible on file menu
Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
parent
a16c43f094
commit
28e0295a4a
5 changed files with 43 additions and 20 deletions
|
@ -37,12 +37,17 @@
|
|||
#include <string.hpp>
|
||||
#include <system.hpp>
|
||||
#include <app/Scene.hpp>
|
||||
#include <engine/Engine.hpp>
|
||||
#include <window/Window.hpp>
|
||||
|
||||
#ifdef NDEBUG
|
||||
# undef DEBUG
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIBLO
|
||||
# include <lo/lo.h>
|
||||
#endif
|
||||
|
||||
// for finding home dir
|
||||
#ifndef ARCH_WIN
|
||||
# include <pwd.h>
|
||||
|
@ -204,6 +209,27 @@ void saveAsDialog()
|
|||
#endif
|
||||
}
|
||||
|
||||
void deployToMOD()
|
||||
{
|
||||
#ifdef HAVE_LIBLO
|
||||
const lo_address addr = lo_address_new_with_proto(LO_UDP, REMOTE_HOST, REMOTE_HOST_PORT);
|
||||
DISTRHO_SAFE_ASSERT_RETURN(addr != nullptr,);
|
||||
|
||||
APP->engine->prepareSave();
|
||||
APP->patch->saveAutosave();
|
||||
APP->patch->cleanAutosave();
|
||||
std::vector<uint8_t> data(rack::system::archiveDirectory(APP->patch->autosavePath, 1));
|
||||
|
||||
if (const lo_blob blob = lo_blob_new(data.size(), data.data()))
|
||||
{
|
||||
lo_send(addr, "/load", "b", blob);
|
||||
lo_blob_free(blob);
|
||||
}
|
||||
|
||||
lo_address_free(addr);
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void async_dialog_filebrowser(const bool saving,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue