+void Monitor::slotSetSizeOneToOne()
+{
+ QRect r = QApplication::desktop()->screenGeometry();
+ const int maxWidth = r.width() - 20;
+ const int maxHeight = r.height() - 20;
+ int width = render->renderWidth();
+ int height = render->renderHeight();
+ kDebug() << "// render info: " << width << "x" << height;
+ while (width >= maxWidth || height >= maxHeight) {
+ width = width * 0.8;
+ height = height * 0.8;
+ }
+ kDebug() << "// MONITOR; set SIZE: " << width << ", " << height;
+ m_ui.video_frame->setFixedSize(width, height);
+ updateGeometry();
+ adjustSize();
+ //m_ui.video_frame->setMinimumSize(0, 0);
+ emit adjustMonitorSize();
+}
+
+void Monitor::slotSetSizeOneToTwo()
+{
+ QRect r = QApplication::desktop()->screenGeometry();
+ const int maxWidth = r.width() - 20;
+ const int maxHeight = r.height() - 20;
+ int width = render->renderWidth() / 2;
+ int height = render->renderHeight() / 2;
+ kDebug() << "// render info: " << width << "x" << height;
+ while (width >= maxWidth || height >= maxHeight) {
+ width = width * 0.8;
+ height = height * 0.8;
+ }
+ kDebug() << "// MONITOR; set SIZE: " << width << ", " << height;
+ m_ui.video_frame->setFixedSize(width, height);
+ updateGeometry();
+ adjustSize();
+ //m_ui.video_frame->setMinimumSize(0, 0);
+ emit adjustMonitorSize();
+}
+
+void Monitor::resetSize()
+{
+ m_ui.video_frame->setMinimumSize(0, 0);
+}
+
+DocClipBase *Monitor::activeClip()
+{
+ return m_currentClip;
+}
+
+void Monitor::slotSeekToPreviousSnap()
+{
+ if (m_currentClip) slotSeek(getSnapForPos(true).frames(m_monitorManager->timecode().fps()));
+}
+
+void Monitor::slotSeekToNextSnap()
+{
+ if (m_currentClip) slotSeek(getSnapForPos(false).frames(m_monitorManager->timecode().fps()));
+}
+
+GenTime Monitor::position()
+{
+ return render->seekPosition();
+}
+
+GenTime Monitor::getSnapForPos(bool previous)
+{
+ QList <GenTime> snaps;
+ QList < GenTime > markers = m_currentClip->snapMarkers();
+ for (int i = 0; i < markers.size(); ++i) {
+ GenTime t = markers.at(i);
+ snaps.append(t);
+ }
+ QPoint zone = m_ruler->zone();
+ snaps.append(GenTime(zone.x(), m_monitorManager->timecode().fps()));
+ snaps.append(GenTime(zone.y(), m_monitorManager->timecode().fps()));
+ snaps.append(GenTime());
+ snaps.append(m_currentClip->duration());
+ qSort(snaps);
+
+ const GenTime pos = render->seekPosition();
+ for (int i = 0; i < snaps.size(); ++i) {
+ if (previous && snaps.at(i) >= pos) {
+ if (i == 0) i = 1;
+ return snaps.at(i - 1);
+ } else if (!previous && snaps.at(i) > pos) {
+ return snaps.at(i);
+ }
+ }
+ return GenTime();
+}
+
+
+
+void Monitor::slotZoneMoved(int start, int end)
+{
+ m_ruler->setZone(start, end);
+ checkOverlay();
+ setClipZone(m_ruler->zone());
+}
+
+void Monitor::slotSetZoneStart()
+{
+ m_ruler->setZone(render->seekFramePosition(), -1);
+ emit zoneUpdated(m_ruler->zone());
+ checkOverlay();
+ setClipZone(m_ruler->zone());
+}
+
+void Monitor::slotSetZoneEnd()
+{
+ m_ruler->setZone(-1, render->seekFramePosition());
+ emit zoneUpdated(m_ruler->zone());
+ checkOverlay();
+ setClipZone(m_ruler->zone());