|
|
@ -2,6 +2,7 @@ import device.Device; |
|
|
|
import device.cdPlayer.CD; |
|
|
|
import device.cdPlayer.CDPlayer; |
|
|
|
import device.radioPlayer.RadioPlayer; |
|
|
|
import device.usbPlayer.USB_Stick; |
|
|
|
import device.usbPlayer.UsbPlayer; |
|
|
|
|
|
|
|
import java.io.FileReader; |
|
|
@ -56,20 +57,28 @@ public class BordComputer { |
|
|
|
return null; |
|
|
|
} |
|
|
|
public void meetAllPreconditionForPlay(){ |
|
|
|
if(activeDevice instanceof CDPlayer) { |
|
|
|
String[] audioPlayList = new String[]{"Audio 01", "Audio 02", "Audio 03", "Audio 04", "Audio 05"}; |
|
|
|
CD audioCD1 = new CD("Audio", "PopMusic", audioPlayList, "XAc20044"); |
|
|
|
CD audioCD2 = new CD("Audio", "RockMusic", audioPlayList, "BLXPP78"); |
|
|
|
|
|
|
|
String[] audioPlayList = new String[]{"Audio 01", "Audio 02", "Audio 03", "Audio 04", "Audio 05"}; |
|
|
|
CD audioCD1 = new CD("Audio", "PopMusic", audioPlayList, "XAc20044"); |
|
|
|
CD audioCD2=new CD("Audio","RockMusic",audioPlayList,"BLXPP78"); |
|
|
|
CDPlayer cdPlayer = (CDPlayer) activeDevice; |
|
|
|
cdPlayer.changePlaySource(); |
|
|
|
cdPlayer.loadCDWechseler(audioCD1, 0); |
|
|
|
cdPlayer.loadCDWechseler(audioCD2, 1); |
|
|
|
|
|
|
|
CDPlayer cdPlayer=(CDPlayer) activeDevice; |
|
|
|
cdPlayer.changePlaySource(); |
|
|
|
cdPlayer.loadCDWechseler(audioCD1, 0); |
|
|
|
cdPlayer.loadCDWechseler(audioCD2, 1); |
|
|
|
cdPlayer.setCD(cdPlayer.getCdWechseler().getCDList().get(0)); |
|
|
|
activeDevice = cdPlayer; |
|
|
|
} |
|
|
|
if(activeDevice instanceof UsbPlayer) { |
|
|
|
USB_Stick USBDrive = new USB_Stick(); |
|
|
|
UsbPlayer up1 = new UsbPlayer(USBDrive); |
|
|
|
activeDevice = up1; |
|
|
|
} |
|
|
|
|
|
|
|
cdPlayer.setCD(cdPlayer.getCdWechseler().getCDList().get(0)); |
|
|
|
activeDevice=cdPlayer; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setActiveDevice(Device activeDevice) { |
|
|
|
this.activeDevice = activeDevice; |
|
|
|
} |
|
|
|