#include <QTimer>
#include <KDebug>
+
MonitorManager::MonitorManager(QWidget *parent) :
QObject(parent),
m_clipMonitor(NULL),
m_monitorsList.removeAll(monitor);
}
-void MonitorManager::activateMonitor(QString name)
+bool MonitorManager::activateMonitor(const QString &name)
{
if (m_clipMonitor == NULL || m_projectMonitor == NULL)
- return;
+ return false;
if (m_activeMonitor && m_activeMonitor->name() == name)
- return;
+ return false;
m_activeMonitor = NULL;
for (int i = 0; i < m_monitorsList.count(); i++) {
if (m_monitorsList.at(i)->name() == name) {
else m_monitorsList.at(i)->stop();
}
if (m_activeMonitor) {
+ m_activeMonitor->blockSignals(true);
m_activeMonitor->parentWidget()->raise();
m_activeMonitor->start();
+ m_activeMonitor->blockSignals(false);
}
emit checkColorScopes();
+ return (m_activeMonitor != NULL);
}
bool MonitorManager::isActive(const QString &name) const
if (m_projectMonitor == NULL || m_clipMonitor == NULL) return;
blockSignals(true);
QString active = m_activeMonitor ? m_activeMonitor->name() : QString();
- 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();
- }
+ m_clipMonitor->resetProfile(KdenliveSettings::current_profile());
+ m_projectMonitor->resetProfile(KdenliveSettings::current_profile());
if (!active.isEmpty()) activateMonitor(active);
blockSignals(false);
if (m_activeMonitor) m_activeMonitor->parentWidget()->raise();
emit checkColorScopes();
}
-void MonitorManager::slotRefreshCurrentMonitor()
+void MonitorManager::slotRefreshCurrentMonitor(const QString &id)
{
+ // Clip producer was modified, check if clip is currently displayed in clip monitor
+ m_clipMonitor->reloadProducer(id);
if (m_activeMonitor == m_clipMonitor) m_clipMonitor->refreshMonitor();
else m_projectMonitor->refreshMonitor();
}