本文整理汇总了Java中org.fourthline.cling.support.model.PositionInfo类的典型用法代码示例。如果您正苦于以下问题:Java PositionInfo类的具体用法?Java PositionInfo怎么用?Java PositionInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PositionInfo类属于org.fourthline.cling.support.model包,在下文中一共展示了PositionInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setTransportURI
import org.fourthline.cling.support.model.PositionInfo; //导入依赖的package包/类
@Override
public Class<? extends AbstractState<?>> setTransportURI(URI uri,
String metaData) {
Log.d(this.getClass().getName(), "Set TransportURI");
Log.d(this.getClass().getName(), "uri: " + uri);
Log.d(this.getClass().getName(), "metaData: " + metaData);
getTransport().setMediaInfo(new MediaInfo(uri.toString(), metaData));
// If you can, you should find and set the duration of the track here!
getTransport().setPositionInfo(
new PositionInfo(1, metaData, uri.toString()));
// It's up to you what "last changes" you want to announce to event
// listeners
getTransport().getLastChange().setEventedValue(
getTransport().getInstanceId(),
new AVTransportVariable.AVTransportURI(uri),
new AVTransportVariable.CurrentTrackURI(uri));
return AvTransportMediaRendererStopped.class;
}
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:20,代码来源:AvTransportMediaRendererPlaying.java
示例2: setTransportURI
import org.fourthline.cling.support.model.PositionInfo; //导入依赖的package包/类
@Override
public Class<? extends AbstractState<?>> setTransportURI(URI uri,
String metaData) {
Log.d(this.getClass().getName(), "setTransportURI");
Log.d(this.getClass().getName(), "uri: " + uri);
Log.d(this.getClass().getName(), "metaData: " + metaData);
getTransport().setMediaInfo(new MediaInfo(uri.toString(), metaData));
// If you can, you should find and set the duration of the track here!
getTransport().setPositionInfo(
new PositionInfo(1, metaData, uri.toString()));
// It's up to you what "last changes" you want to announce to event
// listeners
getTransport().getLastChange().setEventedValue(
getTransport().getInstanceId(),
new AVTransportVariable.AVTransportURI(uri),
new AVTransportVariable.CurrentTrackURI(uri));
// This operation can be triggered in any state, you should think
// about how you'd want your player to react. If we are in Stopped
// state nothing much will happen, except that you have to set
// the media and position info, just like in MyRendererNoMediaPresent.
// However, if this would be the MyRendererPlaying state, would you
// prefer stopping first?
return AvTransportMediaRendererStopped.class;
}
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:25,代码来源:AvTransportMediaRendererStopped.java
示例3: setTransportURI
import org.fourthline.cling.support.model.PositionInfo; //导入依赖的package包/类
@Override
public Class<? extends AbstractState<?>> setTransportURI(URI uri,
String metaData) {
Log.d(this.getClass().getName(), "set Transport: " + uri + " metaData: " + metaData);
getTransport().setMediaInfo(new MediaInfo(uri.toString(), metaData));
// If you can, you should find and set the duration of the track here!
getTransport().setPositionInfo(
new PositionInfo(1, metaData, uri.toString()));
// It's up to you what "last changes" you want to announce to event
// listeners
getTransport().getLastChange().setEventedValue(
getTransport().getInstanceId(),
new AVTransportVariable.AVTransportURI(uri),
new AVTransportVariable.CurrentTrackURI(uri));
return AvTransportMediaRendererStopped.class;
}
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:19,代码来源:AvTransportMediaRendererNoMediaPresent.java
示例4: setTransportURI
import org.fourthline.cling.support.model.PositionInfo; //导入依赖的package包/类
@Override
public Class<? extends AbstractState<?>> setTransportURI(URI uri, String metaData) {
Log.d(this.getClass().getName(), "setTransportURI");
Log.d(this.getClass().getName(), "uri: " + uri);
Log.d(this.getClass().getName(), "metaData: " + metaData);
getTransport().setMediaInfo(new MediaInfo(uri.toString(), metaData));
// If you can, you should find and set the duration of the track here!
getTransport().setPositionInfo(
new PositionInfo(1, metaData, uri.toString()));
// It's up to you what "last changes" you want to announce to event
// listeners
getTransport().getLastChange().setEventedValue(
getTransport().getInstanceId(),
new AVTransportVariable.AVTransportURI(uri),
new AVTransportVariable.CurrentTrackURI(uri));
// This operation can be triggered in any state, you should think
// about how you'd want your player to react. If we are in Stopped
// state nothing much will happen, except that you have to set
// the media and position info, just like in MyRendererNoMediaPresent.
// However, if this would be the MyRendererPlaying state, would you
// prefer stopping first?
return AvTransportMediaRendererStopped.class;
}
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:24,代码来源:AvTransportMediaRendererPaused.java
示例5: setURI
import org.fourthline.cling.support.model.PositionInfo; //导入依赖的package包/类
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);
}
开发者ID:offbye,项目名称:DroidDLNA,代码行数:22,代码来源:ZxtMediaPlayer.java
示例6: setPositionInfo
import org.fourthline.cling.support.model.PositionInfo; //导入依赖的package包/类
public void setPositionInfo(PositionInfo positionInfo)
{
try
{
if (this.positionInfo.getRelTime().compareTo(positionInfo.getRelTime()) == 0
&& this.positionInfo.getAbsTime().compareTo(positionInfo.getAbsTime()) == 0)
return;
this.positionInfo = positionInfo;
notifyAllObservers();
}
catch (Exception e)
{
Log.e(TAG, (e.getMessage() == null) ? "Ëxception !" : e.getMessage());
for (StackTraceElement m : e.getStackTrace())
Log.e(TAG, m.toString());
}
}
开发者ID:trishika,项目名称:DroidUPnP,代码行数:20,代码来源:RendererState.java
示例7: appendCurrentState
import org.fourthline.cling.support.model.PositionInfo; //导入依赖的package包/类
@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(getPossibleTransportActions(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())
);
}
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:35,代码来源:YaaccAVTransportService.java
示例8: getPositionInfo
import org.fourthline.cling.support.model.PositionInfo; //导入依赖的package包/类
@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 PositionInfo getPositionInfo(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes instanceId)
throws AVTransportException {
Log.d(getClass().getName(),"Transport: " + findStateMachine(instanceId).getCurrentState().getTransport() + " PositionInfo: " + findStateMachine(instanceId).getCurrentState().getTransport().getPositionInfo());
return findStateMachine(instanceId).getCurrentState().getTransport().getPositionInfo();
}
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:16,代码来源:YaaccAVTransportService.java
示例9: appendCurrentState
import org.fourthline.cling.support.model.PositionInfo; //导入依赖的package包/类
@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())
);
}
开发者ID:offbye,项目名称:DroidDLNA,代码行数:35,代码来源:AbstractAVTransportService.java
示例10: getPositionInfo
import org.fourthline.cling.support.model.PositionInfo; //导入依赖的package包/类
@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;
开发者ID:offbye,项目名称:DroidDLNA,代码行数:13,代码来源:AbstractAVTransportService.java
示例11: received
import org.fourthline.cling.support.model.PositionInfo; //导入依赖的package包/类
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);
}
开发者ID:offbye,项目名称:DroidDLNA,代码行数:11,代码来源:GetPositionInfoCallback.java
示例12: positionChanged
import org.fourthline.cling.support.model.PositionInfo; //导入依赖的package包/类
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));
}
}
开发者ID:offbye,项目名称:DroidDLNA,代码行数:9,代码来源:ZxtMediaPlayer.java
示例13: initializePlayers
import org.fourthline.cling.support.model.PositionInfo; //导入依赖的package包/类
/**
* Returns all player instances initialized with the given transport object
*
* @param transport the object which describes the content to be played
* @return the player
*/
public List<Player> initializePlayers(AvTransport transport) {
PlayableItem playableItem = new PlayableItem();
List<PlayableItem> items = new ArrayList<PlayableItem>();
if (transport == null) {
return PlayerFactory.createPlayer(this, transport.getSynchronizationInfo(), items);
}
Log.d(getClass().getName(), "TransportId: " + transport.getInstanceId());
PositionInfo positionInfo = transport.getPositionInfo();
Log.d(getClass().getName(), "positionInfo: " + positionInfo);
if (positionInfo == null) {
return PlayerFactory.createPlayer(this, transport.getSynchronizationInfo(), items);
}
DIDLContent metadata = null;
try {
if (positionInfo.getTrackMetaData() != null && positionInfo.getTrackMetaData().indexOf("NOT_IMPLEMENTED") == -1) {
metadata = new DIDLParser().parse(positionInfo.getTrackMetaData());
} else {
Log.d(getClass().getName(), "Warning unparsable TackMetaData: " + positionInfo.getTrackMetaData());
}
} catch (Exception e) {
Log.d(getClass().getName(), "Exception while parsing metadata: ", e);
}
String mimeType = "";
if (metadata != null) {
List<Item> metadataItems = metadata.getItems();
for (Item item : metadataItems) {
playableItem.setTitle(item.getTitle());
List<Res> metadataResources = item.getResources();
for (Res res : metadataResources) {
if (res.getProtocolInfo() != null) {
mimeType = res.getProtocolInfo().getContentFormatMimeType().toString();
break;
}
}
break;
}
} else {
playableItem.setTitle(positionInfo.getTrackURI().toString());
String fileExtension = MimeTypeMap.getFileExtensionFromUrl(positionInfo.getTrackURI());
mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(fileExtension);
Log.d(getClass().getName(), "fileextension from trackURI: " + fileExtension);
}
playableItem.setMimeType(mimeType);
playableItem.setUri(Uri.parse(positionInfo.getTrackURI()));
Log.d(getClass().getName(), "positionInfo.getTrackURI(): " + positionInfo.getTrackURI());
// FIXME Duration not supported in receiver yet
// playableItem.setDuration(duration)
items.add(playableItem);
Log.d(getClass().getName(), "TransportUri: " + positionInfo.getTrackURI());
Log.d(getClass().getName(), "Current duration: " + positionInfo.getTrackDuration());
Log.d(getClass().getName(), "TrackMetaData: " + positionInfo.getTrackMetaData());
Log.d(getClass().getName(), "MimeType: " + playableItem.getMimeType());
return PlayerFactory.createPlayer(this, transport.getSynchronizationInfo(), items);
}
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:61,代码来源:UpnpClient.java
示例14: getPositionInfo
import org.fourthline.cling.support.model.PositionInfo; //导入依赖的package包/类
@Override
public PositionInfo getPositionInfo(@UpnpInputArgument(name = "InstanceID") UnsignedIntegerFourBytes unsignedIntegerFourBytes) throws AVTransportException {
return null;
}
开发者ID:hezhubo,项目名称:HPlayer,代码行数:5,代码来源:AVTransportService.java
示例15: success
import org.fourthline.cling.support.model.PositionInfo; //导入依赖的package包/类
public void success(ActionInvocation invocation) {
PositionInfo positionInfo = new PositionInfo(invocation.getOutputMap());
received(invocation, positionInfo);
}
开发者ID:offbye,项目名称:DroidDLNA,代码行数:5,代码来源:GetPositionInfo.java
示例16: getPositionInfo
import org.fourthline.cling.support.model.PositionInfo; //导入依赖的package包/类
public PositionInfo getPositionInfo(UnsignedIntegerFourBytes instanceId) throws AVTransportException {
return findStateMachine(instanceId).getCurrentState().getTransport().getPositionInfo();
}
开发者ID:offbye,项目名称:DroidDLNA,代码行数:4,代码来源:AVTransportService.java
示例17: getCurrentPositionInfo
import org.fourthline.cling.support.model.PositionInfo; //导入依赖的package包/类
synchronized public PositionInfo getCurrentPositionInfo() {
return currentPositionInfo;
}
开发者ID:offbye,项目名称:DroidDLNA,代码行数:4,代码来源:ZxtMediaPlayer.java
示例18: getPositionInfo
import org.fourthline.cling.support.model.PositionInfo; //导入依赖的package包/类
@Override
public PositionInfo getPositionInfo(UnsignedIntegerFourBytes instanceId) throws AVTransportException {
return getInstance(instanceId).getCurrentPositionInfo();
}
开发者ID:offbye,项目名称:DroidDLNA,代码行数:5,代码来源:AVTransportService.java
示例19: resetTrackInfo
import org.fourthline.cling.support.model.PositionInfo; //导入依赖的package包/类
public void resetTrackInfo()
{
positionInfo = new PositionInfo();
mediaInfo = new MediaInfo();
notifyAllObservers();
}
开发者ID:trishika,项目名称:DroidUPnP,代码行数:7,代码来源:RendererState.java
示例20: received
import org.fourthline.cling.support.model.PositionInfo; //导入依赖的package包/类
public abstract void received(ActionInvocation invocation, PositionInfo positionInfo);
开发者ID:offbye,项目名称:DroidDLNA,代码行数:2,代码来源:GetPositionInfo.java
注:本文中的org.fourthline.cling.support.model.PositionInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论