本文整理汇总了Java中org.fourthline.cling.model.types.UDAServiceType类的典型用法代码示例。如果您正苦于以下问题:Java UDAServiceType类的具体用法?Java UDAServiceType怎么用?Java UDAServiceType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UDAServiceType类属于org.fourthline.cling.model.types包,在下文中一共展示了UDAServiceType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onServiceConnected
import org.fourthline.cling.model.types.UDAServiceType; //导入依赖的package包/类
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
Log.d(TAG, "onServiceConnected: " + name.flattenToShortString() + ", " + service.toString());
mUpnpService = (AndroidUpnpService) service;
Device device = mUpnpService.getRegistry().getDevice(new UDN(mDeviceUdn), false);
mContentDirectoryService = device.findService(new UDAServiceType("ContentDirectory"));
if (mContentDirectoryService == null) {
throw new IllegalStateException("Unable to find ContentDirectory service for device "
+ mDeviceUdn);
}
mDeviceName = (device.getDetails() != null && device.getDetails().getFriendlyName() != null)
? device.getDetails().getFriendlyName() : device.getDisplayString();
selectContainer(mCurrentContainer);
}
示例2: onDeviceAdded
import org.fourthline.cling.model.types.UDAServiceType; //导入依赖的package包/类
@Override
public void onDeviceAdded(Device device) {
if (device.findService(new UDAServiceType("ContentDirectory")) == null)
return;
DeviceWrapper wrapper = new DeviceWrapper(device);
int position = mServerListAdapter.getPosition(wrapper);
if (position >= 0) {
mServerListAdapter.remove(wrapper);
mServerListAdapter.insert(wrapper, position);
} else {
mServerListAdapter.add(wrapper);
}
mServerListAdapter.sort(new DeviceWrapper.Comparator());
mServerListAdapter.notifyDataSetChanged();
mListener.requestBookmarksForDevice(device);
}
示例3: createConfiguration
import org.fourthline.cling.model.types.UDAServiceType; //导入依赖的package包/类
@Override
protected AndroidUpnpServiceConfiguration createConfiguration() {
return new AndroidUpnpServiceConfiguration() {
@Override
public int getRegistryMaintenanceIntervalMillis() {
return 7000;
}
@Override
public ServiceType[] getExclusiveServiceTypes() {
return new ServiceType[] { new UDAServiceType("AVTransport"), new UDAServiceType("ContentDirectory"), new UDAServiceType("ConnectionManager"), new UDAServiceType("RenderingControl"), new UDAServiceType("X_MS_MediaReceiverRegistrar") };
}
};
}
示例4: createConfiguration
import org.fourthline.cling.model.types.UDAServiceType; //导入依赖的package包/类
@Override
protected AndroidUpnpServiceConfiguration createConfiguration() {
return new AndroidUpnpServiceConfiguration() {
@Override
public int getRegistryMaintenanceIntervalMillis() {
return 7000;
}
@Override
public ServiceType[] getExclusiveServiceTypes() {
// only care the these service below
return new ServiceType[]{
new UDAServiceType(UpnpServiceType.AVTRANSPORT),
new UDAServiceType(UpnpServiceType.RENDERING_CONTROL),
new UDAServiceType(UpnpServiceType.CONTENT_DIRECTORY),
};
}
};
}
示例5: createConfiguration
import org.fourthline.cling.model.types.UDAServiceType; //导入依赖的package包/类
@Override
protected AndroidUpnpServiceConfiguration createConfiguration() {
return new AndroidUpnpServiceConfiguration() {
@Override
public int getRegistryMaintenanceIntervalMillis() {
return 7000;
}
@Override
public ServiceType[] getExclusiveServiceTypes() {
// only care the these service below
return new ServiceType[]{
new UDAServiceType(UpnpServiceType.AVTRANSPORT),
new UDAServiceType(UpnpServiceType.RENDERING_CONTROL),
};
}
};
}
示例6: createConfiguration
import org.fourthline.cling.model.types.UDAServiceType; //导入依赖的package包/类
@Override
protected AndroidUpnpServiceConfiguration createConfiguration() {
return new AndroidUpnpServiceConfiguration() {
@Override
public int getRegistryMaintenanceIntervalMillis() {
return 7000;
}
@Override
public ServiceType[] getExclusiveServiceTypes() {
// only care the these service below
return new ServiceType[]{
new UDAServiceType(UpnpServiceType.CONTENT_DIRECTORY),
};
}
};
}
示例7: getVolume
import org.fourthline.cling.model.types.UDAServiceType; //导入依赖的package包/类
public void getVolume(int paramInt) {
try {
Service localService = this.executeDeviceItem.getDevice()
.findService(new UDAServiceType("RenderingControl"));
if (localService != null) {
Log.e("get volume", "get volume");
this.upnpService.getControlPoint().execute(
new GetVolumeCallback(this.activity, mHandle, paramInt,
localService, this.controlType));
} else {
Log.e("null", "null");
}
} catch (Exception localException) {
localException.printStackTrace();
}
}
示例8: seekBarPosition
import org.fourthline.cling.model.types.UDAServiceType; //导入依赖的package包/类
public void seekBarPosition(String paramString) {
try {
Device localDevice = this.executeDeviceItem.getDevice();
Log.e("control action", "seekBarPosition");
Service localService = localDevice.findService(new UDAServiceType(
"AVTransport"));
if (localService != null) {
Log.e("get seekBarPosition info", "get seekBarPosition info");
this.upnpService.getControlPoint().execute(
new SeekCallback(activity, localService, paramString,
mHandle));
} else {
Log.e("null", "null");
}
} catch (Exception localException) {
localException.printStackTrace();
}
}
示例9: setAvURL
import org.fourthline.cling.model.types.UDAServiceType; //导入依赖的package包/类
public void setAvURL() {
try {
Service localService = this.executeDeviceItem.getDevice()
.findService(new UDAServiceType("AVTransport"));
if (localService != null) {
Log.e("set url", "set url" + this.uriString);
this.upnpService.getControlPoint().execute(
new SetAVTransportURIActionCallback(localService,
this.uriString, this.metaData, mHandle,
this.controlType));
} else {
Log.e("null", "null");
}
} catch (Exception localException) {
localException.printStackTrace();
}
}
示例10: setMute
import org.fourthline.cling.model.types.UDAServiceType; //导入依赖的package包/类
public void setMute(boolean paramBoolean) {
try {
Service localService = this.executeDeviceItem.getDevice()
.findService(new UDAServiceType("RenderingControl"));
if (localService != null) {
ControlPoint localControlPoint = this.upnpService
.getControlPoint();
localControlPoint.execute(new SetMuteCalllback(localService,
paramBoolean, mHandle));
} else {
Log.e("null", "null");
}
} catch (Exception localException) {
localException.printStackTrace();
}
}
示例11: setVolume
import org.fourthline.cling.model.types.UDAServiceType; //导入依赖的package包/类
public void setVolume(long paramLong, int paramInt) {
if (paramInt == 0) {
}
Service localService = null;
try {
localService = this.executeDeviceItem.getDevice().findService(
new UDAServiceType("RenderingControl"));
if (localService != null) {
if (paramInt == CUT_VOC) {
if (paramLong >= 0L) {
paramLong -= 1L;
} else {
Toast.makeText(activity, R.string.min_voc,
Toast.LENGTH_SHORT).show();
}
} else {
paramLong += 1L;
}
this.upnpService.getControlPoint().execute(
new SetVolumeCallback(localService, paramLong));
}
} catch (Exception localException) {
localException.printStackTrace();
}
}
示例12: initData
import org.fourthline.cling.model.types.UDAServiceType; //导入依赖的package包/类
private void initData() {
mCounter = 0;
if (null == mSaveDirectoryMap) {
mSaveDirectoryMap = new HashMap<Integer, ArrayList<ContentItem>>();
} else {
mSaveDirectoryMap.clear();
}
upnpService = mBaseApplication.upnpService;
mTitleView.setText(mBaseApplication.deviceItem.toString());
Device device = mBaseApplication.deviceItem.getDevice();
Service service = device.findService(new UDAServiceType(
"ContentDirectory"));
upnpService.getControlPoint().execute(
new ContentBrowseActionCallback(ContentActivity.this,
service, createRootContainer(service), mContentList,
mHandler));
mLastDevice = mBaseApplication.deviceItem.toString();
}
示例13: createConfiguration
import org.fourthline.cling.model.types.UDAServiceType; //导入依赖的package包/类
@Override
protected UpnpServiceConfiguration createConfiguration() {
return new AndroidUpnpServiceConfiguration() {
@Override
public int getRegistryMaintenanceIntervalMillis() {
return 20000;
}
@Override
public ServiceType[] getExclusiveServiceTypes() {
return new ServiceType[]{
new UDAServiceType("ContentDirectory") //SwitchPower
};
}
};
}
示例14: onServerSelected
import org.fourthline.cling.model.types.UDAServiceType; //导入依赖的package包/类
@Override
public void onServerSelected(Device device) {
Service service = device.findService(new UDAServiceType("ContentDirectory"));
if (service == null) {
Toast.makeText(this, "No ContentDirectory service found!", Toast.LENGTH_SHORT).show();
return;
}
startFileBrowserFragment(device.getIdentity().getUdn().getIdentifierString(), null);
}
示例15: getDevicesProvidingContentDirectoryService
import org.fourthline.cling.model.types.UDAServiceType; //导入依赖的package包/类
/**
* Returns all registered UpnpDevices with a ContentDirectory Service.
*
* @return the upnpDevices
*/
public Collection<Device> getDevicesProvidingContentDirectoryService() {
if (isInitialized()) {
return getRegistry().getDevices(new UDAServiceType("ContentDirectory"));
}
return new ArrayList<Device>();
}