Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
VLMC
Commits
20e26777
Commit
20e26777
authored
Jan 15, 2010
by
Hugo Beauzee-Luyssen
Browse files
Solved bug when using previewWidget with a clip and not a media.
parent
af8ef7a5
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/Gui/library/MediaListViewController.cpp
View file @
20e26777
...
...
@@ -156,6 +156,7 @@ MediaListViewController::clipSelection( const QUuid& uuid )
{
Clip
*
clip
;
if
(
(
clip
=
Library
::
getInstance
()
->
clip
(
m_currentUuid
,
uuid
)
)
!=
0
)
{
emit
clipSelected
(
clip
);
}
}
src/Renderer/ClipRenderer.cpp
View file @
20e26777
...
...
@@ -107,7 +107,7 @@ void ClipRenderer::startPreview()
m_mediaPlayer
->
setMedia
(
m_vlcMedia
);
m_mediaPlayer
->
play
();
m_mediaPlayer
->
setPosition
(
m_begin
/
m_selectedMedia
->
getNbFrames
()
);
m_mediaPlayer
->
setPosition
(
(
double
)
m_begin
/
(
double
)
m_selectedMedia
->
getNbFrames
()
);
m_clipLoaded
=
true
;
m_isRendering
=
true
;
m_paused
=
false
;
...
...
@@ -174,6 +174,11 @@ void ClipRenderer::previousFrame()
}
}
qint64
ClipRenderer
::
getLength
()
const
{
return
m_end
-
m_begin
;
}
qint64
ClipRenderer
::
getLengthMs
()
const
{
if
(
m_selectedMedia
)
...
...
@@ -223,6 +228,7 @@ void ClipRenderer::previewWidgetCursorChanged( qint64 newFrame )
{
if
(
m_isRendering
==
true
)
{
newFrame
+=
m_begin
;
qint64
nbSeconds
=
qRound64
(
(
qreal
)
newFrame
/
m_selectedMedia
->
getFps
()
);
m_mediaPlayer
->
setTime
(
nbSeconds
*
1000
);
}
...
...
@@ -259,6 +265,12 @@ void ClipRenderer::__timeChanged( qint64 time )
if
(
fps
<
0.1
f
)
fps
=
m_selectedMedia
->
getFps
();
qint64
f
=
qRound64
(
(
qreal
)
time
/
1000.0
*
fps
);
if
(
f
>=
m_end
)
{
__endReached
();
return
;
}
f
=
f
-
m_begin
;
emit
frameChanged
(
f
,
MainWorkflow
::
Renderer
);
}
...
...
src/Renderer/ClipRenderer.h
View file @
20e26777
...
...
@@ -43,6 +43,7 @@ public:
virtual
void
stop
();
virtual
void
nextFrame
();
virtual
void
previousFrame
();
virtual
qint64
getLength
()
const
;
virtual
qint64
getLengthMs
()
const
;
virtual
qint64
getCurrentFrame
()
const
;
virtual
float
getFps
()
const
;
...
...
@@ -70,7 +71,14 @@ public slots:
virtual
void
mediaUnloaded
(
const
QUuid
&
);
virtual
void
previewWidgetCursorChanged
(
qint64
newFrame
);
// void __positionChanged();
/**
* \brief Triggered at every libvlc_MediaPlayerTimeChanged event.
*
* This slot will compute a frame number based on the time and the clip's FPS.
* Once computed, it will emit a frameChanged signal, with the reason Renderer.
* \warning The frame number computed may be unaccurate.
* \sa frameChanged();
*/
void
__timeChanged
(
qint64
time
);
void
__endReached
();
void
__videoStopped
();
...
...
src/Renderer/GenericRenderer.h
View file @
20e26777
...
...
@@ -98,10 +98,7 @@ public:
* \brief Return the length in frames
* \warning The returned value may not be accurate
*/
qint64
getLength
()
const
{
return
qRound64
(
(
qreal
)
getLengthMs
()
/
1000.0
*
(
qreal
)
getFps
()
);
}
virtual
qint64
getLength
()
const
=
0
;
/**
* \brief Return true if the renderer is paused
...
...
src/Renderer/WorkflowRenderer.cpp
View file @
20e26777
...
...
@@ -214,6 +214,11 @@ qint64 WorkflowRenderer::getCurrentFrame() const
return
m_mainWorkflow
->
getCurrentFrame
();
}
qint64
WorkflowRenderer
::
getLength
()
const
{
return
qRound64
(
(
qreal
)
getLengthMs
()
/
1000.0
*
(
qreal
)
getFps
()
);
}
qint64
WorkflowRenderer
::
getLengthMs
()
const
{
return
m_mainWorkflow
->
getLengthFrame
()
/
getFps
()
*
1000
;
...
...
src/Renderer/WorkflowRenderer.h
View file @
20e26777
...
...
@@ -47,6 +47,7 @@ class WorkflowRenderer : public GenericRenderer
virtual
void
stop
();
virtual
void
nextFrame
();
virtual
void
previousFrame
();
virtual
qint64
getLength
()
const
;
virtual
qint64
getLengthMs
()
const
;
virtual
qint64
getCurrentFrame
()
const
;
virtual
float
getFps
()
const
;
...
...
Write
Preview
Supports
Markdown
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