~ywwg/mixxx/features_xwax2

« back to all changes in this revision

Viewing changes to mixxx/src/widget/wnumberrate.cpp

  • Committer: Owen Williams
  • Date: 2011-01-18 18:36:27 UTC
  • Revision ID: owen@ywwg.com-20110118183627-czw0qcdzdadqcuym
* only update bpm / rate display every 1/4 second

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
    m_pRateRangeControl = new ControlObjectThreadMain(ControlObject::getControl(ConfigKey(group, "rateRange")));
20
20
    m_pRateDirControl = new ControlObjectThreadMain(ControlObject::getControl(ConfigKey(group, "rate_dir")));
21
21
    m_pRateControl = new ControlObjectThreadMain(ControlObject::getControl(ConfigKey(group, "rate")));
 
22
  
 
23
    m_tLabelUpdateTimer = new QTimer(this);
 
24
        connect(m_tLabelUpdateTimer, SIGNAL(timeout()), this, SLOT(updateLabel()));
 
25
        m_tLabelUpdateTimer->start(250); //update BPM every quarter second
 
26
        m_sLabelText = QString("");
22
27
}
23
28
 
24
29
WNumberRate::~WNumberRate()
37
42
        sign = '-';
38
43
    }
39
44
 
40
 
    m_pLabel->setText(QString(m_qsText).append(sign).append("%1").arg(fabs(vsign)*100., 0, 'f', 2));
 
45
    m_sLabelText = QString(m_qsText).append(sign).append("%1").arg(fabs(vsign)*100., 0, 'f', 2);
 
46
}
 
47
 
 
48
void WNumberRate::updateLabel()
 
49
{
 
50
        m_pLabel->setText(m_sLabelText);
41
51
}
42
52