feat: refactor out MusicPlayerEngine
This commit is contained in:
26
app/src/main/java/at/lockstep/player/pasada/PasadaState.java
Normal file
26
app/src/main/java/at/lockstep/player/pasada/PasadaState.java
Normal file
@@ -0,0 +1,26 @@
|
||||
package at.lockstep.player.pasada;
|
||||
|
||||
/** Mirrors the libpasada state machine documented in DESIGN.md. */
|
||||
public enum PasadaState {
|
||||
LOADED(0),
|
||||
INITIALIZED(1),
|
||||
PLAYING(2),
|
||||
PAUSED(3),
|
||||
FINISHED(4),
|
||||
STOPPED(5);
|
||||
|
||||
public final int code;
|
||||
|
||||
PasadaState(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public static PasadaState fromCode(int code) {
|
||||
for (PasadaState state : values()) {
|
||||
if (state.code == code) {
|
||||
return state;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unknown PasadaState code: " + code);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user