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

The following examples show how to use org.fourthline.cling.support.model.TransportSettings. 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
@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 File: AVTransportService.java    From TVRemoteIME with GNU General Public License v2.0 5 votes vote down vote up
public void setPlayMode(UnsignedIntegerFourBytes instanceId, String newPlayMode) throws AVTransportException {
    AVTransport transport = findStateMachine(instanceId).getCurrentState().getTransport();
    try {
        transport.setTransportSettings(
                new TransportSettings(
                        PlayMode.valueOf(newPlayMode),
                        transport.getTransportSettings().getRecQualityMode()
                )
        );
    } catch (IllegalArgumentException ex) {
        throw new AVTransportException(
                AVTransportErrorCode.PLAYMODE_NOT_SUPPORTED, "Unsupported play mode: " + newPlayMode
        );
    }
}
 
Example #3
Source File: AVTransportService.java    From TVRemoteIME with GNU General Public License v2.0 5 votes vote down vote up
public void setRecordQualityMode(UnsignedIntegerFourBytes instanceId, String newRecordQualityMode) throws AVTransportException {
    AVTransport transport = findStateMachine(instanceId).getCurrentState().getTransport();
    try {
        transport.setTransportSettings(
                new TransportSettings(
                        transport.getTransportSettings().getPlayMode(),
                        RecordQualityMode.valueOrExceptionOf(newRecordQualityMode)
                )
        );
    } catch (IllegalArgumentException ex) {
        throw new AVTransportException(
                AVTransportErrorCode.RECORDQUALITYMODE_NOT_SUPPORTED, "Unsupported record quality mode: " + newRecordQualityMode
        );
    }
}
 
Example #4
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 #5
Source File: AVTransportService.java    From DroidDLNA with GNU General Public License v3.0 5 votes vote down vote up
public void setPlayMode(UnsignedIntegerFourBytes instanceId, String newPlayMode) throws AVTransportException {
    AVTransport transport = findStateMachine(instanceId).getCurrentState().getTransport();
    try {
        transport.setTransportSettings(
                new TransportSettings(
                        PlayMode.valueOf(newPlayMode),
                        transport.getTransportSettings().getRecQualityMode()
                )
        );
    } catch (IllegalArgumentException ex) {
        throw new AVTransportException(
                AVTransportErrorCode.PLAYMODE_NOT_SUPPORTED, "Unsupported play mode: " + newPlayMode
        );
    }
}
 
Example #6
Source File: AVTransportService.java    From DroidDLNA with GNU General Public License v3.0 5 votes vote down vote up
public void setRecordQualityMode(UnsignedIntegerFourBytes instanceId, String newRecordQualityMode) throws AVTransportException {
    AVTransport transport = findStateMachine(instanceId).getCurrentState().getTransport();
    try {
        transport.setTransportSettings(
                new TransportSettings(
                        transport.getTransportSettings().getPlayMode(),
                        RecordQualityMode.valueOrExceptionOf(newRecordQualityMode)
                )
        );
    } catch (IllegalArgumentException ex) {
        throw new AVTransportException(
                AVTransportErrorCode.RECORDQUALITYMODE_NOT_SUPPORTED, "Unsupported record quality mode: " + newRecordQualityMode
        );
    }
}
 
Example #7
Source File: AbstractAVTransportService.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
@UpnpAction(out = {
        @UpnpOutputArgument(name = "PlayMode", stateVariable = "CurrentPlayMode", getterName = "getPlayMode"),
        @UpnpOutputArgument(name = "RecQualityMode", stateVariable = "CurrentRecordQualityMode", getterName = "getRecQualityMode")
})
public abstract TransportSettings getTransportSettings(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes instanceId)
        throws AVTransportException;
 
Example #8
Source File: AVTransportService.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
public TransportSettings getTransportSettings(UnsignedIntegerFourBytes instanceId) throws AVTransportException {
    return findStateMachine(instanceId).getCurrentState().getTransport().getTransportSettings();
}
 
Example #9
Source File: AVTransportService.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
@Override
public TransportSettings getTransportSettings(UnsignedIntegerFourBytes instanceId) throws AVTransportException {
    getInstance(instanceId);
    return new TransportSettings(PlayMode.NORMAL);
}
 
Example #10
Source File: AVTransportService.java    From HPlayer with Apache License 2.0 4 votes vote down vote up
@Override
public TransportSettings getTransportSettings(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes unsignedIntegerFourBytes) throws AVTransportException {
    return null;
}
 
Example #11
Source File: AbstractAVTransportService.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
@UpnpAction(out = {
        @UpnpOutputArgument(name = "PlayMode", stateVariable = "CurrentPlayMode", getterName = "getPlayMode"),
        @UpnpOutputArgument(name = "RecQualityMode", stateVariable = "CurrentRecordQualityMode", getterName = "getRecQualityMode")
})
public abstract TransportSettings getTransportSettings(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes instanceId)
        throws AVTransportException;
 
Example #12
Source File: AVTransportService.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
public TransportSettings getTransportSettings(UnsignedIntegerFourBytes instanceId) throws AVTransportException {
    return findStateMachine(instanceId).getCurrentState().getTransport().getTransportSettings();
}
 
Example #13
Source File: AVTransportService.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
@Override
public TransportSettings getTransportSettings(UnsignedIntegerFourBytes instanceId) throws AVTransportException {
    getInstance(instanceId);
    return new TransportSettings(PlayMode.NORMAL);
}