From 72edae5a69a7b42bd1fe71e979b81729e3d159e4 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Thu, 3 Jan 2019 23:55:04 -0500 Subject: [PATCH] Fix Core Note handle, fix AudioIO::toJson when no device --- src/Core/Blank.cpp | 9 ++++----- src/audio.cpp | 3 ++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Core/Blank.cpp b/src/Core/Blank.cpp index 4b8feda2..bdb3bb95 100644 --- a/src/Core/Blank.cpp +++ b/src/Core/Blank.cpp @@ -33,11 +33,10 @@ struct ModuleResizeHandle : virtual Widget { ModuleResizeHandle() { box.size = Vec(RACK_GRID_WIDTH * 1, RACK_GRID_HEIGHT); } - void onHover(const event::Hover &e) override { - // TODO - // if (e.button == 0) { - // e.target = this; - // } + void onButton(const event::Button &e) override { + if (e.button == GLFW_MOUSE_BUTTON_LEFT) { + e.consume(this); + } } void onDragStart(const event::DragStart &e) override { dragX = context()->scene->rackWidget->lastMousePos.x; diff --git a/src/audio.cpp b/src/audio.cpp index ab9e8c17..627b772a 100644 --- a/src/audio.cpp +++ b/src/audio.cpp @@ -323,7 +323,8 @@ json_t *IO::toJson() { json_t *rootJ = json_object(); json_object_set_new(rootJ, "driver", json_integer(driver)); std::string deviceName = getDeviceName(device); - json_object_set_new(rootJ, "deviceName", json_string(deviceName.c_str())); + if (!deviceName.empty()) + json_object_set_new(rootJ, "deviceName", json_string(deviceName.c_str())); json_object_set_new(rootJ, "offset", json_integer(offset)); json_object_set_new(rootJ, "maxChannels", json_integer(maxChannels)); json_object_set_new(rootJ, "sampleRate", json_integer(sampleRate));