org.fourthline.cling.support.model.TransportInfo Java Examples

The following examples show how to use org.fourthline.cling.support.model.TransportInfo. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractAVTransportService.java    From TVRemoteIME with GNU General Public License v2.0 5 votes vote down vote up
@UpnpAction(out = {
        @UpnpOutputArgument(name = "CurrentTransportState", stateVariable = "TransportState", getterName = "getCurrentTransportState"),
        @UpnpOutputArgument(name = "CurrentTransportStatus", stateVariable = "TransportStatus", getterName = "getCurrentTransportStatus"),
        @UpnpOutputArgument(name = "CurrentSpeed", stateVariable = "TransportPlaySpeed", getterName = "getCurrentSpeed")
})
public abstract TransportInfo getTransportInfo(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes instanceId)
        throws AVTransportException;
 
Example #2
Source File: GetTransportInfoCallback.java    From DroidDLNA with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void received(ActionInvocation paramActionInvocation, TransportInfo paramTransportInfo) {
    Log.e("GetTransportInfoCallback", "" + paramTransportInfo.getCurrentTransportState());
    Log.e("GetTransportInfoCallback", "" + paramTransportInfo.getCurrentTransportStatus());
    Log.e("isOnlyGetState", Boolean.toString(this.isOnlyGetState));
    handler.sendEmptyMessage(DMCControlMessage.SETURL);
    
    //TODO
    //XGF
    
    // if (!this.isOnlyGetState)
    // if (paramTransportInfo.getCurrentTransportState() ==
    // TransportState.NO_MEDIA_PRESENT
    // || paramTransportInfo.getCurrentTransportState() ==
    // TransportState.STOPPED
    // || paramTransportInfo.getCurrentTransportState() ==
    // TransportState.PAUSED_PLAYBACK) {
    // this.handler.sendEmptyMessage(DMCControlMessage.SETURL);
    // } else if (paramTransportInfo.getCurrentTransportState() ==
    // TransportState.PLAYING) {
    // this.handler.sendEmptyMessage(DMCControlMessage.STOP);
    // } else if (paramTransportInfo.getCurrentTransportStatus() ==
    // TransportStatus.CUSTOM) {
    // this.handler.sendEmptyMessage(DMCControlMessage.CONNECTIONFAILED);
    // } else if (paramTransportInfo.getCurrentTransportState() ==
    // TransportState.NO_MEDIA_PRESENT) {
    // this.handler.sendEmptyMessage(DMCControlMessage.REMOTE_NOMEDIA);
    // }
}
 
Example #3
Source File: Playing.java    From DroidDLNA with GNU General Public License v3.0 5 votes vote down vote up
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())
    );
}
 
Example #4
Source File: PausedPlay.java    From DroidDLNA with GNU General Public License v3.0 5 votes vote down vote up
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())
    );
}
 
Example #5
Source File: Stopped.java    From DroidDLNA with GNU General Public License v3.0 5 votes vote down vote up
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())
    );
}
 
Example #6
Source File: NoMediaPresent.java    From DroidDLNA with GNU General Public License v3.0 5 votes vote down vote up
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())
    );
}
 
Example #7
Source File: AbstractAVTransportService.java    From DroidDLNA with GNU General Public License v3.0 5 votes vote down vote up
@UpnpAction(out = {
        @UpnpOutputArgument(name = "CurrentTransportState", stateVariable = "TransportState", getterName = "getCurrentTransportState"),
        @UpnpOutputArgument(name = "CurrentTransportStatus", stateVariable = "TransportStatus", getterName = "getCurrentTransportStatus"),
        @UpnpOutputArgument(name = "CurrentSpeed", stateVariable = "TransportPlaySpeed", getterName = "getCurrentSpeed")
})
public abstract TransportInfo getTransportInfo(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes instanceId)
        throws AVTransportException;
 
Example #8
Source File: AbstractAVTransportService.java    From DroidDLNA with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void appendCurrentState(LastChange lc, UnsignedIntegerFourBytes instanceId) throws Exception {

    MediaInfo mediaInfo = getMediaInfo(instanceId);
    TransportInfo transportInfo = getTransportInfo(instanceId);
    TransportSettings transportSettings = getTransportSettings(instanceId);
    PositionInfo positionInfo = getPositionInfo(instanceId);
    DeviceCapabilities deviceCaps = getDeviceCapabilities(instanceId);

    lc.setEventedValue(
            instanceId,
            new AVTransportVariable.AVTransportURI(URI.create(mediaInfo.getCurrentURI())),
            new AVTransportVariable.AVTransportURIMetaData(mediaInfo.getCurrentURIMetaData()),
            new AVTransportVariable.CurrentMediaDuration(mediaInfo.getMediaDuration()),
            new AVTransportVariable.CurrentPlayMode(transportSettings.getPlayMode()),
            new AVTransportVariable.CurrentRecordQualityMode(transportSettings.getRecQualityMode()),
            new AVTransportVariable.CurrentTrack(positionInfo.getTrack()),
            new AVTransportVariable.CurrentTrackDuration(positionInfo.getTrackDuration()),
            new AVTransportVariable.CurrentTrackMetaData(positionInfo.getTrackMetaData()),
            new AVTransportVariable.CurrentTrackURI(URI.create(positionInfo.getTrackURI())),
            new AVTransportVariable.CurrentTransportActions(getCurrentTransportActions(instanceId)),
            new AVTransportVariable.NextAVTransportURI(URI.create(mediaInfo.getNextURI())),
            new AVTransportVariable.NextAVTransportURIMetaData(mediaInfo.getNextURIMetaData()),
            new AVTransportVariable.NumberOfTracks(mediaInfo.getNumberOfTracks()),
            new AVTransportVariable.PossiblePlaybackStorageMedia(deviceCaps.getPlayMedia()),
            new AVTransportVariable.PossibleRecordQualityModes(deviceCaps.getRecQualityModes()),
            new AVTransportVariable.PossibleRecordStorageMedia(deviceCaps.getRecMedia()),
            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())
    );
}
 
Example #9
Source File: Playing.java    From TVRemoteIME with GNU General Public License v2.0 5 votes vote down vote up
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())
    );
}
 
Example #10
Source File: PausedPlay.java    From TVRemoteIME with GNU General Public License v2.0 5 votes vote down vote up
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())
    );
}
 
Example #11
Source File: Stopped.java    From TVRemoteIME with GNU General Public License v2.0 5 votes vote down vote up
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())
    );
}
 
Example #12
Source File: NoMediaPresent.java    From TVRemoteIME with GNU General Public License v2.0 5 votes vote down vote up
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())
    );
}
 
Example #13
Source File: AbstractAVTransportService.java    From TVRemoteIME with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void appendCurrentState(LastChange lc, UnsignedIntegerFourBytes instanceId) throws Exception {

    MediaInfo mediaInfo = getMediaInfo(instanceId);
    TransportInfo transportInfo = getTransportInfo(instanceId);
    TransportSettings transportSettings = getTransportSettings(instanceId);
    PositionInfo positionInfo = getPositionInfo(instanceId);
    DeviceCapabilities deviceCaps = getDeviceCapabilities(instanceId);

    lc.setEventedValue(
            instanceId,
            new AVTransportVariable.AVTransportURI(URI.create(mediaInfo.getCurrentURI())),
            new AVTransportVariable.AVTransportURIMetaData(mediaInfo.getCurrentURIMetaData()),
            new AVTransportVariable.CurrentMediaDuration(mediaInfo.getMediaDuration()),
            new AVTransportVariable.CurrentPlayMode(transportSettings.getPlayMode()),
            new AVTransportVariable.CurrentRecordQualityMode(transportSettings.getRecQualityMode()),
            new AVTransportVariable.CurrentTrack(positionInfo.getTrack()),
            new AVTransportVariable.CurrentTrackDuration(positionInfo.getTrackDuration()),
            new AVTransportVariable.CurrentTrackMetaData(positionInfo.getTrackMetaData()),
            new AVTransportVariable.CurrentTrackURI(URI.create(positionInfo.getTrackURI())),
            new AVTransportVariable.CurrentTransportActions(getCurrentTransportActions(instanceId)),
            new AVTransportVariable.NextAVTransportURI(URI.create(mediaInfo.getNextURI())),
            new AVTransportVariable.NextAVTransportURIMetaData(mediaInfo.getNextURIMetaData()),
            new AVTransportVariable.NumberOfTracks(mediaInfo.getNumberOfTracks()),
            new AVTransportVariable.PossiblePlaybackStorageMedia(deviceCaps.getPlayMedia()),
            new AVTransportVariable.PossibleRecordQualityModes(deviceCaps.getRecQualityModes()),
            new AVTransportVariable.PossibleRecordStorageMedia(deviceCaps.getRecMedia()),
            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())
    );
}
 
Example #14
Source File: ZxtMediaPlayer.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
synchronized public TransportInfo getCurrentTransportInfo() {
    return currentTransportInfo;
}
 
Example #15
Source File: AVTransportService.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
@Override
public TransportInfo getTransportInfo(UnsignedIntegerFourBytes instanceId) throws AVTransportException {
    return getInstance(instanceId).getCurrentTransportInfo();
}
 
Example #16
Source File: AVTransportService.java    From HPlayer with Apache License 2.0 4 votes vote down vote up
@Override
public TransportInfo getTransportInfo(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes unsignedIntegerFourBytes) throws AVTransportException {
    return null;
}
 
Example #17
Source File: GetTransportInfo.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
public void success(ActionInvocation invocation) {
    TransportInfo transportInfo = new TransportInfo(invocation.getOutputMap());
    received(invocation, transportInfo);
}
 
Example #18
Source File: AVTransportService.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
public TransportInfo getTransportInfo(UnsignedIntegerFourBytes instanceId) throws AVTransportException {
    return findStateMachine(instanceId).getCurrentState().getTransport().getTransportInfo();
}
 
Example #19
Source File: AVTransportService.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
public TransportInfo getTransportInfo(UnsignedIntegerFourBytes instanceId) throws AVTransportException {
    return findStateMachine(instanceId).getCurrentState().getTransport().getTransportInfo();
}
 
Example #20
Source File: GetTransportInfo.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
public void success(ActionInvocation invocation) {
    TransportInfo transportInfo = new TransportInfo(invocation.getOutputMap());
    received(invocation, transportInfo);
}
 
Example #21
Source File: ZxtMediaPlayer.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
synchronized public TransportInfo getCurrentTransportInfo() {
    return currentTransportInfo;
}
 
Example #22
Source File: AVTransportService.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
@Override
public TransportInfo getTransportInfo(UnsignedIntegerFourBytes instanceId) throws AVTransportException {
    return getInstance(instanceId).getCurrentTransportInfo();
}
 
Example #23
Source File: GetTransportInfo.java    From DroidDLNA with GNU General Public License v3.0 votes vote down vote up
public abstract void received(ActionInvocation invocation, TransportInfo transportInfo); 
Example #24
Source File: GetTransportInfo.java    From TVRemoteIME with GNU General Public License v2.0 votes vote down vote up
public abstract void received(ActionInvocation invocation, TransportInfo transportInfo);