From 7adabd8745bc52e3f5030dc49d1698d26a4c18db Mon Sep 17 00:00:00 2001 From: falkTX Date: Mon, 29 Apr 2013 04:24:46 +0100 Subject: [PATCH] Auto-change plugin UI window title, when possible --- source/backend/plugin/Lv2Plugin.cpp | 8 +++++++- source/backend/plugin/NativePlugin.cpp | 2 ++ source/backend/plugin/VstPlugin.cpp | 8 +++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/source/backend/plugin/Lv2Plugin.cpp b/source/backend/plugin/Lv2Plugin.cpp index d0d49a20f..d632ff93a 100644 --- a/source/backend/plugin/Lv2Plugin.cpp +++ b/source/backend/plugin/Lv2Plugin.cpp @@ -925,7 +925,13 @@ public: // ------------------------------------------------------------------- // Set data (internal stuff) - // nothing + void setName(const char* const newName) override + { + CarlaPlugin::setName(newName); + + if (kData->gui != nullptr) + kData->gui->setWindowTitle(QString("%1 (GUI)").arg((const char*)fName)); + } // ------------------------------------------------------------------- // Set data (plugin-specific stuff) diff --git a/source/backend/plugin/NativePlugin.cpp b/source/backend/plugin/NativePlugin.cpp index a33906c2e..ad0b2378b 100644 --- a/source/backend/plugin/NativePlugin.cpp +++ b/source/backend/plugin/NativePlugin.cpp @@ -501,6 +501,8 @@ public: fHost.ui_name = carla_strdup(uiName); + // TODO - send callback to plugin, reporting name change + CarlaPlugin::setName(newName); } diff --git a/source/backend/plugin/VstPlugin.cpp b/source/backend/plugin/VstPlugin.cpp index 399106784..60aa7f034 100644 --- a/source/backend/plugin/VstPlugin.cpp +++ b/source/backend/plugin/VstPlugin.cpp @@ -290,7 +290,13 @@ public: // ------------------------------------------------------------------- // Set data (internal stuff) - // nothing + void setName(const char* const newName) override + { + CarlaPlugin::setName(newName); + + if (kData->gui != nullptr) + kData->gui->setWindowTitle(QString("%1 (GUI)").arg((const char*)fName)); + } // ------------------------------------------------------------------- // Set data (plugin-specific stuff)