Tune samples and update ref docs
- Fix cplayer play logic depending if we pressed eject or play. - Updates to ref docs.
This commit is contained in:
@@ -196,6 +196,7 @@ public class Application {
|
||||
@Override
|
||||
public void execute(StateContext<States, Events> context) {
|
||||
if (context.getTransition() != null
|
||||
&& context.getEvent() == Events.PLAY
|
||||
&& context.getTransition().getTarget().getId() == States.CLOSED
|
||||
&& context.getExtendedState().getVariables().get(Variables.CD) != null) {
|
||||
context.getStateMachine().sendEvent(Events.PLAY);
|
||||
|
||||
@@ -91,7 +91,7 @@ public class CdPlayer {
|
||||
}
|
||||
|
||||
//tag::snippetB[]
|
||||
@StatesOnTransition(target = States.CLOSED)
|
||||
@StatesOnTransition(target = {States.CLOSED, States.IDLE})
|
||||
public void closed(ExtendedState extendedState) {
|
||||
Object cd = extendedState.getVariables().get(Variables.CD);
|
||||
if (cd != null) {
|
||||
|
||||
Reference in New Issue
Block a user