QFontMetrics fm = lineedit->fontMetrics();
lineedit->setMaximumWidth(fm.width("88:88:88:888"));
setSizePolicy(QSizePolicy::Maximum, QSizePolicy::MinimumExpanding);
-
+
setTimeCodeFormat(KdenliveSettings::frametimecode(), true);
connect(uparrow, SIGNAL(clicked()), this, SLOT(slotValueUp()));
void TimecodeDisplay::slotValueUp()
{
- int val = value();
+ int val = getValue();
val++;
setValue(val);
lineedit->clearFocus();
void TimecodeDisplay::slotValueDown()
{
- int val = value();
+ int val = getValue();
val--;
setValue(val);
lineedit->clearFocus();
void TimecodeDisplay::setTimeCodeFormat(bool frametimecode, bool init)
{
if (!init && m_frametimecode == frametimecode) return;
- int val = value();
+ int val = getValue();
m_frametimecode = frametimecode;
if (m_frametimecode) {
QIntValidator *valid = new QIntValidator(lineedit);
return m_minimum;
}
-int TimecodeDisplay::value() const
+int TimecodeDisplay::getValue() const
{
if (m_frametimecode) return lineedit->text().toInt();
else return m_timecode.getFrameCount(lineedit->text());
GenTime TimecodeDisplay::gentime() const
{
- return GenTime(value(), m_timecode.fps());
+ return GenTime(getValue(), m_timecode.fps());
}
Timecode TimecodeDisplay::timecode() const
if (m_maximum > m_minimum && value > m_maximum)
value = m_maximum;
+ if (value == getValue()) return;
downarrow->setEnabled(value > m_minimum);
uparrow->setEnabled(m_maximum < m_minimum || value < m_maximum);
if (m_frametimecode)
lineedit->setText(QString::number(value));
- else
- lineedit->setText(m_timecode.getTimecodeFromFrames(value));
+ else {
+ QString v = m_timecode.getTimecodeFromFrames(value);
+ kDebug() << "// SETTING TO: " << value << " = " << v << "( " << m_timecode.fps();
+ lineedit->setText(v);
+ }
}
void TimecodeDisplay::setValue(GenTime value)