From 25b8bcc770a70a6c2d17f9b94b6c5b9df0c845f4 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Thu, 3 Jan 2013 19:23:32 +0100 Subject: [PATCH] Fix profile change on first clip load: http://kdenlive.org/mantis/view.php?id=2925 --- src/mainwindow.cpp | 2 +- src/monitor.cpp | 2 +- src/monitormanager.cpp | 4 +++- src/projectlist.cpp | 3 +++ src/recmonitor.cpp | 1 - src/videoglwidget.cpp | 7 +++++++ src/videoglwidget.h | 4 +--- 7 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index cecbe4bb..3b64937d 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2425,7 +2425,6 @@ void MainWindow::slotUpdateProjectProfile(const QString &profile) KdenliveSettings::setCurrent_profile(profile); KdenliveSettings::setProject_fps(m_activeDocument->fps()); setCaption(m_activeDocument->description(), m_activeDocument->isModified()); - m_activeDocument->clipManager()->clearUnusedProducers(); m_monitorManager->resetProfiles(m_activeDocument->timecode()); m_transitionConfig->updateProjectFormat(m_activeDocument->mltProfile(), m_activeDocument->timecode(), m_activeDocument->tracksList()); @@ -2440,6 +2439,7 @@ void MainWindow::slotUpdateProjectProfile(const QString &profile) m_commandStack->activeStack()->clear(); //Update the mouse position display so it will display in DF/NDF format by default based on the project setting. slotUpdateMousePosition(0); + m_projectList->slotReloadClip(); // We need to desactivate & reactivate monitors to get a refresh //m_monitorManager->switchMonitors(); } diff --git a/src/monitor.cpp b/src/monitor.cpp index a35ff711..1c74137f 100644 --- a/src/monitor.cpp +++ b/src/monitor.cpp @@ -929,7 +929,7 @@ void Monitor::resetProfile(const QString &profile) if (!render->hasProfile(profile)) { slotActivateMonitor(); render->resetProfile(profile); -#ifdef USE_OPENGL +#ifdef USE_OPENGL if (m_glWidget) m_glWidget->setImageAspectRatio(render->dar()); #endif } diff --git a/src/monitormanager.cpp b/src/monitormanager.cpp index 178ffc1d..a871bb51 100644 --- a/src/monitormanager.cpp +++ b/src/monitormanager.cpp @@ -197,7 +197,9 @@ void MonitorManager::resetProfiles(Timecode tc) void MonitorManager::slotResetProfiles() { - if (m_projectMonitor == NULL || m_clipMonitor == NULL) return; + if (m_projectMonitor == NULL || m_clipMonitor == NULL) { + return; + } blockSignals(true); Kdenlive::MONITORID active = m_activeMonitor ? m_activeMonitor->id() : Kdenlive::noMonitor; m_clipMonitor->resetProfile(KdenliveSettings::current_profile()); diff --git a/src/projectlist.cpp b/src/projectlist.cpp index fdba31b3..97dad224 100644 --- a/src/projectlist.cpp +++ b/src/projectlist.cpp @@ -2269,6 +2269,9 @@ void ProjectList::slotReplyGetFileProperties(const QString &clipId, Mlt::Produce } else if (KdenliveSettings::checkfirstprojectclip() && m_listView->topLevelItemCount() == 1 && m_refreshed && m_allClipsProcessed) { // this is the first clip loaded in project, check if we want to adjust project settings to the clip updatedProfile = adjustProjectProfileToItem(item); + if (updatedProfile == false) { + emit clipSelected(item->referencedClip()); + } } if (updatedProfile == false) { //emit clipSelected(item->referencedClip()); diff --git a/src/recmonitor.cpp b/src/recmonitor.cpp index f2395efb..6fbab099 100644 --- a/src/recmonitor.cpp +++ b/src/recmonitor.cpp @@ -867,7 +867,6 @@ void RecMonitor::slotStartGrab(const QRect &rect) { void RecMonitor::slotProcessStatus(QProcess::ProcessState status) { - kDebug()<<"// STATUS CHANGED: "<kill(); if (m_isCapturing && device_selector->currentIndex() != FIREWIRE) diff --git a/src/videoglwidget.cpp b/src/videoglwidget.cpp index eff90f6e..52a69892 100644 --- a/src/videoglwidget.cpp +++ b/src/videoglwidget.cpp @@ -41,6 +41,12 @@ QSize VideoGLWidget::sizeHint() const return QSize(400, 300); } +void VideoGLWidget::setImageAspectRatio(double ratio) +{ + m_display_ratio = ratio; + resizeGL(width(), height()); +} + void VideoGLWidget::initializeGL() { qglClearColor(m_backgroundColor); @@ -57,6 +63,7 @@ void VideoGLWidget::resizeEvent(QResizeEvent* event) { resizeGL(event->size().width(),event->size().height()); } + void VideoGLWidget::resizeGL(int width, int height) { double this_aspect = (double) width / height; diff --git a/src/videoglwidget.h b/src/videoglwidget.h index 8a243ddc..2d492d9e 100644 --- a/src/videoglwidget.h +++ b/src/videoglwidget.h @@ -14,9 +14,7 @@ public: void activateMonitor(); QSize minimumSizeHint() const; QSize sizeHint() const; - void setImageAspectRatio(double ratio) { - m_display_ratio = ratio; - } + void setImageAspectRatio(double ratio); void setBackgroundColor(QColor color) { m_backgroundColor = color; } -- 2.39.2