]> git.sesse.net Git - kdenlive/blob - src/monitormanager.h
Cleaning code style of Definitions.
[kdenlive] / src / monitormanager.h
1 /***************************************************************************
2  *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
3  *                                                                         *
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.                                   *
8  *                                                                         *
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.                          *
13  *                                                                         *
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  ***************************************************************************/
19
20
21 #ifndef MONITORMANAGER_H
22 #define MONITORMANAGER_H
23
24 #include "monitor.h"
25 #include "recmonitor.h"
26 #include "timecode.h"
27
28 class KdenliveDoc;
29
30 class MonitorManager : public QObject
31 {
32     Q_OBJECT
33
34 public:
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.
45     */
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);
55
56 public slots:
57
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;
62     void slotPlay();
63     void slotPause();
64     void slotPlayZone();
65     void slotLoopZone();
66     void slotRewind(double speed = 0);
67     void slotForward(double speed = 0);
68     void slotRewindOneFrame();
69     void slotForwardOneFrame();
70     void slotRewindOneSecond();
71     void slotForwardOneSecond();
72     void slotStart();
73     void slotEnd();
74     void slotResetProfiles();
75     
76     /** @brief Switch current monitor to fullscreen. */
77     void slotSwitchFullscreen();
78
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();
84
85 private slots:
86     void slotRefreshCurrentMonitor(const QString &id);
87
88 private:
89     KdenliveDoc *m_document;
90     Monitor *m_clipMonitor;
91     Monitor *m_projectMonitor;
92     Timecode m_timecode;
93     AbstractMonitor *m_activeMonitor;
94     QList <AbstractMonitor *>m_monitorsList;
95
96 signals:
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 */
100     void clearScopes();
101
102 };
103
104 #endif