synchronized public TransportAction[] getCurrentTransportActions() { TransportState state = currentTransportInfo.getCurrentTransportState(); TransportAction[] actions; switch (state) { case STOPPED: actions = new TransportAction[]{ TransportAction.Play }; break; case PLAYING: actions = new TransportAction[]{ TransportAction.Stop, TransportAction.Pause, TransportAction.Seek }; break; case PAUSED_PLAYBACK: actions = new TransportAction[]{ TransportAction.Stop, TransportAction.Pause, TransportAction.Seek, TransportAction.Play }; break; default: actions = null; } return actions; }
public void onEntry() { log.fine("Setting transport state to PAUSED_PLAYBACK"); getTransport().setTransportInfo( new TransportInfo( TransportState.PAUSED_PLAYBACK, getTransport().getTransportInfo().getCurrentTransportStatus(), getTransport().getTransportInfo().getCurrentSpeed() ) ); getTransport().getLastChange().setEventedValue( getTransport().getInstanceId(), new AVTransportVariable.TransportState(TransportState.PAUSED_PLAYBACK), new AVTransportVariable.CurrentTransportActions(getCurrentTransportActions()) ); }
synchronized protected void transportStateChanged(TransportState newState) { TransportState currentTransportState = currentTransportInfo.getCurrentTransportState(); log.fine("Current state is: " + currentTransportState + ", changing to new state: " + newState); currentTransportInfo = new TransportInfo(newState); getAvTransportLastChange().setEventedValue( getInstanceId(), new AVTransportVariable.TransportState(newState), new AVTransportVariable.CurrentTransportActions(getCurrentTransportActions()) ); }
new AVTransportVariable.RecordMediumWriteStatus(mediaInfo.getWriteStatus()), new AVTransportVariable.RecordStorageMedium(mediaInfo.getRecordMedium()), new AVTransportVariable.TransportPlaySpeed(transportInfo.getCurrentSpeed()), new AVTransportVariable.TransportState(transportInfo.getCurrentTransportState()), new AVTransportVariable.TransportStatus(transportInfo.getCurrentTransportStatus()) );
public void success(ActionInvocation invocation) { TransportInfo transportInfo = new TransportInfo(invocation.getOutputMap()); received(invocation, transportInfo); }
new AVTransportVariable.RecordMediumWriteStatus(mediaInfo.getWriteStatus()), new AVTransportVariable.RecordStorageMedium(mediaInfo.getRecordMedium()), new AVTransportVariable.TransportPlaySpeed(transportInfo.getCurrentSpeed()), new AVTransportVariable.TransportState(transportInfo.getCurrentTransportState()), new AVTransportVariable.TransportStatus(transportInfo.getCurrentTransportStatus()) );
synchronized protected void transportStateChanged(TransportState newState) { TransportState currentTransportState = currentTransportInfo.getCurrentTransportState(); log.fine("Current state is: " + currentTransportState + ", changing to new state: " + newState); currentTransportInfo = new TransportInfo(newState); getAvTransportLastChange().setEventedValue( getInstanceId(), new AVTransportVariable.TransportState(newState), new AVTransportVariable.CurrentTransportActions(getCurrentTransportActions()) ); }
public AVTransport(UnsignedIntegerFourBytes instanceID, LastChange lastChange, StorageMedium[] possiblePlayMedia) { this.instanceID = instanceID; this.lastChange = lastChange; setDeviceCapabilities(new DeviceCapabilities(possiblePlayMedia)); setMediaInfo(new MediaInfo()); setTransportInfo(new TransportInfo()); setPositionInfo(new PositionInfo()); setTransportSettings(new TransportSettings()); }
public void onEntry() { log.fine("Setting transport state to NO_MEDIA_PRESENT"); getTransport().setTransportInfo( new TransportInfo( TransportState.NO_MEDIA_PRESENT, getTransport().getTransportInfo().getCurrentTransportStatus(), getTransport().getTransportInfo().getCurrentSpeed() ) ); getTransport().getLastChange().setEventedValue( getTransport().getInstanceId(), new AVTransportVariable.TransportState(TransportState.NO_MEDIA_PRESENT), new AVTransportVariable.CurrentTransportActions(getCurrentTransportActions()) ); }
new AVTransportVariable.RecordMediumWriteStatus(mediaInfo.getWriteStatus()), new AVTransportVariable.RecordStorageMedium(mediaInfo.getRecordMedium()), new AVTransportVariable.TransportPlaySpeed(transportInfo.getCurrentSpeed()), new AVTransportVariable.TransportState(transportInfo.getCurrentTransportState()), new AVTransportVariable.TransportStatus(transportInfo.getCurrentTransportStatus()) );
synchronized public void stopAllMediaPlayers() { for (GstMediaPlayer mediaPlayer : mediaPlayers.values()) { TransportState state = mediaPlayer.getCurrentTransportInfo().getCurrentTransportState(); if (!state.equals(TransportState.NO_MEDIA_PRESENT) || state.equals(TransportState.STOPPED)) { MediaRenderer.APP.log(Level.FINE, "Stopping player instance: " + mediaPlayer.getInstanceId()); mediaPlayer.stop(); } } }
public void success(ActionInvocation invocation) { TransportInfo transportInfo = new TransportInfo(invocation.getOutputMap()); received(invocation, transportInfo); }
public void onEntry() { log.fine("Setting transport state to PLAYING"); getTransport().setTransportInfo( new TransportInfo( TransportState.PLAYING, getTransport().getTransportInfo().getCurrentTransportStatus(), getTransport().getTransportInfo().getCurrentSpeed() ) ); getTransport().getLastChange().setEventedValue( getTransport().getInstanceId(), new AVTransportVariable.TransportState(TransportState.PLAYING), new AVTransportVariable.CurrentTransportActions(getCurrentTransportActions()) ); }
synchronized public TransportAction[] getCurrentTransportActions() { TransportState state = currentTransportInfo.getCurrentTransportState(); TransportAction[] actions; switch (state) { case STOPPED: actions = new TransportAction[]{ TransportAction.Play }; break; case PLAYING: actions = new TransportAction[]{ TransportAction.Stop, TransportAction.Pause, TransportAction.Seek }; break; case PAUSED_PLAYBACK: actions = new TransportAction[]{ TransportAction.Stop, TransportAction.Pause, TransportAction.Seek, TransportAction.Play }; break; default: actions = null; } return actions; }
public AVTransport(UnsignedIntegerFourBytes instanceID, LastChange lastChange, StorageMedium[] possiblePlayMedia) { this.instanceID = instanceID; this.lastChange = lastChange; setDeviceCapabilities(new DeviceCapabilities(possiblePlayMedia)); setMediaInfo(new MediaInfo()); setTransportInfo(new TransportInfo()); setPositionInfo(new PositionInfo()); setTransportSettings(new TransportSettings()); }
public void onEntry() { log.fine("Setting transport state to STOPPED"); getTransport().setTransportInfo( new TransportInfo( TransportState.STOPPED, getTransport().getTransportInfo().getCurrentTransportStatus(), getTransport().getTransportInfo().getCurrentSpeed() ) ); getTransport().getLastChange().setEventedValue( getTransport().getInstanceId(), new AVTransportVariable.TransportState(TransportState.STOPPED), new AVTransportVariable.CurrentTransportActions(getCurrentTransportActions()) ); }
synchronized public void stopAllMediaPlayers() { for (ZxtMediaPlayer mediaPlayer : mediaPlayers.values()) { TransportState state = mediaPlayer.getCurrentTransportInfo().getCurrentTransportState(); if (!state.equals(TransportState.NO_MEDIA_PRESENT) || state.equals(TransportState.STOPPED)) { Log.i(TAG, "Stopping player instance: " + mediaPlayer.getInstanceId()); // mediaPlayer.stop(); } } }
@Override public void received(ActionInvocation invocation, Map<String, Object> result) { TransportInfo transportInfo = new TransportInfo( invocation.getOutputMap()); onSuccess(transportInfo); }
public void onEntry() { log.fine("Setting transport state to STOPPED"); getTransport().setTransportInfo( new TransportInfo( TransportState.STOPPED, getTransport().getTransportInfo().getCurrentTransportStatus(), getTransport().getTransportInfo().getCurrentSpeed() ) ); getTransport().getLastChange().setEventedValue( getTransport().getInstanceId(), new AVTransportVariable.TransportState(TransportState.STOPPED), new AVTransportVariable.CurrentTransportActions(getCurrentTransportActions()) ); }
public void setTransportInfo(TransportInfo transportInfo) { this.transportInfo = transportInfo; if (transportInfo.getCurrentTransportState() == TransportState.PAUSED_PLAYBACK || transportInfo.getCurrentTransportState() == TransportState.PAUSED_RECORDING) setState(State.PAUSE); else if (transportInfo.getCurrentTransportState() == TransportState.PLAYING) setState(State.PLAY); else // if(transportInfo.getCurrentTransportState() == TransportState.STOPPED) setState(State.STOP); }