added entertainment class
This commit is contained in:
parent
4758ff07fa
commit
a8acb3aca9
1 changed files with 22 additions and 0 deletions
22
Entertainment.java
Normal file
22
Entertainment.java
Normal file
|
@ -0,0 +1,22 @@
|
|||
import java.lang.Class;
|
||||
|
||||
public class Entertainment {
|
||||
public String activeMediaSource;
|
||||
public String[] nowPlayingMetadata;
|
||||
public boolean playState; //true for playing, false for paused
|
||||
|
||||
public Entertainment(String[] sourceParams) { //loads previously played media source at instantiation, Vehicle class handles storing data
|
||||
selectSource(sourceParams[0], sourceParams[1]);
|
||||
}
|
||||
|
||||
public void selectSource(String source, String params) {
|
||||
//source is a string selection from RADIO, USB, AUX, BLUETOOTH
|
||||
//params are a delimited string with a URI and metadata
|
||||
activeMediaSource = source;
|
||||
nowPlayingMetadata = params.split(";", 0);
|
||||
}
|
||||
|
||||
public String[] getMetadata() {
|
||||
return nowPlayingMetadata;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue