const int max = (startPos() - cropStart() + maxDuration()).frames(m_fps) + 1;
if (posx > max) posx = max;
if (posx == endPos().frames(m_fps)) return;
- kDebug() << "// NEW POS: " << posx << ", OLD END: " << endPos().frames(m_fps);
+ //kDebug() << "// NEW POS: " << posx << ", OLD END: " << endPos().frames(m_fps);
const int previous = (cropStart() + duration()).frames(m_fps);
AbstractClipItem::resizeEnd(posx, m_speed);
if (updateKeyFrames) checkEffectsKeyframesPos(previous, (cropStart() + duration()).frames(m_fps), false);
m_view.tabWidget->removeTab(VIDEOTAB);
m_view.clip_thumb->setHidden(true);
}
- if (t != IMAGE && t != COLOR && t != TEXT) m_view.clip_duration->setReadOnly(true);
KFileItem f(KFileItem::Unknown, KFileItem::Unknown, url, true);
m_view.clip_filesize->setText(KIO::convertSize(f.size()));
m_view.clip_duration->setText(tc.getTimecode(m_clip->duration(), m_fps));
+ if (t != IMAGE && t != COLOR && t != TEXT) m_view.clip_duration->setReadOnly(true);
+ else connect(m_view.clip_duration, SIGNAL(editingFinished()), this, SLOT(slotCheckMaxLength()));
// markers
m_view.marker_new->setIcon(KIcon("document-new"));
m_view.clip_thumb->setPixmap(pix);
}
+void ClipProperties::slotCheckMaxLength() {
+ int duration = m_tc.getFrameCount(m_view.clip_duration->text(), m_fps);
+ if (duration > m_clip->maxDuration().frames(m_fps)) {
+ m_view.clip_duration->setText(m_tc.getTimecode(m_clip->maxDuration(), m_fps));
+ }
+}
+
#include "clipproperties.moc"
const GenTime &DocClipBase::maxDuration() const {
if (m_clipType == COLOR || m_clipType == IMAGE || m_clipType == TEXT || (m_clipType == SLIDESHOW && m_properties.value("loop") == "1")) {
- const GenTime dur(10000, KdenliveSettings::project_fps());
+ const GenTime dur(15000, KdenliveSettings::project_fps());
return dur;
}
return m_duration;