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);
90 virtual void wheelEvent(QWheelEvent * event);
91 virtual void mouseMoveEvent(QMouseEvent *event);
92 virtual QStringList mimeTypes() const;
93 /* virtual void dragMoveEvent(QDragMoveEvent * event);
94 virtual Qt::DropActions supportedDropActions() const;*/
96 // virtual void resizeEvent(QResizeEvent * event);
97 // virtual void paintEvent(QPaintEvent * event);
102 MonitorManager *m_monitorManager;
103 DocClipBase *m_currentClip;
110 MonitorRefresh *m_monitorRefresh;
113 KRestrictedLine *m_timePos;
114 QAction *m_playAction;
115 QMenu *m_contextMenu;
119 QPoint m_DragStartPosition;
121 VideoGLWidget *m_glWidget;
123 GenTime getSnapForPos(bool previous);
124 bool m_frametimecode;
127 void seekCursor(int pos);
128 void rendererStopped(int pos);
129 void slotExtractCurrentFrame();
130 void slotSetThumbFrame();
131 void slotSetSizeOneToOne();
132 void slotSetSizeOneToTwo();
135 void setClipZone(QPoint pos);
136 void slotSwitchMonitorInfo(bool show);
137 void slotSwitchDropFrames(bool show);
138 void slotGoToMarker(QAction *action);
141 void slotOpenFile(const QString &);
142 void slotSetXml(DocClipBase *clip, QPoint zone = QPoint(), const int position = -1);
144 void refreshMonitor(bool visible = true);
145 void slotSeek(int pos);
148 void activateMonitor();
152 void slotForward(double speed = 0);
153 void slotRewind(double speed = 0);
154 void slotRewindOneFrame(int diff = 1);
155 void slotForwardOneFrame(int diff = 1);
156 void saveSceneList(QString path, QDomElement info = QDomElement());
159 void slotSetZoneStart();
160 void slotSetZoneEnd();
161 void slotZoneStart();
163 void slotZoneMoved(int start, int end);
164 void slotSeekToNextSnap();
165 void slotSeekToPreviousSnap();
166 void adjustRulerSize(int length);
167 void setTimePos(const QString &pos);
168 QStringList getZoneInfo() const;
171 void renderPosition(int);
172 void durationChanged(int);
173 void refreshClipThumbnail(const QString &);
174 void adjustMonitorSize();
175 void zoneUpdated(QPoint);
176 void saveZone(Render *, QPoint);