1 #pragma once
2 
3 #include "control/controlobject.h"
4 
5 class ControlProxy;
6 
7 class ControlIndicator : public ControlObject {
8     Q_OBJECT
9   public:
10     enum BlinkValue {
11         OFF = 0,
12         ON = 1,
13         RATIO1TO1_500MS = 2, // used for Pioneer play/pause
14         RATIO1TO1_250MS = 3, // used for Pioneer cue
15     };
16 
17     ControlIndicator(const ConfigKey& key);
18     virtual ~ControlIndicator();
19 
20     void setBlinkValue(enum BlinkValue bv);
21 
22   signals:
23     void blinkValueChanged();
24 
25   private slots:
26     void slotGuiTick50ms(double cpuTime);
27     void slotBlinkValueChanged();
28 
29   private:
30     void toggle(double duration);
31     // set() is private, use setBlinkValue instead
32     // it must be called from the GUI thread only to a void
33     // race condition by toggle()
set(double value)34     void set(double value) { ControlObject::set(value); };
35 
36     enum BlinkValue m_blinkValue;
37     double m_nextSwitchTime;
38     ControlProxy* m_pCOTGuiTickTime;
39     ControlProxy* m_pCOTGuiTick50ms;
40 };
41