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

The following examples show how to use org.fourthline.cling.support.model.PositionInfo. 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: ZxtMediaPlayer.java    From DroidDLNA with GNU General Public License v3.0 6 votes vote down vote up
synchronized public void setURI(URI uri, String type, String name, String currentURIMetaData) {
    Log.i(TAG, "setURI " + uri);

    currentMediaInfo = new MediaInfo(uri.toString(),currentURIMetaData);
    currentPositionInfo = new PositionInfo(1, "", uri.toString());

    getAvTransportLastChange().setEventedValue(getInstanceId(),
            new AVTransportVariable.AVTransportURI(uri),
            new AVTransportVariable.CurrentTrackURI(uri));

    transportStateChanged(TransportState.STOPPED);
    
    GPlayer.setMediaListener(new GstMediaListener());
    
    Intent intent = new Intent();
    intent.setClass(mContext, RenderPlayerService.class);
    intent.putExtra("type", type);
    intent.putExtra("name", name);
    intent.putExtra("playURI", uri.toString());
    mContext.startService(intent);
}
 
Example #2
Source File: ZxtMediaPlayer.java    From TVRemoteIME with GNU General Public License v2.0 6 votes vote down vote up
synchronized public void setURI(URI uri, String type, String name, String currentURIMetaData) {
    Log.i(TAG, "setURI " + uri);

    currentMediaInfo = new MediaInfo(uri.toString(),currentURIMetaData);
    currentPositionInfo = new PositionInfo(1, "", uri.toString());

    getAvTransportLastChange().setEventedValue(getInstanceId(),
            new AVTransportVariable.AVTransportURI(uri),
            new AVTransportVariable.CurrentTrackURI(uri));

    transportStateChanged(TransportState.STOPPED);
    
    IJKPlayer.setMediaListener(new GstMediaListener());
    
    Intent intent = new Intent();
    intent.setClass(mContext, RenderPlayerService.class);
    intent.putExtra("type", type);
    intent.putExtra("name", name);
    intent.putExtra("playURI", uri.toString());
    mContext.startService(intent);
}
 
Example #3
Source File: AbstractAVTransportService.java    From TVRemoteIME with GNU General Public License v2.0 5 votes vote down vote up
@UpnpAction(out = {
        @UpnpOutputArgument(name = "Track", stateVariable = "CurrentTrack", getterName = "getTrack"),
        @UpnpOutputArgument(name = "TrackDuration", stateVariable = "CurrentTrackDuration", getterName = "getTrackDuration"),
        @UpnpOutputArgument(name = "TrackMetaData", stateVariable = "CurrentTrackMetaData", getterName = "getTrackMetaData"),
        @UpnpOutputArgument(name = "TrackURI", stateVariable = "CurrentTrackURI", getterName = "getTrackURI"),
        @UpnpOutputArgument(name = "RelTime", stateVariable = "RelativeTimePosition", getterName = "getRelTime"),
        @UpnpOutputArgument(name = "AbsTime", stateVariable = "AbsoluteTimePosition", getterName = "getAbsTime"),
        @UpnpOutputArgument(name = "RelCount", stateVariable = "RelativeCounterPosition", getterName = "getRelCount"),
        @UpnpOutputArgument(name = "AbsCount", stateVariable = "AbsoluteCounterPosition", getterName = "getAbsCount")
})
public abstract PositionInfo getPositionInfo(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes instanceId)
        throws AVTransportException;
 
Example #4
Source File: ZxtMediaPlayer.java    From DroidDLNA with GNU General Public License v3.0 5 votes vote down vote up
public void positionChanged(int position) {
    log.fine("Position Changed event received: " + position);
    synchronized (ZxtMediaPlayer.this) {
        currentPositionInfo = new PositionInfo(1, currentMediaInfo.getMediaDuration(),
                currentMediaInfo.getCurrentURI(), ModelUtil.toTimeString(position/1000),
                ModelUtil.toTimeString(position/1000));
    }
}
 
Example #5
Source File: GetPositionInfoCallback.java    From DroidDLNA with GNU General Public License v3.0 5 votes vote down vote up
public void received(ActionInvocation paramActionInvocation,
		PositionInfo paramPositionInfo) {
	Bundle localBundle = new Bundle();
	localBundle.putString("TrackDuration",
			paramPositionInfo.getTrackDuration());
	localBundle.putString("RelTime", paramPositionInfo.getRelTime());
	Intent localIntent = new Intent(Action.PLAY_UPDATE);
	localIntent.putExtras(localBundle);
	activity.sendBroadcast(localIntent);
}
 
Example #6
Source File: AbstractAVTransportService.java    From DroidDLNA with GNU General Public License v3.0 5 votes vote down vote up
@UpnpAction(out = {
        @UpnpOutputArgument(name = "Track", stateVariable = "CurrentTrack", getterName = "getTrack"),
        @UpnpOutputArgument(name = "TrackDuration", stateVariable = "CurrentTrackDuration", getterName = "getTrackDuration"),
        @UpnpOutputArgument(name = "TrackMetaData", stateVariable = "CurrentTrackMetaData", getterName = "getTrackMetaData"),
        @UpnpOutputArgument(name = "TrackURI", stateVariable = "CurrentTrackURI", getterName = "getTrackURI"),
        @UpnpOutputArgument(name = "RelTime", stateVariable = "RelativeTimePosition", getterName = "getRelTime"),
        @UpnpOutputArgument(name = "AbsTime", stateVariable = "AbsoluteTimePosition", getterName = "getAbsTime"),
        @UpnpOutputArgument(name = "RelCount", stateVariable = "RelativeCounterPosition", getterName = "getRelCount"),
        @UpnpOutputArgument(name = "AbsCount", stateVariable = "AbsoluteCounterPosition", getterName = "getAbsCount")
})
public abstract PositionInfo getPositionInfo(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes instanceId)
        throws AVTransportException;
 
Example #7
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 #8
Source File: ZxtMediaPlayer.java    From TVRemoteIME with GNU General Public License v2.0 5 votes vote down vote up
public void positionChanged(int position) {
    log.fine("Position Changed event received: " + position);
    synchronized (ZxtMediaPlayer.this) {
        currentPositionInfo = new PositionInfo(1, currentMediaInfo.getMediaDuration(),
                currentMediaInfo.getCurrentURI(), ModelUtil.toTimeString(position/1000),
                ModelUtil.toTimeString(position/1000));
    }
}
 
Example #9
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 #10
Source File: AVTransportService.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
@Override
public PositionInfo getPositionInfo(UnsignedIntegerFourBytes instanceId) throws AVTransportException {
    return getInstance(instanceId).getCurrentPositionInfo();
}
 
Example #11
Source File: AVTransportService.java    From HPlayer with Apache License 2.0 4 votes vote down vote up
@Override
public PositionInfo getPositionInfo(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes unsignedIntegerFourBytes) throws AVTransportException {
    return null;
}
 
Example #12
Source File: ZxtMediaPlayer.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
synchronized public PositionInfo getCurrentPositionInfo() {
    return currentPositionInfo;
}
 
Example #13
Source File: AVTransportService.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
public PositionInfo getPositionInfo(UnsignedIntegerFourBytes instanceId) throws AVTransportException {
    return findStateMachine(instanceId).getCurrentState().getTransport().getPositionInfo();
}
 
Example #14
Source File: GetPositionInfo.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
public void success(ActionInvocation invocation) {
    PositionInfo positionInfo = new PositionInfo(invocation.getOutputMap());
    received(invocation, positionInfo);
}
 
Example #15
Source File: AVTransportService.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
public PositionInfo getPositionInfo(UnsignedIntegerFourBytes instanceId) throws AVTransportException {
    return findStateMachine(instanceId).getCurrentState().getTransport().getPositionInfo();
}
 
Example #16
Source File: ZxtMediaPlayer.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
synchronized public PositionInfo getCurrentPositionInfo() {
    return currentPositionInfo;
}
 
Example #17
Source File: GetPositionInfo.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
public void success(ActionInvocation invocation) {
    PositionInfo positionInfo = new PositionInfo(invocation.getOutputMap());
    received(invocation, positionInfo);
}
 
Example #18
Source File: AVTransportService.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
@Override
public PositionInfo getPositionInfo(UnsignedIntegerFourBytes instanceId) throws AVTransportException {
    return getInstance(instanceId).getCurrentPositionInfo();
}
 
Example #19
Source File: GetPositionInfo.java    From DroidDLNA with GNU General Public License v3.0 votes vote down vote up
public abstract void received(ActionInvocation invocation, PositionInfo positionInfo); 
Example #20
Source File: GetPositionInfo.java    From TVRemoteIME with GNU General Public License v2.0 votes vote down vote up
public abstract void received(ActionInvocation invocation, PositionInfo positionInfo);