~ubuntu-branches/ubuntu/quantal/muse/quantal

« back to all changes in this revision

Viewing changes to widgets/posedit.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Kobras
  • Date: 2005-08-23 17:19:39 UTC
  • mto: (4.1.1 breezy) (1.1.9) (10.1.6 sid)
  • mto: This revision was merged to the branch mainline in revision 5.
  • Revision ID: james.westby@ubuntu.com-20050823171939-hd8fgzokb4dbj007
Tags: upstream-0.7.1+0.7.2pre2
ImportĀ upstreamĀ versionĀ 0.7.1+0.7.2pre2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//=========================================================
2
 
//  MusE
3
 
//  Linux Music Editor
4
 
//    $Id: posedit.h,v 1.1.1.1 2003/10/29 10:06:27 wschweer Exp $
5
 
//  (C) Copyright 2001 Werner Schweer (ws@seh.de)
6
 
//=========================================================
7
 
 
8
 
#ifndef __POSEDIT_H__
9
 
#define __POSEDIT_H__
10
 
 
11
 
#include <qwidget.h>
12
 
#include <qstring.h>
13
 
#include "pos.h"
14
 
 
15
 
class PosEditor;
16
 
class QSpinWidget;
17
 
 
18
 
#include "section.h"
19
 
 
20
 
//---------------------------------------------------------
21
 
//   PosEdit
22
 
//---------------------------------------------------------
23
 
 
24
 
class PosEdit : public QWidget
25
 
      {
26
 
      Q_OBJECT
27
 
      Q_PROPERTY(QString separator READ separator WRITE setSeparator)
28
 
      Q_PROPERTY(bool smpte READ smpte WRITE setSmpte)
29
 
 
30
 
      void init();
31
 
      void setSections();
32
 
      QString sectionText(int sec);
33
 
      Section midiSections[3];
34
 
      Section smpteSections[4];
35
 
      Section* sec;
36
 
 
37
 
      bool _smpte;
38
 
 
39
 
      bool adv;
40
 
      bool overwrite;
41
 
      int timerId;
42
 
      bool typing;
43
 
      Pos min;
44
 
      Pos max;
45
 
      bool changed;
46
 
      PosEditor *ed;
47
 
      QSpinWidget* controls;
48
 
 
49
 
   private slots:
50
 
      void stepUp();
51
 
      void stepDown();
52
 
 
53
 
   signals:
54
 
      void valueChanged(const Pos&);
55
 
 
56
 
   protected:
57
 
      bool event(QEvent *e );
58
 
      void timerEvent(QTimerEvent* e);
59
 
      void resizeEvent(QResizeEvent*);
60
 
      QString sectionFormattedText(int sec);
61
 
      void addNumber(int sec, int num);
62
 
      void removeLastNumber(int sec);
63
 
      bool setFocusSection(int s);
64
 
 
65
 
      virtual bool outOfRange(int, int) const;
66
 
      virtual void setSec(int, int);
67
 
      friend class PosEditor;
68
 
 
69
 
   protected slots:
70
 
      void updateButtons();
71
 
 
72
 
   public slots:
73
 
      virtual void setValue(const Pos& time);
74
 
      void setValue(int t);
75
 
      void setValue(const QString& s);
76
 
 
77
 
   public:
78
 
      PosEdit(QWidget*,  const char* = 0);
79
 
      PosEdit(const Pos& time, QWidget*,  const char* = 0);
80
 
      ~PosEdit();
81
 
 
82
 
      QSize sizeHint() const;
83
 
      Pos pos() const;
84
 
      virtual void setAutoAdvance(bool advance) { adv = advance; }
85
 
      bool autoAdvance() const                  { return adv; }
86
 
 
87
 
      virtual void setMinValue(const Pos& d)    { setRange(d, maxValue()); }
88
 
      Pos minValue() const;
89
 
      virtual void setMaxValue( const Pos& d )  { setRange(minValue(), d ); }
90
 
      Pos maxValue() const;
91
 
      virtual void setRange(const Pos& min, const Pos& max);
92
 
      QString separator() const;
93
 
      virtual void setSeparator(const QString& s);
94
 
      void setSmpte(bool);
95
 
      bool smpte() const;
96
 
      };
97
 
 
98
 
#endif