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 virtual void paintEvent(QPaintEvent * event);
60 void setOverlayText(const QString &, bool isZone = true);
66 class Monitor : public QWidget
71 Monitor(QString name, MonitorManager *manager, QString profile = QString(), QWidget *parent = 0);
74 void resetProfile(const QString profile);
77 bool isActive() const;
79 void setupMenu(QMenu *goMenu, QAction *playZone, QAction *loopZone, QMenu *markerMenu = NULL);
80 const QString sceneList();
81 DocClipBase *activeClip();
84 void updateTimecodeFormat();
85 void updateMarkers(DocClipBase *source);
88 virtual void mousePressEvent(QMouseEvent * event);
89 virtual void mouseReleaseEvent(QMouseEvent * event);
91 /** @brief Move to another position on mouse wheel event.
93 * Moves towards the end of the clip/timeline on mouse wheel down/back, the
94 * opposite on mouse wheel up/forward.
95 * Ctrl + wheel moves by a single frame, without Ctrl it moves by a second.
97 * See also http://www.kdenlive.org/mantis/view.php?id=265. */
98 virtual void wheelEvent(QWheelEvent * event);
99 virtual void mouseMoveEvent(QMouseEvent *event);
100 virtual QStringList mimeTypes() const;
101 /*virtual void dragMoveEvent(QDragMoveEvent * event);
102 virtual Qt::DropActions supportedDropActions() const;*/
104 //virtual void resizeEvent(QResizeEvent * event);
105 //virtual void paintEvent(QPaintEvent * event);
110 MonitorManager *m_monitorManager;
111 DocClipBase *m_currentClip;
118 MonitorRefresh *m_monitorRefresh;
121 KRestrictedLine *m_timePos;
122 QAction *m_playAction;
123 QMenu *m_contextMenu;
127 QPoint m_DragStartPosition;
129 VideoGLWidget *m_glWidget;
131 GenTime getSnapForPos(bool previous);
132 bool m_frametimecode;
135 void seekCursor(int pos);
136 void rendererStopped(int pos);
137 void slotExtractCurrentFrame();
138 void slotSetThumbFrame();
139 void slotSetSizeOneToOne();
140 void slotSetSizeOneToTwo();
143 void setClipZone(QPoint pos);
144 void slotSwitchMonitorInfo(bool show);
145 void slotSwitchDropFrames(bool show);
146 void slotGoToMarker(QAction *action);
149 void slotOpenFile(const QString &);
150 void slotSetXml(DocClipBase *clip, QPoint zone = QPoint(), const int position = -1);
152 void refreshMonitor(bool visible = true);
153 void slotSeek(int pos);
156 void activateMonitor();
160 void slotForward(double speed = 0);
161 void slotRewind(double speed = 0);
162 void slotRewindOneFrame(int diff = 1);
163 void slotForwardOneFrame(int diff = 1);
164 void saveSceneList(QString path, QDomElement info = QDomElement());
167 void slotSetZoneStart();
168 void slotSetZoneEnd();
169 void slotZoneStart();
171 void slotZoneMoved(int start, int end);
172 void slotSeekToNextSnap();
173 void slotSeekToPreviousSnap();
174 void adjustRulerSize(int length);
175 void setTimePos(const QString &pos);
176 QStringList getZoneInfo() const;
179 void renderPosition(int);
180 void durationChanged(int);
181 void refreshClipThumbnail(const QString &);
182 void adjustMonitorSize();
183 void zoneUpdated(QPoint);
184 void saveZone(Render *, QPoint);