VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIRecordingSettingsEditor.h

Last change on this file was 104313, checked in by vboxsync, 7 weeks ago

FE/Qt. bugref:10622. Using new UITranslationEventListener in the settings related GUI classes.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 9.6 KB
Line 
1/* $Id: UIRecordingSettingsEditor.h 104313 2024-04-12 13:10:30Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIRecordingSettingsEditor class declaration.
4 */
5
6/*
7 * Copyright (C) 2006-2023 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28#ifndef FEQT_INCLUDED_SRC_settings_editors_UIRecordingSettingsEditor_h
29#define FEQT_INCLUDED_SRC_settings_editors_UIRecordingSettingsEditor_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* GUI includes: */
35#include "UIEditor.h"
36#include "UISettingsDefs.h"
37
38/* Forward declarations: */
39class QCheckBox;
40class QComboBox;
41class QLabel;
42class QSpinBox;
43class QWidget;
44class QIAdvancedSlider;
45class UIFilePathSelector;
46class UIFilmContainer;
47
48/** UIEditor sub-class used as a recording settings editor. */
49class SHARED_LIBRARY_STUFF UIRecordingSettingsEditor : public UIEditor
50{
51 Q_OBJECT;
52
53public:
54
55 /** Constructs editor passing @a pParent to the base-class. */
56 UIRecordingSettingsEditor(QWidget *pParent = 0);
57
58 /** Defines whether feature is @a fEnabled. */
59 void setFeatureEnabled(bool fEnabled);
60 /** Returns whether feature is enabled. */
61 bool isFeatureEnabled() const;
62
63 /** Defines whether options are @a fAvailable. */
64 void setOptionsAvailable(bool fAvailable);
65 /** Defines whether screen options are @a fAvailable. */
66 void setScreenOptionsAvailable(bool fAvailable);
67
68 /** Defines @a enmMode. */
69 void setMode(UISettingsDefs::RecordingMode enmMode);
70 /** Return mode. */
71 UISettingsDefs::RecordingMode mode() const;
72
73 /** Defines @a strFolder. */
74 void setFolder(const QString &strFolder);
75 /** Returns folder. */
76 QString folder() const;
77 /** Defines @a strFilePath. */
78 void setFilePath(const QString &strFilePath);
79 /** Returns file path. */
80 QString filePath() const;
81
82 /** Defines frame @a iWidth. */
83 void setFrameWidth(int iWidth);
84 /** Returns frame width. */
85 int frameWidth() const;
86 /** Defines frame @a iHeight. */
87 void setFrameHeight(int iHeight);
88 /** Returns frame height. */
89 int frameHeight() const;
90
91 /** Defines frame @a iRate. */
92 void setFrameRate(int iRate);
93 /** Returns frame rate. */
94 int frameRate() const;
95
96 /** Defines bit @a iRate. */
97 void setBitRate(int iRate);
98 /** Returns bit rate. */
99 int bitRate() const;
100
101 /** Defines audio quality @a iRate. */
102 void setAudioQualityRate(int iRate);
103 /** Returns audio quality rate. */
104 int audioQualityRate() const;
105
106 /** Defines enabled @a screens. */
107 void setScreens(const QVector<bool> &screens);
108 /** Returns enabled screens. */
109 QVector<bool> screens() const;
110
111
112private slots:
113
114 /** Handles translation event. */
115 virtual void sltRetranslateUI() RT_OVERRIDE RT_FINAL;
116 /** Handles feature toggling. */
117 void sltHandleFeatureToggled();
118 /** Handles mode change. */
119 void sltHandleModeComboChange();
120 /** Handles frame size change. */
121 void sltHandleVideoFrameSizeComboChange();
122 /** Handles frame width change. */
123 void sltHandleVideoFrameWidthChange();
124 /** Handles frame height change. */
125 void sltHandleVideoFrameHeightChange();
126 /** Handles frame rate slider change. */
127 void sltHandleVideoFrameRateSliderChange();
128 /** Handles frame rate spinbox change. */
129 void sltHandleVideoFrameRateSpinboxChange();
130 /** Handles bit-rate slider change. */
131 void sltHandleVideoBitRateSliderChange();
132 /** Handles bit-rate spinbox change. */
133 void sltHandleVideoBitRateSpinboxChange();
134
135private:
136
137 /** Prepares all. */
138 void prepare();
139 /** Prepares widgets. */
140 void prepareWidgets();
141 /** Prepares connections. */
142 void prepareConnections();
143
144 /** Populates mode combo-box. */
145 void populateComboMode();
146
147 /** Updates widget visibility. */
148 void updateWidgetVisibility();
149 /** Updates widget availability. */
150 void updateWidgetAvailability();
151 /** Updates recording file size hint. */
152 void updateRecordingFileSizeHint();
153 /** Searches for corresponding frame size preset. */
154 void lookForCorrespondingFrameSizePreset();
155
156 /** Searches for the @a data field in corresponding @a pComboBox. */
157 static void lookForCorrespondingPreset(QComboBox *pComboBox, const QVariant &data);
158 /** Calculates recording video bit-rate for passed @a iFrameWidth, @a iFrameHeight, @a iFrameRate and @a iQuality. */
159 static int calculateBitRate(int iFrameWidth, int iFrameHeight, int iFrameRate, int iQuality);
160 /** Calculates recording video quality for passed @a iFrameWidth, @a iFrameHeight, @a iFrameRate and @a iBitRate. */
161 static int calculateQuality(int iFrameWidth, int iFrameHeight, int iFrameRate, int iBitRate);
162
163 /** @name Values
164 * @{ */
165 /** Holds whether feature is enabled. */
166 bool m_fFeatureEnabled;
167
168 /** Holds whether options are available. */
169 bool m_fOptionsAvailable;
170 /** Holds whether screen options are available. */
171 bool m_fScreenOptionsAvailable;
172
173 /** Holds the list of supported modes. */
174 QVector<UISettingsDefs::RecordingMode> m_supportedValues;
175 /** Holds the mode. */
176 UISettingsDefs::RecordingMode m_enmMode;
177
178 /** Holds the folder. */
179 QString m_strFolder;
180 /** Holds the file path. */
181 QString m_strFilePath;
182
183 /** Holds the frame width. */
184 int m_iFrameWidth;
185 /** Holds the frame height. */
186 int m_iFrameHeight;
187 /** Holds the frame rate. */
188 int m_iFrameRate;
189 /** Holds the bit rate. */
190 int m_iBitRate;
191 /** Holds the audio quality rate. */
192 int m_iAudioQualityRate;
193
194 /** Holds the screens. */
195 QVector<bool> m_screens;
196 /** @} */
197
198 /** @name Widgets
199 * @{ */
200 /** Holds the feature check-box instance. */
201 QCheckBox *m_pCheckboxFeature;
202 /** Holds the mode label instance. */
203 QLabel *m_pLabelMode;
204 /** Holds the mode combo instance. */
205 QComboBox *m_pComboMode;
206 /** Holds the file path label instance. */
207 QLabel *m_pLabelFilePath;
208 /** Holds the file path editor instance. */
209 UIFilePathSelector *m_pEditorFilePath;
210 /** Holds the frame size label instance. */
211 QLabel *m_pLabelFrameSize;
212 /** Holds the frame size combo instance. */
213 QComboBox *m_pComboFrameSize;
214 /** Holds the frame width spinbox instance. */
215 QSpinBox *m_pSpinboxFrameWidth;
216 /** Holds the frame height spinbox instance. */
217 QSpinBox *m_pSpinboxFrameHeight;
218 /** Holds the frame rate label instance. */
219 QLabel *m_pLabelFrameRate;
220 /** Holds the frame rate settings widget instance. */
221 QWidget *m_pWidgetFrameRateSettings;
222 /** Holds the frame rate slider instance. */
223 QIAdvancedSlider *m_pSliderFrameRate;
224 /** Holds the frame rate spinbox instance. */
225 QSpinBox *m_pSpinboxFrameRate;
226 /** Holds the frame rate min label instance. */
227 QLabel *m_pLabelFrameRateMin;
228 /** Holds the frame rate max label instance. */
229 QLabel *m_pLabelFrameRateMax;
230 /** Holds the video quality label instance. */
231 QLabel *m_pLabelVideoQuality;
232 /** Holds the video quality settings widget instance. */
233 QWidget *m_pWidgetVideoQualitySettings;
234 /** Holds the video quality slider instance. */
235 QIAdvancedSlider *m_pSliderVideoQuality;
236 /** Holds the video quality spinbox instance. */
237 QSpinBox *m_pSpinboxVideoQuality;
238 /** Holds the video quality min label instance. */
239 QLabel *m_pLabelVideoQualityMin;
240 /** Holds the video quality med label instance. */
241 QLabel *m_pLabelVideoQualityMed;
242 /** Holds the video quality max label instance. */
243 QLabel *m_pLabelVideoQualityMax;
244 /** Holds the audio quality label instance. */
245 QLabel *m_pLabelAudioQuality;
246 /** Holds the audio quality settings widget instance. */
247 QWidget *m_pWidgetAudioQualitySettings;
248 /** Holds the audio quality slider instance. */
249 QIAdvancedSlider *m_pSliderAudioQuality;
250 /** Holds the audio quality min label instance. */
251 QLabel *m_pLabelAudioQualityMin;
252 /** Holds the audio quality med label instance. */
253 QLabel *m_pLabelAudioQualityMed;
254 /** Holds the audio quality max label instance. */
255 QLabel *m_pLabelAudioQualityMax;
256 /** Holds the size hint label instance. */
257 QLabel *m_pLabelSizeHint;
258 /** Holds the screens label instance. */
259 QLabel *m_pLabelScreens;
260 /** Holds the screens scroller instance. */
261 UIFilmContainer *m_pScrollerScreens;
262 /** @} */
263};
264
265#endif /* !FEQT_INCLUDED_SRC_settings_editors_UIRecordingSettingsEditor_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use