~ubuntu-branches/ubuntu/breezy/muse/breezy

« back to all changes in this revision

Viewing changes to widgets/bigtime.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:
27
27
 
28
28
      seq->setBigTimeChecked(true); // dont know why i have to do this...
29
29
 
30
 
      barLabel      = new QLabel(this);
31
 
      beatLabel     = new QLabel(this);
32
 
      tickLabel     = new QLabel(this);
33
 
      hourLabel     = new QLabel(this);
34
 
      minLabel      = new QLabel(this);
35
 
      secLabel      = new QLabel(this);
36
 
      frameLabel    = new QLabel(this);
 
30
      barLabel   = new QLabel(this);
 
31
      beatLabel  = new QLabel(this);
 
32
      tickLabel  = new QLabel(this);
 
33
      hourLabel  = new QLabel(this);
 
34
      minLabel   = new QLabel(this);
 
35
      secLabel   = new QLabel(this);
 
36
      frameLabel = new QLabel(this);
37
37
 
38
38
      sep1 = new QLabel(this);
39
39
      sep2 = new QLabel(this);
41
41
      sep4 = new QLabel(this);
42
42
      sep5 = new QLabel(this);
43
43
 
44
 
      sep1->setText(".");
45
 
      sep2->setText(".");
46
 
      sep3->setText(":");
47
 
      sep4->setText(":");
48
 
      sep5->setText(":");
 
44
      sep1->setText(QString("."));
 
45
      sep2->setText(QString("."));
 
46
      sep3->setText(QString(":"));
 
47
      sep4->setText(QString(":"));
 
48
      sep5->setText(QString(":"));
49
49
 
50
50
      oldbar = oldbeat = oldtick = oldhour = oldmin = oldsec = oldframe = -1;
51
51
 
53
53
 
54
54
      setBgColor(black);
55
55
      setFgColor(red);
56
 
      resize(320, 100);
57
 
      QFont f("Courier");
 
56
      QFont f(QString("Courier"));
 
57
      f.setPixelSize(10);
58
58
      setFont(f);
59
 
      setCaption("muse: Bigtime");
60
 
 
 
59
      setCaption(tr("MusE: Bigtime"));
 
60
      resize(420, 200);
61
61
      }
62
62
 
63
63
//---------------------------------------------------------
67
67
bool BigTime::setString(int v)
68
68
      {
69
69
      if (v < 0) {
70
 
            barLabel->setText("----");
71
 
            beatLabel->setText("--");
72
 
            tickLabel->setText("---");
73
 
            hourLabel->setText("--");
74
 
            minLabel->setText("--");
75
 
            secLabel->setText("--");
76
 
            frameLabel->setText("--");
77
 
            oldbar = oldbeat = oldtick = oldhour = oldmin = oldsec = oldframe = -1;
 
70
            barLabel->setText(QString("----"));
 
71
            beatLabel->setText(QString("--"));
 
72
            tickLabel->setText(QString("---"));
 
73
              hourLabel->setText(QString("--"));
 
74
            minLabel->setText(QString("--"));
 
75
            secLabel->setText(QString("--"));
 
76
            frameLabel->setText(QString("--"));
 
77
              oldbar = oldbeat = oldtick = oldhour = oldmin = oldsec = oldframe = -1;
78
78
            return true;
79
79
            }
80
80
 
147
147
              oldframe = frame;
148
148
      }
149
149
 
150
 
 
151
150
      return false;
152
151
      }
153
152
 
157
156
 
158
157
void BigTime::setPos(int idx, int v, bool)
159
158
      {
160
 
      if(idx == 0)
161
 
                setString(v);
162
 
        
 
159
      if (idx == 0)
 
160
            setString(v);
163
161
      }
164
162
 
165
163
//---------------------------------------------------------
168
166
 
169
167
void BigTime::resizeEvent(QResizeEvent *ev)
170
168
      {
171
 
        
172
 
        QFont f = font();
173
 
        int fs = f.pixelSize();
 
169
        QFont f    = font();
 
170
      QFontMetrics fm(f);
 
171
        int fs     = f.pixelSize();
174
172
        int hspace = 20;
175
 
 
176
 
        while(fontMetrics().width("00:00:00:00") < (ev->size().width() - hspace*2))
177
 
              {
178
 
                fs+=2;
179
 
                f.setPixelSize(fs);
180
 
                setFont(f);
181
 
              }
182
 
 
183
 
        while(fontMetrics().width("00:00:00:00") > (ev->size().width() - hspace*2))
184
 
              {
185
 
                fs-=2;
186
 
                f.setPixelSize(fs);
187
 
                setFont(f);
188
 
              }
189
 
 
190
 
 
191
 
        // check widget height
192
 
/*
193
 
        if( ev->size().height() < fs*3.5 )
194
 
                {
195
 
                  resize( ev->size().width(), fs*3.5 );
196
 
                  return;
197
 
                }
198
 
*/
199
 
 
200
 
        int digitWidth = fontMetrics().width("0");
 
173
        int tw     = fm.width(QString("00:00:00:00"));
 
174
        int nfs    = ((ev->size().width() - hspace*2)*fs) / tw;
 
175
 
 
176
//      printf("resize BigTime %d -> %d, w %d\n", fs, nfs, ev->size().width());
 
177
 
 
178
        // set min/max
 
179
        if (fs < 10)
 
180
            fs = 10;
 
181
        else if (fs > 256)
 
182
            fs = 256;
 
183
        f.setPixelSize(nfs);
 
184
        setFont(f);
 
185
 
 
186
        int digitWidth = fontMetrics().width(QString("0"));
201
187
        
202
188
        int vspace = (ev->size().height() - (fs*2)) / 3;
203
189
        int tickY = vspace;
302
288
 
303
289
QColor BigTime::getFgColor()
304
290
      {
305
 
        return sep1->palette().active().foreground();
 
291
      return sep1->palette().active().foreground();
306
292
      }
307
293
 
308
294
//---------------------------------------------------------
311
297
 
312
298
QColor BigTime::getBgColor()
313
299
      {
314
 
        return sep1->palette().active().background();
 
300
      return sep1->palette().active().background();
315
301
      }
 
302