1 /***************************************************************************
2 * Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org) *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
21 #ifndef MONITORMANAGER_H
22 #define MONITORMANAGER_H
25 #include "recmonitor.h"
30 class MonitorManager : public QObject
35 explicit MonitorManager(QWidget *parent = 0);
36 void initMonitors(Monitor *clipMonitor, Monitor *projectMonitor, RecMonitor *recMonitor);
37 void appendMonitor(AbstractMonitor *monitor);
38 void removeMonitor(AbstractMonitor *monitor);
39 Timecode timecode() const;
40 void resetProfiles(const Timecode &tc);
41 void stopActiveMonitor();
42 AbstractRender *activeRenderer();
43 /** Searches for a monitor with the given name.
44 @return NULL, if no monitor could be found, or the monitor otherwise.
46 AbstractMonitor *monitor(Kdenlive::MonitorId monitorName);
47 void updateScopeSource();
48 void clearScopeSource();
49 /** @brief Returns current project's folder. */
50 QString getProjectFolder() const;
51 /** @brief Sets current document for later reference. */
52 void setDocument(KdenliveDoc *doc);
53 /** @brief Change an MLT consumer property for both monitors. */
54 void setConsumerProperty(const QString &name, const QString &value);
58 /** @brief Activates a monitor.
59 * @param name name of the monitor to activate */
60 bool activateMonitor(Kdenlive::MonitorId, bool forceRefresh = false);
61 bool isActive(Kdenlive::MonitorId id) const;
66 void slotRewind(double speed = 0);
67 void slotForward(double speed = 0);
68 void slotRewindOneFrame();
69 void slotForwardOneFrame();
70 void slotRewindOneSecond();
71 void slotForwardOneSecond();
74 void slotResetProfiles();
76 /** @brief Switch current monitor to fullscreen. */
77 void slotSwitchFullscreen();
79 /** @brief Switches between project and clip monitor.
80 * @ref activateMonitor
81 * @param activateClip whether to activate the clip monitor */
82 void slotSwitchMonitors(bool activateClip);
83 void slotUpdateAudioMonitoring();
86 void slotRefreshCurrentMonitor(const QString &id);
89 KdenliveDoc *m_document;
90 Monitor *m_clipMonitor;
91 Monitor *m_projectMonitor;
93 AbstractMonitor *m_activeMonitor;
94 QList <AbstractMonitor *>m_monitorsList;
97 /** @brief When the monitor changed, update the visible color scopes */
98 void checkColorScopes();
99 /** @brief When the active monitor renderer was deleted, reset color scopes */