Changeset 73117 in vbox
- Timestamp:
- Jul 13, 2018 11:32:28 AM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 123697
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp
r73106 r73117 37 37 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ 38 38 39 #define VIDEO_CAPTURE_BIT_RATE_MIN 32 40 #define VIDEO_CAPTURE_BIT_RATE_MAX 2048 39 41 40 42 /** Machine settings: Display page data structure. */ … … 104 106 VideoCaptureOption_Unknown, 105 107 VideoCaptureOption_AC, 106 VideoCaptureOption_VC 108 VideoCaptureOption_VC, 109 VideoCaptureOption_AC_Profile 107 110 }; 108 111 … … 121 124 keys["ac_enabled"] = VideoCaptureOption_AC; 122 125 keys["vc_enabled"] = VideoCaptureOption_VC; 126 keys["ac_profile"] = VideoCaptureOption_AC_Profile; 123 127 /* Return known value or VideoCaptureOption_Unknown otherwise: */ 124 128 return keys.value(strKey, VideoCaptureOption_Unknown); … … 132 136 values[VideoCaptureOption_AC] = "ac_enabled"; 133 137 values[VideoCaptureOption_VC] = "vc_enabled"; 138 values[VideoCaptureOption_AC_Profile] = "ac_profile"; 134 139 /* Return known value or QString() otherwise: */ 135 140 return values.value(enmKey); … … 188 193 } 189 194 190 /** Defines whether passed Video Capture @a enmOption is @a fEnabled. */191 static QString setVideoCaptureOptionEnabled(const QString &strOptions,192 VideoCaptureOption enmOption,193 bool fEnabled)194 {195 QList<VideoCaptureOption> aKeys;196 QStringList aValues;197 parseVideoCaptureOptions(strOptions, aKeys, aValues);198 int iIndex = aKeys.indexOf(enmOption);199 QString strValue = fEnabled ? "true" : "false";200 if (iIndex == -1)201 {202 aKeys << enmOption;203 aValues << strValue;204 }205 else206 {207 aValues[iIndex] = strValue;208 }209 QString strResult;210 serializeVideoCaptureOptions(aKeys, aValues, strResult);211 return strResult;212 }213 214 195 /** Defines whether passed Video Capture Options @a enmOptions is @a flags (enabled). */ 215 196 static QString setVideoCaptureOptionEnabled(const QString &strOptions, 216 197 const QVector<VideoCaptureOption> &enmOptions, 217 const Q Vector<bool> &flags)218 { 219 if (enmOptions.size() != flags.size())198 const QStringList &values) 199 { 200 if (enmOptions.size() != values.size()) 220 201 return QString(); 221 202 QList<VideoCaptureOption> aKeys; 222 203 QStringList aValues; 223 204 parseVideoCaptureOptions(strOptions, aKeys, aValues); 224 for(int i = 0; i < flags.size(); ++i)225 { 226 QString strValue = flags[i] ? "true" : "false";205 for(int i = 0; i < values.size(); ++i) 206 { 207 QString strValue = values[i]; 227 208 int iIndex = aKeys.indexOf(enmOptions[i]); 228 209 if (iIndex == -1) … … 494 475 newDisplayData.m_screens = m_pScrollerVideoCaptureScreens->value(); 495 476 496 QVector<bool> flagsVector; 497 flagsVector.push_back( 498 m_pComboBoxCaptureMode->currentIndex() == static_cast<int>(UIDataSettingsMachineDisplay::CaptureMode_VideoAudio) || 499 m_pComboBoxCaptureMode->currentIndex() == static_cast<int>(UIDataSettingsMachineDisplay::CaptureMode_VideoOnly)); 500 501 flagsVector.push_back( 502 m_pComboBoxCaptureMode->currentIndex() == static_cast<int>(UIDataSettingsMachineDisplay::CaptureMode_VideoAudio) || 503 m_pComboBoxCaptureMode->currentIndex() == static_cast<int>(UIDataSettingsMachineDisplay::CaptureMode_AudioOnly)); 477 /* Update video capture options */ 478 QStringList optionValues; 479 optionValues.push_back((m_pComboBoxCaptureMode->currentIndex() == static_cast<int>(UIDataSettingsMachineDisplay::CaptureMode_VideoAudio) || 480 m_pComboBoxCaptureMode->currentIndex() == static_cast<int>(UIDataSettingsMachineDisplay::CaptureMode_VideoOnly)) ? "true" : "false"); 481 optionValues.push_back((m_pComboBoxCaptureMode->currentIndex() == static_cast<int>(UIDataSettingsMachineDisplay::CaptureMode_VideoAudio) || 482 m_pComboBoxCaptureMode->currentIndex() == static_cast<int>(UIDataSettingsMachineDisplay::CaptureMode_AudioOnly)) ? "true" : "false"); 483 optionValues.push_back("low"); 504 484 505 485 QVector<UIDataSettingsMachineDisplay::VideoCaptureOption> videoCaptureOptionVector; 506 486 videoCaptureOptionVector.push_back(UIDataSettingsMachineDisplay::VideoCaptureOption_VC); 507 487 videoCaptureOptionVector.push_back(UIDataSettingsMachineDisplay::VideoCaptureOption_AC); 488 videoCaptureOptionVector.push_back(UIDataSettingsMachineDisplay::VideoCaptureOption_AC_Profile); 508 489 509 490 newDisplayData.m_strVideoCaptureOptions = UIDataSettingsMachineDisplay::setVideoCaptureOptionEnabled(m_pCache->base().m_strVideoCaptureOptions, 510 491 videoCaptureOptionVector, 511 flagsVector);492 optionValues); 512 493 513 494 /* Cache new display data: */ … … 1148 1129 AssertPtrReturnVoid(m_pSliderVideoCaptureQuality); 1149 1130 { 1150 /* Configure combo-box: */1131 /* Configure quality related widget: */ 1151 1132 m_pContainerLayoutSliderVideoCaptureQuality->setColumnStretch(1, 4); 1152 1133 m_pContainerLayoutSliderVideoCaptureQuality->setColumnStretch(3, 5); … … 1167 1148 /* Configure editor: */ 1168 1149 vboxGlobal().setMinimumWidthAccordingSymbolCount(m_pEditorVideoCaptureBitRate, 5); 1169 m_pEditorVideoCaptureBitRate->setMinimum( 32);1170 m_pEditorVideoCaptureBitRate->setMaximum( 2048);1150 m_pEditorVideoCaptureBitRate->setMinimum(VIDEO_CAPTURE_BIT_RATE_MIN); 1151 m_pEditorVideoCaptureBitRate->setMaximum(VIDEO_CAPTURE_BIT_RATE_MAX); 1171 1152 } 1172 1153 }
Note:
See TracChangeset
for help on using the changeset viewer.