Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Multimedia
Kdenlive
Commits
99cf7c0a
Commit
99cf7c0a
authored
May 31, 2019
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix guides in render widget
Fixes
#207
parent
61323532
Pipeline
#3905
passed with stage
in 25 minutes and 29 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
22 deletions
+43
-22
src/dialogs/renderwidget.cpp
src/dialogs/renderwidget.cpp
+36
-16
src/dialogs/renderwidget.h
src/dialogs/renderwidget.h
+4
-1
src/mainwindow.cpp
src/mainwindow.cpp
+3
-5
No files found.
src/dialogs/renderwidget.cpp
View file @
99cf7c0a
...
...
@@ -465,29 +465,49 @@ void RenderWidget::slotCheckEndGuidePosition()
}
}
void
RenderWidget
::
setGuides
(
const
QList
<
CommentedTime
>
&
guides
List
,
double
duration
)
void
RenderWidget
::
setGuides
(
std
::
weak_ptr
<
MarkerListModel
>
guides
Model
)
{
m_guidesModel
=
std
::
move
(
guidesModel
);
reloadGuides
();
if
(
auto
ptr
=
m_guidesModel
.
lock
())
{
connect
(
ptr
.
get
(),
&
MarkerListModel
::
modelChanged
,
this
,
&
RenderWidget
::
reloadGuides
);
}
}
void
RenderWidget
::
reloadGuides
()
{
double
projectDuration
=
GenTime
(
pCore
->
projectDuration
()
-
TimelineModel
::
seekDuration
-
2
,
pCore
->
getCurrentFps
()).
ms
()
/
1000
;
QVariant
startData
=
m_view
.
guide_start
->
currentData
();
QVariant
endData
=
m_view
.
guide_end
->
currentData
();
m_view
.
guide_start
->
clear
();
m_view
.
guide_end
->
clear
();
if
(
!
guidesList
.
isEmpty
())
{
m_view
.
guide_start
->
addItem
(
i18n
(
"Beginning"
),
"0"
);
m_view
.
render_guide
->
setEnabled
(
true
);
m_view
.
create_chapter
->
setEnabled
(
true
);
if
(
auto
ptr
=
m_guidesModel
.
lock
())
{
QList
<
CommentedTime
>
markers
=
ptr
->
getAllMarkers
();
double
fps
=
pCore
->
getCurrentProfile
()
->
fps
();
m_view
.
render_guide
->
setEnabled
(
!
markers
.
isEmpty
());
if
(
!
markers
.
isEmpty
())
{
m_view
.
guide_start
->
addItem
(
i18n
(
"Beginning"
),
"0"
);
m_view
.
create_chapter
->
setEnabled
(
true
);
for
(
auto
marker
:
markers
)
{
GenTime
pos
=
marker
.
time
();
const
QString
guidePos
=
Timecode
::
getStringTimecode
(
pos
.
frames
(
fps
),
fps
);
m_view
.
guide_start
->
addItem
(
marker
.
comment
()
+
QLatin1Char
(
'/'
)
+
guidePos
,
pos
.
seconds
());
m_view
.
guide_end
->
addItem
(
marker
.
comment
()
+
QLatin1Char
(
'/'
)
+
guidePos
,
pos
.
seconds
());
}
m_view
.
guide_end
->
addItem
(
i18n
(
"End"
),
QString
::
number
(
projectDuration
));
if
(
!
startData
.
isNull
())
{
int
ix
=
qMax
(
0
,
m_view
.
guide_start
->
findData
(
startData
));
m_view
.
guide_start
->
setCurrentIndex
(
ix
);
}
if
(
!
endData
.
isNull
())
{
int
ix
=
qMax
(
m_view
.
guide_start
->
currentIndex
()
+
1
,
m_view
.
guide_end
->
findData
(
endData
));
m_view
.
guide_end
->
setCurrentIndex
(
ix
);
}
}
}
else
{
m_view
.
render_guide
->
setEnabled
(
false
);
m_view
.
create_chapter
->
setEnabled
(
false
);
}
double
fps
=
pCore
->
getCurrentProfile
()
->
fps
();
for
(
int
i
=
0
;
i
<
guidesList
.
count
();
i
++
)
{
const
CommentedTime
&
c
=
guidesList
.
at
(
i
);
GenTime
pos
=
c
.
time
();
const
QString
guidePos
=
Timecode
::
getStringTimecode
(
pos
.
frames
(
fps
),
fps
);
m_view
.
guide_start
->
addItem
(
c
.
comment
()
+
QLatin1Char
(
'/'
)
+
guidePos
,
pos
.
seconds
());
m_view
.
guide_end
->
addItem
(
c
.
comment
()
+
QLatin1Char
(
'/'
)
+
guidePos
,
pos
.
seconds
());
}
if
(
!
guidesList
.
isEmpty
())
{
m_view
.
guide_end
->
addItem
(
i18n
(
"End"
),
QString
::
number
(
duration
));
}
}
/**
...
...
src/dialogs/renderwidget.h
View file @
99cf7c0a
...
...
@@ -33,6 +33,7 @@ class Menu;
#endif
#include "definitions.h"
#include "bin/model/markerlistmodel.hpp"
#include "ui_renderwidget_ui.h"
class
QDomElement
;
...
...
@@ -120,7 +121,7 @@ class RenderWidget : public QDialog
public:
explicit
RenderWidget
(
bool
enableProxy
,
QWidget
*
parent
=
nullptr
);
~
RenderWidget
()
override
;
void
setGuides
(
const
QList
<
CommentedTime
>
&
guides
List
,
double
duration
);
void
setGuides
(
std
::
weak_ptr
<
MarkerListModel
>
guides
Model
);
void
focusFirstVisibleItem
(
const
QString
&
profile
=
QString
());
void
setRenderJob
(
const
QString
&
dest
,
int
progress
=
0
);
void
setRenderStatus
(
const
QString
&
dest
,
int
status
,
const
QString
&
error
);
...
...
@@ -155,6 +156,7 @@ public slots:
void
slotAbortCurrentJob
();
void
slotPrepareExport
(
bool
scriptExport
=
false
,
const
QString
&
scriptPath
=
QString
());
void
adjustViewToProfile
();
void
reloadGuides
();
private
slots
:
void
slotUpdateButtons
(
const
QUrl
&
url
);
...
...
@@ -212,6 +214,7 @@ private:
KMessageWidget
*
m_infoMessage
;
KMessageWidget
*
m_jobInfoMessage
;
QMap
<
int
,
QString
>
m_errorMessages
;
std
::
weak_ptr
<
MarkerListModel
>
m_guidesModel
;
#ifdef KF5_USE_PURPOSE
Purpose
::
Menu
*
m_shareMenu
;
...
...
src/mainwindow.cpp
View file @
99cf7c0a
...
...
@@ -1771,8 +1771,7 @@ void MainWindow::slotRenderProject()
connect
(
m_renderWidget
,
&
RenderWidget
::
abortProcess
,
this
,
&
MainWindow
::
abortRenderJob
);
connect
(
m_renderWidget
,
&
RenderWidget
::
openDvdWizard
,
this
,
&
MainWindow
::
slotDvdWizard
);
connect
(
this
,
&
MainWindow
::
updateRenderWidgetProfile
,
m_renderWidget
,
&
RenderWidget
::
adjustViewToProfile
);
double
projectDuration
=
GenTime
(
getMainTimeline
()
->
controller
()
->
duration
(),
pCore
->
getCurrentFps
()).
ms
()
/
1000
;
m_renderWidget
->
setGuides
(
project
->
getGuideModel
()
->
getAllMarkers
(),
projectDuration
);
m_renderWidget
->
setGuides
(
project
->
getGuideModel
());
m_renderWidget
->
updateDocumentPath
();
m_renderWidget
->
setRenderProfile
(
project
->
getRenderProperties
());
}
...
...
@@ -2000,7 +1999,7 @@ void MainWindow::connectDocument()
if
(
m_renderWidget
)
{
slotCheckRenderStatus
();
//
m_renderWidget->setGuides(pCore->
projectManager()->currentTimeline()->projectView
()->guide
sData(), project->projectDuration
());
m_renderWidget
->
setGuides
(
pCore
->
currentDoc
()
->
g
etG
uide
Model
());
m_renderWidget
->
updateDocumentPath
();
m_renderWidget
->
setRenderProfile
(
project
->
getRenderProperties
());
}
...
...
@@ -2044,8 +2043,7 @@ void MainWindow::slotZoneMoved(int start, int end)
void
MainWindow
::
slotGuidesUpdated
()
{
if
(
m_renderWidget
)
{
double
projectDuration
=
GenTime
(
getMainTimeline
()
->
controller
()
->
duration
()
-
TimelineModel
::
seekDuration
-
2
,
pCore
->
getCurrentFps
()).
ms
()
/
1000
;
m_renderWidget
->
setGuides
(
pCore
->
currentDoc
()
->
getGuideModel
()
->
getAllMarkers
(),
projectDuration
);
m_renderWidget
->
setGuides
(
pCore
->
currentDoc
()
->
getGuideModel
());
}
}
...
...
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