|
|
@ -164,7 +164,10 @@ public class RadioPlayer implements Device { |
|
|
|
|
|
|
|
@Override |
|
|
|
public String play() { |
|
|
|
return ("Radio is playing station: 0" + (savedPlaylist.indexOf(playedStation) + 1) + " " + this.playedStation); |
|
|
|
if (regionPlaylist.contains(playedStation)) |
|
|
|
return ("Radio is playing station: 0" + (regionPlaylist.indexOf(playedStation) + 1) + " " + this.playedStation + " from regional playlist"); |
|
|
|
else |
|
|
|
return ("Radio is playing station: 0" + (savedPlaylist.indexOf(playedStation) + 1) + " " + this.playedStation + " from saved playlist"); |
|
|
|
} |
|
|
|
|
|
|
|
public String showStationInfo() { |
|
|
@ -186,7 +189,7 @@ public class RadioPlayer implements Device { |
|
|
|
if (savedPlaylist.contains(playedStation)) return "Station " + playedStation + " is already saved"; |
|
|
|
else |
|
|
|
savedPlaylist.add(playedStation); |
|
|
|
regionPlaylist.clear(); |
|
|
|
regionPlaylist.clear(); |
|
|
|
return "Station " + playedStation + " is saved in your Station list"; |
|
|
|
} |
|
|
|
} |