VirtualBox

Changeset 46455 in vbox


Ignore:
Timestamp:
Jun 10, 2013 8:40:27 AM (11 years ago)
Author:
vboxsync
Message:

FE/Qt: Machine settings: Display page: Video Capture tab: Replacing combo-box with slider for frame-rate value management.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp

    r46418 r46455  
    387387    setTabOrder(m_pComboVideoCaptureSize, m_pEditorVideoCaptureWidth);
    388388    setTabOrder(m_pEditorVideoCaptureWidth, m_pEditorVideoCaptureHeight);
    389     setTabOrder(m_pEditorVideoCaptureHeight, m_pComboVideoCaptureFrameRate);
    390     setTabOrder(m_pComboVideoCaptureFrameRate, m_pEditorVideoCaptureFrameRate);
     389    setTabOrder(m_pEditorVideoCaptureHeight, m_pSliderVideoCaptureFrameRate);
     390    setTabOrder(m_pSliderVideoCaptureFrameRate, m_pEditorVideoCaptureFrameRate);
    391391    setTabOrder(m_pEditorVideoCaptureFrameRate, m_pComboVideoCaptureBitRate);
    392392    setTabOrder(m_pComboVideoCaptureBitRate, m_pEditorVideoCaptureBitRate);
     
    401401    CSystemProperties sys = vboxGlobal().virtualBox().GetSystemProperties();
    402402    m_pLabelMemoryMin->setText(tr("<qt>%1&nbsp;MB</qt>").arg(m_iMinVRAM));
    403     m_pLabelMemoryMin->setText(tr("<qt>%1&nbsp;MB</qt>").arg(m_iMaxVRAMVisible));
     403    m_pLabelMemoryMax->setText(tr("<qt>%1&nbsp;MB</qt>").arg(m_iMaxVRAMVisible));
    404404    m_pLabelScreensMin->setText(tr("<qt>%1</qt>").arg(1));
    405405    m_pLabelScreensMax->setText(tr("<qt>%1</qt>").arg(sys.GetMaxGuestMonitors()));
     
    412412    /* Video Capture stuff: */
    413413    m_pComboVideoCaptureSize->setItemText(0, tr("User Defined"));
    414     m_pComboVideoCaptureFrameRate->setItemText(0, tr("User Defined"));
     414    m_pLabelVideoCaptureFrameRateMin->setText(tr("%1 fps").arg(m_pSliderVideoCaptureFrameRate->minimum()));
     415    m_pLabelVideoCaptureFrameRateMax->setText(tr("%1 fps").arg(m_pSliderVideoCaptureFrameRate->maximum()));
     416    m_pLabelVideoCaptureFrameRateUnits->setText(tr("fps"));
    415417    m_pComboVideoCaptureBitRate->setItemText(0, tr("User Defined"));
     418    m_pComboVideoCaptureBitRate->setItemText(1, tr("%1 kbps").arg(32));
     419    m_pComboVideoCaptureBitRate->setItemText(2, tr("%1 kbps").arg(64));
     420    m_pComboVideoCaptureBitRate->setItemText(3, tr("%1 kbps").arg(128));
     421    m_pComboVideoCaptureBitRate->setItemText(4, tr("%1 kbps").arg(160));
     422    m_pComboVideoCaptureBitRate->setItemText(5, tr("%1 kbps").arg(256));
     423    m_pComboVideoCaptureBitRate->setItemText(6, tr("%1 kbps").arg(320));
     424    m_pComboVideoCaptureBitRate->setItemText(7, tr("%1 kbps").arg(512));
     425    m_pComboVideoCaptureBitRate->setItemText(8, tr("%1 kbps").arg(1024));
     426    m_pComboVideoCaptureBitRate->setItemText(9, tr("%1 kbps").arg(2048));
     427    m_pLabelVideoCaptureBitRateUnits->setText(tr("kbps"));
    416428}
    417429
     
    474486}
    475487
    476 void UIMachineSettingsDisplay::sltHandleVideoCaptureFrameRateChange(int iCurrentIndex)
    477 {
    478     /* Get the proposed frame-rate: */
    479     int iVideoCaptureFrameRate = m_pComboVideoCaptureFrameRate->itemData(iCurrentIndex).toInt();
    480 
    481     /* Make sure its valid: */
    482     if (iVideoCaptureFrameRate == 0)
    483         return;
    484 
     488void UIMachineSettingsDisplay::sltHandleVideoCaptureFrameRateChange(int iFrameRate)
     489{
    485490    /* Apply proposed frame-rate: */
    486     m_pEditorVideoCaptureFrameRate->setValue(iVideoCaptureFrameRate);
     491    m_pEditorVideoCaptureFrameRate->setValue(iFrameRate);
    487492}
    488493
     
    496501        return;
    497502
    498     /* Apply proposed frame-rate: */
     503    /* Apply proposed bit-rate: */
    499504    m_pEditorVideoCaptureBitRate->setValue(iVideoCaptureBitRate);
    500505}
     
    514519void UIMachineSettingsDisplay::sltHandleVideoCaptureFrameRateChange()
    515520{
    516     /* Look for preset: */
    517     lookForCorrespondingFrameRatePreset();
     521    /* Apply proposed frame-rate: */
     522    m_pSliderVideoCaptureFrameRate->setValue(m_pEditorVideoCaptureFrameRate->value());
    518523}
    519524
     
    638643    connect(m_pEditorVideoCaptureHeight, SIGNAL(valueChanged(int)), this, SLOT(sltHandleVideoCaptureHeightChange()));
    639644
    640     /* Prepare frame-rate combo-box: */
    641     m_pComboVideoCaptureFrameRate->addItem(""); /* User Defined */
    642     m_pComboVideoCaptureFrameRate->addItem("1",  QVariant(1));
    643     m_pComboVideoCaptureFrameRate->addItem("2",  QVariant(2));
    644     m_pComboVideoCaptureFrameRate->addItem("5",  QVariant(5));
    645     m_pComboVideoCaptureFrameRate->addItem("10", QVariant(10));
    646     m_pComboVideoCaptureFrameRate->addItem("15", QVariant(15));
    647     m_pComboVideoCaptureFrameRate->addItem("20", QVariant(20));
    648     m_pComboVideoCaptureFrameRate->addItem("25", QVariant(25));
    649     m_pComboVideoCaptureFrameRate->addItem("30", QVariant(30));
    650     connect(m_pComboVideoCaptureFrameRate, SIGNAL(currentIndexChanged(int)), this, SLOT(sltHandleVideoCaptureFrameRateChange(int)));
     645    /* Prepare frame-rate slider: */
     646    m_pSliderVideoCaptureFrameRate->setMinimum(1);
     647    m_pSliderVideoCaptureFrameRate->setMaximum(30);
     648    m_pSliderVideoCaptureFrameRate->setPageStep(1);
     649    m_pSliderVideoCaptureFrameRate->setSingleStep(1);
     650    m_pSliderVideoCaptureFrameRate->setTickInterval(1);
     651    m_pSliderVideoCaptureFrameRate->setSnappingEnabled(true);
     652    m_pSliderVideoCaptureFrameRate->setOptimalHint(1, 25);
     653    m_pSliderVideoCaptureFrameRate->setWarningHint(25, 30);
     654    connect(m_pSliderVideoCaptureFrameRate, SIGNAL(valueChanged(int)), this, SLOT(sltHandleVideoCaptureFrameRateChange(int)));
    651655
    652656    /* Prepare frame-rate spin-box: */
     
    657661
    658662    /* Prepare bit-rate combo-box: */
    659     m_pComboVideoCaptureBitRate->addItem(""); /* User Defined */
    660     m_pComboVideoCaptureBitRate->addItem("32",  QVariant(32));
    661     m_pComboVideoCaptureBitRate->addItem("64",  QVariant(64));
    662     m_pComboVideoCaptureBitRate->addItem("128", QVariant(128));
    663     m_pComboVideoCaptureBitRate->addItem("160", QVariant(160));
    664     m_pComboVideoCaptureBitRate->addItem("256", QVariant(256));
    665     m_pComboVideoCaptureBitRate->addItem("320", QVariant(320));
    666     m_pComboVideoCaptureBitRate->addItem("512", QVariant(512));
    667     m_pComboVideoCaptureBitRate->addItem("1024", QVariant(1024));
    668     m_pComboVideoCaptureBitRate->addItem("2048", QVariant(2048));
     663    m_pComboVideoCaptureBitRate->insertItem(0, QString()); /* User Defined */
     664    m_pComboVideoCaptureBitRate->insertItem(1, QString(), QVariant(32));
     665    m_pComboVideoCaptureBitRate->insertItem(2, QString(), QVariant(64));
     666    m_pComboVideoCaptureBitRate->insertItem(3, QString(), QVariant(128));
     667    m_pComboVideoCaptureBitRate->insertItem(4, QString(), QVariant(160));
     668    m_pComboVideoCaptureBitRate->insertItem(5, QString(), QVariant(256));
     669    m_pComboVideoCaptureBitRate->insertItem(6, QString(), QVariant(320));
     670    m_pComboVideoCaptureBitRate->insertItem(7, QString(), QVariant(512));
     671    m_pComboVideoCaptureBitRate->insertItem(8, QString(), QVariant(1024));
     672    m_pComboVideoCaptureBitRate->insertItem(9, QString(), QVariant(2048));
    669673    connect(m_pComboVideoCaptureBitRate, SIGNAL(currentIndexChanged(int)), this, SLOT(sltHandleVideoCaptureBitRateChange(int)));
    670674
     
    716720    m_pSliderMemory->setOptimalHint(uNeedMBytes, m_iMaxVRAMVisible);
    717721    m_pEditorMemory->setValidator(new QIntValidator(m_iMinVRAM, m_iMaxVRAMVisible, this));
    718     m_pLabelMemoryMin->setText(tr("<qt>%1&nbsp;MB</qt>").arg(m_iMaxVRAMVisible));
     722    m_pLabelMemoryMax->setText(tr("<qt>%1&nbsp;MB</qt>").arg(m_iMaxVRAMVisible));
    719723}
    720724
     
    755759}
    756760
    757 void UIMachineSettingsDisplay::lookForCorrespondingFrameRatePreset()
    758 {
    759     /* Look for video-capture frame-rate preset: */
    760     lookForCorrespondingPreset(m_pComboVideoCaptureFrameRate,
    761                                m_pEditorVideoCaptureFrameRate->value());
    762 }
    763 
    764761void UIMachineSettingsDisplay::lookForCorrespondingBitRatePreset()
    765762{
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.h

    r46418 r46455  
    168168    /* Handlers: Video Capture stuff: */
    169169    void sltHandleVideoCaptureSizeChange(int iCurrentIndex);
    170     void sltHandleVideoCaptureFrameRateChange(int iCurrentIndex);
     170    void sltHandleVideoCaptureFrameRateChange(int iFrameRate);
    171171    void sltHandleVideoCaptureBitRateChange(int iCurrentIndex);
    172172    void sltHandleVideoCaptureWidthChange();
     
    190190    /* Helpers: Video Capture stuff: */
    191191    void lookForCorrespondingSizePreset();
    192     void lookForCorrespondingFrameRatePreset();
    193192    void lookForCorrespondingBitRatePreset();
    194193    static void lookForCorrespondingPreset(QComboBox *pWhere, const QVariant &whichData);
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.ui

    r46418 r46455  
    6868             <layout class="QHBoxLayout" name="m_pLayoutLegendMemory">
    6969              <item>
    70                <widget class="QLabel" name="m_pLabelMemoryMin">
    71                 <property name="sizePolicy">
    72                  <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
    73                   <horstretch>0</horstretch>
    74                   <verstretch>0</verstretch>
    75                  </sizepolicy>
    76                 </property>
    77                </widget>
     70               <widget class="QLabel" name="m_pLabelMemoryMin"/>
    7871              </item>
    7972              <item>
     
    9184              </item>
    9285              <item>
    93                <widget class="QLabel" name="m_pLabelMemoryMax">
    94                 <property name="sizePolicy">
    95                  <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
    96                   <horstretch>0</horstretch>
    97                   <verstretch>0</verstretch>
    98                  </sizepolicy>
    99                 </property>
    100                </widget>
     86               <widget class="QLabel" name="m_pLabelMemoryMax"/>
    10187              </item>
    10288             </layout>
     
    535521             </item>
    536522             <item row="2" column="0">
    537               <widget class="QLabel" name="m_pLabelVideoCaptureFPS">
     523              <widget class="QLabel" name="m_pLabelVideoCaptureFrameRate">
    538524               <property name="text">
    539525                <string>&amp;Frame Rate:</string>
     
    543529               </property>
    544530               <property name="buddy">
    545                 <cstring>m_pComboVideoCaptureFrameRate</cstring>
    546                </property>
    547               </widget>
    548              </item>
    549              <item row="2" column="1">
    550               <widget class="QComboBox" name="m_pComboVideoCaptureFrameRate">
    551                <property name="sizePolicy">
    552                 <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
    553                  <horstretch>1</horstretch>
    554                  <verstretch>0</verstretch>
    555                 </sizepolicy>
    556                </property>
    557                <property name="whatsThis">
    558                 <string>This setting determines the maximum number of &lt;b>frames per second&lt;/b>. Frames with a higher frequency will be skipped. Reducing this value increses the number of skipped frames but reduces the file size.</string>
    559                </property>
    560               </widget>
     531                <cstring>m_pSliderVideoCaptureFrameRate</cstring>
     532               </property>
     533              </widget>
     534             </item>
     535             <item row="2" column="1" rowspan="2">
     536              <layout class="QGridLayout" name="m_pSliderLayoutVideoCaptureFrameRate">
     537               <property name="spacing">
     538                <number>0</number>
     539               </property>
     540               <item row="0" column="0" colspan="3">
     541                <widget class="QIAdvancedSlider" name="m_pSliderVideoCaptureFrameRate">
     542                 <property name="whatsThis">
     543                  <string>This setting determines the maximum number of &lt;b>frames per second&lt;/b>. Frames with a higher frequency will be skipped. Reducing this value increses the number of skipped frames but reduces the file size.</string>
     544                 </property>
     545                 <property name="orientation">
     546                  <enum>Qt::Horizontal</enum>
     547                 </property>
     548                 <property name="tickPosition">
     549                  <enum>QSlider::TicksBelow</enum>
     550                 </property>
     551                </widget>
     552               </item>
     553               <item row="1" column="0">
     554                <widget class="QLabel" name="m_pLabelVideoCaptureFrameRateMin"/>
     555               </item>
     556               <item row="1" column="1">
     557                <spacer name="m_pStretchVideoCaptureFrameRate">
     558                 <property name="orientation">
     559                  <enum>Qt::Horizontal</enum>
     560                 </property>
     561                 <property name="sizeHint" stdset="0">
     562                  <size>
     563                   <width>0</width>
     564                   <height>0</height>
     565                  </size>
     566                 </property>
     567                </spacer>
     568               </item>
     569               <item row="1" column="2">
     570                <widget class="QLabel" name="m_pLabelVideoCaptureFrameRateMax"/>
     571               </item>
     572              </layout>
    561573             </item>
    562574             <item row="2" column="2">
     
    567579              </widget>
    568580             </item>
    569              <item row="3" column="0">
     581             <item row="2" column="3">
     582              <widget class="QLabel" name="m_pLabelVideoCaptureFrameRateUnits"/>
     583             </item>
     584             <item row="4" column="0">
    570585              <widget class="QLabel" name="m_pLabelVideoCaptureRate">
    571586               <property name="text">
     
    580595              </widget>
    581596             </item>
    582              <item row="3" column="1">
     597             <item row="4" column="1">
    583598              <widget class="QComboBox" name="m_pComboVideoCaptureBitRate">
    584599               <property name="sizePolicy">
     
    593608              </widget>
    594609             </item>
    595              <item row="3" column="2">
     610             <item row="4" column="2">
    596611              <widget class="QSpinBox" name="m_pEditorVideoCaptureBitRate">
    597612               <property name="whatsThis">
     
    599614               </property>
    600615              </widget>
     616             </item>
     617             <item row="4" column="3">
     618              <widget class="QLabel" name="m_pLabelVideoCaptureBitRateUnits"/>
    601619             </item>
    602620            </layout>
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette