Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Kdenlive
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
261
Issues
261
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Multimedia
Kdenlive
Commits
17411d21
Commit
17411d21
authored
Mar 07, 2018
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small cleanup in monitor ruler, fix monitor image offset
parent
a8d94198
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
21 additions
and
22 deletions
+21
-22
src/monitor/glwidget.cpp
src/monitor/glwidget.cpp
+6
-11
src/monitor/glwidget.h
src/monitor/glwidget.h
+8
-0
src/monitor/monitor.cpp
src/monitor/monitor.cpp
+2
-2
src/monitor/view/MonitorRuler.qml
src/monitor/view/MonitorRuler.qml
+0
-1
src/monitor/view/kdenliveclipmonitor.qml
src/monitor/view/kdenliveclipmonitor.qml
+2
-3
src/monitor/view/kdenlivemonitor.qml
src/monitor/view/kdenlivemonitor.qml
+2
-3
src/monitor/view/kdenlivemonitoreffectscene.qml
src/monitor/view/kdenlivemonitoreffectscene.qml
+1
-2
No files found.
src/monitor/glwidget.cpp
View file @
17411d21
...
...
@@ -245,9 +245,9 @@ void GLWidget::initializeGL()
void
GLWidget
::
resizeGL
(
int
width
,
int
height
)
{
int
x
,
y
,
w
,
h
;
height
-=
m_proxy
->
rulerHeight
();
double
this_aspect
=
(
double
)
width
/
height
;
double
video_aspect
=
m_monitorProfile
->
dar
();
height
-=
rulerHeight
();
// Special case optimisation to negate odd effect of sample aspect ratio
// not corresponding exactly with image resolution.
...
...
@@ -420,7 +420,7 @@ void GLWidget::paintGL()
f
->
glDisable
(
GL_BLEND
);
f
->
glDisable
(
GL_DEPTH_TEST
);
f
->
glDepthMask
(
GL_FALSE
);
f
->
glViewport
(
0
,
rulerHeight
()
/
2
,
width
,
height
);
f
->
glViewport
(
0
,
0
,
width
,
height
);
check_error
(
f
);
QColor
color
(
KdenliveSettings
::
window_background
());
f
->
glClearColor
(
color
.
redF
(),
color
.
greenF
(),
color
.
blueF
(),
color
.
alphaF
());
...
...
@@ -486,10 +486,10 @@ void GLWidget::paintGL()
QVector
<
QVector2D
>
vertices
;
width
=
m_rect
.
width
()
*
devicePixelRatio
();
height
=
m_rect
.
height
()
*
devicePixelRatio
();
vertices
<<
QVector2D
(
float
(
-
width
)
/
2.0
f
,
float
(
-
height
)
/
2.0
f
);
vertices
<<
QVector2D
(
float
(
-
width
)
/
2.0
f
,
float
(
height
)
/
2.0
f
);
vertices
<<
QVector2D
(
float
(
width
)
/
2.0
f
,
float
(
-
height
)
/
2.0
f
);
vertices
<<
QVector2D
(
float
(
width
)
/
2.0
f
,
float
(
height
)
/
2.0
f
);
vertices
<<
QVector2D
(
float
(
-
width
)
/
2.0
f
,
float
(
-
height
)
/
2.0
f
+
m_proxy
->
rulerHeight
()
);
vertices
<<
QVector2D
(
float
(
-
width
)
/
2.0
f
,
float
(
height
)
/
2.0
f
+
m_proxy
->
rulerHeight
()
);
vertices
<<
QVector2D
(
float
(
width
)
/
2.0
f
,
float
(
-
height
)
/
2.0
f
+
m_proxy
->
rulerHeight
()
);
vertices
<<
QVector2D
(
float
(
width
)
/
2.0
f
,
float
(
height
)
/
2.0
f
+
m_proxy
->
rulerHeight
()
);
m_shader
->
enableAttributeArray
(
m_vertexLocation
);
check_error
(
f
);
m_shader
->
setAttributeArray
(
m_vertexLocation
,
vertices
.
constData
());
...
...
@@ -1785,11 +1785,6 @@ void GLWidget::setRulerInfo(int duration, std::shared_ptr<MarkerListModel> model
}
}
int
GLWidget
::
rulerHeight
()
const
{
return
rootObject
()
->
property
(
"rulerHeight"
).
toInt
();
}
void
GLWidget
::
startConsumer
()
{
if
(
m_consumer
==
nullptr
)
{
...
...
src/monitor/glwidget.h
View file @
17411d21
...
...
@@ -26,6 +26,9 @@
#include <QOpenGLFunctions>
#include <QOpenGLShaderProgram>
#include <QQuickView>
#include <QApplication>
#include <QFont>
#include <QFontMetrics>
#include <QRect>
#include <QSemaphore>
#include <QThread>
...
...
@@ -295,6 +298,7 @@ class MonitorProxy : public QObject
Q_PROPERTY
(
int
seekPosition
READ
seekPosition
WRITE
setSeekPosition
NOTIFY
seekPositionChanged
)
Q_PROPERTY
(
int
zoneIn
READ
zoneIn
WRITE
setZoneIn
NOTIFY
zoneChanged
)
Q_PROPERTY
(
int
zoneOut
READ
zoneOut
WRITE
setZoneOut
NOTIFY
zoneChanged
)
Q_PROPERTY
(
int
rulerHeight
READ
rulerHeight
NOTIFY
rulerHeightChanged
)
Q_PROPERTY
(
QString
markerComment
READ
markerComment
NOTIFY
markerCommentChanged
)
public:
MonitorProxy
(
GLWidget
*
parent
)
...
...
@@ -304,10 +308,12 @@ public:
,
m_seekPosition
(
-
1
)
,
m_zoneIn
(
0
)
,
m_zoneOut
(
-
1
)
,
m_rulerHeight
(
QFontMetrics
(
QApplication
::
font
()).
lineSpacing
()
*
0.7
)
{
}
int
seekPosition
()
const
{
return
m_seekPosition
;
}
int
position
()
const
{
return
m_position
;
}
int
rulerHeight
()
const
{
return
m_rulerHeight
;
}
QString
markerComment
()
const
{
return
m_markerComment
;
}
Q_INVOKABLE
void
requestSeekPosition
(
int
pos
)
{
...
...
@@ -371,6 +377,7 @@ signals:
void
seekRequestChanged
();
void
zoneChanged
();
void
markerCommentChanged
();
void
rulerHeightChanged
();
private:
GLWidget
*
q
;
...
...
@@ -378,6 +385,7 @@ private:
int
m_seekPosition
;
int
m_zoneIn
;
int
m_zoneOut
;
int
m_rulerHeight
;
QString
m_markerComment
;
};
...
...
src/monitor/monitor.cpp
View file @
17411d21
...
...
@@ -550,13 +550,13 @@ void Monitor::slotForceSize(QAction *a)
setSizePolicy
(
QSizePolicy
::
MinimumExpanding
,
QSizePolicy
::
MinimumExpanding
);
m_videoWidget
->
setMinimumSize
(
profileWidth
,
profileHeight
);
m_videoWidget
->
setMaximumSize
(
profileWidth
,
profileHeight
);
setMinimumSize
(
QSize
(
profileWidth
,
profileHeight
+
m_toolbar
->
height
()
+
m_glMonitor
->
rulerHeight
()));
setMinimumSize
(
QSize
(
profileWidth
,
profileHeight
+
m_toolbar
->
height
()
+
m_glMonitor
->
getControllerProxy
()
->
rulerHeight
()));
break
;
default:
// Free resize
m_videoWidget
->
setMinimumSize
(
profileWidth
,
profileHeight
);
m_videoWidget
->
setMaximumSize
(
QWIDGETSIZE_MAX
,
QWIDGETSIZE_MAX
);
setMinimumSize
(
QSize
(
profileWidth
,
profileHeight
+
m_toolbar
->
height
()
+
m_glMonitor
->
rulerHeight
()));
setMinimumSize
(
QSize
(
profileWidth
,
profileHeight
+
m_toolbar
->
height
()
+
m_glMonitor
->
getControllerProxy
()
->
rulerHeight
()));
setSizePolicy
(
QSizePolicy
::
Expanding
,
QSizePolicy
::
Expanding
);
break
;
}
...
...
src/monitor/view/MonitorRuler.qml
View file @
17411d21
...
...
@@ -8,7 +8,6 @@ import QtQuick 2.4
Rectangle
{
id
:
ruler
color
:
activePalette
.
window
opacity
:
0.8
// frame ticks
Repeater
{
...
...
src/monitor/view/kdenliveclipmonitor.qml
View file @
17411d21
...
...
@@ -33,7 +33,6 @@ Item {
property
int
mouseRulerPos
:
0
property
double
frameSize
:
10
property
double
timeScale
:
1
property
int
rulerHeight
:
20
FontMetrics
{
id
:
fontMetrics
...
...
@@ -61,7 +60,7 @@ Item {
Item
{
id
:
monitorOverlay
height
:
root
.
height
-
root
.
rulerHeight
height
:
root
.
height
-
controller
.
rulerHeight
width
:
root
.
width
SceneToolBar
{
id
:
sceneToolBar
...
...
@@ -209,6 +208,6 @@ Item {
right
:
root
.
right
bottom
:
root
.
bottom
}
height
:
root
.
rulerHeight
height
:
controller
.
rulerHeight
}
}
src/monitor/view/kdenlivemonitor.qml
View file @
17411d21
...
...
@@ -33,7 +33,6 @@ Item {
property
int
mouseRulerPos
:
0
property
double
frameSize
:
10
property
double
timeScale
:
1
property
int
rulerHeight
:
20
FontMetrics
{
id
:
fontMetrics
...
...
@@ -61,7 +60,7 @@ Item {
Item
{
id
:
monitorOverlay
height
:
root
.
height
-
root
.
rulerHeight
height
:
root
.
height
-
controller
.
rulerHeight
width
:
root
.
width
SceneToolBar
{
id
:
sceneToolBar
...
...
@@ -177,6 +176,6 @@ Item {
right
:
root
.
right
bottom
:
root
.
bottom
}
height
:
root
.
rulerHeight
height
:
controller
.
rulerHeight
}
}
src/monitor/view/kdenlivemonitoreffectscene.qml
View file @
17411d21
...
...
@@ -19,7 +19,6 @@ Item {
property
double
offsetx
:
0
property
double
offsety
:
0
property
double
lockratio
:
-
1
property
int
rulerHeight
:
20
property
double
timeScale
:
1
property
double
frameSize
:
10
property
int
duration
:
300
...
...
@@ -536,6 +535,6 @@ Item {
right
:
root
.
right
bottom
:
root
.
bottom
}
height
:
root
.
rulerHeight
height
:
controller
.
rulerHeight
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment