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 ***************************************************************************/
28 #include <KRestrictedLine>
29 #include <QDomElement>
32 #include "ui_monitor_ui.h"
34 #include "videoglwidget.h"
42 class MonitorRefresh : public QWidget
46 MonitorRefresh(QWidget* parent);
47 virtual void paintEvent(QPaintEvent * event);
48 void setRenderer(Render* render);
54 class Overlay : public QLabel
58 Overlay(QWidget* parent);
59 void setOverlayText(const QString &, bool isZone = true);
65 class Monitor : public QWidget
70 Monitor(QString name, MonitorManager *manager, QString profile = QString(), QWidget *parent = 0);
73 void resetProfile(const QString profile);
76 bool isActive() const;
78 void setupMenu(QMenu *goMenu, QAction *playZone, QAction *loopZone, QMenu *markerMenu = NULL);
79 const QString sceneList();
80 DocClipBase *activeClip();
83 void updateTimecodeFormat();
84 void updateMarkers(DocClipBase *source);
87 virtual void mousePressEvent(QMouseEvent * event);
88 virtual void mouseReleaseEvent(QMouseEvent * event);
90 /** @brief Move to another position on mouse wheel event.
92 * Moves towards the end of the clip/timeline on mouse wheel down/back, the
93 * opposite on mouse wheel up/forward.
94 * Ctrl + wheel moves by a single frame, without Ctrl it moves by a second.
96 * See also http://www.kdenlive.org/mantis/view.php?id=265. */
97 virtual void wheelEvent(QWheelEvent * event);
98 virtual void mouseMoveEvent(QMouseEvent *event);
99 virtual QStringList mimeTypes() const;
100 /*virtual void dragMoveEvent(QDragMoveEvent * event);
101 virtual Qt::DropActions supportedDropActions() const;*/
103 //virtual void resizeEvent(QResizeEvent * event);
104 //virtual void paintEvent(QPaintEvent * event);
109 MonitorManager *m_monitorManager;
110 DocClipBase *m_currentClip;
117 MonitorRefresh *m_monitorRefresh;
120 KRestrictedLine *m_timePos;
121 QAction *m_playAction;
122 QMenu *m_contextMenu;
126 QPoint m_DragStartPosition;
128 VideoGLWidget *m_glWidget;
130 GenTime getSnapForPos(bool previous);
131 bool m_frametimecode;
134 void seekCursor(int pos);
135 void rendererStopped(int pos);
136 void slotExtractCurrentFrame();
137 void slotSetThumbFrame();
138 void slotSetSizeOneToOne();
139 void slotSetSizeOneToTwo();
142 void setClipZone(QPoint pos);
143 void slotSwitchMonitorInfo(bool show);
144 void slotSwitchDropFrames(bool show);
145 void slotGoToMarker(QAction *action);
148 void slotOpenFile(const QString &);
149 void slotSetXml(DocClipBase *clip, QPoint zone = QPoint(), const int position = -1);
151 void refreshMonitor(bool visible = true);
152 void slotSeek(int pos);
155 void activateMonitor();
159 void slotForward(double speed = 0);
160 void slotRewind(double speed = 0);
161 void slotRewindOneFrame(int diff = 1);
162 void slotForwardOneFrame(int diff = 1);
163 void saveSceneList(QString path, QDomElement info = QDomElement());
166 void slotSetZoneStart();
167 void slotSetZoneEnd();
168 void slotZoneStart();
170 void slotZoneMoved(int start, int end);
171 void slotSeekToNextSnap();
172 void slotSeekToPreviousSnap();
173 void adjustRulerSize(int length);
174 void setTimePos(const QString &pos);
175 QStringList getZoneInfo() const;
178 void renderPosition(int);
179 void durationChanged(int);
180 void refreshClipThumbnail(const QString &);
181 void adjustMonitorSize();
182 void zoneUpdated(QPoint);
183 void saveZone(Render *, QPoint);