本文整理汇总了Java中org.fourthline.cling.model.action.ActionInvocation类的典型用法代码示例。如果您正苦于以下问题:Java ActionInvocation类的具体用法?Java ActionInvocation怎么用?Java ActionInvocation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ActionInvocation类属于org.fourthline.cling.model.action包,在下文中一共展示了ActionInvocation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: received
import org.fourthline.cling.model.action.ActionInvocation; //导入依赖的package包/类
@Override
public void received(ActionInvocation actionInvocation, final DIDLContent didl) {
if (getActivity() == null || didl.getItems().isEmpty())
return;
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
for (int i = 0; i < mFileBrowserAdapter.getCount(); i++) {
FileBrowserAdapter.ListItem listItem = mFileBrowserAdapter.getItem(i);
if (listItem != null && listItem.holdsContainer() &&
Objects.equals(listItem.getContainer().getId(), mContainerId)) {
listItem.setMediaItems(didl.getItems());
mFileBrowserAdapter.notifyDataSetChanged();
}
}
}
});
}
示例2: failure
import org.fourthline.cling.model.action.ActionInvocation; //导入依赖的package包/类
@Override
public void failure(ActionInvocation actioninvocation,
UpnpResponse upnpresponse, String s) {
Log.d(getClass().getName(), "Failure UpnpResponse: " + upnpresponse);
if (upnpresponse != null) {
Log.d(getClass().getName(),
"UpnpResponse: " + upnpresponse.getResponseDetails());
Log.d(getClass().getName(),
"UpnpResponse: " + upnpresponse.getStatusMessage());
Log.d(getClass().getName(),
"UpnpResponse: " + upnpresponse.getStatusCode());
}
hasFailures = true;
Log.d(getClass().getName(), "s: " + s);
actionState.actionFinished = true;
}
示例3: setDeviceVolume
import org.fourthline.cling.model.action.ActionInvocation; //导入依赖的package包/类
/**
* 设置音量
*/
public void setDeviceVolume(int volume) {
ActionCallback setVolume = new SetVolume(renderingControlService, volume) {
@Override
public void failure(ActionInvocation arg0, UpnpResponse arg1, String arg2) {
onFailureCallBack(SET_VOLUME, arg2);
}
@Override
public void success(ActionInvocation invocation) {
onSuccessCallBack(SET_VOLUME);
}
};
mUpnpService.getControlPoint().execute(setVolume);
}
示例4: setDeviceMute
import org.fourthline.cling.model.action.ActionInvocation; //导入依赖的package包/类
/**
* 设置静音
*/
public void setDeviceMute(boolean mute) {
ActionCallback setMute = new SetMute(renderingControlService, mute) {
@Override
public void failure(ActionInvocation arg0, UpnpResponse arg1, String arg2) {
onFailureCallBack(SET_MUTE, arg2);
}
@Override
public void success(ActionInvocation invocation) {
onSuccessCallBack(SET_MUTE);
}
};
mUpnpService.getControlPoint().execute(setMute);
}
示例5: onVideoSeek
import org.fourthline.cling.model.action.ActionInvocation; //导入依赖的package包/类
/**
* 视频跳转
*/
public void onVideoSeek(int schedule) {
String seekToTime = generateTime(schedule);
ActionCallback seek = new Seek(avTransportService, seekToTime) {
@Override
public void failure(ActionInvocation arg0, UpnpResponse arg1, String arg2) {
onFailureCallBack(SEEK, arg2);
}
@Override
public void success(ActionInvocation invocation) {
onSuccessCallBack(SEEK);
}
};
mUpnpService.getControlPoint().execute(seek);
}
示例6: setUrl
import org.fourthline.cling.model.action.ActionInvocation; //导入依赖的package包/类
public void setUrl(String url, String metadata) {
SetAVTransportURI callback = new SetAVTransportURI(mAvTransportService,
url, metadata) {
@SuppressWarnings("rawtypes")
@Override
public void failure(ActionInvocation actionInvocation,
UpnpResponse response, String message) {
// TODO Auto-generated method stub
Log.e(LOG_TAG, "Set play uri failed! the reason is:" + message
+ "the response details is:" + response);
Utils.showToast(mContext, message);
}
};
if (mAvTransportService != null)
mAndroidUpnpService.getControlPoint().execute(callback);
}
示例7: play
import org.fourthline.cling.model.action.ActionInvocation; //导入依赖的package包/类
public void play() {
Play callback = new Play(mAvTransportService) {
@SuppressWarnings("rawtypes")
@Override
public void failure(ActionInvocation actionInvocation,
UpnpResponse response, String message) {
// TODO Auto-generated method stub
Log.e(LOG_TAG, "Play failed! the reason is:" + message
+ "the response details is:" + response);
Utils.showToast(mContext, message);
}
};
if (mAvTransportService != null)
mAndroidUpnpService.getControlPoint().execute(callback);
}
示例8: pause
import org.fourthline.cling.model.action.ActionInvocation; //导入依赖的package包/类
public void pause() {
Pause callback = new Pause(mAvTransportService) {
@SuppressWarnings("rawtypes")
@Override
public void failure(ActionInvocation actionInvocation,
UpnpResponse response, String message) {
// TODO Auto-generated method stub
Log.e(LOG_TAG, "Pause failed! the reason is:" + message
+ "the response details is:" + response);
Utils.showToast(mContext, message);
}
};
if (mAvTransportService != null)
mAndroidUpnpService.getControlPoint().execute(callback);
}
示例9: stop
import org.fourthline.cling.model.action.ActionInvocation; //导入依赖的package包/类
public void stop() {
Stop callback = new Stop(mAvTransportService) {
@SuppressWarnings("rawtypes")
@Override
public void failure(ActionInvocation actionInvocation,
UpnpResponse response, String message) {
// TODO Auto-generated method stub
Log.e(LOG_TAG, "Stop failed! the reason is:" + message
+ "the response details is:" + response);
Utils.showToast(mContext, message);
}
};
if (mAvTransportService != null)
mAndroidUpnpService.getControlPoint().execute(callback);
}
示例10: seek
import org.fourthline.cling.model.action.ActionInvocation; //导入依赖的package包/类
public void seek(SeekMode mode, String target) {
Seek callback = new Seek(mAvTransportService, mode, target) {
@SuppressWarnings("rawtypes")
@Override
public void failure(ActionInvocation actionInvocation,
UpnpResponse response, String message) {
// TODO Auto-generated method stub
Log.e(LOG_TAG, "Seek failed! the reason is:" + message
+ "the response details is:" + response);
Utils.showToast(mContext, message);
}
};
if (mAvTransportService != null)
mAndroidUpnpService.getControlPoint().execute(callback);
}
示例11: setMute
import org.fourthline.cling.model.action.ActionInvocation; //导入依赖的package包/类
public void setMute(boolean desiredMute) {
SetMute callback = new SetMute(mRendererControlService, desiredMute) {
@SuppressWarnings("rawtypes")
@Override
public void failure(ActionInvocation actionInvocation,
UpnpResponse response, String message) {
// TODO Auto-generated method stub
Log.e(LOG_TAG, "SetMute failed! the reason is:" + message
+ "the response details is:" + response);
Utils.showToast(mContext, message);
}
};
if (mRendererControlService != null)
mAndroidUpnpService.getControlPoint().execute(callback);
}
示例12: start
import org.fourthline.cling.model.action.ActionInvocation; //导入依赖的package包/类
@Override
public void start() {
if(error) {
Log.w(TAG, "Attempting to restart song");
startSong(downloadService.getCurrentPlaying(), true, 0);
return;
}
try {
controlPoint.execute(new Play(getTransportService()) {
@Override
public void success(ActionInvocation invocation) {
lastUpdate.set(System.currentTimeMillis());
downloadService.setPlayerState(PlayerState.STARTED);
}
@Override
public void failure(ActionInvocation actionInvocation, UpnpResponse upnpResponse, String msg) {
Log.w(TAG, "Failed to start playing: " + msg);
failedLoad();
}
});
} catch(Exception e) {
Log.w(TAG, "Failed to start", e);
}
}
示例13: OutgoingActionRequestMessage
import org.fourthline.cling.model.action.ActionInvocation; //导入依赖的package包/类
public OutgoingActionRequestMessage(ActionInvocation actionInvocation, URL controlURL) {
this(actionInvocation.getAction(), new UpnpRequest(UpnpRequest.Method.POST, controlURL));
// For proxy remote invocations, pass through the user agent header
if (actionInvocation instanceof RemoteActionInvocation) {
RemoteActionInvocation remoteActionInvocation = (RemoteActionInvocation) actionInvocation;
if (remoteActionInvocation.getRemoteClientInfo() != null
&& remoteActionInvocation.getRemoteClientInfo().getRequestUserAgent() != null) {
getHeaders().add(
UpnpHeader.Type.USER_AGENT,
new UserAgentHeader(remoteActionInvocation.getRemoteClientInfo().getRequestUserAgent())
);
}
} else if (actionInvocation.getClientInfo() != null) {
getHeaders().putAll(actionInvocation.getClientInfo().getRequestHeaders());
}
}
示例14: success
import org.fourthline.cling.model.action.ActionInvocation; //导入依赖的package包/类
@Override
public void success(ActionInvocation invocation) {
try {
ActionArgumentValue sink = invocation.getOutput("Sink");
ActionArgumentValue source = invocation.getOutput("Source");
received(invocation,
sink != null ? new ProtocolInfos(sink.toString()) : null,
source != null ? new ProtocolInfos(source.toString())
: null);
} catch (Exception ex) {
invocation.setFailure(new ActionException(ErrorCode.ACTION_FAILED,
"Can't parse ProtocolInfo response: " + ex, ex));
failure(invocation, null);
}
}
示例15: readActionResponseElement
import org.fourthline.cling.model.action.ActionInvocation; //导入依赖的package包/类
protected Element readActionResponseElement(Element bodyElement, ActionInvocation actionInvocation) {
NodeList bodyChildren = bodyElement.getChildNodes();
for (int i = 0; i < bodyChildren.getLength(); i++) {
Node bodyChild = bodyChildren.item(i);
if (bodyChild.getNodeType() != Node.ELEMENT_NODE)
continue;
if (getUnprefixedNodeName(bodyChild).equals(actionInvocation.getAction().getName() + "Response")) {
log.fine("Reading action response element: " + getUnprefixedNodeName(bodyChild));
return (Element) bodyChild;
}
}
log.fine("Could not read action response element");
return null;
}