Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
VLMC
Commits
bf05f834
Commit
bf05f834
authored
Apr 10, 2016
by
luyikei
Committed by
Hugo Beauzée-Luyssen
Apr 10, 2016
Browse files
Clip: Don't use "get" prefix
Signed-off-by:
Hugo Beauzée-Luyssen
<
hugo@beauzee.fr
>
parent
e9d23106
Changes
18
Hide whitespace changes
Inline
Side-by-side
src/Gui/ClipProperty.cpp
View file @
bf05f834
...
...
@@ -41,9 +41,9 @@ ClipProperty::ClipProperty( Clip* clip, QWidget *parent ) :
connect
(
this
,
SIGNAL
(
accepted
()
),
this
,
SLOT
(
deleteLater
()
)
);
connect
(
this
,
SIGNAL
(
rejected
()
),
this
,
SLOT
(
deleteLater
()
)
);
setWindowTitle
(
m_clip
->
getM
edia
()
->
fileInfo
()
->
fileName
()
+
" "
+
tr
(
"properties"
)
);
setWindowTitle
(
m_clip
->
m
edia
()
->
fileInfo
()
->
fileName
()
+
" "
+
tr
(
"properties"
)
);
//Snapshot
ui
->
snapshotLabel
->
setPixmap
(
m_clip
->
getM
edia
()
->
snapshot
().
scaled
(
128
,
128
,
Qt
::
KeepAspectRatio
)
);
ui
->
snapshotLabel
->
setPixmap
(
m_clip
->
m
edia
()
->
snapshot
().
scaled
(
128
,
128
,
Qt
::
KeepAspectRatio
)
);
//Metatags
const
QPushButton
*
button
=
ui
->
buttonBox
->
button
(
QDialogButtonBox
::
Apply
);
Q_ASSERT
(
button
!=
nullptr
);
...
...
src/Gui/import/ImportController.cpp
View file @
bf05f834
...
...
@@ -236,7 +236,7 @@ ImportController::accept()
collapseAllButCurrentPath
();
foreach
(
Clip
*
clip
,
m_temporaryMedias
->
clips
().
values
()
)
{
if
(
clip
->
getM
edia
()
->
source
()
->
length
()
==
0
)
if
(
clip
->
m
edia
()
->
source
()
->
length
()
==
0
)
invalidMedias
=
true
;
Core
::
instance
()
->
library
()
->
addClip
(
clip
);
}
...
...
@@ -258,9 +258,9 @@ ImportController::handleInvalidMedias()
{
foreach
(
Clip
*
clip
,
m_temporaryMedias
->
clips
().
values
()
)
{
if
(
clip
->
getM
edia
()
->
source
()
->
length
()
==
0
)
if
(
clip
->
m
edia
()
->
source
()
->
length
()
==
0
)
{
Transcoder
*
transcoder
=
new
Transcoder
(
clip
->
getM
edia
()
);
Transcoder
*
transcoder
=
new
Transcoder
(
clip
->
m
edia
()
);
connect
(
transcoder
,
SIGNAL
(
done
()
),
transcoder
,
SLOT
(
deleteLater
()
)
);
transcoder
->
transcodeToPs
();
}
...
...
src/Gui/import/TagWidget.cpp
View file @
bf05f834
...
...
@@ -68,7 +68,7 @@ TagWidget::clipSelected( Clip* clip )
else
static_cast
<
QPushButton
*>
(
m_buttonList
[
i
])
->
setChecked
(
false
);
}
connect
(
clip
->
getM
edia
(),
SIGNAL
(
metaDataComputed
(
const
Media
*
)
),
connect
(
clip
->
m
edia
(),
SIGNAL
(
metaDataComputed
(
const
Media
*
)
),
this
,
SLOT
(
setMetaTags
()
)
);
connect
(
clip
,
SIGNAL
(
destroyed
()
),
this
,
SLOT
(
clipDestroyed
()
)
);
}
...
...
src/Gui/library/MediaCellView.cpp
View file @
bf05f834
...
...
@@ -65,20 +65,20 @@ MediaCellView::MediaCellView( Clip* clip, QWidget *parent ) :
m_ui
->
clipCountLabel
->
hide
();
m_ui
->
arrow
->
hide
();
}
if
(
clip
->
getM
edia
()
->
source
()
->
isParsed
()
==
false
)
if
(
clip
->
m
edia
()
->
source
()
->
isParsed
()
==
false
)
{
m_ui
->
thumbnail
->
setEnabled
(
false
);
connect
(
MetaDataManager
::
instance
(),
SIGNAL
(
startingComputing
(
const
Media
*
)),
this
,
SLOT
(
metadataComputingStarted
(
const
Media
*
)
),
Qt
::
DirectConnection
);
}
connect
(
clip
->
getM
edia
(),
SIGNAL
(
metaDataComputed
()
),
connect
(
clip
->
m
edia
(),
SIGNAL
(
metaDataComputed
()
),
this
,
SLOT
(
metadataUpdated
()
)
);
// Snapshot generation will generate a QPixmap, which has to be done on GUI thread
connect
(
clip
->
getM
edia
(),
SIGNAL
(
snapshotAvailable
()
),
connect
(
clip
->
m
edia
(),
SIGNAL
(
snapshotAvailable
()
),
this
,
SLOT
(
snapshotUpdated
()
),
Qt
::
QueuedConnection
);
setThumbnail
(
clip
->
getM
edia
()
->
snapshot
()
);
setTitle
(
clip
->
getM
edia
()
->
fileName
()
);
setThumbnail
(
clip
->
m
edia
()
->
snapshot
()
);
setTitle
(
clip
->
m
edia
()
->
fileName
()
);
setLength
(
clip
->
lengthSecond
()
*
1000
);
}
...
...
@@ -90,7 +90,7 @@ MediaCellView::~MediaCellView()
void
MediaCellView
::
metadataComputingStarted
(
const
Media
*
media
)
{
if
(
media
!=
m_clip
->
getM
edia
()
)
if
(
media
!=
m_clip
->
m
edia
()
)
return
;
//Disable the delete button to avoid deleting the media while metadata are computed.
m_ui
->
delLabel
->
setEnabled
(
false
);
...
...
@@ -102,18 +102,18 @@ MediaCellView::metadataComputingStarted( const Media *media )
void
MediaCellView
::
metadataUpdated
()
{
setLength
(
m_clip
->
getM
edia
()
->
source
()
->
length
()
);
setLength
(
m_clip
->
m
edia
()
->
source
()
->
length
()
);
m_ui
->
thumbnail
->
setEnabled
(
true
);
//If the media is a Video or an Image, we must wait for the snapshot to be computer
//before allowing deletion.
if
(
m_clip
->
getM
edia
()
->
fileType
()
==
Media
::
Audio
)
if
(
m_clip
->
m
edia
()
->
fileType
()
==
Media
::
Audio
)
m_ui
->
delLabel
->
setEnabled
(
true
);
}
void
MediaCellView
::
snapshotUpdated
()
{
setThumbnail
(
m_clip
->
getM
edia
()
->
snapshot
()
);
setThumbnail
(
m_clip
->
m
edia
()
->
snapshot
()
);
m_ui
->
delLabel
->
setEnabled
(
true
);
}
...
...
@@ -147,7 +147,7 @@ MediaCellView::nbClipUpdated()
if
(
m_clip
->
isRootClip
()
==
true
)
nbClips
=
m_clip
->
mediaContainer
()
->
count
();
else
nbClips
=
m_clip
->
getP
arent
()
->
mediaContainer
()
->
count
();
nbClips
=
m_clip
->
p
arent
()
->
mediaContainer
()
->
count
();
if
(
nbClips
==
0
)
{
...
...
@@ -222,7 +222,7 @@ MediaCellView::mouseMoveEvent( QMouseEvent* event )
mimeData
->
setData
(
"vlmc/uuid"
,
m_clip
->
uuid
().
toString
().
toLatin1
()
);
QDrag
*
drag
=
new
QDrag
(
this
);
drag
->
setMimeData
(
mimeData
);
Media
*
parent
=
m_clip
->
getM
edia
();
Media
*
parent
=
m_clip
->
m
edia
();
drag
->
setPixmap
(
parent
->
snapshot
().
scaled
(
100
,
100
,
Qt
::
KeepAspectRatio
)
);
drag
->
exec
(
Qt
::
CopyAction
|
Qt
::
MoveAction
,
Qt
::
CopyAction
);
}
...
...
@@ -294,7 +294,7 @@ MediaCellView::contextMenuEvent( QContextMenuEvent *event )
return
;
if
(
copyInWorkspace
==
selectedAction
)
{
if
(
Core
::
instance
()
->
workspace
()
->
copyToWorkspace
(
m_clip
->
getM
edia
()
)
==
false
)
if
(
Core
::
instance
()
->
workspace
()
->
copyToWorkspace
(
m_clip
->
m
edia
()
)
==
false
)
{
QMessageBox
::
warning
(
nullptr
,
tr
(
"Can't copy to workspace"
),
tr
(
"Can't copy this media to workspace: %1"
).
arg
(
Core
::
instance
()
->
workspace
()
->
lastError
()
)
);
...
...
src/Gui/library/MediaLibrary.cpp
View file @
bf05f834
...
...
@@ -123,7 +123,7 @@ MediaLibrary::viewChanged( ViewController *view )
bool
MediaLibrary
::
filterByName
(
const
Clip
*
clip
,
const
QString
&
filter
)
{
return
(
clip
->
getM
edia
()
->
fileName
().
contains
(
filter
,
Qt
::
CaseInsensitive
)
);
return
(
clip
->
m
edia
()
->
fileName
().
contains
(
filter
,
Qt
::
CaseInsensitive
)
);
}
bool
...
...
src/Gui/media/ClipMetadataDisplayer.cpp
View file @
bf05f834
...
...
@@ -98,7 +98,7 @@ ClipMetadataDisplayer::setWatchedClip( const Clip *clip )
disconnect
(
m_watchedClip
);
m_watchedClip
=
clip
;
m_watchedMedia
=
clip
->
getM
edia
();
m_watchedMedia
=
clip
->
m
edia
();
connect
(
m_watchedClip
,
SIGNAL
(
unloaded
(
Clip
*
)
),
this
,
SLOT
(
clipDestroyed
(
Clip
*
)
)
);
if
(
m_watchedMedia
->
source
()
->
isParsed
()
==
true
)
metadataUpdated
();
...
...
src/Gui/timeline/AbstractGraphicsMediaItem.cpp
View file @
bf05f834
...
...
@@ -201,7 +201,7 @@ AbstractGraphicsMediaItem::setEmphasized( bool value )
bool
AbstractGraphicsMediaItem
::
hasResizeBoundaries
()
const
{
return
(
clipHelper
()
->
clip
()
->
getM
edia
()
->
fileType
()
!=
Media
::
Image
);
return
(
clipHelper
()
->
clip
()
->
m
edia
()
->
fileType
()
!=
Media
::
Image
);
}
qint64
...
...
src/Gui/timeline/GraphicsAudioItem.cpp
View file @
bf05f834
...
...
@@ -38,10 +38,10 @@
GraphicsAudioItem
::
GraphicsAudioItem
(
Clip
*
clip
)
:
AbstractGraphicsMediaItem
(
clip
)
{
QTime
length
=
QTime
().
addMSecs
(
clip
->
getM
edia
()
->
source
()
->
length
()
);
QTime
length
=
QTime
().
addMSecs
(
clip
->
m
edia
()
->
source
()
->
length
()
);
QString
tooltip
(
tr
(
"<p style='white-space:pre'><b>Name:</b> %1"
"<br><b>Length:</b> %2"
)
.
arg
(
clip
->
getM
edia
()
->
fileName
()
)
.
arg
(
clip
->
m
edia
()
->
fileName
()
)
.
arg
(
length
.
toString
(
"hh:mm:ss.zzz"
)
)
);
setToolTip
(
tooltip
);
}
...
...
@@ -51,10 +51,10 @@ GraphicsAudioItem::GraphicsAudioItem( ClipHelper* ch ) :
{
setFlags
(
QGraphicsItem
::
ItemIsSelectable
);
QTime
length
=
QTime
().
addMSecs
(
ch
->
clip
()
->
getM
edia
()
->
source
()
->
length
()
);
QTime
length
=
QTime
().
addMSecs
(
ch
->
clip
()
->
m
edia
()
->
source
()
->
length
()
);
QString
tooltip
(
tr
(
"<p style='white-space:pre'><b>Name:</b> %1"
"<br><b>Length:</b> %2"
)
.
arg
(
ch
->
clip
()
->
getM
edia
()
->
fileName
()
)
.
arg
(
ch
->
clip
()
->
m
edia
()
->
fileName
()
)
.
arg
(
length
.
toString
(
"hh:mm:ss.zzz"
)
)
);
setToolTip
(
tooltip
);
setAcceptHoverEvents
(
true
);
...
...
@@ -171,7 +171,7 @@ GraphicsAudioItem::paintTitle( QPainter* painter, const QStyleOptionGraphicsItem
// Initiate the font metrics calculation
QFontMetrics
fm
(
painter
->
font
()
);
QString
text
=
m_clipHelper
->
clip
()
->
getM
edia
()
->
fileName
();
QString
text
=
m_clipHelper
->
clip
()
->
m
edia
()
->
fileName
();
// Get the transformations required to map the text on the viewport
QTransform
viewPortTransform
=
Timeline
::
instance
()
->
tracksView
()
->
viewportTransform
();
...
...
src/Gui/timeline/GraphicsMovieItem.cpp
View file @
bf05f834
...
...
@@ -37,10 +37,10 @@
GraphicsMovieItem
::
GraphicsMovieItem
(
Clip
*
clip
)
:
AbstractGraphicsMediaItem
(
clip
)
{
QTime
length
=
QTime
().
addMSecs
(
clip
->
getM
edia
()
->
source
()
->
length
()
);
QTime
length
=
QTime
().
addMSecs
(
clip
->
m
edia
()
->
source
()
->
length
()
);
QString
tooltip
(
tr
(
"<p style='white-space:pre'><b>Name:</b> %1"
"<br><b>Length:</b> %2"
)
.
arg
(
clip
->
getM
edia
()
->
fileName
()
)
.
arg
(
clip
->
m
edia
()
->
fileName
()
)
.
arg
(
length
.
toString
(
"hh:mm:ss.zzz"
)
)
);
setToolTip
(
tooltip
);
}
...
...
@@ -48,10 +48,10 @@ GraphicsMovieItem::GraphicsMovieItem( Clip* clip ) :
GraphicsMovieItem
::
GraphicsMovieItem
(
ClipHelper
*
ch
)
:
AbstractGraphicsMediaItem
(
ch
)
{
QTime
length
=
QTime
().
addMSecs
(
ch
->
clip
()
->
getM
edia
()
->
source
()
->
length
()
);
QTime
length
=
QTime
().
addMSecs
(
ch
->
clip
()
->
m
edia
()
->
source
()
->
length
()
);
QString
tooltip
(
tr
(
"<p style='white-space:pre'><b>Name:</b> %1"
"<br><b>Length:</b> %2"
)
.
arg
(
ch
->
clip
()
->
getM
edia
()
->
fileName
()
)
.
arg
(
ch
->
clip
()
->
m
edia
()
->
fileName
()
)
.
arg
(
length
.
toString
(
"hh:mm:ss.zzz"
)
)
);
setToolTip
(
tooltip
);
}
...
...
@@ -165,7 +165,7 @@ GraphicsMovieItem::paintTitle( QPainter* painter, const QStyleOptionGraphicsItem
// Initiate the font metrics calculation
QFontMetrics
fm
(
painter
->
font
()
);
QString
text
=
m_clipHelper
->
clip
()
->
getM
edia
()
->
fileName
();
QString
text
=
m_clipHelper
->
clip
()
->
m
edia
()
->
fileName
();
// Get the transformations required to map the text on the viewport
QTransform
viewPortTransform
=
Timeline
::
instance
()
->
tracksView
()
->
viewportTransform
();
...
...
src/Gui/timeline/TracksView.cpp
View file @
bf05f834
...
...
@@ -378,8 +378,8 @@ TracksView::clipDragEnterEvent( QDragEnterEvent *event )
Clip
*
clip
=
Core
::
instance
()
->
library
()
->
clip
(
fullId
);
if
(
clip
==
nullptr
)
return
;
bool
hasVideo
=
clip
->
getM
edia
()
->
source
()
->
hasVideo
();
bool
hasAudio
=
clip
->
getM
edia
()
->
source
()
->
hasAudio
();
bool
hasVideo
=
clip
->
m
edia
()
->
source
()
->
hasVideo
();
bool
hasAudio
=
clip
->
m
edia
()
->
source
()
->
hasAudio
();
if
(
hasAudio
==
false
&&
hasVideo
==
false
)
return
;
...
...
src/Library/Library.cpp
View file @
bf05f834
...
...
@@ -124,7 +124,7 @@ Library::addClip( Clip *clip )
bool
ret
=
MediaContainer
::
addClip
(
clip
);
if
(
ret
!=
false
)
setCleanState
(
false
);
m_medias
[
clip
->
getM
edia
()
->
fileInfo
()
->
absoluteFilePath
()]
=
clip
->
getM
edia
();
m_medias
[
clip
->
m
edia
()
->
fileInfo
()
->
absoluteFilePath
()]
=
clip
->
m
edia
();
return
ret
;
}
...
...
src/Library/MediaContainer.cpp
View file @
bf05f834
...
...
@@ -84,7 +84,7 @@ MediaContainer::addMedia( const QFileInfo& fileInfo )
}
foreach
(
Clip
*
it
,
m_clips
.
values
()
)
{
if
(
(
*
it
->
getM
edia
()
->
fileInfo
())
==
fileInfo
)
if
(
(
*
it
->
m
edia
()
->
fileInfo
())
==
fileInfo
)
{
vlmcWarning
()
<<
"Ignoring aleady imported media"
<<
fileInfo
.
absolutePath
();
return
nullptr
;
...
...
@@ -99,7 +99,7 @@ MediaContainer::mediaAlreadyLoaded( const QFileInfo& fileInfo )
{
foreach
(
Clip
*
clip
,
m_clips
.
values
()
)
{
if
(
clip
->
getM
edia
()
->
fileInfo
()
->
filePath
()
==
fileInfo
.
filePath
()
)
if
(
clip
->
m
edia
()
->
fileInfo
()
->
filePath
()
==
fileInfo
.
filePath
()
)
return
true
;
}
return
false
;
...
...
@@ -111,7 +111,7 @@ MediaContainer::addClip( Clip* clip )
foreach
(
Clip
*
c
,
m_clips
.
values
()
)
{
if
(
clip
->
uuid
()
==
c
->
uuid
()
||
(
clip
->
getM
edia
()
->
fileInfo
()
==
c
->
getM
edia
()
->
fileInfo
()
&&
(
clip
->
m
edia
()
->
fileInfo
()
==
c
->
m
edia
()
->
fileInfo
()
&&
(
clip
->
begin
()
==
c
->
begin
()
&&
clip
->
end
()
==
c
->
end
()
)
)
)
{
vlmcWarning
()
<<
"Clip already loaded."
;
...
...
src/Media/Clip.cpp
View file @
bf05f834
...
...
@@ -55,7 +55,7 @@ Clip::Clip( Media *media, qint64 begin /*= 0*/, qint64 end /*= -1*/, const QStri
Clip
::
Clip
(
Clip
*
parent
,
qint64
begin
/*= -1*/
,
qint64
end
/*= -1*/
,
const
QString
&
uuid
/*= QString()*/
)
:
m_media
(
parent
->
getM
edia
()
),
m_media
(
parent
->
m
edia
()
),
m_begin
(
begin
),
m_end
(
end
),
m_rootClip
(
parent
->
rootClip
()
),
...
...
@@ -82,13 +82,13 @@ Clip::~Clip()
}
Media
*
Clip
::
getM
edia
()
Clip
::
m
edia
()
{
return
m_media
;
}
const
Media
*
Clip
::
getM
edia
()
const
Clip
::
m
edia
()
const
{
return
m_media
;
}
...
...
@@ -183,13 +183,13 @@ Clip::isRootClip() const
}
Clip
*
Clip
::
getP
arent
()
Clip
::
p
arent
()
{
return
m_parent
;
}
const
Clip
*
Clip
::
getP
arent
()
const
Clip
::
p
arent
()
const
{
return
m_parent
;
}
...
...
src/Media/Clip.h
View file @
bf05f834
...
...
@@ -93,11 +93,11 @@ class Clip : public QObject
/**
\return Returns the Media that the clip was basep uppon.
*/
Media
*
getM
edia
();
const
Media
*
getM
edia
()
const
;
Media
*
m
edia
();
const
Media
*
m
edia
()
const
;
Clip
*
getP
arent
();
const
Clip
*
getP
arent
()
const
;
Clip
*
p
arent
();
const
Clip
*
p
arent
()
const
;
MediaContainer
*
mediaContainer
();
const
MediaContainer
*
mediaContainer
()
const
;
...
...
src/Project/Workspace.cpp
View file @
bf05f834
...
...
@@ -118,9 +118,9 @@ Workspace::clipLoaded( Clip *clip )
if
(
clip
->
isRootClip
()
==
false
)
return
;
//If already in workspace : well...
if
(
isInWorkspace
(
clip
->
getM
edia
()
)
==
true
)
if
(
isInWorkspace
(
clip
->
m
edia
()
)
==
true
)
return
;
copyToWorkspace
(
clip
->
getM
edia
()
);
copyToWorkspace
(
clip
->
m
edia
()
);
}
void
...
...
src/Renderer/ClipRenderer.cpp
View file @
bf05f834
...
...
@@ -88,7 +88,7 @@ ClipRenderer::startPreview()
updateInfos
(
m_selectedClip
);
delete
m_sourceRenderer
;
m_sourceRenderer
=
m_selectedClip
->
getM
edia
()
->
source
()
->
createRenderer
(
m_eventWatcher
);
m_sourceRenderer
=
m_selectedClip
->
m
edia
()
->
source
()
->
createRenderer
(
m_eventWatcher
);
m_sourceRenderer
->
setOutputWidget
(
(
void
*
)
static_cast
<
RenderWidget
*
>
(
m_renderWidget
)
->
id
()
);
connect
(
m_eventWatcher
,
SIGNAL
(
stopped
()
),
this
,
SLOT
(
videoStopped
()
)
);
...
...
@@ -100,7 +100,7 @@ ClipRenderer::startPreview()
connect
(
m_eventWatcher
,
SIGNAL
(
timeChanged
(
qint64
)
),
this
,
SLOT
(
timeChanged
(
qint64
)
)
);
m_sourceRenderer
->
start
();
m_sourceRenderer
->
setPosition
(
(
float
)
m_begin
/
(
float
)
m_selectedClip
->
getM
edia
()
->
source
()
->
nbFrames
()
);
m_sourceRenderer
->
setPosition
(
(
float
)
m_begin
/
(
float
)
m_selectedClip
->
m
edia
()
->
source
()
->
nbFrames
()
);
m_clipLoaded
=
true
;
m_isRendering
=
true
;
m_paused
=
false
;
...
...
@@ -175,7 +175,7 @@ ClipRenderer::previousFrame()
Q_ASSERT
(
m_paused
==
true
);
}
/* FIXME: Implement a better way to render previous frame */
qint64
interval
=
static_cast
<
qint64
>
(
qCeil
(
1000.0
f
*
2.0
f
/
m_selectedClip
->
getM
edia
()
->
source
()
->
fps
()
)
);
qint64
interval
=
static_cast
<
qint64
>
(
qCeil
(
1000.0
f
*
2.0
f
/
m_selectedClip
->
m
edia
()
->
source
()
->
fps
()
)
);
m_sourceRenderer
->
setTime
(
m_sourceRenderer
->
time
()
-
interval
);
m_sourceRenderer
->
nextFrame
();
}
...
...
@@ -191,7 +191,7 @@ qint64
ClipRenderer
::
getLengthMs
()
const
{
if
(
m_selectedClip
)
return
(
qRound64
(
(
qreal
)(
m_end
-
m_begin
)
/
m_selectedClip
->
getM
edia
()
->
source
()
->
fps
()
*
1000.0
)
);
return
(
qRound64
(
(
qreal
)(
m_end
-
m_begin
)
/
m_selectedClip
->
m
edia
()
->
source
()
->
fps
()
*
1000.0
)
);
return
0
;
}
...
...
@@ -214,14 +214,14 @@ ClipRenderer::getCurrentFrame() const
if
(
m_clipLoaded
==
false
||
m_isRendering
==
false
||
m_selectedClip
==
nullptr
)
return
0
;
return
qRound64
(
(
qreal
)
m_sourceRenderer
->
time
()
/
1000
*
(
qreal
)
m_selectedClip
->
getM
edia
()
->
source
()
->
fps
()
);
(
qreal
)
m_selectedClip
->
m
edia
()
->
source
()
->
fps
()
);
}
float
ClipRenderer
::
getFps
()
const
{
if
(
m_selectedClip
!=
nullptr
)
return
m_selectedClip
->
getM
edia
()
->
source
()
->
fps
();
return
m_selectedClip
->
m
edia
()
->
source
()
->
fps
();
return
0.0
f
;
}
...
...
@@ -237,7 +237,7 @@ ClipRenderer::previewWidgetCursorChanged( qint64 newFrame )
if
(
m_isRendering
==
true
)
{
newFrame
+=
m_begin
;
qint64
nbSeconds
=
qRound64
(
(
qreal
)
newFrame
/
m_selectedClip
->
getM
edia
()
->
source
()
->
fps
()
);
qint64
nbSeconds
=
qRound64
(
(
qreal
)
newFrame
/
m_selectedClip
->
m
edia
()
->
source
()
->
fps
()
);
m_sourceRenderer
->
setTime
(
nbSeconds
*
1000
);
}
}
...
...
@@ -271,7 +271,7 @@ ClipRenderer::videoPlaying()
void
ClipRenderer
::
timeChanged
(
qint64
time
)
{
float
fps
=
m_selectedClip
->
getM
edia
()
->
source
()
->
fps
();
float
fps
=
m_selectedClip
->
m
edia
()
->
source
()
->
fps
();
qint64
f
=
qRound64
(
(
qreal
)
time
/
1000.0
*
fps
);
if
(
f
>=
m_end
)
return
;
...
...
src/Workflow/ClipWorkflow.cpp
View file @
bf05f834
...
...
@@ -68,7 +68,7 @@ ClipWorkflow::initialize()
m_state
=
ClipWorkflow
::
Initializing
;
delete
m_renderer
;
m_renderer
=
m_clipHelper
->
clip
()
->
getM
edia
()
->
source
()
->
createRenderer
(
m_eventWatcher
);
m_renderer
=
m_clipHelper
->
clip
()
->
m
edia
()
->
source
()
->
createRenderer
(
m_eventWatcher
);
preallocate
();
initializeInternals
();
...
...
@@ -104,11 +104,11 @@ ClipWorkflow::loadingComplete()
void
ClipWorkflow
::
adjustBegin
()
{
if
(
m_clipHelper
->
clip
()
->
getM
edia
()
->
fileType
()
==
Media
::
Video
||
m_clipHelper
->
clip
()
->
getM
edia
()
->
fileType
()
==
Media
::
Audio
)
if
(
m_clipHelper
->
clip
()
->
m
edia
()
->
fileType
()
==
Media
::
Video
||
m_clipHelper
->
clip
()
->
m
edia
()
->
fileType
()
==
Media
::
Audio
)
{
m_renderer
->
setTime
(
m_clipHelper
->
begin
()
/
m_clipHelper
->
clip
()
->
getM
edia
()
->
source
()
->
fps
()
*
1000
);
m_clipHelper
->
clip
()
->
m
edia
()
->
source
()
->
fps
()
*
1000
);
}
}
...
...
src/Workflow/TrackWorkflow.cpp
View file @
bf05f834
...
...
@@ -82,7 +82,7 @@ TrackWorkflow::addClip( ClipHelper* ch, qint64 start )
ClipWorkflow
*
cw
;
if
(
m_trackType
==
Workflow
::
VideoTrack
)
{
if
(
ch
->
clip
()
->
getM
edia
()
->
fileType
()
==
Media
::
Video
)
if
(
ch
->
clip
()
->
m
edia
()
->
fileType
()
==
Media
::
Video
)
cw
=
new
VideoClipWorkflow
(
ch
);
else
cw
=
new
ImageClipWorkflow
(
ch
);
...
...
@@ -529,7 +529,7 @@ TrackWorkflow::clear()
void
TrackWorkflow
::
adjustClipTime
(
qint64
currentFrame
,
qint64
start
,
ClipWorkflow
*
cw
)
{
float
fps
=
cw
->
clip
()
->
getM
edia
()
->
source
()
->
fps
();
float
fps
=
cw
->
clip
()
->
m
edia
()
->
source
()
->
fps
();
qint64
nbMs
=
(
currentFrame
-
start
)
/
fps
*
1000
;
qint64
beginInMs
=
cw
->
getClipHelper
()
->
begin
()
/
fps
*
1000
;
qint64
startFrame
=
beginInMs
+
nbMs
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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