clap

CLAP Audio Plugin API
Log | Files | Refs | README | LICENSE

commit ccfe150965564dab70285bd7290370b6fc3f7c2e
parent 96be27ae41b9f43899effb7b20b10fb995013c49
Author: Alexandre BIQUE <bique.alexandre@gmail.com>
Date:   Tue, 17 Aug 2021 16:34:49 +0200

Much better

Diffstat:
Mexamples/gui/CMakeLists.txt | 3+--
Mexamples/gui/application.cc | 4+++-
Mexamples/gui/application.hh | 6+++---
3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/examples/gui/CMakeLists.txt b/examples/gui/CMakeLists.txt @@ -2,7 +2,6 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) find_package(Qt6 COMPONENTS Quick REQUIRED) -find_package(Qt6 COMPONENTS Widgets REQUIRED) add_executable(clap-gui main.cc @@ -15,7 +14,7 @@ add_executable(clap-gui plugin-proxy.hh plugin-proxy.cc ) -target_link_libraries(clap-gui clap-io Qt6::Widgets Qt6::Quick) +target_link_libraries(clap-gui clap-io Qt6::Quick) set_target_properties(clap-gui PROPERTIES CXX_STANDARD 17) install(TARGETS clap-gui DESTINATION "${CMAKE_INSTALL_PREFIX}/bin") \ No newline at end of file diff --git a/examples/gui/application.cc b/examples/gui/application.cc @@ -9,7 +9,7 @@ #include "application.hh" Application::Application(int& argc, char **argv) - : QApplication(argc, argv), quickView_(new QQuickView()) { + : QGuiApplication(argc, argv), quickView_(new QQuickView()) { bool waitForDebbugger = false; while (waitForDebbugger) @@ -82,6 +82,7 @@ void Application::removeFd() { socketReadNotifier_.reset(); socketWriteNotifier_.reset(); socketErrorNotifier_.reset(); + quit(); } void Application::onMessage(const clap::RemoteChannel::Message &msg) { @@ -89,6 +90,7 @@ void Application::onMessage(const clap::RemoteChannel::Message &msg) { case clap::messages::kDestroyRequest: clap::messages::DestroyResponse rp; remoteChannel_->sendResponseAsync(rp, msg.cookie); + quit(); break; case clap::messages::kDefineParameterRequest: { diff --git a/examples/gui/application.hh b/examples/gui/application.hh @@ -1,6 +1,6 @@ #pragma once -#include <QApplication> +#include <QGuiApplication> #include <QSocketNotifier> #include <QWindow> @@ -9,7 +9,7 @@ class QQuickView; -class Application : public QApplication, public clap::RemoteChannel::EventControl { +class Application : public QGuiApplication, public clap::RemoteChannel::EventControl { Q_OBJECT; public: @@ -19,7 +19,7 @@ public: void modifyFd(clap_fd_flags flags) override; void removeFd() override; - static Application& instance() { return *dynamic_cast<Application *>(QApplication::instance()); } + static Application& instance() { return *dynamic_cast<Application *>(QGuiApplication::instance()); } private: void onMessage(const clap::RemoteChannel::Message& msg);