#include <QLabel>
#include <QIntValidator>
#include <QVBoxLayout>
+#include <QSlider>
#define SEEK_INACTIVE (-1)
m_markerMenu = new QMenu(i18n("Go to marker..."), this);
m_markerMenu->setEnabled(false);
m_configMenu->addMenu(m_markerMenu);
- connect(m_markerMenu, SIGNAL(triggered(QAction *)), this, SLOT(slotGoToMarker(QAction *)));
+ connect(m_markerMenu, SIGNAL(triggered(QAction*)), this, SLOT(slotGoToMarker(QAction*)));
}
m_configMenu->addAction(KIcon("transform-scale"), i18n("Resize (100%)"), this, SLOT(slotSetSizeOneToOne()));
m_configMenu->addAction(KIcon("transform-scale"), i18n("Resize (50%)"), this, SLOT(slotSetSizeOneToTwo()));
setLayout(layout);
setMinimumHeight(200);
- if (profile.isEmpty()) profile = KdenliveSettings::current_profile();
+ if (profile.isEmpty())
+ profile = KdenliveSettings::current_profile();
bool monitorCreated = false;
#ifdef Q_WS_MAC
if (id == Kdenlive::projectMonitor) {
m_effectWidget = new MonitorEditWidget(render, videoBox);
- connect(m_effectWidget, SIGNAL(showEdit(bool, bool)), this, SLOT(slotShowEffectScene(bool, bool)));
+ connect(m_effectWidget, SIGNAL(showEdit(bool,bool)), this, SLOT(slotShowEffectScene(bool,bool)));
m_toolbar->addAction(m_effectWidget->getVisibilityAction());
videoBox->layout()->addWidget(m_effectWidget);
m_effectWidget->hide();
}
#ifdef USE_OPENGL
-bool Monitor::createOpenGlWidget(QWidget *parent, const QString profile)
+bool Monitor::createOpenGlWidget(QWidget *parent, const QString &profile)
{
render = new Render(id(), 0, profile, this);
m_glWidget = new VideoGLWidget(parent);
if (markerMenu) {
m_contextMenu->addMenu(markerMenu);
QList <QAction *>list = markerMenu->actions();
- for (int i = 0; i < list.count(); i++) {
+ for (int i = 0; i < list.count(); ++i) {
if (list.at(i)->data().toString() == "edit_marker") {
m_editMarker = list.at(i);
break;
showTips->setCheckable(true);
connect(showTips, SIGNAL(toggled(bool)), this, SLOT(slotSwitchMonitorInfo(bool)));
showTips->setChecked(KdenliveSettings::displayMonitorInfo());
-
- KSelectAction *interlace = new KSelectAction(i18n("Deinterlacer"), this);
- interlace->addAction(i18n("One Field (fast)"));
- interlace->addAction(i18n("Linear Blend (fast)"));
- interlace->addAction(i18n("YADIF - temporal only (good)"));
- interlace->addAction(i18n("YADIF - temporal + spacial (best)"));
- if (KdenliveSettings::mltdeinterlacer() == "linearblend") interlace->setCurrentItem(1);
- else if (KdenliveSettings::mltdeinterlacer() == "yadif-temporal") interlace->setCurrentItem(2);
- else if (KdenliveSettings::mltdeinterlacer() == "yadif") interlace->setCurrentItem(3);
- else interlace->setCurrentItem(0);
- connect(interlace, SIGNAL(triggered(int)), this, SLOT(slotSetDeinterlacer(int)));
-
- KSelectAction *interpol = new KSelectAction(i18n("Interpolation"), this);
- interpol->addAction(i18n("Nearest Neighbor (fast)"));
- interpol->addAction(i18n("Bilinear (good)"));
- interpol->addAction(i18n("Bicubic (better)"));
- interpol->addAction(i18n("Hyper/Lanczos (best)"));
- if (KdenliveSettings::mltinterpolation() == "bilinear") interpol->setCurrentItem(1);
- else if (KdenliveSettings::mltinterpolation() == "bicubic") interpol->setCurrentItem(2);
- else if (KdenliveSettings::mltinterpolation() == "hyper") interpol->setCurrentItem(3);
- else interpol->setCurrentItem(0);
- connect(interpol, SIGNAL(triggered(int)), this, SLOT(slotSetInterpolation(int)));
QAction *dropFrames = m_contextMenu->addAction(KIcon(), i18n("Real time (drop frames)"));
dropFrames->setCheckable(true);
m_configMenu->addAction(showTips);
m_configMenu->addAction(dropFrames);
- m_configMenu->addAction(interlace);
- m_configMenu->addAction(interpol);
-
}
void Monitor::slotGoToMarker(QAction *action)
QList <CommentedTime> markers = m_currentClip->commentedSnapMarkers();
if (!markers.isEmpty()) {
QList <int> marks;
- for (int i = 0; i < markers.count(); i++) {
+ for (int i = 0; i < markers.count(); ++i) {
int pos = (int) markers.at(i).time().frames(m_monitorManager->timecode().fps());
marks.append(pos);
QString position = m_monitorManager->timecode().getTimecode(markers.at(i).time()) + ' ' + markers.at(i).comment();
}
}
-void Monitor::setMarkers(QList <CommentedTime> markers)
+void Monitor::setMarkers(const QList<CommentedTime> &markers)
{
m_ruler->setMarkers(markers);
}
fs->setMode(KFile::File);
fs->setConfirmOverwrite(true);
fs->setKeepLocation(true);
- fs->exec();
- QString path;
- if (fs) path = fs->selectedFile();
- delete fs;
- if (!path.isEmpty()) {
- frame.save(path);
+ if (fs->exec()) {
+ QString path = fs->selectedFile();
+ if (!path.isEmpty()) {
+ frame.save(path);
+ }
}
+ delete fs;
}
void Monitor::setTimePos(const QString &pos)
//render->setSceneList(doc, 0);
}
-void Monitor::setCustomProfile(const QString &profile, Timecode tc)
+void Monitor::setCustomProfile(const QString &profile, const Timecode &tc)
{
m_timePos->updateTimeCode(tc);
if (render == NULL) return;
m_effectWidget->resetProfile(render);
}
-void Monitor::saveSceneList(QString path, QDomElement info)
+void Monitor::saveSceneList(const QString &path, const QDomElement &info)
{
if (render == NULL) return;
render->saveSceneList(path, info);
return render->sceneList();
}
-void Monitor::setClipZone(QPoint pos)
+void Monitor::setClipZone(const QPoint &pos)
{
if (m_currentClip == NULL) return;
m_currentClip->setZone(pos);
render->setDropFrames(show);
}
-void Monitor::slotSetDeinterlacer(int ix)
-{
- QString value;
- switch (ix) {
-
- case 1:
- value = "linearblend";
- break;
- case 2:
- value = "yadif-nospatial";
- break;
- case 3:
- value = "yadif";
- break;
- default:
- value = "onefield";
- }
- KdenliveSettings::setMltdeinterlacer(value);
- m_monitorManager->setConsumerProperty("deinterlace_method", value);
-}
-
-void Monitor::slotSetInterpolation(int ix)
-{
- QString value;
- switch (ix) {
- case 1:
- value = "bilinear";
- break;
- case 2:
- value = "bicubic";
- break;
- case 3:
- value = "hyper";
- break;
- default:
- value = "nearest";
- }
- KdenliveSettings::setMltinterpolation(value);
- m_monitorManager->setConsumerProperty("rescale", value);
-}
-
-
void Monitor::slotSwitchMonitorInfo(bool show)
{
KdenliveSettings::setDisplayMonitorInfo(show);