diff options
author | RJ Ryan <rryan@mixxx.org> | 2014-01-12 01:00:21 -0500 |
---|---|---|
committer | RJ Ryan <rryan@mixxx.org> | 2014-01-12 01:00:21 -0500 |
commit | 181560d22823512001f22bc8352fdf5fac6c1df7 (patch) | |
tree | d9b7f932b36f7ee59aee7917e227e3dbc13e0baa /src | |
parent | 9154b3104b662c2bada104ce63e4da79a941e07b (diff) |
Add toDebugString() method to ControlWidgetConnection.
Diffstat (limited to 'src')
-rw-r--r-- | src/widget/wbasewidget.cpp | 15 | ||||
-rw-r--r-- | src/widget/wbasewidget.h | 6 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/widget/wbasewidget.cpp b/src/widget/wbasewidget.cpp index 51a8213571..b5c233f121 100644 --- a/src/widget/wbasewidget.cpp +++ b/src/widget/wbasewidget.cpp @@ -3,6 +3,7 @@ #include "widget/wbasewidget.h" #include "controlobjectslave.h" +#include "util/debug.h" ControlWidgetConnection::ControlWidgetConnection(WBaseWidget* pBaseWidget, ControlObjectSlave* pControl) @@ -39,6 +40,15 @@ ValueControlWidgetConnection::ValueControlWidgetConnection(WBaseWidget* pBaseWid ValueControlWidgetConnection::~ValueControlWidgetConnection() { } +QString ValueControlWidgetConnection::toDebugString() const { + const ConfigKey& key = m_pControl->getKey(); + return QString("%1,%2 ToWidget: %3 FromWidget %4 Emit: %5") + .arg(key.group, key.item, + ::toDebugString(m_bConnectValueToWidget), + ::toDebugString(m_bConnectValueFromWidget), + emitOptionToString(m_emitOption)); +} + void ValueControlWidgetConnection::slotControlValueChanged(double v) { if (m_bConnectValueToWidget) { m_pWidget->onConnectedControlValueChanged( @@ -75,6 +85,11 @@ DisabledControlWidgetConnection::DisabledControlWidgetConnection(WBaseWidget* pB DisabledControlWidgetConnection::~DisabledControlWidgetConnection() { } +QString DisabledControlWidgetConnection::toDebugString() const { + const ConfigKey& key = m_pControl->getKey(); + return QString("Disabled %1,%2").arg(key.group, key.item); +} + void DisabledControlWidgetConnection::slotControlValueChanged(double v) { m_pWidget->setControlDisabled(m_pControl->getParameterForValue(v) != 0.0); m_pWidget->toQWidget()->update(); diff --git a/src/widget/wbasewidget.h b/src/widget/wbasewidget.h index 8ef30ccce6..f06e53a934 100644 --- a/src/widget/wbasewidget.h +++ b/src/widget/wbasewidget.h @@ -47,6 +47,8 @@ class ControlWidgetConnection : public QObject { virtual void setControlParameterDown(double v) = 0; virtual void setControlParameterUp(double v) = 0; + virtual QString toDebugString() const = 0; + protected slots: virtual void slotControlValueChanged(double v) = 0; @@ -65,6 +67,8 @@ class ValueControlWidgetConnection : public ControlWidgetConnection { EmitOption emitOption); virtual ~ValueControlWidgetConnection(); + QString toDebugString() const; + protected: void resetControl(); void setControlParameterDown(double v); @@ -86,6 +90,8 @@ class DisabledControlWidgetConnection : public ControlWidgetConnection { ControlObjectSlave* pControl); virtual ~DisabledControlWidgetConnection(); + QString toDebugString() const; + protected: void resetControl(); void setControlParameterDown(double v); |