summaryrefslogtreecommitdiff
path: root/muse2/muse/widgets/poslabel.h
blob: 29c5297d8d5635cd54cf72353f5c23fbd2d3df61 (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
44
45
//=========================================================
//  MusE
//  Linux Music Editor
//    $Id: poslabel.h,v 1.2 2004/01/11 18:55:37 wschweer Exp $
//  (C) Copyright 2001 Werner Schweer (ws@seh.de)
//=========================================================

#ifndef __POSLABEL_H__
#define __POSLABEL_H__

#include <QLabel>

//---------------------------------------------------------
//   PosLabel
//---------------------------------------------------------

class PosLabel : public QLabel {
      bool _smpte;
      unsigned _tickValue;
      unsigned _sampleValue;
      Q_OBJECT

      void updateValue();

   protected:
      QSize sizeHint() const;

   public slots:
      void setTickValue(unsigned);
      void setSampleValue(unsigned);
      void setValue(unsigned);

   public:
      PosLabel(QWidget* parent, const char* name = 0);
      unsigned value()       const { return _smpte ? _sampleValue : _tickValue; }
      unsigned tickValue()   const { return _tickValue; }
      unsigned sampleValue() const { return _sampleValue; }
      void setSmpte(bool);
      bool smpte() const { return _smpte; }
      };


#endif