m_baseTrackProducers.clear();
}
+void DocClipBase::setZone(QPoint zone) {
+ m_properties.insert("zone_in", QString::number(zone.x()));
+ m_properties.insert("zone_out", QString::number(zone.y()));
+}
+
+QPoint DocClipBase::zone() const {
+ QPoint zone;
+ zone.setX(m_properties.value("zone_in").toInt());
+ zone.setY(m_properties.value("zone_out", "50").toInt());
+ return zone;
+}
+
void DocClipBase::slotCreateAudioTimer() {
connect(m_thumbProd, SIGNAL(audioThumbReady(QMap <int, QMap <int, QByteArray> >)), this , SLOT(updateAudioThumbnail(QMap <int, QMap <int, QByteArray> >)));
connect(this, SIGNAL(getAudioThumbs()), this , SLOT(slotGetAudioThumbs()));
if (track == -1 || (m_clipType != AUDIO && m_clipType != AV)) {
if (m_baseTrackProducers.count() == 0) return NULL;
int i;
- for (int i = 0; i < m_baseTrackProducers.count(); i++)
- if (m_baseTrackProducers.at(i) != NULL) return m_baseTrackProducers.at(i);
+ for (int i = 0; i < m_baseTrackProducers.count(); i++) {
+ if (m_baseTrackProducers.at(i) != NULL)
+ return m_baseTrackProducers.at(i);
+ }
return NULL;
}
if (track >= m_baseTrackProducers.count()) {
connect(m_ruler, SIGNAL(seekRenderer(int)), this, SLOT(slotSeek(int)));
- connect(m_ruler, SIGNAL(zoneChanged(QPoint)), this, SIGNAL(zoneUpdated(QPoint)));
connect(render, SIGNAL(durationChanged(int)), this, SLOT(adjustRulerSize(int)));
connect(render, SIGNAL(rendererPosition(int)), this, SLOT(seekCursor(int)));
connect(render, SIGNAL(rendererStopped(int)), this, SLOT(rendererStopped(int)));
if (name != "clip") {
connect(render, SIGNAL(rendererPosition(int)), this, SIGNAL(renderPosition(int)));
connect(render, SIGNAL(durationChanged(int)), this, SIGNAL(durationChanged(int)));
+ connect(m_ruler, SIGNAL(zoneChanged(QPoint)), this, SIGNAL(zoneUpdated(QPoint)));
+ } else {
+ connect(m_ruler, SIGNAL(zoneChanged(QPoint)), this, SLOT(setClipZone(QPoint)));
}
m_monitorRefresh->show();
kDebug() << "/////// BUILDING MONITOR, ID: " << ui.video_frame->winId();
void Monitor::slotZoneMoved(int start, int end) {
m_ruler->setZone(start, end);
checkOverlay();
+ setClipZone(m_ruler->zone());
}
void Monitor::slotSetZoneStart() {
m_ruler->setZone(m_position, -1);
emit zoneUpdated(m_ruler->zone());
checkOverlay();
+ setClipZone(m_ruler->zone());
}
void Monitor::slotSetZoneEnd() {
m_ruler->setZone(-1, m_position);
emit zoneUpdated(m_ruler->zone());
checkOverlay();
+ setClipZone(m_ruler->zone());
}
// virtual
void Monitor::adjustRulerSize(int length) {
if (length > 0) m_length = length;
m_ruler->adjustScale(m_length);
+ if (m_currentClip != NULL) {
+ QPoint zone = m_currentClip->zone();
+ m_ruler->setZone(zone.x(), zone.y());
+ }
}
void Monitor::stop() {
return;
}
if (clip != m_currentClip) {
- if (clip->producer() != NULL) {
- m_currentClip = clip;
- render->setProducer(clip->producer(), position);
- //m_ruler->slotNewValue(0);
- //adjustRulerSize(clip->producer()->get_playtime());
- //m_timePos->setText("00:00:00:00");
- m_position = position;
- }
+ m_currentClip = clip;
+ render->setProducer(clip->producer(), position);
+ m_position = position;
} else if (position != -1) render->seek(GenTime(position, render->fps()));
}
return doc;
}
+
+void Monitor::setClipZone(QPoint pos) {
+ if (m_currentClip == NULL) return;
+ m_currentClip->setZone(pos);
+}
+
MonitorRefresh::MonitorRefresh(QWidget* parent): QWidget(parent), m_renderer(NULL) {
setAttribute(Qt::WA_PaintOnScreen);
setAttribute(Qt::WA_OpaquePaintEvent); //setAttribute(Qt::WA_NoSystemBackground);
if (!m_mltProducer || !m_mltConsumer)
return;
m_isBlocked = false;
+ if (!m_isZoneMode) m_originalOut = m_mltProducer->get_playtime() - 1;
m_mltProducer->set("out", stopTime.frames(m_fps));
m_mltProducer->seek((int)(startTime.frames(m_fps)));
m_mltProducer->set_speed(1.0);
}
void Render::resetZoneMode() {
- m_mltProducer->set("out", m_mltProducer->get_length() - 1);
+ if (!m_isZoneMode && !m_isLoopMode) return;
+ m_mltProducer->set("out", m_originalOut);
//m_mltProducer->set("eof", "pause");
m_isZoneMode = false;
m_isLoopMode = false;