zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

commit 7d97e859bffe470bdc177dc56f710f9aeae8a68a
parent a89918b1f8018cc1b1e7d067ec62499ed3e2fc94
Author: Johannes Lorenz <[email protected]>
Date:   Sat, 19 Oct 2019 08:50:10 +0200

Implement "/last_dnd::s"

Diffstat:
Msrc/Misc/Master.cpp | 12++++++++++++
Msrc/Misc/Master.h | 6++++++
2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/src/Misc/Master.cpp b/src/Misc/Master.cpp @@ -544,6 +544,18 @@ static const Ports master_ports = { [](const char *, rtosc::RtData &d) {d.reply("/undo_pause", "");}}, {"undo_resume:",rProp(internal) rDoc("resume undo event recording"),0, [](const char *, rtosc::RtData &d) {d.reply("/undo_resume", "");}}, + {"last_dnd::s", rProp(internal) rDoc("Last Drag and Drop OSC path"),0, + rBOIL_BEGIN + if(!strcmp("", args)) { + data.reply(loc, "c", obj->dnd_buffer); + *obj->dnd_buffer = 0; + } else { + assert(!*obj->dnd_buffer); + const char* var = rtosc_argument(msg, 0).s; + printf("receiving /last_dnd %s\n",var); + strncpy(obj->dnd_buffer, var, Master::dnd_buffer_size); + } + rBOIL_END }, {"config/", rNoDefaults rDoc("Top Level Application Configuration Parameters"), &Config::ports, [](const char *, rtosc::RtData &d){d.forward();}}, diff --git a/src/Misc/Master.h b/src/Misc/Master.h @@ -219,6 +219,12 @@ class Master //in units of 10 ms (done s.t. overflow is in 497 days) uint32_t last_beat = 0; uint32_t last_ack = 0; + + //Buffer to contain the OSC path to the last GUI element + //on which a drag and drop operation ended + constexpr static std::size_t dnd_buffer_size = 1024; + char dnd_buffer[dnd_buffer_size] = {0}; + private: std::atomic<bool> run_osc_in_use = { false };