1 //=========================================================
2 //  MusE
3 //  Linux Music Editor
4 //    $Id: poslabel.h,v 1.2 2004/01/11 18:55:37 wschweer Exp $
5 //  (C) Copyright 2001 Werner Schweer (ws@seh.de)
6 //
7 //  This program is free software; you can redistribute it and/or
8 //  modify it under the terms of the GNU General Public License
9 //  as published by the Free Software Foundation; version 2 of
10 //  the License, or (at your option) any later version.
11 //
12 //  This program is distributed in the hope that it will be useful,
13 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
14 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 //  GNU General Public License for more details.
16 //
17 //  You should have received a copy of the GNU General Public License
18 //  along with this program; if not, write to the Free Software
19 //  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20 //
21 //=========================================================
22 
23 #ifndef __POSLABEL_H__
24 #define __POSLABEL_H__
25 
26 #include <QLabel>
27 
28 namespace MusEGui {
29 
30 //---------------------------------------------------------
31 //   PosLabel
32 //---------------------------------------------------------
33 
34 class PosLabel : public QLabel {
35       Q_OBJECT
36 
37       bool _smpte;
38       unsigned _tickValue;
39       unsigned _sampleValue;
40 
41 
42       void updateValue();
43 
44    protected:
45       QSize sizeHint() const;
46 
47    public slots:
48       void setTickValue(unsigned);
49       void setSampleValue(unsigned);
50       void setValue(unsigned);
51 
52    public:
53       PosLabel(QWidget* parent, const char* name = 0);
value()54       unsigned value()       const { return _smpte ? _sampleValue : _tickValue; }
tickValue()55       unsigned tickValue()   const { return _tickValue; }
sampleValue()56       unsigned sampleValue() const { return _sampleValue; }
57       void setSmpte(bool);
smpte()58       bool smpte() const { return _smpte; }
59       };
60 
61 } // namespace MusEGui
62 
63 #endif
64 
65 
66