Changeset 6597 in vbox for trunk/src/VBox/Main
- Timestamp:
- Jan 30, 2008 12:55:54 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 27654
- Location:
- trunk/src/VBox/Main
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/AudioAdapterImpl.cpp
r6076 r6597 265 265 } 266 266 267 STDMETHODIMP AudioAdapter::COMGETTER(AudioController)(AudioControllerType_T *aAudioController) 268 { 269 if (!aAudioController) 270 return E_POINTER; 271 272 AutoCaller autoCaller (this); 273 CheckComRCReturnRC (autoCaller.rc()); 274 275 AutoReaderLock alock (this); 276 277 *aAudioController = mData->mAudioController; 278 279 return S_OK; 280 } 281 282 STDMETHODIMP AudioAdapter::COMSETTER(AudioController)(AudioControllerType_T aAudioController) 283 { 284 AutoCaller autoCaller (this); 285 CheckComRCReturnRC (autoCaller.rc()); 286 287 /* the machine needs to be mutable */ 288 Machine::AutoMutableStateDependency adep (mParent); 289 CheckComRCReturnRC (adep.rc()); 290 291 AutoLock alock (this); 292 293 HRESULT rc = S_OK; 294 295 if (mData->mAudioController != aAudioController) 296 { 297 /* 298 * which audio hardware type are we supposed to use? 299 */ 300 switch (aAudioController) 301 { 302 case AudioControllerType_AC97: 303 case AudioControllerType_SB16: 304 mData.backup(); 305 mData->mAudioController = aAudioController; 306 break; 307 308 default: 309 { 310 AssertMsgFailed (("Wrong audio controller type %d\n", 311 aAudioController)); 312 rc = E_FAIL; 313 } 314 } 315 } 316 317 return rc; 318 } 319 267 320 // IAudioAdapter methods 268 321 ///////////////////////////////////////////////////////////////////////////// … … 306 359 /* is the adapter enabled? (required) */ 307 360 mData->mEnabled = audioAdapterNode.value <bool> ("enabled"); 361 362 /* now check the audio adapter (not required, default is AC97) */ 363 const char *controller = audioAdapterNode.stringValue ("controller"); 364 if (strcmp (controller, "SB16") == 0) 365 mData->mAudioController = AudioControllerType_SB16; 366 else 367 mData->mAudioController = AudioControllerType_AC97; 308 368 309 369 /* now check the audio driver (required) */ … … 375 435 Key node = aMachineNode.createKey ("AudioAdapter"); 376 436 437 const char *controllerStr = NULL; 438 switch (mData->mAudioController) 439 { 440 case AudioControllerType_SB16: 441 { 442 controllerStr = "SB16"; 443 break; 444 } 445 default: 446 { 447 controllerStr = "AC97"; 448 break; 449 } 450 } 451 node.setStringValue ("controller", controllerStr); 452 377 453 const char *driverStr = NULL; 378 454 switch (mData->mAudioDriver) -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r6177 r6597 1283 1283 1284 1284 /* 1285 * AC'97 ICH audio1285 * AC'97 ICH / SoundBlaster16 audio 1286 1286 */ 1287 1287 ComPtr<IAudioAdapter> audioAdapter; … … 1289 1289 BOOL enabled = FALSE; 1290 1290 if (audioAdapter) 1291 {1292 1291 hrc = audioAdapter->COMGETTER(Enabled)(&enabled); H(); 1293 } 1292 1294 1293 if (enabled) 1295 1294 { 1296 rc = CFGMR3InsertNode(pDevices, "ichac97", &pDev); /* ichac97 */ 1297 rc = CFGMR3InsertNode(pDev, "0", &pInst); 1298 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK(); 1299 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 5); RC_CHECK(); 1300 Assert(!afPciDeviceNo[5]); 1301 afPciDeviceNo[5] = true; 1302 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK(); 1303 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); 1295 AudioControllerType_T audioController; 1296 hrc = audioAdapter->COMGETTER(AudioController)(&audioController); H(); 1297 switch (audioController) 1298 { 1299 case AudioControllerType_AC97: 1300 { 1301 /* default: ICH AC97 */ 1302 rc = CFGMR3InsertNode(pDevices, "ichac97", &pDev); RC_CHECK(); 1303 rc = CFGMR3InsertNode(pDev, "0", &pInst); 1304 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK(); 1305 rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo", 5); RC_CHECK(); 1306 Assert(!afPciDeviceNo[5]); 1307 afPciDeviceNo[5] = true; 1308 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK(); 1309 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK(); 1310 break; 1311 } 1312 case AudioControllerType_SB16: 1313 { 1314 /* legacy SoundBlaster16 */ 1315 rc = CFGMR3InsertNode(pDevices, "sb16", &pDev); RC_CHECK(); 1316 rc = CFGMR3InsertNode(pDev, "0", &pInst); RC_CHECK(); 1317 rc = CFGMR3InsertInteger(pInst, "Trusted", 1); /* boolean */ RC_CHECK(); 1318 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); RC_CHECK(); 1319 rc = CFGMR3InsertInteger(pCfg, "IRQ", 5); RC_CHECK(); 1320 rc = CFGMR3InsertInteger(pCfg, "DMA", 1); RC_CHECK(); 1321 rc = CFGMR3InsertInteger(pCfg, "DMA16", 5); RC_CHECK(); 1322 rc = CFGMR3InsertInteger(pCfg, "Port", 0x220); RC_CHECK(); 1323 rc = CFGMR3InsertInteger(pCfg, "Version", 0x0405); RC_CHECK(); 1324 break; 1325 } 1326 } 1304 1327 1305 1328 /* the Audio driver */ … … 1307 1330 rc = CFGMR3InsertString(pLunL0, "Driver", "AUDIO"); RC_CHECK(); 1308 1331 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK(); 1332 1309 1333 AudioDriverType_T audioDriver; 1310 1334 hrc = audioAdapter->COMGETTER(AudioDriver)(&audioDriver); H(); -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r6384 r6597 8856 8856 </enum> 8857 8857 8858 <enum 8859 name="AudioControllerType" 8860 uuid="7afd395c-42c3-444e-8788-3ce80292f36c" 8861 > 8862 <const name="AC97" value="0"/> 8863 <const name="SB16" value="1"/> 8864 </enum> 8865 8858 8866 <interface 8859 8867 name="IAudioAdapter" extends="$unknown" … … 8871 8879 not contain any audio adapter. Can only be changed when 8872 8880 the VM is not running. 8881 </desc> 8882 </attribute> 8883 <attribute name="audioController" type="AudioControllerType"> 8884 <desc> 8885 The audio hardware we emulate. 8873 8886 </desc> 8874 8887 </attribute> -
trunk/src/VBox/Main/include/AudioAdapterImpl.h
r6076 r6597 38 38 mEnabled = false; 39 39 mAudioDriver = AudioDriverType_NullAudioDriver; 40 mAudioController = AudioControllerType_AC97; 40 41 } 41 42 … … 44 45 return this == &that || 45 46 (mEnabled == that.mEnabled && 46 mAudioDriver == that.mAudioDriver); 47 mAudioDriver == that.mAudioDriver && 48 mAudioController == that.mAudioController); 47 49 } 48 50 49 51 BOOL mEnabled; 50 52 AudioDriverType_T mAudioDriver; 53 AudioControllerType_T mAudioController; 51 54 }; 52 55 … … 79 82 STDMETHOD(COMGETTER(AudioDriver)) (AudioDriverType_T *aAudioDriverType); 80 83 STDMETHOD(COMSETTER(AudioDriver)) (AudioDriverType_T aAudioDriverType); 84 STDMETHOD(COMGETTER(AudioController)) (AudioControllerType_T *aAudioControllerType); 85 STDMETHOD(COMSETTER(AudioController)) (AudioControllerType_T aAudioControllerType); 81 86 82 87 // public methods only for internal purposes -
trunk/src/VBox/Main/xml/SchemaDefs.xsl
r5999 r6597 129 129 <xsl:with-param name="member" select="' NetworkAdapterCount'"/> 130 130 <xsl:with-param name="select" select=" 131 xsd:complexType[@name='T Adapter']/xsd:attribute[@name='slot']//xsd:maxExclusive/@value131 xsd:complexType[@name='TNetworkAdapter']/xsd:attribute[@name='slot']//xsd:maxExclusive/@value 132 132 "/> 133 133 </xsl:call-template> -
trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd
r6384 r6597 545 545 </xsd:complexType> 546 546 547 <xsd:complexType name="TAdapter"> 547 <xsd:complexType name="TAudioAdapterBase"> 548 <xsd:attribute name="enabled" type="xsd:boolean" use="required"/> 549 <xsd:attribute name="controller" default="AC97"> 550 <xsd:simpleType> 551 <xsd:restriction base="xsd:token"> 552 <xsd:enumeration value="AC97"/> 553 <xsd:enumeration value="SB16"/> 554 </xsd:restriction> 555 </xsd:simpleType> 556 </xsd:attribute> 557 </xsd:complexType> 558 559 <xsd:complexType name="TNetworkAdapter"> 548 560 <xsd:attribute name="type" type="TNetworkAdapterType" default="Am79C970A"/> 549 561 <xsd:attribute name="slot" use="required"> -
trunk/src/VBox/Main/xml/VirtualBox-settings-freebsd.xsd
r6076 r6597 60 60 <xsd:complexType> 61 61 <xsd:complexContent> 62 <xsd:extension base="T Adapter">62 <xsd:extension base="TNetworkAdapter"> 63 63 <xsd:choice minOccurs="0"> 64 64 <xsd:element name="NAT"> … … 86 86 87 87 <xsd:complexType name="TAudioAdapter"> 88 <xsd:attribute name="enabled" type="xsd:boolean" use="required"/> 89 <xsd:attribute name="driver" use="required"> 90 <!--- @todo (dmik) capitalize enum values on next format change! --> 91 <xsd:simpleType> 92 <xsd:restriction base="xsd:token"> 93 <xsd:enumeration value="null"/> 94 <xsd:enumeration value="oss"/> 95 <xsd:enumeration value="alsa"/> 96 </xsd:restriction> 97 </xsd:simpleType> 98 </xsd:attribute> 88 <xsd:extension base="TAudioAdapterBase"> 89 <xsd:attribute name="driver" use="required"> 90 <!--- @todo (dmik) capitalize enum values on next format change! --> 91 <xsd:simpleType> 92 <xsd:restriction base="xsd:token"> 93 <xsd:enumeration value="null"/> 94 <xsd:enumeration value="oss"/> 95 <xsd:enumeration value="alsa"/> 96 </xsd:restriction> 97 </xsd:simpleType> 98 </xsd:attribute> 99 </xsd:extension> 99 100 </xsd:complexType> 100 101 -
trunk/src/VBox/Main/xml/VirtualBox-settings-linux.xsd
r6076 r6597 60 60 <xsd:complexType> 61 61 <xsd:complexContent> 62 <xsd:extension base="T Adapter">62 <xsd:extension base="TNetworkAdapter"> 63 63 <xsd:choice minOccurs="0"> 64 64 <xsd:element name="NAT"> … … 86 86 87 87 <xsd:complexType name="TAudioAdapter"> 88 <xsd:attribute name="enabled" type="xsd:boolean" use="required"/> 89 <xsd:attribute name="driver" use="required"> 90 <!--- @todo (dmik) capitalize enum values on next format change! --> 91 <xsd:simpleType> 92 <xsd:restriction base="xsd:token"> 93 <xsd:enumeration value="null"/> 94 <xsd:enumeration value="oss"/> 95 <xsd:enumeration value="alsa"/> 96 <xsd:enumeration value="pulse"/> 97 </xsd:restriction> 98 </xsd:simpleType> 99 </xsd:attribute> 88 <xsd:complexContent> 89 <xsd:extension base="TAudioAdapterBase"> 90 <xsd:attribute name="driver" use="required"> 91 <!--- @todo (dmik) capitalize enum values on next format change! --> 92 <xsd:simpleType> 93 <xsd:restriction base="xsd:token"> 94 <xsd:enumeration value="null"/> 95 <xsd:enumeration value="oss"/> 96 <xsd:enumeration value="alsa"/> 97 <xsd:enumeration value="pulse"/> 98 </xsd:restriction> 99 </xsd:simpleType> 100 </xsd:attribute> 101 </xsd:extension> 102 </xsd:complexContent> 100 103 </xsd:complexType> 101 104 -
trunk/src/VBox/Main/xml/VirtualBox-settings-macosx.xsd
r6076 r6597 60 60 <xsd:complexType> 61 61 <xsd:complexContent> 62 <xsd:extension base="T Adapter">62 <xsd:extension base="TNetworkAdapter"> 63 63 <xsd:choice minOccurs="0"> 64 64 <xsd:element name="NAT"> … … 86 86 87 87 <xsd:complexType name="TAudioAdapter"> 88 <xsd:attribute name="enabled" type="xsd:boolean" use="required"/> 89 <xsd:attribute name="driver" use="required"> 90 <!--- @todo (dmik) capitalize enum values on next format change! --> 91 <xsd:simpleType> 92 <xsd:restriction base="xsd:token"> 93 <xsd:enumeration value="null"/> 94 <xsd:enumeration value="coreaudio"/> 95 </xsd:restriction> 96 </xsd:simpleType> 97 </xsd:attribute> 88 <xsd:extension base="TAudioAdapterBase"> 89 <xsd:attribute name="driver" use="required"> 90 <!--- @todo (dmik) capitalize enum values on next format change! --> 91 <xsd:simpleType> 92 <xsd:restriction base="xsd:token"> 93 <xsd:enumeration value="null"/> 94 <xsd:enumeration value="coreaudio"/> 95 </xsd:restriction> 96 </xsd:simpleType> 97 </xsd:attribute> 98 </xsd:extension> 98 99 </xsd:complexType> 99 100 -
trunk/src/VBox/Main/xml/VirtualBox-settings-os2.xsd
r6596 r6597 60 60 <xsd:complexType> 61 61 <xsd:complexContent> 62 <xsd:extension base="T Adapter">62 <xsd:extension base="TNetworkAdapter"> 63 63 <xsd:choice minOccurs="0"> 64 64 <xsd:element name="NAT"> … … 86 86 87 87 <xsd:complexType name="TAudioAdapter"> 88 <xsd:attribute name="enabled" type="xsd:boolean" use="required"/> 89 <xsd:attribute name="driver" use="required"> 90 <!--- @todo (dmik) capitalize enum values on next format change! --> 91 <xsd:simpleType> 92 <xsd:restriction base="xsd:token"> 93 <xsd:enumeration value="null"/> 94 <xsd:enumeration value="mmpm"/> 95 </xsd:restriction> 96 </xsd:simpleType> 97 </xsd:attribute> 88 <xsd:extension base="TAudioAdapterBase"> 89 <xsd:attribute name="driver" use="required"> 90 <!--- @todo (dmik) capitalize enum values on next format change! --> 91 <xsd:simpleType> 92 <xsd:restriction base="xsd:token"> 93 <xsd:enumeration value="null"/> 94 <xsd:enumeration value="mmpm"/> 95 </xsd:restriction> 96 </xsd:simpleType> 97 </xsd:attribute> 98 </xsd:extension> 98 99 </xsd:complexType> 99 100 -
trunk/src/VBox/Main/xml/VirtualBox-settings-solaris.xsd
r6076 r6597 60 60 <xsd:complexType> 61 61 <xsd:complexContent> 62 <xsd:extension base="T Adapter">62 <xsd:extension base="TNetworkAdapter"> 63 63 <xsd:choice minOccurs="0"> 64 64 <xsd:element name="NAT"> … … 86 86 87 87 <xsd:complexType name="TAudioAdapter"> 88 <xsd:attribute name="enabled" type="xsd:boolean" use="required"/> 89 <xsd:attribute name="driver" use="required"> 90 <!--- @todo (dmik) capitalize enum values on next format change! --> 91 <xsd:simpleType> 92 <xsd:restriction base="xsd:token"> 93 <xsd:enumeration value="null"/> 94 <xsd:enumeration value="esd"/> 95 </xsd:restriction> 96 </xsd:simpleType> 97 </xsd:attribute> 88 <xsd:extension base="TAudioAdapterBase"> 89 <xsd:attribute name="driver" use="required"> 90 <!--- @todo (dmik) capitalize enum values on next format change! --> 91 <xsd:simpleType> 92 <xsd:restriction base="xsd:token"> 93 <xsd:enumeration value="null"/> 94 <xsd:enumeration value="esd"/> 95 </xsd:restriction> 96 </xsd:simpleType> 97 </xsd:attribute> 98 </xsd:extension> 98 99 </xsd:complexType> 99 100 -
trunk/src/VBox/Main/xml/VirtualBox-settings-windows.xsd
r6076 r6597 60 60 <xsd:complexType> 61 61 <xsd:complexContent> 62 <xsd:extension base="T Adapter">62 <xsd:extension base="TNetworkAdapter"> 63 63 <xsd:choice minOccurs="0"> 64 64 <xsd:element name="NAT"> … … 84 84 85 85 <xsd:complexType name="TAudioAdapter"> 86 <xsd:attribute name="enabled" type="xsd:boolean" use="required"/> 87 <xsd:attribute name="driver" use="required"> 88 <!--- @todo (dmik) capitalize enum values on next format change! --> 89 <xsd:simpleType> 90 <xsd:restriction base="xsd:token"> 91 <xsd:enumeration value="null"/> 92 <xsd:enumeration value="winmm"/> 93 <xsd:enumeration value="dsound"/> 94 </xsd:restriction> 95 </xsd:simpleType> 96 </xsd:attribute> 86 <xsd:extension base="TAudioAdapterBase"> 87 <xsd:attribute name="driver" use="required"> 88 <!--- @todo (dmik) capitalize enum values on next format change! --> 89 <xsd:simpleType> 90 <xsd:restriction base="xsd:token"> 91 <xsd:enumeration value="null"/> 92 <xsd:enumeration value="winmm"/> 93 <xsd:enumeration value="dsound"/> 94 </xsd:restriction> 95 </xsd:simpleType> 96 </xsd:attribute> 97 </xsd:extension> 97 98 </xsd:complexType> 98 99
Note:
See TracChangeset
for help on using the changeset viewer.