Changeset 95770 in vbox for trunk/src/VBox/Main/xml
- Timestamp:
- Jul 21, 2022 10:05:38 AM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 152480
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/xml/Settings.cpp
r95741 r95770 2787 2787 /* Note: Needs to be kept in sync with FE/Qt's UIMachineSettingsDisplay::putToCache()! */ 2788 2788 return "vc_enabled=true,ac_enabled=false,ac_profile=med"; 2789 } 2790 2791 /** 2792 * Returns a recording settings feature map from a given string. 2793 * 2794 * @returns VBox status code. 2795 * @param strFeatures String of features to convert. 2796 * @param featureMap Where to return the converted features on success. 2797 */ 2798 /* static */ 2799 int RecordingScreenSettings::featuresFromString(const com::Utf8Str &strFeatures, RecordingFeatureMap &featureMap) 2800 { 2801 featureMap.clear(); 2802 2803 RTCList<RTCString> lstFeatures = strFeatures.split(" "); 2804 for (size_t i = 0; i < lstFeatures.size(); i++) 2805 { 2806 if (lstFeatures.at(i).compare("video", RTCString::CaseInsensitive)) 2807 featureMap[RecordingFeature_Video] = true; 2808 else if (lstFeatures.at(i).compare("audio", RTCString::CaseInsensitive)) 2809 featureMap[RecordingFeature_Audio] = true; 2810 /* ignore everything else */ 2811 } 2812 2813 return VINF_SUCCESS; 2814 } 2815 2816 /** 2817 * Converts a feature map to a serializable string. 2818 * 2819 * @param featureMap Feature map to convert. 2820 * @param strFeatures Where to return the features converted as a string. 2821 */ 2822 /* static */ 2823 void RecordingScreenSettings::featuresToString(const RecordingFeatureMap &featureMap, com::Utf8Str &strFeatures) 2824 { 2825 RecordingFeatureMap::const_iterator itFeature = featureMap.begin(); 2826 while (itFeature != featureMap.end()) 2827 { 2828 if (itFeature->first == RecordingFeature_Video && itFeature->second) 2829 strFeatures += "video "; 2830 if (itFeature->first == RecordingFeature_Audio && itFeature->second) 2831 strFeatures += "audio "; 2832 strFeatures += " "; 2833 2834 ++itFeature; 2835 } 2836 strFeatures.strip(); 2789 2837 } 2790 2838 … … 6019 6067 6020 6068 (*itScreen)->getAttributeValue("enabled", screenSettings.fEnabled); 6069 Utf8Str strFeatures; 6070 (*itScreen)->getAttributeValue("featuresEnabled", strFeatures); 6071 RecordingScreenSettings::featuresFromString(strFeatures, screenSettings.featureMap); 6021 6072 (*itScreen)->getAttributeValue("maxTimeS", screenSettings.ulMaxTimeS); 6022 6073 (*itScreen)->getAttributeValue("options", screenSettings.strOptions); … … 8054 8105 pelmScreen->setAttribute("id", itScreen->first); /* The key equals the monitor ID. */ 8055 8106 pelmScreen->setAttribute("enabled", itScreen->second.fEnabled); 8107 com::Utf8Str strFeatures; 8108 RecordingScreenSettings::featuresToString(itScreen->second.featureMap, strFeatures); 8109 pelmScreen->setAttribute("featuresEnabled", strFeatures); 8056 8110 if (itScreen->second.ulMaxTimeS) 8057 8111 pelmScreen->setAttribute("maxTimeS", itScreen->second.ulMaxTimeS);
Note:
See TracChangeset
for help on using the changeset viewer.