VirtualBox

Ignore:
Timestamp:
Aug 21, 2017 2:17:01 PM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:7820: Allow to enable/disable audio output/input through VM settings Audio page.

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

Legend:

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

    r68435 r68489  
    3939        , m_audioDriverType(KAudioDriverType_Null)
    4040        , m_audioControllerType(KAudioControllerType_AC97)
     41        , m_fAudioOutputEnabled(false)
     42        , m_fAudioInputEnabled(false)
    4143    {}
    4244
     
    4850               && (m_audioDriverType == other.m_audioDriverType)
    4951               && (m_audioControllerType == other.m_audioControllerType)
     52               && (m_fAudioOutputEnabled == other.m_fAudioOutputEnabled)
     53               && (m_fAudioInputEnabled == other.m_fAudioInputEnabled)
    5054               ;
    5155    }
     
    6266    /** Holds the audio controller type. */
    6367    KAudioControllerType  m_audioControllerType;
     68    /** Holds whether the audio output is enabled. */
     69    bool                  m_fAudioOutputEnabled;
     70    /** Holds whether the audio input is enabled. */
     71    bool                  m_fAudioInputEnabled;
    6472};
    6573
     
    102110        oldAudioData.m_audioDriverType = comAdapter.GetAudioDriver();
    103111        oldAudioData.m_audioControllerType = comAdapter.GetAudioController();
     112        oldAudioData.m_fAudioOutputEnabled = comAdapter.GetEnabledOut();
     113        oldAudioData.m_fAudioInputEnabled = comAdapter.GetEnabledIn();
    104114    }
    105115
     
    120130    m_pComboAudioDriver->setCurrentIndex(m_pComboAudioDriver->findData((int)oldAudioData.m_audioDriverType));
    121131    m_pComboAudioController->setCurrentIndex(m_pComboAudioController->findData((int)oldAudioData.m_audioControllerType));
     132    m_pCheckBoxAudioOutput->setChecked(oldAudioData.m_fAudioOutputEnabled);
     133    m_pCheckBoxAudioInput->setChecked(oldAudioData.m_fAudioInputEnabled);
    122134
    123135    /* Polish page finally: */
     
    134146    newAudioData.m_audioDriverType = static_cast<KAudioDriverType>(m_pComboAudioDriver->itemData(m_pComboAudioDriver->currentIndex()).toInt());
    135147    newAudioData.m_audioControllerType = static_cast<KAudioControllerType>(m_pComboAudioController->itemData(m_pComboAudioController->currentIndex()).toInt());
     148    newAudioData.m_fAudioOutputEnabled = m_pCheckBoxAudioOutput->isChecked();
     149    newAudioData.m_fAudioInputEnabled = m_pCheckBoxAudioInput->isChecked();
    136150
    137151    /* Cache new audio data: */
     
    294308                fSuccess = comAdapter.isOk();
    295309            }
     310            /* Save whether audio output is enabled: */
     311            if (fSuccess && isMachineOffline() && newAudioData.m_fAudioOutputEnabled != oldAudioData.m_fAudioOutputEnabled)
     312            {
     313                comAdapter.SetEnabledOut(newAudioData.m_fAudioOutputEnabled);
     314                fSuccess = comAdapter.isOk();
     315            }
     316            /* Save whether audio input is enabled: */
     317            if (fSuccess && isMachineOffline() && newAudioData.m_fAudioInputEnabled != oldAudioData.m_fAudioInputEnabled)
     318            {
     319                comAdapter.SetEnabledIn(newAudioData.m_fAudioInputEnabled);
     320                fSuccess = comAdapter.isOk();
     321            }
    296322
    297323            /* Show error message if necessary: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsAudio.ui

    r67067 r68489  
    103103          </widget>
    104104         </item>
     105         <item row="2" column="0">
     106          <widget class="QLabel" name="m_pLabelAudioExtended">
     107           <property name="text">
     108            <string>Extended Features:</string>
     109           </property>
     110           <property name="alignment">
     111            <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
     112           </property>
     113          </widget>
     114         </item>
     115         <item row="2" column="1">
     116          <widget class="QCheckBox" name="m_pCheckBoxAudioOutput">
     117           <property name="sizePolicy">
     118            <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
     119             <horstretch>1</horstretch>
     120             <verstretch>0</verstretch>
     121            </sizepolicy>
     122           </property>
     123           <property name="whatsThis">
     124            <string>When checked, a virtual PCI audio card output will be enabled.</string>
     125           </property>
     126           <property name="text">
     127            <string>Enable Audio &amp;Output</string>
     128           </property>
     129          </widget>
     130         </item>
     131         <item row="3" column="1">
     132          <widget class="QCheckBox" name="m_pCheckBoxAudioInput">
     133           <property name="sizePolicy">
     134            <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
     135             <horstretch>1</horstretch>
     136             <verstretch>0</verstretch>
     137            </sizepolicy>
     138           </property>
     139           <property name="whatsThis">
     140            <string>When checked, a virtual PCI audio card input will be enabled.</string>
     141           </property>
     142           <property name="text">
     143            <string>Enable Audio &amp;Input</string>
     144           </property>
     145          </widget>
     146         </item>
    105147        </layout>
    106148       </widget>
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