#include <QObject>
#include <QTimer>
-
+#include <KDebug>
MonitorManager::MonitorManager(QWidget *parent) :
QObject(parent),
m_clipMonitor(NULL),
m_projectMonitor(NULL),
- m_activeMonitor(NULL),
- m_blocked(false)
+ m_activeMonitor(NULL)
{
}
void MonitorManager::activateMonitor(QString name)
{
- if (m_blocked || m_clipMonitor == NULL || m_projectMonitor == NULL)
+ if (m_clipMonitor == NULL || m_projectMonitor == NULL)
return;
if (m_activeMonitor && m_activeMonitor->name() == name)
return;
void MonitorManager::stopActiveMonitor()
{
- if (m_blocked) return;
if (m_activeMonitor == m_clipMonitor) m_clipMonitor->pause();
else m_projectMonitor->pause();
}
void MonitorManager::resetProfiles(Timecode tc)
{
- if (m_blocked) return;
m_timecode = tc;
slotResetProfiles();
//QTimer::singleShot(300, this, SLOT(slotResetProfiles()));
void MonitorManager::slotResetProfiles()
{
- if (m_blocked) return;
if (m_projectMonitor == NULL || m_clipMonitor == NULL) return;
blockSignals(true);
QString active = m_activeMonitor ? m_activeMonitor->name() : QString();
- activateMonitor("clip");
- m_clipMonitor->resetProfile(KdenliveSettings::current_profile());
- m_clipMonitor->updateTimecodeFormat();
- activateMonitor("project");
- m_projectMonitor->resetProfile(KdenliveSettings::current_profile());
- m_projectMonitor->updateTimecodeFormat();
- //m_projectMonitor->refreshMonitor(true);
+ if (!m_clipMonitor->render->hasProfile(KdenliveSettings::current_profile())) {
+ activateMonitor("clip");
+ m_clipMonitor->resetProfile(KdenliveSettings::current_profile());
+ m_clipMonitor->updateTimecodeFormat();
+ }
+ if (!m_projectMonitor->render->hasProfile(KdenliveSettings::current_profile())) {
+ activateMonitor("project");
+ m_projectMonitor->resetProfile(KdenliveSettings::current_profile());
+ m_projectMonitor->updateTimecodeFormat();
+ }
if (!active.isEmpty()) activateMonitor(active);
blockSignals(false);
- m_activeMonitor->parentWidget()->raise();
+ if (m_activeMonitor) m_activeMonitor->parentWidget()->raise();
emit checkColorScopes();
}
return clip;
}
+bool Render::hasProfile(const QString &profileName) const
+{
+ return m_activeProfile == profileName;
+}
+
int Render::resetProfile(const QString &profileName, bool dropSceneList)
{
- QString scene;
- if (!dropSceneList) scene = sceneList();
if (m_mltConsumer) {
if (m_externalConsumer == KdenliveSettings::external_display()) {
if (KdenliveSettings::external_display() && m_activeProfile == profileName) return 1;
delete m_mltConsumer;
m_mltConsumer = NULL;
}
+ QString scene;
+ if (!dropSceneList) scene = sceneList();
int pos = 0;
double current_fps = m_mltProfile->fps();
double current_dar = m_mltProfile->dar();
/** @brief Change the Mlt PROFILE
* @param profileName The MLT profile name
* @param dropSceneList If true, the current playlist will be deleted
+ * @return true if the profile was changed
* . */
int resetProfile(const QString& profileName, bool dropSceneList = false);
+ /** @brief Returns true if the render uses profileName as current profile. */
+ bool hasProfile(const QString& profileName) const;
double fps() const;
/** @brief Returns the width of a frame for this profile. */