Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Screengrab: allow user to select which monitor he wants to capture in multi-monitor setup

parent 4e3effd1
......@@ -699,6 +699,12 @@ void KdenliveSettingsDialog::updateSettings()
saveCurrentV4lProfile();
KdenliveSettings::setV4l_format(0);
}
// Check if screengrab is fullscreen
if ((uint) m_configCapture.kcfg_grab_capture_type->currentIndex() != KdenliveSettings::grab_capture_type()) {
KdenliveSettings::setGrab_capture_type(m_configCapture.kcfg_grab_capture_type->currentIndex());
emit updateFullScreenGrab();
}
// Check encoding profiles
// FFmpeg
......
......@@ -117,6 +117,8 @@ signals:
void customChanged();
void doResetProfile();
void updateCaptureFolder();
// Screengrab method changed between fullsceen and region, update rec monitor
void updateFullScreenGrab();
};
......
......@@ -1639,6 +1639,7 @@ void MainWindow::slotPreferences(int page, int option)
connect(dialog, SIGNAL(doResetProfile()), pCore->monitorManager(), SLOT(slotResetProfiles()));
#ifndef Q_WS_MAC
connect(dialog, SIGNAL(updateCaptureFolder()), this, SLOT(slotUpdateCaptureFolder()));
connect(dialog, SIGNAL(updateFullScreenGrab()), m_recMonitor, SLOT(slotUpdateFullScreenGrab()));
#endif
dialog->show();
if (page != -1) {
......
......@@ -132,6 +132,15 @@ RecMonitor::RecMonitor(Kdenlive::MonitorId name, MonitorManager *manager, QWidge
m_spaceTimer.setInterval(30000);
m_spaceTimer.setSingleShot(false);
// Check number of monitors for FFmpeg screen capture
int screens = QApplication::desktop()->screenCount();
if (screens > 1) {
for (int ix = 0; ix < screens; ix++)
monitor_box->addItem(i18n("Monitor %1", ix));
}
// Update screen grab monitor choice in case we changed from fullscreen
monitor_box->setEnabled(KdenliveSettings::grab_capture_type() == 0);
control_frame_firewire->setLayout(hlayout);
m_displayProcess = new QProcess;
m_captureProcess = new QProcess;
......@@ -213,11 +222,16 @@ void RecMonitor::slotUpdateCaptureFolder(const QString &currentProjectFolder)
else KMessageBox::information(this, i18n("You need to stop capture before your changes can be applied"), i18n("Capturing"));
} else slotVideoDeviceChanged(device_selector->currentIndex());
}
// update free space info
slotUpdateFreeSpace();
}
void RecMonitor::slotUpdateFullScreenGrab()
{
// Update screen grab monitor choice in case we changed from fullscreen
monitor_box->setEnabled(KdenliveSettings::grab_capture_type() == 0);
}
void RecMonitor::slotVideoDeviceChanged(int ix)
{
QString capturefile;
......@@ -227,6 +241,7 @@ void RecMonitor::slotVideoDeviceChanged(int ix)
}
m_previewSettings->setEnabled(ix == Video4Linux || ix == BlackMagic);
control_frame->setVisible(ix == Video4Linux);
monitor_box->setVisible(ix == ScreenBag && monitor_box->count() > 0);
m_playAction->setVisible(ix != ScreenBag);
m_fwdAction->setVisible(ix == Firewire);
m_discAction->setVisible(ix == Firewire);
......@@ -611,7 +626,12 @@ void RecMonitor::slotRecord()
bool showPreview;
bool isXml;
QString captureSize;
QRect screenSize = QApplication::desktop()->screenGeometry();
int screen = -1;
if (monitor_box->count() > 0) {
// Multi monitor setup, capture monitor selected by user
screen = monitor_box->currentIndex();
}
QRect screenSize = QApplication::desktop()->screenGeometry(screen);
QString capturename = KdenliveSettings::dvgrabfilename();
if (capturename.isEmpty()) capturename = "capture";
......@@ -710,6 +730,7 @@ void RecMonitor::slotRecord()
if (KdenliveSettings::grab_capture_type() == 0) {
// Full screen capture
m_captureArgs << "-s" << QString::number(screenSize.width()) + 'x' + QString::number(screenSize.height());
captureSize.append("+" + QString::number(screenSize.left()) + '.' + QString::number(screenSize.top()));
} else {
// Region capture
m_captureArgs << "-s" << QString::number(KdenliveSettings::grab_width()) + 'x' + QString::number(KdenliveSettings::grab_height());
......
......@@ -143,6 +143,7 @@ public slots:
void start();
void slotStopCapture();
void slotUpdateCaptureFolder(const QString &currentProjectFolder);
void slotUpdateFullScreenGrab();
void slotMouseSeek(int eventDelta, bool fast);
void slotSwitchFullScreen();
......
......@@ -6,12 +6,21 @@
<rect>
<x>0</x>
<y>0</y>
<width>312</width>
<height>204</height>
<width>390</width>
<height>206</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
......@@ -79,6 +88,12 @@
<enum>QFrame::Plain</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="topMargin">
<number>3</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item>
<widget class="QCheckBox" name="rec_video">
<property name="text">
......@@ -96,6 +111,9 @@
</layout>
</widget>
</item>
<item>
<widget class="QComboBox" name="monitor_box"/>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment