diff --git a/c++/carla-native/Makefile b/c++/carla-native/Makefile index d9deab8..a5719aa 100644 --- a/c++/carla-native/Makefile +++ b/c++/carla-native/Makefile @@ -29,6 +29,7 @@ OBJS = \ OBJS += \ distrho-3bandeq.o \ distrho-3bandsplitter.o \ + distrho-pingpongpan.o \ distrho-pugl.o # ZynAddSubFX @@ -56,6 +57,9 @@ distrho-3bandeq.o: distrho-3bandeq.cpp distrho-3bandsplitter.o: distrho-3bandsplitter.cpp $(CXX) -c $< $(BUILD_CXX_FLAGS) -I../distrho-plugin-toolkit -I3bandsplitter -DDISTRHO_NAMESPACE=DISTRHO_3BandSplitter -o $@ +distrho-pingpongpan.o: distrho-pingpongpan.cpp + $(CXX) -c $< $(BUILD_CXX_FLAGS) -I../distrho-plugin-toolkit -Ipingpongpan -DDISTRHO_NAMESPACE=DISTRHO_PingPongPan -o $@ + distrho-pugl.o: distrho-pugl.cpp $(CXX) -c $< $(BUILD_CXX_FLAGS) -I../distrho-plugin-toolkit -o $@ diff --git a/c++/carla-native/carla_native.h b/c++/carla-native/carla_native.h index 1971400..126695a 100644 --- a/c++/carla-native/carla_native.h +++ b/c++/carla-native/carla_native.h @@ -191,6 +191,7 @@ void carla_register_native_plugin_midiSplit(); // DISTRHO plugins void carla_register_native_plugin_3BandEQ(); void carla_register_native_plugin_3BandSplitter(); +void carla_register_native_plugin_PingPongPan(); #ifdef WANT_ZYNADDSUBFX // ZynAddSubFX diff --git a/c++/carla-native/distrho/DistrhoPluginCarla.cpp b/c++/carla-native/distrho/DistrhoPluginCarla.cpp index aa5d627..7469eac 100644 --- a/c++/carla-native/distrho/DistrhoPluginCarla.cpp +++ b/c++/carla-native/distrho/DistrhoPluginCarla.cpp @@ -130,6 +130,12 @@ protected: setFixedSize(width, height); } + void closeEvent(QCloseEvent* event) + { + m_host->ui_closed(m_host->handle); + QDialog::closeEvent(event); + } + private: // Plugin stuff const HostDescriptor* const m_host; diff --git a/c++/carla-plugin/native.cpp b/c++/carla-plugin/native.cpp index d833b30..db8225a 100644 --- a/c++/carla-plugin/native.cpp +++ b/c++/carla-plugin/native.cpp @@ -51,6 +51,7 @@ public: host.write_midi_event = carla_host_write_midi_event; host.ui_parameter_changed = carla_host_ui_parameter_changed; host.ui_custom_data_changed = carla_host_ui_custom_data_changed; + host.ui_closed = carla_host_ui_closed; isProcessing = false; @@ -1481,6 +1482,13 @@ public: setCustomData(CUSTOM_DATA_STRING, key, value, false); } + void handleUiClosed() + { + x_engine->callback(CALLBACK_SHOW_GUI, m_id, 0, 0, 0.0, nullptr); + } + + // ------------------------------------------------------------------- + static uint32_t carla_host_get_buffer_size(HostHandle handle) { CARLA_ASSERT(handle); @@ -1517,6 +1525,12 @@ public: ((NativePlugin*)handle)->handleUiCustomDataChanged(key, value); } + static void carla_host_ui_closed(HostHandle handle) + { + CARLA_ASSERT(handle); + ((NativePlugin*)handle)->handleUiClosed(); + } + // ------------------------------------------------------------------- static size_t getPluginCount() @@ -1552,6 +1566,7 @@ public: carla_register_native_plugin_3BandEQ(); carla_register_native_plugin_3BandSplitter(); + carla_register_native_plugin_PingPongPan(); #ifdef WANT_ZYNADDSUBFX carla_register_native_plugin_zynaddsubfx(); diff --git a/c++/distrho-plugin-toolkit/src/DistrhoUIOpenGLExt.cpp b/c++/distrho-plugin-toolkit/src/DistrhoUIOpenGLExt.cpp index 0c80a2d..703f03c 100644 --- a/c++/distrho-plugin-toolkit/src/DistrhoUIOpenGLExt.cpp +++ b/c++/distrho-plugin-toolkit/src/DistrhoUIOpenGLExt.cpp @@ -1176,7 +1176,7 @@ void OpenGLExtUI::d_onMotion(int x, int y) if (movX != 0) { - int d = (d_uiGetModifiers() & MOD_SHIFT) ? 2000 : 200; + int d = (d_uiGetModifiers() & MODIFIER_SHIFT) ? 2000 : 200; float value = knob->_value + (knob->_max - knob->_min) / d * movX; if (value < knob->_min) @@ -1199,7 +1199,7 @@ void OpenGLExtUI::d_onMotion(int x, int y) if (movY != 0) { - int d = (d_uiGetModifiers() & MOD_SHIFT) ? 2000 : 200; + int d = (d_uiGetModifiers() & MODIFIER_SHIFT) ? 2000 : 200; float value = knob->_value + (knob->_max - knob->_min) / d * movY; if (value < knob->_min)