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
ad1636bd
Commit
ad1636bd
authored
Jun 14, 2019
by
Aurélien Bertron
Committed by
Jean-Baptiste Mardelle
Jun 14, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add screen selection in screen grab widget
Fix
#243
parent
32423ba3
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
18 deletions
+31
-18
src/mainwindow.cpp
src/mainwindow.cpp
+13
-0
src/mainwindow.h
src/mainwindow.h
+1
-0
src/monitor/monitor.cpp
src/monitor/monitor.cpp
+5
-0
src/monitor/monitor.h
src/monitor/monitor.h
+2
-0
src/monitor/recmanager.cpp
src/monitor/recmanager.cpp
+8
-17
src/monitor/recmanager.h
src/monitor/recmanager.h
+2
-1
No files found.
src/mainwindow.cpp
View file @
ad1636bd
...
...
@@ -107,6 +107,7 @@
#include <QUndoGroup>
#include <KConfigGroup>
#include <QDesktopWidget>
#include <QDialogButtonBox>
#include <QPushButton>
#include <QScreen>
...
...
@@ -284,6 +285,18 @@ void MainWindow::init()
QToolBar
*
recToolbar
=
new
QToolBar
(
grabWidget
);
grabLayout
->
addWidget
(
recToolbar
);
grabLayout
->
addStretch
(
10
);
// Check number of monitors for FFmpeg screen capture
int
screens
=
QApplication
::
desktop
()
->
screenCount
();
if
(
screens
>
1
)
{
QComboBox
*
screenCombo
=
new
QComboBox
(
recToolbar
);
for
(
int
ix
=
0
;
ix
<
screens
;
ix
++
)
{
screenCombo
->
addItem
(
i18n
(
"Monitor %1"
,
ix
));
}
connect
(
screenCombo
,
static_cast
<
void
(
QComboBox
::*
)(
int
)
>
(
&
QComboBox
::
currentIndexChanged
),
m_clipMonitor
,
&
Monitor
::
slotSetScreen
);
recToolbar
->
addWidget
(
screenCombo
);
// Update screen grab monitor choice in case we changed from fullscreen
screenCombo
->
setEnabled
(
KdenliveSettings
::
grab_capture_type
()
==
0
);
}
QAction
*
recAction
=
m_clipMonitor
->
recAction
();
addAction
(
QStringLiteral
(
"screengrab_record"
),
recAction
);
recToolbar
->
addAction
(
recAction
);
...
...
src/mainwindow.h
View file @
ad1636bd
...
...
@@ -20,6 +20,7 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QComboBox>
#include <QDBusAbstractAdaptor>
#include <QDockWidget>
#include <QEvent>
...
...
src/monitor/monitor.cpp
View file @
ad1636bd
...
...
@@ -2112,6 +2112,11 @@ void Monitor::removeSnapPoint(int pos)
m_snaps
->
removePoint
(
pos
);
}
void
Monitor
::
slotSetScreen
(
int
screenIndex
)
{
emit
screenChanged
(
screenIndex
);
}
void
Monitor
::
slotZoomIn
()
{
m_glMonitor
->
slotZoom
(
true
);
...
...
src/monitor/monitor.h
View file @
ad1636bd
...
...
@@ -273,6 +273,7 @@ private slots:
void
removeSnapPoint
(
int
pos
);
public
slots
:
void
slotSetScreen
(
int
screenIndex
);
void
slotOpenDvdFile
(
const
QString
&
);
// void slotSetClipProducer(DocClipBase *clip, QPoint zone = QPoint(), bool forceUpdate = false, int position = -1);
void
updateClipProducer
(
const
std
::
shared_ptr
<
Mlt
::
Producer
>
&
prod
);
...
...
@@ -325,6 +326,7 @@ public slots:
void
refreshMonitorIfActive
(
bool
directUpdate
=
false
)
override
;
signals:
void
screenChanged
(
int
screenIndex
);
void
seekPosition
(
int
pos
);
void
updateScene
();
/** @brief Request a timeline seeking if diff is true, position is a relative offset, otherwise an absolute position */
...
...
src/monitor/recmanager.cpp
View file @
ad1636bd
...
...
@@ -46,6 +46,7 @@ RecManager::RecManager(Monitor *parent)
,
m_recToolbar
(
new
QToolBar
(
parent
))
,
m_checkAudio
(
false
)
,
m_checkVideo
(
false
)
,
m_screenIndex
(
-
1
)
{
m_playAction
=
m_recToolbar
->
addAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"media-playback-start"
)),
i18n
(
"Preview"
));
m_playAction
->
setCheckable
(
true
);
...
...
@@ -65,17 +66,6 @@ RecManager::RecManager(Monitor *parent)
m_recAudio
->
setChecked
(
KdenliveSettings
::
v4l_captureaudio
());
m_recVideo
->
setChecked
(
KdenliveSettings
::
v4l_capturevideo
());
// Check number of monitors for FFmpeg screen capture
int
screens
=
QApplication
::
desktop
()
->
screenCount
();
if
(
screens
>
1
)
{
m_screenCombo
=
new
QComboBox
(
parent
);
for
(
int
ix
=
0
;
ix
<
screens
;
ix
++
)
{
m_screenCombo
->
addItem
(
i18n
(
"Monitor %1"
,
ix
));
}
m_recToolbar
->
addWidget
(
m_screenCombo
);
// Update screen grab monitor choice in case we changed from fullscreen
m_screenCombo
->
setEnabled
(
KdenliveSettings
::
grab_capture_type
()
==
0
);
}
QWidget
*
spacer
=
new
QWidget
(
parent
);
spacer
->
setSizePolicy
(
QSizePolicy
::
MinimumExpanding
,
QSizePolicy
::
Preferred
);
m_recToolbar
->
addWidget
(
spacer
);
...
...
@@ -135,6 +125,7 @@ RecManager::RecManager(Monitor *parent)
connect
(
m_switchRec
,
&
QAction
::
toggled
,
m_monitor
,
&
Monitor
::
slotSwitchRec
);
m_recToolbar
->
setVisible
(
false
);
slotVideoDeviceChanged
();
connect
(
m_monitor
,
&
Monitor
::
screenChanged
,
this
,
&
RecManager
::
slotSetScreen
);
}
RecManager
::~
RecManager
()
=
default
;
...
...
@@ -236,12 +227,7 @@ void RecManager::slotRecord(bool record)
}
m_captureFile
=
QUrl
::
fromLocalFile
(
path
);
QString
captureSize
;
int
screen
=
-
1
;
if
(
m_screenCombo
)
{
// Multi monitor setup, capture monitor selected by user
screen
=
m_screenCombo
->
currentIndex
();
}
QRect
screenSize
=
QApplication
::
desktop
()
->
screenGeometry
(
screen
);
QRect
screenSize
=
QApplication
::
desktop
()
->
screenGeometry
(
m_screenIndex
);
QStringList
captureArgs
;
#ifdef Q_OS_WIN
captureArgs
<<
QStringLiteral
(
"-f"
)
<<
QStringLiteral
(
"gdigrab"
);
...
...
@@ -409,6 +395,11 @@ Mlt::Producer *RecManager::createV4lProducer()
return
prod
;
}
void
RecManager
::
slotSetScreen
(
int
screenIndex
)
{
m_screenIndex
=
screenIndex
;
}
void
RecManager
::
slotPreview
(
bool
preview
)
{
if
(
m_device_selector
->
currentData
().
toInt
()
==
Video4Linux
)
{
...
...
src/monitor/recmanager.h
View file @
ad1636bd
...
...
@@ -77,7 +77,6 @@ private:
QAction
*
m_playAction
;
QAction
*
m_showLogAction
;
QToolBar
*
m_recToolbar
;
QComboBox
*
m_screenCombo
{
nullptr
};
QToolButton
*
m_audioCaptureButton
;
QComboBox
*
m_device_selector
;
QComboBox
*
m_audio_device
;
...
...
@@ -87,8 +86,10 @@ private:
bool
m_checkAudio
;
bool
m_checkVideo
;
Mlt
::
Producer
*
createV4lProducer
();
int
m_screenIndex
;
private
slots
:
void
slotSetScreen
(
int
ScreenIndex
);
void
slotRecord
(
bool
record
);
void
slotPreview
(
bool
record
);
void
slotProcessStatus
(
int
exitCode
,
QProcess
::
ExitStatus
exitStatus
);
...
...
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