当前位置: 首页>>代码示例>>Java>>正文


Java ActionCallback类代码示例

本文整理汇总了Java中org.fourthline.cling.controlpoint.ActionCallback的典型用法代码示例。如果您正苦于以下问题:Java ActionCallback类的具体用法?Java ActionCallback怎么用?Java ActionCallback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ActionCallback类属于org.fourthline.cling.controlpoint包,在下文中一共展示了ActionCallback类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setDeviceVolume

import org.fourthline.cling.controlpoint.ActionCallback; //导入依赖的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);
}
 
开发者ID:hezhubo,项目名称:HPlayer,代码行数:19,代码来源:UpnpControlSet.java

示例2: setDeviceMute

import org.fourthline.cling.controlpoint.ActionCallback; //导入依赖的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);
}
 
开发者ID:hezhubo,项目名称:HPlayer,代码行数:19,代码来源:UpnpControlSet.java

示例3: onVideoSeek

import org.fourthline.cling.controlpoint.ActionCallback; //导入依赖的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);
}
 
开发者ID:hezhubo,项目名称:HPlayer,代码行数:20,代码来源:UpnpControlSet.java

示例4: execute

import org.fourthline.cling.controlpoint.ActionCallback; //导入依赖的package包/类
/**
 * returns -1 if not ready
 * @param callback
 * @return
 */
protected int execute(ActionCallback callback) {
    if (mState!=State.RUNNING) {
        return -1;
    }

    mAndroidUpnpService.getControlPoint().execute(callback);
    return 0;
}
 
开发者ID:archos-sa,项目名称:aos-MediaLib,代码行数:14,代码来源:UpnpServiceManager.java

示例5: getConnectionInfos

import org.fourthline.cling.controlpoint.ActionCallback; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
private void getConnectionInfos(UpnpClient upnpClient,
		final List<Device<?, ?, ?>> devices) throws Exception {
	for (Device<?, ?, ?> device : devices) {
		Service service = device.findService(new UDAServiceId(
				"ConnectionManager"));
		if (service != null) {
			Action getCurrentConnectionIds = service
					.getAction("GetCurrentConnectionIDs");
			assertNotNull(getCurrentConnectionIds);
			ActionInvocation getCurrentConnectionIdsInvocation = new ActionInvocation(
					getCurrentConnectionIds);
			ActionCallback getCurrentConnectionCallback = new ActionCallback(
					getCurrentConnectionIdsInvocation) {
				
				@Override
				public void success(ActionInvocation invocation) {
					ActionArgumentValue[] connectionIds = invocation
							.getOutput();
				    for (ActionArgumentValue connectionId : connectionIds) {
				    	Log.d(getClass().getName(), connectionId.getValue().toString());
						
					}
				}

				@Override
				public void failure(ActionInvocation actioninvocation,
						UpnpResponse upnpresponse, String s) {
					Log.d(getClass().getName(),"Failure:" + upnpresponse);

				}
			};

			upnpClient.getUpnpService().getControlPoint()
					.execute(getCurrentConnectionCallback);

		}
	}
	myWait();
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:41,代码来源:UpnpClientTest.java

示例6: testConnectionManagerActionGetCurrentConnectionIDs

import org.fourthline.cling.controlpoint.ActionCallback; //导入依赖的package包/类
public void testConnectionManagerActionGetCurrentConnectionIDs() {
	UpnpClient upnpClient = getInitializedUpnpClientWithDevice(OPENBIT_AVTRANSPORT_DEVICE);
	Device<?, ?, ?> device = upnpClient
			.getDevice(OPENBIT_AVTRANSPORT_DEVICE);
	Service avservice = getConnectionManagerService(device); 		
	Log.d(getClass().getName(), "Action GetCurrentConnectionIDs ");
	actionFinished = false;
	ActionInvocation actionInvocation = new ActionInvocation(
			avservice.getAction("GetCurrentConnectionIDs"));		
	ActionCallback actionCallback = new ActionCallback(actionInvocation) {

		@Override
		public void success(ActionInvocation invocation) {

			
			displaySuccess(invocation);
		}

		@Override
		public void failure(ActionInvocation actioninvocation,
				UpnpResponse upnpresponse, String s) {
			Log.d(getClass().getName(), "Failure UpnpResponse: "
					+ upnpresponse);
			Log.d(getClass().getName(),
					"UpnpResponse: " + upnpresponse.getResponseDetails());
			actionFinished = true;

		}

	

	};

	upnpClient.getControlPoint().execute(actionCallback);
	waitForActionComplete();

}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:38,代码来源:OpenbitTestCases.java

示例7: testConnectionManagerActionGetCurrentConnectionInfo

import org.fourthline.cling.controlpoint.ActionCallback; //导入依赖的package包/类
public void testConnectionManagerActionGetCurrentConnectionInfo() {
	UpnpClient upnpClient = getInitializedUpnpClientWithDevice(OPENBIT_AVTRANSPORT_DEVICE);
	Device<?, ?, ?> device = upnpClient
			.getDevice(OPENBIT_AVTRANSPORT_DEVICE);
	Service avservice = getConnectionManagerService(device); 		
	Log.d(getClass().getName(), "Action GetCurrentConnectionInfo ");
	actionFinished = false;
	ActionInvocation actionInvocation = new ActionInvocation(
			avservice.getAction("GetCurrentConnectionInfo"));	
	actionInvocation.setInput("ConnectionID", "0");
	ActionCallback actionCallback = new ActionCallback(actionInvocation) {

		@Override
		public void success(ActionInvocation invocation) {

			
			displaySuccess(invocation);
		}

		@Override
		public void failure(ActionInvocation actioninvocation,
				UpnpResponse upnpresponse, String s) {
			Log.d(getClass().getName(), "Failure UpnpResponse: "
					+ upnpresponse);
			Log.d(getClass().getName(),
					"UpnpResponse: " + upnpresponse.getResponseDetails());
			actionFinished = true;

		}

	

	};

	upnpClient.getControlPoint().execute(actionCallback);
	waitForActionComplete();

}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:39,代码来源:OpenbitTestCases.java

示例8: setAVTransportURI

import org.fourthline.cling.controlpoint.ActionCallback; //导入依赖的package包/类
public void setAVTransportURI(String url, int schedule, String title, String id, String creator, String parentID) {
    alreadyPlay = false;
    currentPosition = schedule;
    //TODO 此处有问题 究竟如何才是正确的DLNA推屏数据?
    DIDLParser didlParser = new DIDLParser();
    DIDLContent content = new DIDLContent();
    Res res = new Res();
    Movie movie = new Movie(id, parentID, title, creator, res);
    content.addItem(movie);
    String didlString = "";
    try {
        didlString = didlParser.generate(content);
    } catch (Exception e) {
        e.printStackTrace();
    }
    ActionCallback setAVTransport = new SetAVTransportURI(
            avTransportService, url, didlString) {

        @Override
        public void failure(ActionInvocation arg0, UpnpResponse arg1, String arg2) {
            onFailureCallBack(SET_AVTRANSPORT, arg2);
        }

        @Override
        public void success(ActionInvocation invocation) {
            onVideoPlay();

            // TODO 究竟如何将当前进度一起推送过去,让播放器播放时自动跳转?
            // TODO DLNA 是否支持这个尚不清楚
            getDMRTransportInfo();// 远程渲染器播放准备完成不会主动告诉终端,需获取状态来做进度推送

            onSuccessCallBack(SET_AVTRANSPORT);
        }
    };
    mUpnpService.getControlPoint().execute(setAVTransport);
}
 
开发者ID:hezhubo,项目名称:HPlayer,代码行数:37,代码来源:UpnpControlSet.java

示例9: stopPlay

import org.fourthline.cling.controlpoint.ActionCallback; //导入依赖的package包/类
/**
 * stop the player
 */
public void stopPlay() {
  if (this.playerService == null) {
    return;
  }

  ActionCallback stopAction = new Stop(this.playerService) {
    @Override
    public void failure(ActionInvocation invocation, UpnpResponse operation, String defaultMsg) {
      LOGGER.warn("Stopping failed! " + defaultMsg);
    }
  };
  this.upnpService.getControlPoint().execute(stopAction);

}
 
开发者ID:tinyMediaManager,项目名称:tinyMediaManager,代码行数:18,代码来源:Upnp.java

示例10: testConnectionManagerActionGetProtocolInfoMS

import org.fourthline.cling.controlpoint.ActionCallback; //导入依赖的package包/类
public void testConnectionManagerActionGetProtocolInfoMS() {
	UpnpClient upnpClient = getInitializedUpnpClientWithDevice(OPENBIT_TABLET);
	Device<?, ?, ?> device = upnpClient
			.getDevice(OPENBIT_TABLET);
	Service avservice = getConnectionManagerService(device); 
	Log.d(getClass().getName(), "Action GetProtocolInfo ");
	actionFinished = false;
	ActionCallback actionCallback = new GetProtocolInfo(avservice) {

		@Override
		public void success(ActionInvocation invocation) {

			super.success(invocation);
			displaySuccess(invocation);
		}

		@Override
		public void failure(ActionInvocation actioninvocation,
				UpnpResponse upnpresponse, String s) {
			Log.d(getClass().getName(), "Failure UpnpResponse: "
					+ upnpresponse);
			Log.d(getClass().getName(),
					upnpresponse != null? "UpnpResponse: " + upnpresponse.getResponseDetails() : "");
			Log.d(getClass().getName(),
					"s: " + s);
			actionFinished = true;

		}

		@Override
		public void received(ActionInvocation arg0, ProtocolInfos arg1,
				ProtocolInfos arg2) {
			Log.d(getClass().getName(), "ProtocolInfos 1: " + arg1);
			Log.d(getClass().getName(), "ProtocolInfos 2: " + arg2);
			
		}

	};

	upnpClient.getControlPoint().execute(actionCallback);
	waitForActionComplete();

}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:44,代码来源:OpenbitTestCases.java

示例11: testConnectionManagerActionGetProtocolInfo

import org.fourthline.cling.controlpoint.ActionCallback; //导入依赖的package包/类
public void testConnectionManagerActionGetProtocolInfo() {
	UpnpClient upnpClient = getInitializedUpnpClientWithDevice(OPENBIT_AVTRANSPORT_DEVICE);
	Device<?, ?, ?> device = upnpClient
			.getDevice(OPENBIT_AVTRANSPORT_DEVICE);
	Service avservice = getConnectionManagerService(device); 
	Log.d(getClass().getName(), "Action GetProtocolInfo ");
	actionFinished = false;
	ActionCallback actionCallback = new GetProtocolInfo(avservice) {

		@Override
		public void success(ActionInvocation invocation) {

			super.success(invocation);
			displaySuccess(invocation);
		}

		@Override
		public void failure(ActionInvocation actioninvocation,
				UpnpResponse upnpresponse, String s) {
			Log.d(getClass().getName(), "Failure UpnpResponse: "
					+ upnpresponse);
			Log.d(getClass().getName(),
					upnpresponse != null? "UpnpResponse: " + upnpresponse.getResponseDetails() : "");
			Log.d(getClass().getName(),
					"s: " + s);
			actionFinished = true;

		}

		@Override
		public void received(ActionInvocation arg0, ProtocolInfos arg1,
				ProtocolInfos arg2) {
			Log.d(getClass().getName(), "ProtocolInfos 1: " + arg1);
			Log.d(getClass().getName(), "ProtocolInfos 2: " + arg2);
			
		}

	};

	upnpClient.getControlPoint().execute(actionCallback);
	waitForActionComplete();

}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:44,代码来源:OpenbitTestCases.java

示例12: ExecuteAction

import org.fourthline.cling.controlpoint.ActionCallback; //导入依赖的package包/类
public ExecuteAction(ActionCallback callback) {
    this.callback = callback;
}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:4,代码来源:ExecuteAction.java

示例13: getCallback

import org.fourthline.cling.controlpoint.ActionCallback; //导入依赖的package包/类
public ActionCallback getCallback() {
    return callback;
}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:4,代码来源:ExecuteAction.java


注:本文中的org.fourthline.cling.controlpoint.ActionCallback类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。