Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
VLMC
Commits
e399a1b2
Commit
e399a1b2
authored
May 31, 2017
by
luyikei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WorkflowFileRendererDialog: Simplify the calculation of the rendering progress
parent
a987aa88
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
16 deletions
+12
-16
src/Gui/WorkflowFileRendererDialog.cpp
src/Gui/WorkflowFileRendererDialog.cpp
+8
-12
src/Gui/WorkflowFileRendererDialog.h
src/Gui/WorkflowFileRendererDialog.h
+2
-3
src/Workflow/MainWorkflow.cpp
src/Workflow/MainWorkflow.cpp
+2
-1
No files found.
src/Gui/WorkflowFileRendererDialog.cpp
View file @
e399a1b2
...
...
@@ -34,16 +34,12 @@
#include "Tools/RendererEventWatcher.h"
#include "Backend/IInput.h"
WorkflowFileRendererDialog
::
WorkflowFileRendererDialog
(
quint32
width
,
quint32
height
,
qint64
totalFrames
,
RendererEventWatcher
*
eventWatcher
)
:
WorkflowFileRendererDialog
::
WorkflowFileRendererDialog
(
quint32
width
,
quint32
height
)
:
m_width
(
width
),
m_height
(
height
),
m_totalFrames
(
totalFrames
)
m_height
(
height
)
{
m_ui
.
setupUi
(
this
);
connect
(
m_ui
.
cancelButton
,
SIGNAL
(
clicked
()
),
this
,
SLOT
(
cancel
()
)
);
connect
(
eventWatcher
,
&
RendererEventWatcher
::
positionChanged
,
this
,
&
WorkflowFileRendererDialog
::
frameChanged
);
}
void
...
...
@@ -69,15 +65,15 @@ WorkflowFileRendererDialog::updatePreview( const uchar* buff )
}
void
WorkflowFileRendererDialog
::
frameChanged
(
qint64
frame
)
WorkflowFileRendererDialog
::
frameChanged
(
qint64
newFrame
,
qint64
length
)
{
// Since frame is 0-indexed
f
rame
++
;
if
(
f
rame
<=
m_totalFrames
)
newF
rame
++
;
if
(
newF
rame
<=
length
)
{
m_ui
.
frameCounter
->
setText
(
tr
(
"Rendering frame %1 / %2"
).
arg
(
QString
::
number
(
f
rame
),
QString
::
number
(
m_totalFrames
)
)
);
setProgressBarValue
(
f
rame
*
100
/
m_totalFrames
);
m_ui
.
frameCounter
->
setText
(
tr
(
"Rendering frame %1 / %2"
).
arg
(
QString
::
number
(
newF
rame
),
QString
::
number
(
length
)
)
);
setProgressBarValue
(
newF
rame
*
100
/
length
);
}
}
...
...
src/Gui/WorkflowFileRendererDialog.h
View file @
e399a1b2
...
...
@@ -33,7 +33,7 @@ class WorkflowFileRendererDialog : public QDialog
Q_OBJECT
Q_DISABLE_COPY
(
WorkflowFileRendererDialog
)
public:
WorkflowFileRendererDialog
(
quint32
width
,
quint32
height
,
qint64
totalFrames
,
RendererEventWatcher
*
eventWatcher
);
WorkflowFileRendererDialog
(
quint32
width
,
quint32
height
);
void
setOutputFileName
(
const
QString
&
filename
);
void
setProgressBarValue
(
int
val
);
...
...
@@ -41,16 +41,15 @@ private:
Ui
::
WorkflowFileRendererDialog
m_ui
;
quint32
m_width
;
quint32
m_height
;
qint64
m_totalFrames
;
signals:
void
stop
();
public
slots
:
void
updatePreview
(
const
uchar
*
buff
);
void
frameChanged
(
qint64
newFrame
,
qint64
length
);
private
slots
:
void
frameChanged
(
qint64
);
void
cancel
();
};
...
...
src/Workflow/MainWorkflow.cpp
View file @
e399a1b2
...
...
@@ -335,9 +335,10 @@ MainWorkflow::startRenderToFile( const QString &outputFileName, quint32 width, q
output
.
connect
(
*
input
);
#ifdef HAVE_GUI
WorkflowFileRendererDialog
dialog
(
width
,
height
,
input
->
playableLength
(),
m_renderer
->
eventWatcher
()
);
WorkflowFileRendererDialog
dialog
(
width
,
height
);
dialog
.
setModal
(
true
);
dialog
.
setOutputFileName
(
outputFileName
);
connect
(
this
,
&
MainWorkflow
::
frameChanged
,
&
dialog
,
&
WorkflowFileRendererDialog
::
frameChanged
);
connect
(
&
dialog
,
&
WorkflowFileRendererDialog
::
stop
,
this
,
[
&
output
]{
output
.
stop
();
}
);
connect
(
m_renderer
->
eventWatcher
(),
&
RendererEventWatcher
::
positionChanged
,
&
dialog
,
[
this
,
input
,
&
dialog
,
width
,
height
](
qint64
pos
)
...
...
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