summaryrefslogtreecommitdiffstats
path: root/src/controlindicator.h
blob: 9f30033ad5d61c0faa148af42beca41c70cd3b88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef CONTROLINDICATOR_H
#define CONTROLINDICATOR_H

#include "controlobject.h"

class ControlObjectSlave;

class ControlIndicator : public ControlObject {
    Q_OBJECT
  public:
    enum BlinkValue {
        OFF = 0,
        ON = 1,
        RATIO1TO1_500MS = 2, // used for Pioneer play/pause
        RATIO1TO1_250MS = 3, // used for Pioneer cue
    };

    ControlIndicator(ConfigKey key);
    virtual ~ControlIndicator();

    void setBlinkValue(enum BlinkValue bv);

  signals:
    void blinkValueChanged();

  private slots:
    void slotGuiTick50ms(double cpuTime);
    void slotBlinkValueChanged();

  private:
    void toggle(double duration);
    // set() is private, use setBlinkValue instead
    // it must be called from the GUI thread only to a void
    // race condition by toggle()
    void set(double value) { ControlObject::set(value); };

    enum BlinkValue m_blinkValue;
    double m_nextSwitchTime;
    ControlObjectSlave* m_pCOTGuiTickTime;
    ControlObjectSlave* m_pCOTGuiTick50ms;
};

#endif // CONTROLINDICATOR_H