Commit 8874bde9 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Kdenlive display settings: allow to define on which physical monitor the...

Kdenlive display settings: allow to define on which physical monitor the fullscreen monitor view will show up
parent 0684aba2
Pipeline #87610 passed with stage
in 8 minutes and 35 seconds
......@@ -335,6 +335,8 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(QMap<QString, QString> mappable_a
loadEncodingProfiles();
connect(m_configSdl.fullscreen_monitor, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
&KdenliveSettingsDialog::slotSetFullscreenMonitor);
connect(m_configSdl.kcfg_audio_driver, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
&KdenliveSettingsDialog::slotCheckAlsaDriver);
connect(m_configSdl.kcfg_audio_backend, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
......@@ -766,6 +768,20 @@ void KdenliveSettingsDialog::initDevices()
KdenliveSettings::setAudio_backend(ix);
}
m_configSdl.group_sdl->setEnabled(KdenliveSettings::audiobackend().startsWith(QLatin1String("sdl")));
// Fill monitors data
QSignalBlocker bk(m_configSdl.fullscreen_monitor);
m_configSdl.fullscreen_monitor->clear();
m_configSdl.fullscreen_monitor->addItem(i18n("auto"));
for (auto screen : qApp->screens()) {
m_configSdl.fullscreen_monitor->addItem(QString("%1 %2 (%3)").arg(screen->manufacturer(), screen->model(), screen->name()), screen->serialNumber());
}
if (!KdenliveSettings::fullscreen_monitor().isEmpty()) {
int ix = m_configSdl.fullscreen_monitor->findData(KdenliveSettings::fullscreen_monitor());
if (ix > -1) {
m_configSdl.fullscreen_monitor->setCurrentIndex(ix);
}
}
loadCurrentV4lProfileInfo();
}
......@@ -1214,15 +1230,21 @@ void KdenliveSettingsDialog::updateSettings()
settingsGroup.writeEntry("dialogSize", QVariant(size()));
}
void KdenliveSettingsDialog::slotSetFullscreenMonitor()
{
QString value = m_configSdl.fullscreen_monitor->currentData().toString();
KdenliveSettings::setFullscreen_monitor(value);
}
void KdenliveSettingsDialog::slotCheckAlsaDriver()
{
QString value = m_configSdl.kcfg_audio_driver->itemData(m_configSdl.kcfg_audio_driver->currentIndex()).toString();
QString value = m_configSdl.kcfg_audio_driver->currentData().toString();
m_configSdl.kcfg_audio_device->setEnabled(value == QLatin1String("alsa"));
}
void KdenliveSettingsDialog::slotCheckAudioBackend()
{
QString value = m_configSdl.kcfg_audio_backend->itemData(m_configSdl.kcfg_audio_backend->currentIndex()).toString();
QString value = m_configSdl.kcfg_audio_backend->currentData().toString();
m_configSdl.group_sdl->setEnabled(value.startsWith(QLatin1String("sdl")));
}
......
......@@ -65,6 +65,7 @@ private slots:
void slotEditAudioApplication();
void slotReadAudioDevices();
void slotUpdateGrabRegionStatus();
void slotSetFullscreenMonitor();
void slotCheckAlsaDriver();
void slotCheckAudioBackend();
void slotAddTranscode();
......
......@@ -485,6 +485,11 @@
<label>Blackmagic video output device.</label>
<default>0</default>
</entry>
<entry name="fullscreen_monitor" type="String">
<label>Monitor used for fullscreen output.</label>
<default></default>
</entry>
</group>
<group name="env">
......
......@@ -966,13 +966,30 @@ void Monitor::slotSwitchFullScreen(bool minimizeOnly)
if (!m_glWidget->isFullScreen() && !minimizeOnly) {
// Move monitor widget to the second screen (one screen for Kdenlive, the other one for the Monitor widget)
if (qApp->screens().count() > 1) {
for (auto screen : qApp->screens()) {
QRect screenRect = screen->availableGeometry();
if (!screenRect.contains(pCore->window()->geometry().center())) {
m_glWidget->setParent(nullptr);
m_glWidget->move(this->parentWidget()->mapFromGlobal(screenRect.center()));
m_glWidget->setGeometry(screenRect);
break;
bool screenFound = false;
if (!KdenliveSettings::fullscreen_monitor().isEmpty()) {
for (auto screen : qApp->screens()) {
if (screen->serialNumber() == KdenliveSettings::fullscreen_monitor()) {
// Match
QRect screenRect = screen->availableGeometry();
m_glWidget->setParent(nullptr);
m_glWidget->move(this->parentWidget()->mapFromGlobal(screenRect.center()));
m_glWidget->setGeometry(screenRect);
screenFound = true;
break;
}
}
}
if (!screenFound) {
for (auto screen : qApp->screens()) {
// Autodetect second monitor
QRect screenRect = screen->availableGeometry();
if (!screenRect.contains(pCore->window()->geometry().center())) {
m_glWidget->setParent(nullptr);
m_glWidget->move(this->parentWidget()->mapFromGlobal(screenRect.center()));
m_glWidget->setGeometry(screenRect);
break;
}
}
}
} else {
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>482</width>
<height>425</height>
<width>611</width>
<height>506</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
......@@ -21,27 +21,6 @@
</property>
</widget>
</item>
<item row="1" column="0" colspan="6">
<widget class="QCheckBox" name="kcfg_gpu_accel">
<property name="text">
<string>Use GPU processing (Movit library) - restart Kdenlive to apply</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="6">
<widget class="QCheckBox" name="kcfg_audio_scrub">
<property name="text">
<string>Enable Audio Scrubbing</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Audio backend</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="6">
<widget class="QGroupBox" name="group_sdl">
<property name="title">
......@@ -83,66 +62,96 @@
</layout>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="QLabel" name="label_3">
<item row="6" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Preview volume:</string>
<string>Monitor for fullscreen output:</string>
</property>
</widget>
</item>
<item row="5" column="3">
<widget class="QSpinBox" name="kcfg_volume">
<property name="suffix">
<string>%</string>
<item row="8" column="0" colspan="6">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="maximum">
<number>200</number>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Output device</string>
</property>
<property name="value">
<number>100</number>
</widget>
</item>
<item row="6" column="2" colspan="4">
<widget class="QComboBox" name="fullscreen_monitor"/>
</item>
<item row="3" column="0" colspan="2">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Audio backend</string>
</property>
</widget>
</item>
<item row="6" column="0" colspan="3">
<widget class="QLabel" name="label">
<item row="2" column="3" colspan="3">
<widget class="QComboBox" name="kcfg_audio_backend"/>
</item>
<item row="1" column="0" colspan="6">
<widget class="QCheckBox" name="kcfg_gpu_accel">
<property name="text">
<string>Monitor background color:</string>
<string>Use GPU processing (Movit library) - restart Kdenlive to apply</string>
</property>
</widget>
</item>
<item row="6" column="3" colspan="3">
<widget class="KColorButton" name="kcfg_window_background">
<property name="defaultColor" stdset="0">
<color>
<red>180</red>
<green>180</green>
<blue>180</blue>
</color>
<item row="5" column="0" colspan="2">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Preview volume:</string>
</property>
</widget>
</item>
<item row="7" column="0" colspan="6">
<widget class="Line" name="line">
<item row="10" column="5">
<widget class="QToolButton" name="reload_blackmagic">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="11" column="4">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0" colspan="6">
<widget class="QCheckBox" name="kcfg_audio_scrub">
<property name="text">
<string>Enable Audio Scrubbing</string>
</property>
</widget>
</item>
<item row="8" column="0" colspan="4">
<item row="9" column="0" colspan="4">
<widget class="QCheckBox" name="kcfg_external_display">
<property name="text">
<string>Use external display (Blackmagic card)</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_5">
<item row="7" column="0" colspan="2">
<widget class="QLabel" name="label">
<property name="text">
<string>Output device</string>
<string>Monitor background color:</string>
</property>
</widget>
</item>
<item row="9" column="1" colspan="4">
<item row="10" column="1" colspan="4">
<widget class="QComboBox" name="kcfg_blackmagic_output_device">
<property name="enabled">
<bool>true</bool>
......@@ -155,28 +164,35 @@
</property>
</widget>
</item>
<item row="9" column="5">
<widget class="QToolButton" name="reload_blackmagic">
<property name="text">
<string>...</string>
<item row="5" column="2" colspan="4">
<widget class="QSpinBox" name="kcfg_volume">
<property name="suffix">
<string>%</string>
</property>
<property name="maximum">
<number>200</number>
</property>
<property name="value">
<number>100</number>
</property>
</widget>
</item>
<item row="10" column="4">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
<item row="7" column="2" colspan="4">
<widget class="KColorButton" name="kcfg_window_background">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
<property name="defaultColor">
<color>
<red>180</red>
<green>180</green>
<blue>180</blue>
</color>
</property>
</spacer>
</item>
<item row="2" column="3" colspan="3">
<widget class="QComboBox" name="kcfg_audio_backend"/>
</widget>
</item>
</layout>
</widget>
......
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