]> git.sesse.net Git - kdenlive/blob - src/geometryval.h
Add widget for easier timecode display
[kdenlive] / src / geometryval.h
1 /***************************************************************************
2                           geomeytrval.h  -  description
3                              -------------------
4     begin                : 03 Aug 2008
5     copyright            : (C) 2008 by Marco Gittler
6     email                : g.marco@freenet.de
7  ***************************************************************************/
8
9 /***************************************************************************
10  *                                                                         *
11  *   This program is free software; you can redistribute it and/or modify  *
12  *   it under the terms of the GNU General Public License as published by  *
13  *   the Free Software Foundation; either version 2 of the License, or     *
14  *   (at your option) any later version.                                   *
15  *                                                                         *
16  ***************************************************************************/
17
18 #ifndef GEOMETRYVAL_H
19 #define GEOMETRYVAL_H
20
21
22 #include <QWidget>
23 #include <QDomElement>
24 #include <QGraphicsPathItem>
25 #include <QGraphicsView>
26
27 #include <mlt++/Mlt.h>
28
29 #include "ui_geometryval_ui.h"
30 #include "definitions.h"
31 #include "keyframehelper.h"
32 #include "timecodedisplay.h"
33 #include "ui_geometryposition_ui.h"
34
35 //class QGraphicsScene;
36 class GraphicsSceneRectMove;
37 class QGraphicsRectItem;
38 class QMouseEvent;
39
40
41 class Geometryval : public QWidget, public Ui::Geometryval
42 {
43     Q_OBJECT
44 public:
45     explicit Geometryval(const MltVideoProfile profile, Timecode t, QPoint frame_size, int startPoint = 0, QWidget* parent = 0);
46     virtual ~Geometryval();
47     QDomElement getParamDesc();
48     QString getValue() const;
49     void setFrameSize(QPoint p);
50     /* update the timecode display depending on what the user wants (frame number or hh:mm:ss:ff) */
51     void updateTimecodeFormat();
52
53 private:
54     MltVideoProfile m_profile;
55     Timecode m_timecode;
56     int m_realWidth;
57     GraphicsSceneRectMove *m_scene;
58     QGraphicsRectItem *m_paramRect;
59     Mlt::Geometry *m_geom;
60     KeyframeHelper *m_helper;
61     QGraphicsPathItem *m_path;
62     QMenu *m_configMenu;
63     QAction *m_syncAction;
64     QAction *m_editOptions;
65     QAction *m_reset;
66     bool m_fixedMode;
67     QPoint m_frameSize;
68     Ui::GeometryPosition_UI m_view;
69     void updateTransitionPath();
70     double m_dar;
71     int m_startPoint;
72     QGraphicsView *m_sceneview;
73     TimecodeDisplay m_timePos;
74     bool keyframeSelected();
75
76 public slots:
77     void setupParam(const QDomElement, int, int);
78
79 private slots:
80     void slotNextFrame();
81     void slotPreviousFrame();
82     void slotPositionChanged(int pos = -1, bool seek = true);
83     void slotDeleteFrame(int pos = -1);
84     void slotAddFrame(int pos = -1);
85     void slotUpdateTransitionProperties();
86     void slotTransparencyChanged(int transp);
87     void slotResizeCustom();
88     void slotResizeOriginal();
89     void slotAlignRight();
90     void slotAlignLeft();
91     void slotAlignTop();
92     void slotAlignBottom();
93     void slotAlignHCenter();
94     void slotAlignVCenter();
95     void slotSyncCursor();
96     void slotResetPosition();
97     void slotKeyframeMoved(int);
98     void slotSwitchOptions();
99     void slotUpdateGeometry();
100     void slotGeometryX(int value);
101     void slotGeometryY(int value);
102     void slotGeometryWidth(int value);
103     void slotGeometryHeight(int value);
104
105 signals:
106     void parameterChanged();
107     void seekToPos(int);
108 };
109
110 #endif