-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathqgraphicstrimslider.h
99 lines (77 loc) · 2.76 KB
/
qgraphicstrimslider.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/*******************************************************************************
YCbCr Exporter
A tool to aid filmmakers / artists to manipulate YCbCr files to
maximize quality.
Copyright (C) 2013 Troy James Sobotka, troy.sobotka@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/
#ifndef QGRAPHICSTRIMSLIDER_H
#define QGRAPHICSTRIMSLIDER_H
#include <QtWidgets>
#include "ffsequence.h"
class QGraphicsTrimSlider : public QGraphicsWidget
{
Q_OBJECT
signals:
void signal_trimChanged(ffTrim);
void signal_valueChanged(long);
private:
QColor m_colorInOut;
QColor m_colorBackground;
QColor m_colorPen;
QRectF m_rectF;
QPainterPath m_painterPath;
QPainterPath m_painterPathTrim;
long m_value;
long m_minValue;
long m_maxValue;
long m_trimIn;
long m_trimOut;
float m_position;
void updatePaths(void);
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
void createObjects(void);
void initObjects(void);
float valueToGeometry(void);
long geometryToValue(float);
virtual void mousePressEvent(QGraphicsSceneMouseEvent *);
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *);
virtual void resizeEvent(QGraphicsSceneResizeEvent *);
QPainterPath shape() const;
public:
enum Default
{
Width = 100,
Height = 16,
MinimumValue = 0,
MaximumValue = 100,
ValueSliderWidth = 6,
ValueSliderPen = 2,
ColorDarkGray = 64,
ColorMediumGray = 100,
ColorLightGray = 140
};
QGraphicsTrimSlider(QGraphicsItem *parent = 0);
~QGraphicsTrimSlider();
void setTrim(long, long);
void setTrim(ffTrim);
void setTrimIn(long);
void setTrimOut(long);
ffTrim getTrim(void);
void setMaximum(long);
void setMinimum(long);
void setValue(long);
long maximum(void);
long minimum(void);
long value(void);
};
#endif // QGRAPHICSTRIMSLIDER_H