diff --git a/CMakeLists.txt b/CMakeLists.txt index c6819fc7620..f3cb0b13164 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2789,7 +2789,7 @@ if(QML) src/qml/qmlvisibleeffectsmodel.cpp src/qml/qmlchainpresetmodel.cpp src/qml/qmlwaveformoverview.cpp - src/qml/qmlmixxxcontroller.cpp + src/qml/qmlmixxxcontrollerscreen.cpp # The following sources need to be in this target to get QML_ELEMENT properly interpreted src/control/controlmodel.cpp src/control/controlsortfiltermodel.cpp @@ -2801,7 +2801,7 @@ if(QML) # and :/mixxx.org/imports/Mixxx/Controls are placed into beginning of the binary qt_finalize_target(mixxx) - # Required for src/qml/qmlmixxxcontroller.h, used in controllerscriptenginelegacy_test.cpp + # Required for src/qml/qmlmixxxcontrollerscreen.h, used in controllerscriptenginelegacy_test.cpp target_link_libraries(mixxx-test PRIVATE Qt6::Quick) install( diff --git a/src/controllers/scripting/legacy/controllerscriptenginelegacy.cpp b/src/controllers/scripting/legacy/controllerscriptenginelegacy.cpp index 1c9cef3aa26..88c030d005b 100644 --- a/src/controllers/scripting/legacy/controllerscriptenginelegacy.cpp +++ b/src/controllers/scripting/legacy/controllerscriptenginelegacy.cpp @@ -17,7 +17,7 @@ #include "mixer/playermanager.h" #include "moc_controllerscriptenginelegacy.cpp" #ifdef MIXXX_USE_QML -#include "qml/qmlmixxxcontroller.h" +#include "qml/qmlmixxxcontrollerscreen.h" #include "util/assert.h" #include "util/cmdlineargs.h" diff --git a/src/qml/qmlmixxxcontroller.cpp b/src/qml/qmlmixxxcontroller.cpp deleted file mode 100644 index 80a65ab4193..00000000000 --- a/src/qml/qmlmixxxcontroller.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include "qml/qmlmixxxcontroller.h" - -#include -#include - -#include "moc_qmlmixxxcontroller.cpp" - -namespace mixxx { -namespace qml { - -QmlMixxxControllerScreen::QmlMixxxControllerScreen(QQuickItem* parent) - : QQuickItem(parent) { -} - -void QmlMixxxControllerScreen::setTransform(const QJSValue& value) { - if (!value.isCallable()) { - return; - } - m_transformFunc = value; - emit transformChanged(); -} - -void QmlMixxxControllerScreen::setInit(const QJSValue& value) { - if (!value.isCallable()) { - return; - } - m_initFunc = value; - emit initChanged(); -} - -void QmlMixxxControllerScreen::setShutdown(const QJSValue& value) { - if (!value.isCallable()) { - return; - } - m_shutdownFunc = value; - emit shutdownChanged(); -} - -} // namespace qml -} // namespace mixxx diff --git a/src/qml/qmlmixxxcontroller.h b/src/qml/qmlmixxxcontroller.h deleted file mode 100644 index b87e29bc744..00000000000 --- a/src/qml/qmlmixxxcontroller.h +++ /dev/null @@ -1,51 +0,0 @@ -#pragma once - -#include - -#include "controllers/rendering/controllerrenderingengine.h" - -namespace mixxx { -namespace qml { - -class QmlMixxxControllerScreen : public QQuickItem { - Q_OBJECT - QML_NAMED_ELEMENT(ControllerScreen) - Q_PROPERTY(QJSValue init READ getInit WRITE setInit - NOTIFY initChanged REQUIRED); - Q_PROPERTY(QJSValue shutdown READ getShutdown WRITE setShutdown - NOTIFY shutdownChanged REQUIRED); - Q_PROPERTY(QJSValue transformFrame READ getTransform WRITE setTransform - NOTIFY transformChanged REQUIRED); - - public: - explicit QmlMixxxControllerScreen(QQuickItem* parent = nullptr); - - void setInit(const QJSValue& value); - void setShutdown(const QJSValue& value); - void setTransform(const QJSValue& value); - - QJSValue getInit() const { - return m_initFunc; - } - - QJSValue getShutdown() const { - return m_shutdownFunc; - } - - QJSValue getTransform() const { - return m_transformFunc; - } - - signals: - void initChanged(); - void shutdownChanged(); - void transformChanged(); - - private: - QJSValue m_initFunc; - QJSValue m_shutdownFunc; - QJSValue m_transformFunc; -}; - -} // namespace qml -} // namespace mixxx diff --git a/src/test/controllerscriptenginelegacy_test.cpp b/src/test/controllerscriptenginelegacy_test.cpp index 48f3b074ed4..cd968497ee4 100644 --- a/src/test/controllerscriptenginelegacy_test.cpp +++ b/src/test/controllerscriptenginelegacy_test.cpp @@ -21,7 +21,7 @@ #include "controllers/softtakeover.h" #include "helpers/log_test.h" #include "preferences/usersettings.h" -#include "qml/qmlmixxxcontroller.h" +#include "qml/qmlmixxxcontrollerscreen.h" #include "test/mixxxtest.h" #include "util/color/colorpalette.h" #include "util/time.h"