#include <QIntValidator>
-Monitor::Monitor(QString name, MonitorManager *manager, QWidget *parent) :
+Monitor::Monitor(QString name, MonitorManager *manager, QString profile, QWidget *parent) :
QWidget(parent),
render(NULL),
m_name(name),
//m_ruler->setPixelPerMark(3);
+ if (profile.isEmpty()) profile = KdenliveSettings::current_profile();
+
QVBoxLayout *rendererBox = new QVBoxLayout(m_ui.video_frame);
rendererBox->setContentsMargins(0, 0, 0, 0);
#ifdef Q_WS_MAC
m_glWidget = new VideoGLWidget(m_ui.video_frame);
rendererBox->addWidget(m_glWidget);
- render = new Render(m_name, (int) m_ui.video_frame->winId(), -1, this);
+ render = new Render(m_name, (int) m_ui.video_frame->winId(), -1, profile, this);
m_glWidget->setImageAspectRatio(render->dar());
m_glWidget->setBackgroundColor(KdenliveSettings::window_background());
m_glWidget->resize(m_ui.video_frame->size());
#else
m_monitorRefresh = new MonitorRefresh(m_ui.video_frame);
rendererBox->addWidget(m_monitorRefresh);
- render = new Render(m_name, (int) m_monitorRefresh->winId(), -1, this);
+ render = new Render(m_name, (int) m_monitorRefresh->winId(), -1, profile, this);
m_monitorRefresh->setRenderer(render);
#endif
//TODO: add save zone to timeline monitor when fixed
if (m_name == "clip") {
- m_contextMenu->addMenu(m_markerMenu);
- m_contextMenu->addAction(KIcon("document-save"), i18n("Save zone"), this, SLOT(slotSaveZone()));
+ m_contextMenu->addMenu(m_markerMenu);
+ 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);
void Monitor::updateMarkers(DocClipBase *source)
{
- if (source == m_currentClip) {
+ if (source == m_currentClip && source != NULL) {
m_markerMenu->clear();
QList <CommentedTime> markers = m_currentClip->commentedSnapMarkers();
if (!markers.isEmpty()) {
void Monitor::slotExtractCurrentFrame()
{
QImage frame = render->extractFrame(render->seekFramePosition());
- KFileDialog *fs = new KFileDialog(KUrl(), "image/png",this);
+ KFileDialog *fs = new KFileDialog(KUrl(), "image/png", this);
fs->setOperationMode(KFileDialog::Saving);
fs->setMode(KFile::File);
#if KDE_IS_VERSION(4,2,0)
}
if (clip != m_currentClip) {
m_currentClip = clip;
- updateMarkers(clip);
+ updateMarkers(clip);
if (render->setProducer(clip->producer(), position) == -1) {
// MLT CONSUMER is broken
emit blockMonitors();
}
-void Monitor::resetProfile()
+void Monitor::resetProfile(const QString profile)
{
if (render == NULL) return;
- render->resetProfile();
+ render->resetProfile(profile);
}
void Monitor::saveSceneList(QString path, QDomElement info)