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
258
Issues
258
List
Boards
Labels
Service Desk
Milestones
Merge Requests
15
Merge Requests
15
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
9522922e
Commit
9522922e
authored
Mar 06, 2012
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merging of scopes manager by Granjow (final merge)
parent
b4fed78d
Changes
29
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
402 additions
and
468 deletions
+402
-468
src/abstractmonitor.h
src/abstractmonitor.h
+4
-1
src/definitions.h
src/definitions.h
+10
-1
src/mainwindow.cpp
src/mainwindow.cpp
+66
-186
src/mainwindow.h
src/mainwindow.h
+4
-12
src/mltdevicecapture.cpp
src/mltdevicecapture.cpp
+3
-3
src/mltdevicecapture.h
src/mltdevicecapture.h
+0
-3
src/monitor.cpp
src/monitor.cpp
+7
-7
src/monitormanager.cpp
src/monitormanager.cpp
+17
-3
src/monitormanager.h
src/monitormanager.h
+4
-0
src/recmonitor.cpp
src/recmonitor.cpp
+23
-23
src/renderer.cpp
src/renderer.cpp
+27
-20
src/renderer.h
src/renderer.h
+0
-2
src/scopes/abstractscopewidget.cpp
src/scopes/abstractscopewidget.cpp
+6
-4
src/scopes/abstractscopewidget.h
src/scopes/abstractscopewidget.h
+53
-32
src/scopes/audioscopes/abstractaudioscopewidget.cpp
src/scopes/audioscopes/abstractaudioscopewidget.cpp
+1
-1
src/scopes/audioscopes/abstractaudioscopewidget.h
src/scopes/audioscopes/abstractaudioscopewidget.h
+7
-4
src/scopes/audioscopes/audiosignal.cpp
src/scopes/audioscopes/audiosignal.cpp
+101
-80
src/scopes/audioscopes/audiosignal.h
src/scopes/audioscopes/audiosignal.h
+17
-11
src/scopes/audioscopes/audiospectrum.h
src/scopes/audioscopes/audiospectrum.h
+8
-5
src/scopes/colorscopes/abstractgfxscopewidget.cpp
src/scopes/colorscopes/abstractgfxscopewidget.cpp
+5
-40
src/scopes/colorscopes/abstractgfxscopewidget.h
src/scopes/colorscopes/abstractgfxscopewidget.h
+9
-11
src/scopes/colorscopes/histogram.cpp
src/scopes/colorscopes/histogram.cpp
+2
-3
src/scopes/colorscopes/histogram.h
src/scopes/colorscopes/histogram.h
+4
-1
src/scopes/colorscopes/rgbparade.cpp
src/scopes/colorscopes/rgbparade.cpp
+2
-3
src/scopes/colorscopes/rgbparade.h
src/scopes/colorscopes/rgbparade.h
+5
-2
src/scopes/colorscopes/vectorscope.cpp
src/scopes/colorscopes/vectorscope.cpp
+2
-3
src/scopes/colorscopes/vectorscope.h
src/scopes/colorscopes/vectorscope.h
+7
-3
src/scopes/colorscopes/waveform.cpp
src/scopes/colorscopes/waveform.cpp
+2
-3
src/scopes/colorscopes/waveform.h
src/scopes/colorscopes/waveform.h
+6
-1
No files found.
src/abstractmonitor.h
View file @
9522922e
...
...
@@ -82,6 +82,9 @@ Q_OBJECT public:
/** @brief This property is used to decide if the renderer should convert it's frames to QImage for use in other Kdenlive widgets. */
bool
sendFrameForAnalysis
;
/** @brief This property is used to decide if the renderer should send audio data for monitoring. */
bool
analyseAudio
;
const
QString
&
name
()
const
{
return
m_name
;};
/** @brief Someone needs us to send again a frame. */
...
...
@@ -95,7 +98,7 @@ signals:
void
frameUpdated
(
QImage
);
/** @brief This signal contains the audio of the current frame. */
void
audioSamplesSignal
(
const
QVector
<
int16_t
>&
,
const
int
&
,
const
int
&
,
const
int
&
);
void
audioSamplesSignal
(
QVector
<
int16_t
>
,
int
,
int
,
int
);
};
class
AbstractMonitor
:
public
QWidget
...
...
src/definitions.h
View file @
9522922e
...
...
@@ -24,11 +24,20 @@
#include "gentime.h"
#include "effectslist.h"
#include <QTreeWidgetItem>
#include <KLocale>
#include <QTreeWidgetItem>
#include <QtCore/QString>
const
int
MAXCLIPDURATION
=
15000
;
namespace
Kdenlive
{
const
QString
clipMonitor
(
"clipMonitor"
);
const
QString
recordMonitor
(
"recordMonitor"
);
const
QString
projectMonitor
(
"projectMonitor"
);
const
QString
stopmotionMonitor
(
"stopmotionMonitor"
);
}
enum
OPERATIONTYPE
{
NONE
=
0
,
MOVE
=
1
,
RESIZESTART
=
2
,
RESIZEEND
=
3
,
FADEIN
=
4
,
FADEOUT
=
5
,
TRANSITIONSTART
=
6
,
TRANSITIONEND
=
7
,
MOVEGUIDE
=
8
,
KEYFRAME
=
9
,
SEEK
=
10
,
SPACER
=
11
,
RUBBERSELECTION
=
12
};
enum
CLIPTYPE
{
UNKNOWN
=
0
,
AUDIO
=
1
,
VIDEO
=
2
,
AV
=
3
,
COLOR
=
4
,
IMAGE
=
5
,
TEXT
=
6
,
SLIDESHOW
=
7
,
VIRTUAL
=
8
,
PLAYLIST
=
9
};
...
...
src/mainwindow.cpp
View file @
9522922e
This diff is collapsed.
Click to expand it.
src/mainwindow.h
View file @
9522922e
...
...
@@ -66,6 +66,7 @@ class JogShuttleAction;
class
DocClipBase
;
class
Render
;
class
Transition
;
class
ScopeManager
;
class
Histogram
;
class
Vectorscope
;
class
Waveform
;
...
...
@@ -137,6 +138,8 @@ private:
KTabWidget
*
m_timelineArea
;
QProgressBar
*
m_statusProgressBar
;
ScopeManager
*
m_scopeManager
;
/** @brief Sets up all the actions and attaches them to the collection. */
void
setupActions
();
KdenliveDoc
*
m_activeDocument
;
...
...
@@ -197,7 +200,6 @@ private:
/** This list holds all the scopes used in Kdenlive, allowing to manage some global settings */
QList
<
QDockWidget
*>
m_gfxScopesList
;
QList
<
AbstractAudioScopeWidget
*>
m_audioScopesList
;
KActionCategory
*
m_effectActions
;
QMenu
*
m_effectsMenu
;
...
...
@@ -209,7 +211,7 @@ private:
/** Actions used in the stopmotion widget */
KActionCategory
*
m_stopmotion_actions
;
/** Action names that can be used in the slotDoAction() slot, with their i18n() names */
QStringList
m_action_names
;
...
...
@@ -529,16 +531,6 @@ private slots:
/** @brief The monitor informs that it needs (or not) to have frames sent by the renderer. */
void
slotMonitorRequestRenderFrame
(
bool
request
);
/** @brief Check if someone needs the render frame sent. */
void
slotUpdateGfxScopeFrameRequest
();
/** @brief Check if someone needs the render frame sent. */
void
slotDoUpdateGfxScopeFrameRequest
();
void
slotUpdateAudioScopeFrameRequest
();
void
slotDoUpdateAudioScopeFrameRequest
();
/** @brief When switching between monitors, update the visible scopes. */
void
slotUpdateColorScopes
();
/** @brief Active monitor deleted, clear scopes. */
void
slotClearColorScopes
();
/** @brief Switch current monitor to fullscreen. */
void
slotSwitchFullscreen
();
/** @brief Open the stopmotion dialog. */
...
...
src/mltdevicecapture.cpp
View file @
9522922e
...
...
@@ -48,12 +48,12 @@ static void consumer_gl_frame_show(mlt_consumer, MltDeviceCapture * self, mlt_fr
self
->
showFrame
(
frame
);
}
static
void
rec_consumer_frame_show
(
mlt_consumer
,
MltDeviceCapture
*
self
,
mlt_frame
frame_ptr
)
/*
static void rec_consumer_frame_show(mlt_consumer, MltDeviceCapture * self, mlt_frame frame_ptr)
{
Mlt::Frame frame(frame_ptr);
if (!frame.is_valid()) return;
self->gotCapturedFrame(frame);
}
}
*/
static
void
rec_consumer_frame_preview
(
mlt_consumer
,
MltDeviceCapture
*
self
,
mlt_frame
frame_ptr
)
{
...
...
@@ -80,7 +80,6 @@ MltDeviceCapture::MltDeviceCapture(QString profile, VideoPreviewContainer *surfa
AbstractRender
(
"capture"
,
parent
),
doCapture
(
0
),
sendFrameForAnalysis
(
false
),
analyseAudio
(
KdenliveSettings
::
monitor_audio
()),
processingImage
(
false
),
m_mltConsumer
(
NULL
),
m_mltProducer
(
NULL
),
...
...
@@ -91,6 +90,7 @@ MltDeviceCapture::MltDeviceCapture(QString profile, VideoPreviewContainer *surfa
m_captureDisplayWidget
(
surface
),
m_winid
((
int
)
surface
->
winId
())
{
analyseAudio
=
KdenliveSettings
::
monitor_audio
();
if
(
profile
.
isEmpty
())
profile
=
KdenliveSettings
::
current_profile
();
buildConsumer
(
profile
);
connect
(
this
,
SIGNAL
(
unblockPreview
()),
this
,
SLOT
(
slotPreparePreview
()));
...
...
src/mltdevicecapture.h
View file @
9522922e
...
...
@@ -89,9 +89,6 @@ Q_OBJECT public:
/** @brief This will add a horizontal flip effect, easier to work when filming yourself. */
void
mirror
(
bool
activate
);
/** @brief This property is used to decide if the renderer should send audio data for monitoring. */
bool
analyseAudio
;
/** @brief True if we are processing an image (yuv > rgb) when recording. */
bool
processingImage
;
...
...
src/monitor.cpp
View file @
9522922e
...
...
@@ -116,7 +116,7 @@ Monitor::Monitor(QString name, MonitorManager *manager, QString profile, QWidget
configButton
->
setPopupMode
(
QToolButton
::
QToolButton
::
InstantPopup
);
m_toolbar
->
addWidget
(
configButton
);
if
(
name
==
"clip"
)
{
if
(
name
==
Kdenlive
::
clipMonitor
)
{
m_markerMenu
=
new
QMenu
(
i18n
(
"Go to marker..."
),
this
);
m_markerMenu
->
setEnabled
(
false
);
m_configMenu
->
addMenu
(
m_markerMenu
);
...
...
@@ -182,7 +182,7 @@ Monitor::Monitor(QString name, MonitorManager *manager, QString profile, QWidget
connect
(
render
,
SIGNAL
(
rendererStopped
(
int
)),
this
,
SLOT
(
rendererStopped
(
int
)));
connect
(
render
,
SIGNAL
(
rendererPosition
(
int
)),
this
,
SLOT
(
seekCursor
(
int
)));
if
(
name
!=
"clip"
)
{
if
(
name
!=
Kdenlive
::
clipMonitor
)
{
connect
(
render
,
SIGNAL
(
rendererPosition
(
int
)),
this
,
SIGNAL
(
renderPosition
(
int
)));
connect
(
render
,
SIGNAL
(
durationChanged
(
int
)),
this
,
SIGNAL
(
durationChanged
(
int
)));
connect
(
m_ruler
,
SIGNAL
(
zoneChanged
(
QPoint
)),
this
,
SIGNAL
(
zoneUpdated
(
QPoint
)));
...
...
@@ -192,7 +192,7 @@ Monitor::Monitor(QString name, MonitorManager *manager, QString profile, QWidget
if
(
m_monitorRefresh
)
m_monitorRefresh
->
show
();
if
(
name
==
"project"
)
{
if
(
name
==
Kdenlive
::
projectMonitor
)
{
m_effectWidget
=
new
MonitorEditWidget
(
render
,
m_videoBox
);
m_toolbar
->
addAction
(
m_effectWidget
->
getVisibilityAction
());
lay
->
addWidget
(
m_effectWidget
);
...
...
@@ -271,7 +271,7 @@ void Monitor::setupMenu(QMenu *goMenu, QAction *playZone, QAction *loopZone, QMe
}
//TODO: add save zone to timeline monitor when fixed
if
(
m_name
==
"clip"
)
{
if
(
m_name
==
Kdenlive
::
clipMonitor
)
{
m_contextMenu
->
addMenu
(
m_markerMenu
);
m_contextMenu
->
addAction
(
KIcon
(
"document-save"
),
i18n
(
"Save zone"
),
this
,
SLOT
(
slotSaveZone
()));
QAction
*
extractZone
=
m_configMenu
->
addAction
(
KIcon
(
"document-new"
),
i18n
(
"Extract Zone"
),
this
,
SLOT
(
slotExtractCurrentZone
()));
...
...
@@ -280,7 +280,7 @@ void Monitor::setupMenu(QMenu *goMenu, QAction *playZone, QAction *loopZone, QMe
QAction
*
extractFrame
=
m_configMenu
->
addAction
(
KIcon
(
"document-new"
),
i18n
(
"Extract frame"
),
this
,
SLOT
(
slotExtractCurrentFrame
()));
m_contextMenu
->
addAction
(
extractFrame
);
if
(
m_name
!=
"clip"
)
{
if
(
m_name
!=
Kdenlive
::
clipMonitor
)
{
QAction
*
splitView
=
m_contextMenu
->
addAction
(
KIcon
(
"view-split-left-right"
),
i18n
(
"Split view"
),
render
,
SLOT
(
slotSplitView
(
bool
)));
splitView
->
setCheckable
(
true
);
m_configMenu
->
addAction
(
splitView
);
...
...
@@ -841,7 +841,7 @@ void Monitor::slotSetClipProducer(DocClipBase *clip, QPoint zone, bool forceUpda
render
->
setProducer
(
NULL
,
-
1
);
return
;
}
if
(
clip
!=
m_currentClip
||
forceUpdate
)
{
m_currentClip
=
clip
;
if
(
m_currentClip
)
activateMonitor
();
...
...
@@ -1005,7 +1005,7 @@ void Monitor::slotSetSelectedClip(Transition* item)
void
Monitor
::
slotEffectScene
(
bool
show
)
{
if
(
m_name
==
"project"
)
{
if
(
m_name
==
Kdenlive
::
projectMonitor
)
{
if
(
m_monitorRefresh
)
{
m_monitorRefresh
->
setVisible
(
!
show
);
}
else
{
...
...
src/monitormanager.cpp
View file @
9522922e
...
...
@@ -63,6 +63,17 @@ void MonitorManager::removeMonitor(AbstractMonitor *monitor)
m_monitorsList
.
removeAll
(
monitor
);
}
AbstractMonitor
*
MonitorManager
::
monitor
(
const
QString
monitorName
)
{
AbstractMonitor
*
monitor
=
NULL
;
for
(
int
i
=
0
;
i
<
m_monitorsList
.
size
();
i
++
)
{
if
(
m_monitorsList
[
i
]
->
name
()
==
monitorName
)
{
monitor
=
m_monitorsList
[
i
];
}
}
return
monitor
;
}
bool
MonitorManager
::
activateMonitor
(
const
QString
&
name
)
{
if
(
m_clipMonitor
==
NULL
||
m_projectMonitor
==
NULL
)
...
...
@@ -94,9 +105,9 @@ bool MonitorManager::isActive(const QString &name) const
void
MonitorManager
::
slotSwitchMonitors
(
bool
activateClip
)
{
if
(
activateClip
)
activateMonitor
(
"clip"
);
activateMonitor
(
Kdenlive
::
clipMonitor
);
else
activateMonitor
(
"project"
);
activateMonitor
(
Kdenlive
::
projectMonitor
);
}
void
MonitorManager
::
stopActiveMonitor
()
...
...
@@ -207,11 +218,14 @@ void MonitorManager::slotRefreshCurrentMonitor(const QString &id)
void
MonitorManager
::
slotUpdateAudioMonitoring
()
{
// if(...) added since they are 0x0 when the config wizard is running! --Granjow
if
(
m_clipMonitor
)
{
/*
if (m_clipMonitor) {
m_clipMonitor->render->analyseAudio = KdenliveSettings::monitor_audio();
}
if (m_projectMonitor) {
m_projectMonitor->render->analyseAudio = KdenliveSettings::monitor_audio();
}*/
for
(
int
i
=
0
;
i
<
m_monitorsList
.
count
();
i
++
)
{
if
(
m_monitorsList
.
at
(
i
)
->
abstractRender
())
m_monitorsList
.
at
(
i
)
->
abstractRender
()
->
analyseAudio
=
KdenliveSettings
::
monitor_audio
();
}
}
...
...
src/monitormanager.h
View file @
9522922e
...
...
@@ -39,6 +39,10 @@ public:
void
resetProfiles
(
Timecode
tc
);
void
stopActiveMonitor
();
AbstractRender
*
activeRenderer
();
/** Searches for a monitor with the given name.
@return NULL, if no monitor could be found, or the monitor otherwise.
*/
AbstractMonitor
*
monitor
(
const
QString
monitorName
);
void
updateScopeSource
();
void
clearScopeSource
();
...
...
src/recmonitor.cpp
View file @
9522922e
...
...
@@ -93,20 +93,20 @@ RecMonitor::RecMonitor(QString name, MonitorManager *manager, QWidget *parent) :
m_recAction
=
toolbar
->
addAction
(
KIcon
(
"media-record"
),
i18n
(
"Record"
));
connect
(
m_recAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
slotRecord
()));
m_recAction
->
setCheckable
(
true
);
rec_options
->
setIcon
(
KIcon
(
"system-run"
));
QMenu
*
menu
=
new
QMenu
(
this
);
m_addCapturedClip
=
new
QAction
(
i18n
(
"Add Captured File to Project"
),
this
);
m_addCapturedClip
->
setCheckable
(
true
);
m_addCapturedClip
->
setChecked
(
true
);
menu
->
addAction
(
m_addCapturedClip
);
rec_audio
->
setChecked
(
KdenliveSettings
::
v4l_captureaudio
());
rec_video
->
setChecked
(
KdenliveSettings
::
v4l_capturevideo
());
m_previewSettings
=
new
QAction
(
i18n
(
"Recording Preview"
),
this
);
m_previewSettings
->
setCheckable
(
true
);
rec_options
->
setMenu
(
menu
);
menu
->
addAction
(
m_previewSettings
);
...
...
@@ -142,7 +142,7 @@ RecMonitor::RecMonitor(QString name, MonitorManager *manager, QWidget *parent) :
connect
(
m_captureProcess
,
SIGNAL
(
stateChanged
(
QProcess
::
ProcessState
)),
this
,
SLOT
(
slotProcessStatus
(
QProcess
::
ProcessState
)));
connect
(
m_captureProcess
,
SIGNAL
(
readyReadStandardError
()),
this
,
SLOT
(
slotReadDvgrabInfo
()));
QString
videoDriver
=
KdenliveSettings
::
videodrivername
();
#if QT_VERSION >= 0x040600
QProcessEnvironment
env
=
QProcessEnvironment
::
systemEnvironment
();
...
...
@@ -488,34 +488,34 @@ void RecMonitor::slotStartPreview(bool play)
break
;
case
VIDEO4LINUX
:
path
=
KStandardDirs
::
locateLocal
(
"appdata"
,
"profiles/video4linux"
);
m_manager
->
activateMonitor
(
"record"
);
m_manager
->
activateMonitor
(
Kdenlive
::
recordMonitor
);
buildMltDevice
(
path
);
profile
=
ProfilesDialog
::
getVideoProfile
(
path
);
producer
=
getV4lXmlPlaylist
(
profile
);
//producer = QString("avformat-novalidate:video4linux2:%1?width:%2&height:%3&frame_rate:%4").arg(KdenliveSettings::video4vdevice()).arg(profile.width).arg(profile.height).arg((double) profile.frame_rate_num / profile.frame_rate_den);
if
(
!
m_captureDevice
->
slotStartPreview
(
producer
,
true
))
{
// v4l capture failed to start
video_frame
->
setText
(
i18n
(
"Failed to start Video4Linux,
\n
check your parameters..."
));
m_videoBox
->
setHidden
(
true
);
}
else
{
m_playAction
->
setEnabled
(
false
);
m_stopAction
->
setEnabled
(
true
);
m_isPlaying
=
true
;
}
break
;
case
BLACKMAGIC
:
path
=
KdenliveSettings
::
current_profile
();
m_manager
->
activateMonitor
(
"record"
);
m_manager
->
activateMonitor
(
Kdenlive
::
recordMonitor
);
buildMltDevice
(
path
);
producer
=
QString
(
"decklink:%1"
).
arg
(
KdenliveSettings
::
decklink_capturedevice
());
if
(
!
m_captureDevice
->
slotStartPreview
(
producer
))
{
// v4l capture failed to start
video_frame
->
setText
(
i18n
(
"Failed to start Decklink,
\n
check your parameters..."
));
m_videoBox
->
setHidden
(
true
);
}
else
{
m_playAction
->
setEnabled
(
false
);
m_stopAction
->
setEnabled
(
true
);
...
...
@@ -583,7 +583,7 @@ void RecMonitor::slotRecord()
switch
(
device_selector
->
currentIndex
())
{
case
VIDEO4LINUX
:
m_manager
->
activateMonitor
(
"record"
);
m_manager
->
activateMonitor
(
Kdenlive
::
recordMonitor
);
path
=
KStandardDirs
::
locateLocal
(
"appdata"
,
"profiles/video4linux"
);
profile
=
ProfilesDialog
::
getVideoProfile
(
path
);
m_videoBox
->
setRatio
((
double
)
profile
.
display_aspect_num
/
profile
.
display_aspect_den
);
...
...
@@ -591,7 +591,7 @@ void RecMonitor::slotRecord()
playlist
=
getV4lXmlPlaylist
(
profile
);
v4lparameters
=
KdenliveSettings
::
v4l_parameters
();
// TODO: when recording audio only, allow param configuration?
if
(
!
rec_video
->
isChecked
())
v4lparameters
.
clear
();
...
...
@@ -623,7 +623,7 @@ void RecMonitor::slotRecord()
v4lparameters
=
QString
(
v4lparameters
.
section
(
"acodec"
,
0
,
0
)
+
"an=1 "
+
endParam
).
simplified
();
}
}
showPreview
=
m_previewSettings
->
isChecked
();
if
(
!
rec_video
->
isChecked
())
showPreview
=
false
;
...
...
@@ -635,19 +635,19 @@ void RecMonitor::slotRecord()
m_previewSettings
->
setEnabled
(
false
);
}
else
{
video_frame
->
setText
(
i18n
(
"Failed to start Video4Linux,
\n
check your parameters..."
));
video_frame
->
setText
(
i18n
(
"Failed to start Video4Linux,
\n
check your parameters..."
));
m_videoBox
->
setHidden
(
true
);
m_isCapturing
=
false
;
}
break
;
case
BLACKMAGIC
:
m_manager
->
activateMonitor
(
"record"
);
m_manager
->
activateMonitor
(
Kdenlive
::
recordMonitor
);
path
=
KdenliveSettings
::
current_profile
();
profile
=
ProfilesDialog
::
getVideoProfile
(
path
);
m_videoBox
->
setRatio
((
double
)
profile
.
display_aspect_num
/
profile
.
display_aspect_den
);
buildMltDevice
(
path
);
playlist
=
QString
(
"<producer id=
\"
producer0
\"
in=
\"
0
\"
out=
\"
99999
\"
><property name=
\"
mlt_type
\"
>producer</property><property name=
\"
length
\"
>100000</property><property name=
\"
eof
\"
>pause</property><property name=
\"
resource
\"
>%1</property><property name=
\"
mlt_service
\"
>decklink</property></producer>"
).
arg
(
KdenliveSettings
::
decklink_capturedevice
());
if
(
m_captureDevice
->
slotStartCapture
(
KdenliveSettings
::
decklink_parameters
(),
m_captureFile
.
path
(),
QString
(
"decklink:%1"
).
arg
(
KdenliveSettings
::
decklink_capturedevice
()),
m_previewSettings
->
isChecked
(),
false
))
{
...
...
@@ -665,7 +665,7 @@ void RecMonitor::slotRecord()
m_isCapturing
=
false
;
}
break
;
case
SCREENGRAB
:
switch
(
KdenliveSettings
::
rmd_capture_type
())
{
case
0
:
...
...
@@ -731,13 +731,13 @@ void RecMonitor::slotRecord()
}
const
QString
RecMonitor
::
getV4lXmlPlaylist
(
MltVideoProfile
profile
)
{
QString
playlist
=
QString
(
"<mlt title=
\"
capture
\"
LC_NUMERIC=
\"
C
\"
><profile description=
\"
v4l
\"
width=
\"
%1
\"
height=
\"
%2
\"
progressive=
\"
%3
\"
sample_aspect_num=
\"
%4
\"
sample_aspect_den=
\"
%5
\"
display_aspect_num=
\"
%6
\"
display_aspect_den=
\"
%7
\"
frame_rate_num=
\"
%8
\"
frame_rate_den=
\"
%9
\"
colorspace=
\"
%10
\"
/>"
).
arg
(
profile
.
width
).
arg
(
profile
.
height
).
arg
(
profile
.
progressive
).
arg
(
profile
.
sample_aspect_num
).
arg
(
profile
.
sample_aspect_den
).
arg
(
profile
.
display_aspect_num
).
arg
(
profile
.
display_aspect_den
).
arg
(
profile
.
frame_rate_num
).
arg
(
profile
.
frame_rate_den
).
arg
(
profile
.
colorspace
);
if
(
rec_video
->
isChecked
())
{
playlist
.
append
(
QString
(
"<producer id=
\"
producer0
\"
in=
\"
0
\"
out=
\"
999999
\"
><property name=
\"
mlt_type
\"
>producer</property><property name=
\"
length
\"
>1000000</property><property name=
\"
eof
\"
>loop</property><property name=
\"
resource
\"
>video4linux2:%1?width:%2&height:%3&frame_rate:%4</property><property name=
\"
mlt_service
\"
>avformat-novalidate</property></producer><playlist id=
\"
playlist0
\"
><entry producer=
\"
producer0
\"
in=
\"
0
\"
out=
\"
999999
\"
/></playlist>"
).
arg
(
KdenliveSettings
::
video4vdevice
()).
arg
(
profile
.
width
).
arg
(
profile
.
height
).
arg
((
double
)
profile
.
frame_rate_num
/
profile
.
frame_rate_den
));
}
if
(
rec_audio
->
isChecked
())
{
playlist
.
append
(
QString
(
"<producer id=
\"
producer1
\"
in=
\"
0
\"
out=
\"
999999
\"
><property name=
\"
mlt_type
\"
>producer</property><property name=
\"
length
\"
>1000000</property><property name=
\"
eof
\"
>loop</property><property name=
\"
resource
\"
>alsa:%5</property><property name=
\"
audio_index
\"
>0</property><property name=
\"
video_index
\"
>-1</property><property name=
\"
mlt_service
\"
>avformat-novalidate</property></producer><playlist id=
\"
playlist1
\"
><entry producer=
\"
producer1
\"
in=
\"
0
\"
out=
\"
999999
\"
/></playlist>"
).
arg
(
KdenliveSettings
::
v4l_alsadevicename
()));
}
...
...
@@ -859,7 +859,7 @@ void RecMonitor::manageCapturedFiles()
if
(
QFile
::
rename
(
url
.
path
(),
newUrl
))
{
url
=
KUrl
(
newUrl
);
}
}
capturedFiles
.
append
(
url
);
}
...
...
src/renderer.cpp
View file @
9522922e
...
...
@@ -105,7 +105,6 @@ static void consumer_gl_frame_show(mlt_consumer, Render * self, mlt_frame frame_
Render
::
Render
(
const
QString
&
rendererName
,
int
winid
,
QString
profile
,
QWidget
*
parent
)
:
AbstractRender
(
rendererName
,
parent
),
analyseAudio
(
KdenliveSettings
::
monitor_audio
()),
m_name
(
rendererName
),
m_mltConsumer
(
NULL
),
m_mltProducer
(
NULL
),
...
...
@@ -119,6 +118,7 @@ Render::Render(const QString & rendererName, int winid, QString profile, QWidget
m_blackClip
(
NULL
),
m_winid
(
winid
)
{
analyseAudio
=
KdenliveSettings
::
monitor_audio
();
if
(
profile
.
isEmpty
())
profile
=
KdenliveSettings
::
current_profile
();
buildConsumer
(
profile
);
m_mltProducer
=
m_blackClip
->
cut
(
0
,
1
);
...
...
@@ -137,7 +137,7 @@ Render::~Render()
void
Render
::
closeMlt
()
{
{
//delete m_osdTimer;
m_requestList
.
clear
();
m_infoThread
.
waitForFinished
();
...
...
@@ -203,7 +203,7 @@ void Render::buildConsumer(const QString &profileName)
m_blackClip
->
set
(
"id"
,
"black"
);
m_blackClip
->
set
(
"mlt_type"
,
"producer"
);
if
(
KdenliveSettings
::
external_display
()
&&
m_name
!=
"clip"
)
{
if
(
KdenliveSettings
::
external_display
()
&&
m_name
!=
Kdenlive
::
clipMonitor
)
{
#ifdef USE_BLACKMAGIC
// Use blackmagic card for video output
QMap
<
QString
,
QString
>
profileProperties
=
ProfilesDialog
::
getSettingsFromFile
(
profileName
);
...
...
@@ -360,7 +360,7 @@ int Render::resetProfile(const QString &profileName, bool dropSceneList)
buildConsumer
(
profileName
);
double
new_fps
=
m_mltProfile
->
fps
();
double
new_dar
=
m_mltProfile
->
dar
();
if
(
!
dropSceneList
)
{
// We need to recover our playlist
if
(
current_fps
!=
new_fps
)
{
...
...
@@ -447,7 +447,7 @@ QImage Render::extractFrame(int frame_position, QString path, int width, int hei
else
delete
producer
;
}
}
if
(
!
m_mltProducer
||
!
path
.
isEmpty
())
{
QImage
pix
(
width
,
height
,
QImage
::
Format_RGB32
);
pix
.
fill
(
Qt
::
black
);
...
...
@@ -644,7 +644,7 @@ void Render::processFileProperties()
info
=
m_requestList
.
takeFirst
();
m_processingClipId
=
info
.
clipId
;
m_infoMutex
.
unlock
();
QString
path
;
bool
proxyProducer
;
if
(
info
.
xml
.
hasAttribute
(
"proxy"
)
&&
info
.
xml
.
attribute
(
"proxy"
)
!=
"-"
)
{
...
...
@@ -784,7 +784,7 @@ void Render::processFileProperties()
int
imageWidth
=
(
int
)((
double
)
info
.
imageHeight
*
m_mltProfile
->
width
()
/
m_mltProfile
->
height
()
+
0.5
);
int
fullWidth
=
(
int
)((
double
)
info
.
imageHeight
*
m_mltProfile
->
dar
()
+
0.5
);
int
frameNumber
=
info
.
xml
.
attribute
(
"thumbnail"
,
"-1"
).
toInt
();
if
((
!
info
.
replaceProducer
&&
info
.
xml
.
hasAttribute
(
"file_hash"
))
||
proxyProducer
)
{
// Clip already has all properties
if
(
proxyProducer
)
{
...
...
@@ -805,9 +805,9 @@ void Render::processFileProperties()
stringMap
filePropertyMap
;
stringMap
metadataPropertyMap
;
char
property
[
200
];
if
(
frameNumber
>
0
)
producer
->
seek
(
frameNumber
);
duration
=
duration
>
0
?
duration
:
producer
->
get_playtime
();
filePropertyMap
[
"duration"
]
=
QString
::
number
(
duration
);
//kDebug() << "/////// PRODUCER: " << url.path() << " IS: " << producer->get_playtime();
...
...
@@ -857,9 +857,9 @@ void Render::processFileProperties()
}
}
}
// Get frame rate
int
vindex
=
producer
->
get_int
(
"video_index"
);
int
vindex
=
producer
->
get_int
(
"video_index"
);
if
(
vindex
>
-
1
)
{
snprintf
(
property
,
sizeof
(
property
),
"meta.media.%d.stream.frame_rate"
,
vindex
);
if
(
producer
->
get
(
property
))
...
...
@@ -925,7 +925,7 @@ void Render::processFileProperties()
int
video_max
=
0
;
int
default_audio
=
producer
->
get_int
(
"audio_index"
);
int
audio_max
=
0
;
int
scan
=
producer
->
get_int
(
"meta.media.progressive"
);
filePropertyMap
[
"progressive"
]
=
QString
::
number
(
scan
);
...
...
@@ -1295,7 +1295,7 @@ void Render::saveZone(KUrl url, QString desc, QPoint zone)
Mlt
::
Consumer
xmlConsumer
(
*
m_mltProfile
,
(
"xml:"
+
url
.
path
()).
toUtf8
().
constData
());
m_mltProducer
->
optimise
();
xmlConsumer
.
set
(
"terminate_on_pause"
,
1
);
if
(
m_name
==
"clip"
)
{
if
(
m_name
==
Kdenlive
::
clipMonitor
)
{
Mlt
::
Producer
*
prod
=
m_mltProducer
->
cut
(
zone
.
x
(),
zone
.
y
());
Mlt
::
Playlist
list
;
list
.
insert_at
(
0
,
prod
,
0
);
...
...
@@ -1425,7 +1425,7 @@ void Render::switchPlay(bool play)
return
;
if
(
m_isZoneMode
)
resetZoneMode
();
if
(
play
&&
m_mltProducer
->
get_speed
()
==
0.0
)
{
if
(
m_name
==
"clip"
&&
m_mltConsumer
->
position
()
==
m_mltProducer
->
get_out
())
m_mltProducer
->
seek
(
0
);
if
(
m_name
==
Kdenlive
::
clipMonitor
&&
m_mltConsumer
->
position
()
==
m_mltProducer
->
get_out
())
m_mltProducer
->
seek
(
0
);
if
(
m_mltConsumer
->
is_stopped
())
{
m_mltConsumer
->
start
();
}
...
...
@@ -1437,7 +1437,7 @@ void Render::switchPlay(bool play)
m_mltProducer
->
seek
(
m_mltConsumer
->
position
());
if
(
!
m_mltConsumer
->
is_stopped
())
m_mltConsumer
->
stop
();
if
(
m_isZoneMode
)
resetZoneMode
();
//emitConsumerStopped();
/*m_mltConsumer->set("refresh", 0);
m_mltConsumer->stop();
...
...
@@ -1585,12 +1585,19 @@ const QString & Render::rendererName() const
void
Render
::
emitFrameUpdated
(
Mlt
::
Frame
&
frame
)
{
mlt_image_format
format
=
mlt_image_rgb24
;
mlt_image_format
format
=
mlt_image_rgb24a
;
int
width
=
0
;
int
height
=
0
;
const
uchar
*
image
=
frame
.
get_image
(
format
,
width
,
height
);
QImage
qimage
(
width
,
height
,
QImage
::
Format_ARGB32_Premultiplied
);
memcpy
(
qimage
.
scanLine
(
0
),
image
,
width
*
height
*
4
);
/*mlt_image_format format = mlt_image_rgb24;
int width = 0;
int height = 0;
const uchar* image = frame.get_image(format, width, height);
QImage qimage(width, height, QImage::Format_RGB888);
memcpy
(
qimage
.
bits
(),
image
,
width
*
height
*
3
);
memcpy(qimage.bits(), image, width * height * 3);
*/
emit
frameUpdated
(
qimage
);
}
...
...
@@ -1925,7 +1932,7 @@ Mlt::Tractor *Render::lockService()
}
service
.
lock
();
return
new
Mlt
::
Tractor
(
service
);
}
void
Render
::
unlockService
(
Mlt
::
Tractor
*
tractor
)
...
...
@@ -2812,7 +2819,7 @@ bool Render::mltEditEffect(int track, GenTime position, EffectsParameterList par
service
.
lock
();
for
(
int
j
=
0
;
j
<
params
.
count
();
j
++
)
{
filter
->
set
((
prefix
+
params
.
at
(
j
).
name
()).
toUtf8
().
constData
(),
params
.
at
(
j
).
value
().
toUtf8
().
constData
());
}
}
delete
clip
;
service
.
unlock
();
...
...
@@ -3105,7 +3112,7 @@ void Render::mltChangeTrackState(int track, bool mute, bool blind)
trackProducer
.
set
(
"hide"
,
0
);
}
if
(
audioMixingBroken
)
fixAudioMixing
(
tractor
);
tractor
.
multitrack
()
->
refresh
();
tractor
.
refresh
();
refresh
();
...
...
src/renderer.h
View file @
9522922e
...
...
@@ -277,8 +277,6 @@ Q_OBJECT public:
void
showFrame
(
Mlt
::
Frame
&
);
void
showAudio
(
Mlt
::
Frame
&
);
/** @brief This property is used to decide if the renderer should send audio data for monitoring. */
bool
analyseAudio
;
QList
<
int
>
checkTrackSequence
(
int
);
void
sendFrameUpdate
();
...
...
src/scopes/abstractscopewidget.cpp
View file @
9522922e
...
...
@@ -8,11 +8,12 @@
* (at your option) any later version. *
***************************************************************************/
#include "qtconcurrentrun.h"
#include "abstractscopewidget.h"
#include "renderer.h"
#include "monitor.h"
#include <QtConcurrentRun>
#include <QFuture>
#include <QColor>
#include <QMenu>
...
...
@@ -62,7 +63,8 @@ AbstractScopeWidget::AbstractScopeWidget(bool trackMouse, QWidget *parent) :
initialDimensionUpdateDone
(
false
),
m_requestForcedUpdate
(
false
),
m_rescaleMinDist
(
4
),
m_rescaleVerticalThreshold
(
2.0
f
)
m_rescaleVerticalThreshold
(
2.0
f
),
m_rescaleActive
(
false
)
{
m_scopePalette
=
QPalette
();
...
...
@@ -427,7 +429,7 @@ void AbstractScopeWidget::slotHUDRenderingFinished(uint mseconds, uint oldFactor
qDebug
()
<<
"Trying to start a new HUD thread for "
<<
m_widgetName
<<
". New frames/updates: "
<<
m_newHUDFrames
<<
"/"
<<
m_newHUDUpdates
;
#endif
prodHUDThread
();
;
prodHUDThread
();
}
}
...
...
@@ -531,7 +533,7 @@ void AbstractScopeWidget::slotResetRealtimeFactor(bool realtimeChecked)
}
}
bool
AbstractScopeWidget
::
autoRefreshEnabled
()
bool
AbstractScopeWidget
::
autoRefreshEnabled
()
const
{
return
m_aAutoRefresh
->
isChecked
();
}
...
...
src/scopes/abstractscopewidget.h
View file @
9522922e
...
...
@@ -8,16 +8,28 @@
* (at your option) any later version. *
***************************************************************************/