summaryrefslogtreecommitdiffstats
path: root/src/widget
diff options
context:
space:
mode:
Diffstat (limited to 'src/widget')
-rw-r--r--src/widget/weffectchain.cpp23
-rw-r--r--src/widget/weffectchain.h25
2 files changed, 48 insertions, 0 deletions
diff --git a/src/widget/weffectchain.cpp b/src/widget/weffectchain.cpp
new file mode 100644
index 0000000000..3835dadea7
--- /dev/null
+++ b/src/widget/weffectchain.cpp
@@ -0,0 +1,23 @@
+#include "widget/weffectchain.h"
+
+WEffectChain::WEffectChain(QWidget* pParent)
+ : QLabel(pParent) {
+}
+
+WEffectChain::~WEffectChain() {
+}
+
+void WEffectChain::setEffectChainSlot(EffectChainSlotPointer effectChainSlot) {
+ if (effectChainSlot) {
+ m_pEffectChainSlot = effectChainSlot;
+ connect(effectChainSlot.data(), SIGNAL(updated()),
+ this, SLOT(chainUpdated()));
+ chainUpdated();
+ }
+}
+
+void WEffectChain::chainUpdated() {
+ if (m_pEffectChainSlot) {
+ setText(m_pEffectChainSlot->name());
+ }
+}
diff --git a/src/widget/weffectchain.h b/src/widget/weffectchain.h
new file mode 100644
index 0000000000..273dfbd5b1
--- /dev/null
+++ b/src/widget/weffectchain.h
@@ -0,0 +1,25 @@
+#ifndef WEFFECTCHAIN_H
+#define WEFFECTCHAIN_H
+
+#include <QWidget>
+#include <QLabel>
+
+#include "effects/effectchainslot.h"
+
+class WEffectChain : public QLabel {
+ Q_OBJECT
+ public:
+ WEffectChain(QWidget* pParent=NULL);
+ virtual ~WEffectChain();
+
+ // Set the EffectChain that should be monitored by this WEffectChain
+ void setEffectChainSlot(EffectChainSlotPointer pEffectChainSlot);
+
+ private slots:
+ void chainUpdated();
+
+ private:
+ EffectChainSlotPointer m_pEffectChainSlot;
+};
+
+#endif /* WEFFECTCHAIN_H */