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 Project: TVRemoteIME   Author: kingthy   File: AbstractAVTransportService.java    License: 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 #2
Source Project: TVRemoteIME   Author: kingthy   File: AbstractAVTransportService.java    License: 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 #3
Source Project: TVRemoteIME   Author: kingthy   File: NoMediaPresent.java    License: 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 #4
Source Project: TVRemoteIME   Author: kingthy   File: Stopped.java    License: 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 #5
Source Project: TVRemoteIME   Author: kingthy   File: PausedPlay.java    License: 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 #6
Source Project: TVRemoteIME   Author: kingthy   File: Playing.java    License: 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 #7
Source Project: DroidDLNA   Author: offbye   File: AbstractAVTransportService.java    License: 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 #8
Source Project: DroidDLNA   Author: offbye   File: AbstractAVTransportService.java    License: 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 #9
Source Project: DroidDLNA   Author: offbye   File: NoMediaPresent.java    License: 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 #10
Source Project: DroidDLNA   Author: offbye   File: Stopped.java    License: 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 #11
Source Project: DroidDLNA   Author: offbye   File: PausedPlay.java    License: 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 #12
Source Project: DroidDLNA   Author: offbye   File: Playing.java    License: 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 #13
Source Project: DroidDLNA   Author: offbye   File: GetTransportInfoCallback.java    License: 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 #14
Source Project: TVRemoteIME   Author: kingthy   File: GetTransportInfo.java    License: 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 #15
Source Project: TVRemoteIME   Author: kingthy   File: AVTransportService.java    License: 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 #16
Source Project: TVRemoteIME   Author: kingthy   File: ZxtMediaPlayer.java    License: GNU General Public License v2.0 4 votes vote down vote up
synchronized public TransportInfo getCurrentTransportInfo() {
    return currentTransportInfo;
}
 
Example #17
Source Project: TVRemoteIME   Author: kingthy   File: AVTransportService.java    License: 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 #18
Source Project: HPlayer   Author: hezhubo   File: AVTransportService.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public TransportInfo getTransportInfo(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes unsignedIntegerFourBytes) throws AVTransportException {
    return null;
}
 
Example #19
Source Project: DroidDLNA   Author: offbye   File: GetTransportInfo.java    License: 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 #20
Source Project: DroidDLNA   Author: offbye   File: AVTransportService.java    License: 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 #21
Source Project: DroidDLNA   Author: offbye   File: ZxtMediaPlayer.java    License: GNU General Public License v3.0 4 votes vote down vote up
synchronized public TransportInfo getCurrentTransportInfo() {
    return currentTransportInfo;
}
 
Example #22
Source Project: DroidDLNA   Author: offbye   File: AVTransportService.java    License: 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 Project: TVRemoteIME   Author: kingthy   File: GetTransportInfo.java    License: GNU General Public License v2.0 votes vote down vote up
public abstract void received(ActionInvocation invocation, TransportInfo transportInfo); 
Example #24
Source Project: DroidDLNA   Author: offbye   File: GetTransportInfo.java    License: GNU General Public License v3.0 votes vote down vote up
public abstract void received(ActionInvocation invocation, TransportInfo transportInfo);