diff options
author | Victor Mocanu | 2017-11-14 13:55:52 +0100 |
---|---|---|
committer | Victor Mocanu | 2017-11-14 13:55:52 +0100 |
commit | 0bc42d7cbf571b413039cd4a811ba61900fdf56a (patch) | |
tree | bfc20d2fa17bd8b98e07bc2053699afceb44c708 /src/main | |
parent | [VBox] new working coppy (diff) | |
download | master-sync-shared-0bc42d7cbf571b413039cd4a811ba61900fdf56a.tar.gz master-sync-shared-0bc42d7cbf571b413039cd4a811ba61900fdf56a.tar.xz master-sync-shared-0bc42d7cbf571b413039cd4a811ba61900fdf56a.zip |
[VBox] setter for the 3dacceleration works now, added new hardwareversion enum type for virtualbox
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/openslx/util/vm/VboxMetaData.java | 70 | ||||
-rw-r--r-- | src/main/java/org/openslx/util/vm/VmMetaData.java | 5 |
2 files changed, 35 insertions, 40 deletions
diff --git a/src/main/java/org/openslx/util/vm/VboxMetaData.java b/src/main/java/org/openslx/util/vm/VboxMetaData.java index 7e814fa..fcb89d9 100644 --- a/src/main/java/org/openslx/util/vm/VboxMetaData.java +++ b/src/main/java/org/openslx/util/vm/VboxMetaData.java @@ -274,10 +274,10 @@ public class VboxMetaData extends VmMetaData<VBoxSoundCardMeta, VBoxDDAccelMeta, @Override public void setDDAcceleration( VmMetaData.DDAcceleration type ) { - // TODO Auto-generated method stub - + VBoxDDAccelMeta accel = ddacc.get( type ); + config.changeAttribute( "Display", "accelerate3D", vmBoolean(accel.isPresent)); } - + @Override public VmMetaData.DDAcceleration getDDAcceleration() { @@ -296,10 +296,12 @@ public class VboxMetaData extends VmMetaData<VBoxSoundCardMeta, VBoxDDAccelMeta, } @Override + /** + * Function does nothing for Virtual Box; + * Virtual Box accepts per default only one hardware version and is hidden from the user + */ public void setHWVersion( HWVersion type ) { - // TODO Auto-generated method stub - } @Override @@ -307,7 +309,7 @@ public class VboxMetaData extends VmMetaData<VBoxSoundCardMeta, VBoxDDAccelMeta, { VmMetaData.HWVersion returnhwv = null; // TODO what do here? there is only one supported hwversion as far as I know - returnhwv = VmMetaData.HWVersion.NONE; + returnhwv = VmMetaData.HWVersion.DEFAULT; // TODO End return returnhwv; } @@ -336,42 +338,34 @@ public class VboxMetaData extends VmMetaData<VBoxSoundCardMeta, VBoxDDAccelMeta, public void populateTheMaps() { - /* add all from VBox supported sound cards here + // add all from vmware supported sound cards here soundCards.put( VmMetaData.SoundCardType.NONE, new VBoxSoundCardMeta( false, null ) ); + soundCards.put( VmMetaData.SoundCardType.SOUND_BLASTER, new VBoxSoundCardMeta( true, "sb16" ) ); + soundCards.put( VmMetaData.SoundCardType.ES, new VBoxSoundCardMeta( true, "es1371" ) ); soundCards.put( VmMetaData.SoundCardType.HD_AUDIO, new VBoxSoundCardMeta( true, "hdaudio" ) ); // end of supported sound cards - // add all from VBox supported settings for the 3D acceleration - ddacc.put( VmMetaData.DDAcceleration.ON, new VBoxDDAccelMeta( true ) ); + // add all from vmware supported settings for the 3D acceleration ddacc.put( VmMetaData.DDAcceleration.OFF, new VBoxDDAccelMeta( false ) ); - // end of all from VBox supported settings for the 3D acceleration - // add all from VBox supported Hardware versions here - hwversion.put( VmMetaData.HWVersion.NONE, new VBoxHWVersionMeta( 0 ) ); - // end of all from VBox supported Hardware versions here - // add all from VBox supported Ethernet devices versions here + ddacc.put( VmMetaData.DDAcceleration.ON, new VBoxDDAccelMeta( true ) ); + // end of all from vmware supported settings for the 3D acceleration + // add all from vmware supported Hardware versions here + hwversion.put( VmMetaData.HWVersion.DEFAULT, new VBoxHWVersionMeta( 0 ) ); + + // end of all from vmware supported Hardware versions here + // add all from vmware supported Ethernet devices versions here + networkCards.put( VmMetaData.EthernetDevType.AUTO, new VBoxEthernetDevTypeMeta( null ) ); + networkCards.put( VmMetaData.EthernetDevType.PCNET32, new VBoxEthernetDevTypeMeta( "vlance" ) ); networkCards.put( VmMetaData.EthernetDevType.E1000, new VBoxEthernetDevTypeMeta( "e1000" ) ); - // end of all from VBox supported Ethernet devices versions here */ - - // add all from vmware supported sound cards here - soundCards.put( VmMetaData.SoundCardType.NONE, new VBoxSoundCardMeta( false, null ) ); - soundCards.put( VmMetaData.SoundCardType.DEFAULT, new VBoxSoundCardMeta( true, null ) ); - soundCards.put( VmMetaData.SoundCardType.SOUND_BLASTER, new VBoxSoundCardMeta( true, "sb16" ) ); - soundCards.put( VmMetaData.SoundCardType.ES, new VBoxSoundCardMeta( true, "es1371" ) ); - soundCards.put( VmMetaData.SoundCardType.HD_AUDIO, new VBoxSoundCardMeta( true, "hdaudio" ) ); - // end of supported sound cards - // add all from vmware supported settings for the 3D acceleration - ddacc.put( VmMetaData.DDAcceleration.OFF, new VBoxDDAccelMeta( false ) ); - ddacc.put( VmMetaData.DDAcceleration.ON, new VBoxDDAccelMeta( true ) ); - // end of all from vmware supported settings for the 3D acceleration - // add all from vmware supported Hardware versions here - hwversion.put( VmMetaData.HWVersion.NONE, new VBoxHWVersionMeta( 0 ) ); - hwversion.put( VmMetaData.HWVersion.THREE, new VBoxHWVersionMeta( 3 ) ); - hwversion.put( VmMetaData.HWVersion.FOUR, new VBoxHWVersionMeta( 4 ) ); - - // end of all from vmware supported Hardware versions here - // add all from vmware supported Ethernet devices versions here - networkCards.put( VmMetaData.EthernetDevType.AUTO, new VBoxEthernetDevTypeMeta( null ) ); - networkCards.put( VmMetaData.EthernetDevType.PCNET32, new VBoxEthernetDevTypeMeta( "vlance" ) ); - networkCards.put( VmMetaData.EthernetDevType.E1000, new VBoxEthernetDevTypeMeta( "e1000" ) ); - // end of all from vmware supported Ethernet devices versions here + // end of all from vmware supported Ethernet devices versions here + } + + /** + * given a boolean value returns a string in lowercase of given boolean + * @param var + * @return + */ + private static String vmBoolean( boolean var ) + { + return Boolean.toString( var ).toLowerCase(); } } diff --git a/src/main/java/org/openslx/util/vm/VmMetaData.java b/src/main/java/org/openslx/util/vm/VmMetaData.java index 5529c63..ba9c357 100644 --- a/src/main/java/org/openslx/util/vm/VmMetaData.java +++ b/src/main/java/org/openslx/util/vm/VmMetaData.java @@ -88,7 +88,9 @@ public abstract class VmMetaData<T, U, V, W> NINE( " 9 (Workstation 9, Player/Fusion 5)" ), TEN( "10 (Workstation 10, Player/Fusion 6)" ), ELEVEN( "11 (Workstation 11, Player/Fusion 7)" ), - TWELVE( "12 (Workstation/Player 12, Fusion 8)" ); + TWELVE( "12 (Workstation/Player 12, Fusion 8)" ), + DEFAULT( "default" ); + public final String displayName; @@ -343,7 +345,6 @@ public abstract class VmMetaData<T, U, V, W> public abstract HWVersion getHWVersion(); - // TODO export to VmMetaData like SoundCardType public abstract void setEthernetDevType( int cardIndex, EthernetDevType type ); public abstract EthernetDevType getEthernetDevType( int cardIndex ); |