From aae5aed612d1126a481464fd57471d69cde11d8e Mon Sep 17 00:00:00 2001 From: Till Theato Date: Thu, 22 Jul 2010 12:56:41 +0000 Subject: [PATCH] - Allow to set volume for monitors - Apply monitor background change without restart svn path=/trunk/kdenlive/; revision=4620 --- src/kdenlivesettings.kcfg | 5 ++ src/kdenlivesettingsdialog.cpp | 10 +++ src/renderer.cpp | 8 +- src/widgets/configsdl_ui.ui | 149 +++++++++++++++++++-------------- 4 files changed, 107 insertions(+), 65 deletions(-) diff --git a/src/kdenlivesettings.kcfg b/src/kdenlivesettings.kcfg index 2d52c34a..21f197d0 100644 --- a/src/kdenlivesettings.kcfg +++ b/src/kdenlivesettings.kcfg @@ -132,6 +132,11 @@ #999999 + + + 100 + + false diff --git a/src/kdenlivesettingsdialog.cpp b/src/kdenlivesettingsdialog.cpp index affc5e1f..e7a8f432 100644 --- a/src/kdenlivesettingsdialog.cpp +++ b/src/kdenlivesettingsdialog.cpp @@ -477,6 +477,16 @@ void KdenliveSettingsDialog::updateSettings() resetProfile = true; } + if (m_configSdl.kcfg_window_background->color() != KdenliveSettings::window_background()) { + KdenliveSettings::setWindow_background(m_configSdl.kcfg_window_background->color()); + resetProfile = true; + } + + if (m_configSdl.kcfg_volume->value() != KdenliveSettings::volume()) { + KdenliveSettings::setVolume(m_configSdl.kcfg_volume->value()); + resetProfile = true; + } + bool updatePreview = false; if (m_configSdl.kcfg_dropbframes->isChecked() != KdenliveSettings::dropbframes()) { KdenliveSettings::setDropbframes(m_configSdl.kcfg_dropbframes->isChecked()); diff --git a/src/renderer.cpp b/src/renderer.cpp index 52105a4d..3e7e53f1 100644 --- a/src/renderer.cpp +++ b/src/renderer.cpp @@ -230,6 +230,8 @@ void Render::buildConsumer(const QString profileName) delete[] tmp; } + int volume = KdenliveSettings::volume(); + m_mltConsumer->set("volume", (float)volume / 100); m_mltConsumer->set("progressive", 1); m_mltConsumer->set("audio_buffer", 1024); @@ -257,7 +259,11 @@ int Render::resetProfile(const QString profileName) QString videoDriver = KdenliveSettings::videodrivername(); QString currentDriver = m_mltConsumer->get("video_driver"); if (getenv("SDL_VIDEO_YUV_HWACCEL") != NULL && currentDriver == "x11") currentDriver = "x11_noaccel"; - if (m_activeProfile == profileName && currentDriver == videoDriver) { + QString background = KdenliveSettings::window_background().name(); + QString currentBackground = m_mltConsumer->get("window_background"); + int volume = KdenliveSettings::volume(); + int currentVolume = (int)(QString(m_mltConsumer->get("volume")).toDouble() * 100.0); + if (m_activeProfile == profileName && currentDriver == videoDriver && volume == currentVolume && background == currentBackground) { kDebug() << "reset to same profile, nothing to do"; return 1; } diff --git a/src/widgets/configsdl_ui.ui b/src/widgets/configsdl_ui.ui index 3473ad29..49fc26d5 100644 --- a/src/widgets/configsdl_ui.ui +++ b/src/widgets/configsdl_ui.ui @@ -1,86 +1,80 @@ - + + ConfigSdl_UI - - + + 0 0 - 358 - 217 + 352 + 239 - - - - + + + + Warning: changes to the drivers and devices can make Kdenlive unstable. Change only if you know what you do. - + true - - - - + + + + 0 0 - + Video driver: - + false - - + + - - - - + + + + 0 0 - + Audio driver: - + false - - + + - - - + + + Audio device: - + false - - + + - - - - Monitor background color (requires restart) - - - - - - + + + 180 180 @@ -89,15 +83,28 @@ - - - + + + + Qt::Vertical + + + + 20 + 0 + + + + + + + Monitor Preview Speedup Settings - - - - + + + + Drop B frames on H.264 clips @@ -105,32 +112,46 @@ - - - - Qt::Vertical + + + + Monitor background color: - - - 20 - 0 - + + + + + + Preview volume: - + + + + + + % + + + 200 + + + 100 + + - - KColorButton - QPushButton -
kcolorbutton.h
-
KComboBox QComboBox
kcombobox.h
+ + KColorButton + QPushButton +
kcolorbutton.h
+
-- 2.39.2