|
@ -164,7 +164,10 @@ public class RadioPlayer implements Device { |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public String play() { |
|
|
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() { |
|
|
public String showStationInfo() { |
|
@ -186,7 +189,7 @@ public class RadioPlayer implements Device { |
|
|
if (savedPlaylist.contains(playedStation)) return "Station " + playedStation + " is already saved"; |
|
|
if (savedPlaylist.contains(playedStation)) return "Station " + playedStation + " is already saved"; |
|
|
else |
|
|
else |
|
|
savedPlaylist.add(playedStation); |
|
|
savedPlaylist.add(playedStation); |
|
|
regionPlaylist.clear(); |
|
|
|
|
|
|
|
|
regionPlaylist.clear(); |
|
|
return "Station " + playedStation + " is saved in your Station list"; |
|
|
return "Station " + playedStation + " is saved in your Station list"; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |