|
|
@ -20,6 +20,9 @@ public class CDPlayer implements Device { |
|
|
|
private String actualPlayTrack=""; |
|
|
|
private CD loadedCD=null; |
|
|
|
|
|
|
|
private CDWechseler cdWechseler; |
|
|
|
private String activeSource="CDDrive";//or CDWechseler |
|
|
|
|
|
|
|
@Override |
|
|
|
public void louder() { |
|
|
|
if(volume < 100) { |
|
|
@ -48,9 +51,7 @@ public class CDPlayer implements Device { |
|
|
|
List<String> playList = Arrays.asList(loadedCD.getPlayList()); |
|
|
|
int indexOfActualPlayTrack=playList.indexOf(actualPlayTrack); |
|
|
|
int indexOfNextPlayTrack=(indexOfActualPlayTrack+1)%loadedCD.getPlayList().length; |
|
|
|
//System.out.println("actualIndex= "+indexOfActualPlayTrack); |
|
|
|
this.actualPlayTrack=playList.get(indexOfNextPlayTrack ); |
|
|
|
//System.out.println("nextSong= "+actualPlayTrack); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -131,6 +132,10 @@ public class CDPlayer implements Device { |
|
|
|
} |
|
|
|
return null; |
|
|
|
} |
|
|
|
public String changePlaySource(){ |
|
|
|
this.activeSource="CDWechseler"; |
|
|
|
return activeSource; |
|
|
|
} |
|
|
|
|
|
|
|
//Getters, Setters und SupportMethods |
|
|
|
public void setCD(CD _loadedCD) { |
|
|
@ -175,8 +180,10 @@ public class CDPlayer implements Device { |
|
|
|
this.infoText=this.getClass().getSimpleName()+": Item->"+actualPlayTrack+" from Album->"+this.loadedCD.getAlbumName()+" running."; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public CD getCD() { |
|
|
|
return this.loadedCD; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |