+ 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: " << m_ui.video_frame->winId();
+}
+
+Monitor::~Monitor()
+{
+ delete m_ruler;
+ delete m_timePos;
+ delete m_overlay;
+ delete m_monitorRefresh;
+}
+
+QString Monitor::name() const
+{
+ return m_name;
+}
+
+void Monitor::setupMenu(QMenu *goMenu, QAction *playZone, QAction *loopZone, QMenu *markerMenu)
+{
+ m_contextMenu = new QMenu(this);
+ m_contextMenu->addMenu(m_playMenu);
+ if (goMenu) m_contextMenu->addMenu(goMenu);
+ if (markerMenu) m_contextMenu->addMenu(markerMenu);
+
+ m_playMenu->addAction(playZone);
+ m_playMenu->addAction(loopZone);
+
+ //TODO: add save zone to timeline monitor when fixed
+ if (m_name == "clip") m_contextMenu->addAction(KIcon("document-save"), i18n("Save zone"), this, SLOT(slotSaveZone()));
+
+ QAction *extractFrame = m_configMenu->addAction(KIcon("document-new"), i18n("Extract frame"), this, SLOT(slotExtractCurrentFrame()));
+ m_contextMenu->addAction(extractFrame);
+
+ if (m_name != "clip") {
+ QAction *splitView = m_contextMenu->addAction(KIcon("view-split-left-right"), i18n("Split view"), render, SLOT(slotSplitView(bool)));
+ splitView->setCheckable(true);
+ m_configMenu->addAction(splitView);
+ } else {
+ QAction *setThumbFrame = m_contextMenu->addAction(KIcon("document-new"), i18n("Set current image as thumbnail"), this, SLOT(slotSetThumbFrame()));
+ m_configMenu->addAction(setThumbFrame);
+ }
+
+ QAction *showTips = m_contextMenu->addAction(KIcon("help-hint"), i18n("Monitor overlay infos"));
+ showTips->setCheckable(true);
+ connect(showTips, SIGNAL(toggled(bool)), this, SLOT(slotSwitchMonitorInfo(bool)));
+ showTips->setChecked(KdenliveSettings::displayMonitorInfo());
+
+ QAction *dropFrames = m_contextMenu->addAction(KIcon(), i18n("Real time (drop frames)"));
+ dropFrames->setCheckable(true);
+ dropFrames->setChecked(true);
+ connect(dropFrames, SIGNAL(toggled(bool)), this, SLOT(slotSwitchDropFrames(bool)));
+
+ m_configMenu->addAction(showTips);
+ m_configMenu->addAction(dropFrames);
+
+}
+
+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;