~ubuntu-branches/ubuntu/raring/muse/raring-proposed

« back to all changes in this revision

Viewing changes to widgets/tempolabel.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Kobras
  • Date: 2004-02-07 15:18:22 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040207151822-es27xxkzbcxkebjm
Tags: 0.6.3-1
* New upstream version.
* Added patches:
  + [10_alsa_init_fix] New, from upstream CVS.
    Initialize direction variable when setting Alsa parameters.
  + [10_canvas_translation_fix] New, from upstream CVS.
    Do not translate tooltips twice in canvas popup.
  + [10_checkbox_fix] New, from upstream CVS.
    Use proper set/test methods on metronome checkboxes.
  + [10_html_doc_cleanup] New.
    Fix links and HTML errors in documentation.
  + [20_allow_system_timer] New.
    The new upstream version fails by default if the real-time clock
    could not be accessed (usually the case when not running suid-root).
    This patch reverts the old behaviour of falling back to the more
    inaccurate system timer.
* Updated patches:
  + [11_PIC_fixes_fixup] Rediffed.
* Removed patches:
  + [20_no_atomic_asm] Merged upstream.
* debian/compat: Splice out debhelper compatibility level from rules file.
* debian/control: Build-depend on latest jack release by default.
  Closes: #228788
* debian/control: Bump standards version.
* debian/control: Use auto-generated debconf dependency via misc:Depends.
* debian/control: Minor tweaks to the long description.
* debian/control: Tighten fluidsynth build dependency to sane version.
* debian/muse.doc-base: New. Register HTML documentation with doc-base.
* debian/templates: Tiny rewording, and typo fix.
* debian/templates, debian/po/*: Switch to po-debconf for translations.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//=========================================================
2
2
//  MusE
3
3
//  Linux Music Editor
4
 
//    $Id: tempolabel.cpp,v 1.1 2002/01/30 14:54:04 muse Exp $
 
4
//    $Id: tempolabel.cpp,v 1.1.1.1 2003/10/29 10:06:21 wschweer Exp $
5
5
//  (C) Copyright 1999 Werner Schweer (ws@seh.de)
6
6
//=========================================================
7
7
 
14
14
//   TempoLabel
15
15
//---------------------------------------------------------
16
16
 
17
 
TempoLabel::TempoLabel(QWidget* parent, const char* name = 0)
 
17
TempoLabel::TempoLabel(QWidget* parent, const char* name)
18
18
   : QLabel(parent, name)
19
19
      {
20
20
      setFrameStyle(WinPanel | Sunken);
22
22
      setMidLineWidth(3);
23
23
      _value = 1.0;
24
24
      setValue(0.0);
25
 
      int fw = style().pixelMetric(QStyle::PM_DefaultFrameWidth, this);
26
 
      setIndent(fw);
 
25
      setIndent(3);
 
26
      setMinimumSize(sizeHint());
27
27
      }
28
28
 
29
29
//---------------------------------------------------------
51
51
QSize TempoLabel::sizeHint() const
52
52
      {
53
53
      QFontMetrics fm(font());
54
 
      int fw = style().pixelMetric(QStyle::PM_DefaultFrameWidth, this);
 
54
      int fw = 4;
55
55
      int h  = fm.height() + fw * 2;
56
 
      int w  = 2 + fm.width("000.00") +  fw * 4;
 
56
      int w  = 6 + fm.width(QString("000.00")) +  fw * 2;  // 6=indent
57
57
      return QSize(w, h).expandedTo(QApplication::globalStrut());
58
58
      }
59
59
 
61
61
//   TempoSpinBox
62
62
//---------------------------------------------------------
63
63
 
64
 
TempoSpinBox::TempoSpinBox(QWidget* parent, const char* name = 0)
 
64
TempoEdit::TempoEdit(QWidget* parent, const char* name)
65
65
   : QSpinBox(parent, name)
66
66
      {
67
67
      setLineStep(100);
75
75
//   sizeHint
76
76
//---------------------------------------------------------
77
77
 
78
 
QSize TempoSpinBox::sizeHint() const
 
78
QSize TempoEdit::sizeHint() const
79
79
      {
80
80
      QFontMetrics fm(font());
81
81
      int fw = style().pixelMetric(QStyle::PM_DefaultFrameWidth, this);
82
82
      int h  = fm.height() + fw * 2;
83
 
      int w  = 2 + fm.width("000.00") +  fw * 4 + 30;
 
83
      int w  = 2 + fm.width(QString("000.00")) +  fw * 4 + 30;
84
84
      return QSize(w, h).expandedTo(QApplication::globalStrut());
85
85
      }
86
86
 
88
88
//   mapValueToText
89
89
//---------------------------------------------------------
90
90
 
91
 
QString TempoSpinBox::mapValueToText(int val)
 
91
QString TempoEdit::mapValueToText(int val)
92
92
      {
93
93
      double v = val / 100.0;
94
94
      return QString("%1").arg(v, 3, 'f', 2);
98
98
//   mapTextToValue
99
99
//---------------------------------------------------------
100
100
 
101
 
int TempoSpinBox::mapTextToValue(bool* ok)
 
101
int TempoEdit::mapTextToValue(bool* ok)
102
102
      {
103
103
      double v = text().toDouble(ok);
104
104
      return int(v * 100);
108
108
//   tempoChanged
109
109
//---------------------------------------------------------
110
110
 
111
 
void TempoSpinBox::tempoChanged(int val)
 
111
void TempoEdit::tempoChanged(int val)
112
112
      {
113
113
      emit valueChanged(double(val)/100.0);
114
114
      }
117
117
//   setValue
118
118
//---------------------------------------------------------
119
119
 
120
 
void TempoSpinBox::setValue(double val)
 
120
void TempoEdit::setValue(double val)
121
121
      {
122
122
      QSpinBox::setValue(int(val*100));
123
123
      }