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


Java UDAServiceType类代码示例

本文整理汇总了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);
}
 
开发者ID:stephenmcgruer,项目名称:simple-upnp,代码行数:18,代码来源:FileBrowserFragment.java

示例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);
}
 
开发者ID:stephenmcgruer,项目名称:simple-upnp,代码行数:19,代码来源:ServerBrowserFragment.java

示例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") };
		}

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

示例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),
            };
        }

    };
}
 
开发者ID:hezhubo,项目名称:HPlayer,代码行数:22,代码来源:UpnpService.java

示例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),
            };
        }

    };
}
 
开发者ID:hezhubo,项目名称:HPlayer,代码行数:21,代码来源:UpnpService.java

示例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),
            };
        }

    };
}
 
开发者ID:hezhubo,项目名称:HPlayer,代码行数:20,代码来源:UpnpService.java

示例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();
	}
}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:17,代码来源:DMCControl.java

示例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();
	}
}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:19,代码来源:DMCControl.java

示例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();
	}
}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:18,代码来源:DMCControl.java

示例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();
	}
}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:17,代码来源:DMCControl.java

示例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();
	}
}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:26,代码来源:DMCControl.java

示例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();
	}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:21,代码来源:ContentActivity.java

示例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
            };
        }
    };
}
 
开发者ID:eriklupander,项目名称:microgramcaster,代码行数:19,代码来源:BrowserUpnpService.java

示例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);
}
 
开发者ID:stephenmcgruer,项目名称:simple-upnp,代码行数:11,代码来源:MainActivity.java

示例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>();
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:12,代码来源:UpnpClient.java


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