• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ManufacturerDetails类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: createDevice

import org.fourthline.cling.model.meta.ManufacturerDetails; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
public static LocalDevice createDevice() throws ValidationException, LocalServiceBindingException, IOException {
  DeviceIdentity identity = new DeviceIdentity(UDN.uniqueSystemIdentifier("tinyMediaManager"));
  DeviceType type = new UDADeviceType("MediaServer", 1);
  String hostname = NetworkUtil.getMachineHostname();
  if (hostname == null) {
    hostname = Upnp.IP;
  }
  DeviceDetails details = new DeviceDetails("tinyMediaManager (" + hostname + ")",
      new ManufacturerDetails("tinyMediaManager", "http://www.tinymediamanager.org/"),
      new ModelDetails("tinyMediaManager", "tinyMediaManager - Media Server", ReleaseInfo.getVersion()));

  LOGGER.info("Hello, i'm " + identity.getUdn().getIdentifierString());

  // Content Directory Service
  LocalService cds = new AnnotationLocalServiceBinder().read(ContentDirectoryService.class);
  cds.setManager(new DefaultServiceManager<ContentDirectoryService>(cds, ContentDirectoryService.class));

  // Connection Manager Service
  LocalService<ConnectionManagerService> cms = new AnnotationLocalServiceBinder().read(ConnectionManagerService.class);
  cms.setManager(new DefaultServiceManager<>(cms, ConnectionManagerService.class));

  return new LocalDevice(identity, type, details, new LocalService[] { cds, cms });
}
 
开发者ID:tinyMediaManager,项目名称:tinyMediaManager,代码行数:25,代码来源:MediaServer.java


示例2: createDevice

import org.fourthline.cling.model.meta.ManufacturerDetails; //导入依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
LocalDevice createDevice() throws ValidationException, LocalServiceBindingException, IOException {

    DeviceIdentity identity = new DeviceIdentity(UDN.uniqueSystemIdentifier("SensoryEffectRendererDevice"));
    DeviceType type = new UDADeviceType("SensoryEffectRenderer", 1);
    DeviceDetails details =
            new DeviceDetails(
                    "LPRM - PlaySEM - Sensory Effect Renderer Device",
                    new ManufacturerDetails("LPRM"),
                    new ModelDetails(
                            "PlaySEM.SERendererDevice.ModelA",
                            "A remote Sensory Effect Renderer Device. Model A supports Light, Fan and Vibration.",
                            "v1"
                    )
            );

    String iconResource = "br/ufes/inf/lprm/sensoryeffect/renderer/icon.png";
    Icon icon = new Icon("image/png", 48, 48, 8, "icon.png", Thread.currentThread().getContextClassLoader().getResourceAsStream(iconResource));

    LocalService<SERendererService> seRendererService = new AnnotationLocalServiceBinder().read(SERendererService.class);
    seRendererService.setManager(new DefaultServiceManager(seRendererService, SERendererService.class));

    try {
    	return new LocalDevice(identity, type, details, icon, seRendererService);
    }
    catch (Exception e) {
    	System.out.print("An exception has occured: " + e.getMessage());
    	e.printStackTrace();
    	return null;
    }
}
 
开发者ID:estevaosaleme,项目名称:PlaySEM_SERenderer,代码行数:32,代码来源:SERendererDevice.java


示例3: createDevice

import org.fourthline.cling.model.meta.ManufacturerDetails; //导入依赖的package包/类
public LocalDevice createDevice( ) 
		throws ValidationException,
		LocalServiceBindingException, 
		IOException {

	DeviceIdentity identity = new DeviceIdentity(
			UDN.uniqueSystemIdentifier(deviceIdentity));

	DeviceType type = new UDADeviceType("BinaryLight", 1);

	DeviceDetails details = new DeviceDetails(friendlyName,
			new ManufacturerDetails(manufacturerName), new ModelDetails(
					modelName, modelDescription, modelNumber));

	/*Icon icon = new Icon("image/png", 48, 48, 8, getClass().getResource(
			"icon.png"));*/

	LocalService switchPowerService = new AnnotationLocalServiceBinder()
			.read(implClass);

	switchPowerService.setManager(new DefaultServiceManager(
			switchPowerService, implClass));

	return new LocalDevice(identity, type, details, /*icon,*/
			switchPowerService);

	/*
	 * Several services can be bound to the same device: return new
	 * LocalDevice( identity, type, details, icon, new LocalService[]
	 * {switchPowerService, myOtherService} );
	 */

}
 
开发者ID:cyclingengineer,项目名称:UpnpHomeAutomationBridge,代码行数:34,代码来源:BinaryLightDevice.java


示例4: createDeviceDetails

import org.fourthline.cling.model.meta.ManufacturerDetails; //导入依赖的package包/类
public DeviceDetails createDeviceDetails(URL baseURL) {
    return new DeviceDetails(
            baseURL,
            friendlyName,
            new ManufacturerDetails(manufacturer, manufacturerURI),
            new ModelDetails(modelName, modelDescription, modelNumber, modelURI),
            serialNumber, upc, presentationURI, dlnaDocs.toArray(new DLNADoc[dlnaDocs.size()]), dlnaCaps
    );
}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:10,代码来源:MutableDevice.java


示例5: MediaServer

import org.fourthline.cling.model.meta.ManufacturerDetails; //导入依赖的package包/类
public MediaServer(Context context ) throws ValidationException {
    mContext = context;
    DeviceType type = new UDADeviceType(deviceType, version);

    DeviceDetails details = new DeviceDetails(SettingActivity.getDeviceName(context) + " ("
            + android.os.Build.MODEL + ")", new ManufacturerDetails(
            android.os.Build.MANUFACTURER), new ModelDetails(android.os.Build.MODEL,
            Utils.DMS_DESC, "v1"));

    LocalService service = new AnnotationLocalServiceBinder()
            .read(ContentDirectoryService.class);

    service.setManager(new DefaultServiceManager<ContentDirectoryService>(service,
            ContentDirectoryService.class));

    udn = UpnpUtil.uniqueSystemIdentifier("msidms");

    localDevice = new LocalDevice(new DeviceIdentity(udn), type, details, createDefaultDeviceIcon(), service);

    Log.v(LOGTAG, "MediaServer device created: ");
    Log.v(LOGTAG, "friendly name: " + details.getFriendlyName());
    Log.v(LOGTAG, "manufacturer: " + details.getManufacturerDetails().getManufacturer());
    Log.v(LOGTAG, "model: " + details.getModelDetails().getModelName());

    // start http server
    try {
        new HttpServer(PORT);
    } catch (IOException ioe) {
        System.err.println("Couldn't start server:\n" + ioe);
        System.exit(-1);
    }

    Log.v(LOGTAG, "Started Http Server on port " + PORT);
}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:35,代码来源:MediaServer.java


示例6: createLocalDevice

import org.fourthline.cling.model.meta.ManufacturerDetails; //导入依赖的package包/类
public void createLocalDevice() throws ValidationException
{
	String version = "";
	try {
		version = ctx.getPackageManager().getPackageInfo(ctx.getPackageName(), 0).versionName;
	} catch (PackageManager.NameNotFoundException e) {
		Log.e(TAG, "Application version name not found");
	}

	DeviceDetails details = new DeviceDetails(
		SettingsActivity.getSettingContentDirectoryName(ctx),
		new ManufacturerDetails(ctx.getString(R.string.app_name), ctx.getString(R.string.app_url)),
		new ModelDetails(ctx.getString(R.string.app_name), ctx.getString(R.string.app_url)),
		ctx.getString(R.string.app_name), version);

	List<ValidationError> l = details.validate();
	for( ValidationError v : l )
	{
		Log.e(TAG, "Validation pb for property "+ v.getPropertyName());
		Log.e(TAG, "Error is " + v.getMessage());
	}


	DeviceType type = new UDADeviceType("MediaServer", 1);

	localDevice = new LocalDevice(new DeviceIdentity(udn), type, details, localService);
}
 
开发者ID:trishika,项目名称:DroidUPnP,代码行数:28,代码来源:MediaServer.java


示例7: MediaServer

import org.fourthline.cling.model.meta.ManufacturerDetails; //导入依赖的package包/类
public MediaServer(final Context context) throws ValidationException, UnknownHostException {

        localAddress = getWIFIIpAddress(context);

        generateContentTask = new GenerateContentTask();
        generateContentTask.execute(context);

        udn = new UDN(UUID.randomUUID());
        DeviceType type = new UDADeviceType(deviceType, version);

        DeviceDetails details = new DeviceDetails(android.os.Build.MODEL,
                new ManufacturerDetails(android.os.Build.MANUFACTURER),
                new ModelDetails("HPlayer", "HPlayer MediaServer for Android", "v1"));

        LocalServiceBinder binder = new AnnotationLocalServiceBinder();

        // 文件共享服务
        LocalService<ContentDirectoryService> contentDirectoryService
                = binder.read(ContentDirectoryService.class);
        ServiceManager<ContentDirectoryService> contentDirectoryManger
                = new DefaultServiceManager<ContentDirectoryService>(contentDirectoryService) {
            @Override
            protected ContentDirectoryService createServiceInstance() throws Exception {
                return new ContentDirectoryService();
            }
        };
        contentDirectoryService.setManager(contentDirectoryManger);

        // 连接管理服务
        LocalService<ConnectionManagerService> connectionManagerService
                = binder.read(ConnectionManagerService.class);
        connectionManagerService.setManager(new DefaultServiceManager<>(
                connectionManagerService, ConnectionManagerService.class));

        // TODO 添加 AVTransportService
        // TODO 添加 AudioRenderingControl

        localDevice = new LocalDevice(new DeviceIdentity(udn), type, details,
                new LocalService[]{contentDirectoryService, connectionManagerService});

        // 启动服务器
        try {
            nanoHttpServer = new NanoHttpServer(port);
            nanoHttpServer.start();
            Log.d(TAG, "Started Http Server on port " + port);
        } catch (IOException e) {
            Log.d(TAG, "Started Http Server on error:" + e.getMessage());
            Toast.makeText(context, "启动服务器失败!", Toast.LENGTH_SHORT).show();
            e.printStackTrace();
        }

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


示例8: createMediaServerDevice

import org.fourthline.cling.model.meta.ManufacturerDetails; //导入依赖的package包/类
private LocalDevice createMediaServerDevice() throws Exception {

        String serverName = settingsService.getDlnaServerName();
        DeviceIdentity identity = new DeviceIdentity(UDN.uniqueSystemIdentifier(serverName));
        DeviceType type = new UDADeviceType("MediaServer", 1);

        // TODO: DLNACaps
        Version version = versionService.getLocalVersion();
        String versionString = version == null ? null : version.toString();
        String licenseEmail = settingsService.getLicenseEmail();
        String licenseString = licenseEmail == null ? "Unlicensed" : ("Licensed to " + licenseEmail);

        DeviceDetails details = new DeviceDetails(serverName, new ManufacturerDetails(serverName),
                new ModelDetails(serverName, licenseString, versionString),
                new DLNADoc[]{new DLNADoc("DMS", DLNADoc.Version.V1_5)}, null);

        Icon icon = new Icon("image/png", 512, 512, 32, getClass().getResource("subsonic-512.png"));

        LocalService<FolderBasedContentDirectory> contentDirectoryservice = new AnnotationLocalServiceBinder().read(FolderBasedContentDirectory.class);
        contentDirectoryservice.setManager(new DefaultServiceManager<FolderBasedContentDirectory>(contentDirectoryservice) {

            @Override
            protected FolderBasedContentDirectory createServiceInstance() throws Exception {
                return folderBasedContentDirectory;
            }
        });

        final ProtocolInfos protocols = new ProtocolInfos();
        for (DLNAProfiles dlnaProfile : DLNAProfiles.values()) {
            if (dlnaProfile == DLNAProfiles.NONE) {
                continue;
            }
            try {
                protocols.add(new DLNAProtocolInfo(dlnaProfile));
            } catch (Exception e) {
                // Silently ignored.
            }
        }

        LocalService<ConnectionManagerService> connetionManagerService = new AnnotationLocalServiceBinder().read(ConnectionManagerService.class);
        connetionManagerService.setManager(new DefaultServiceManager<ConnectionManagerService>(connetionManagerService) {
            @Override
            protected ConnectionManagerService createServiceInstance() throws Exception {
                return new ConnectionManagerService(protocols, null);
            }
        });

        // For compatibility with Microsoft
        LocalService<MSMediaReceiverRegistrarService> receiverService = new AnnotationLocalServiceBinder().read(MSMediaReceiverRegistrarService.class);
        receiverService.setManager(new DefaultServiceManager<MSMediaReceiverRegistrarService>(receiverService, MSMediaReceiverRegistrarService.class));

        return new LocalDevice(identity, type, details, new Icon[]{icon}, new LocalService[]{contentDirectoryservice, connetionManagerService, receiverService});
    }
 
开发者ID:sindremehus,项目名称:subsonic,代码行数:54,代码来源:UPnPService.java


示例9: MediaRenderer

import org.fourthline.cling.model.meta.ManufacturerDetails; //导入依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
public MediaRenderer(final Context context) {
	DeviceType type = new UDADeviceType(UpnpUtils.DMR, UpnpUtils.VERSION);
	DeviceDetails details = new DeviceDetails(
			UpnpUtils.DMR_NAME + "(" + android.os.Build.MODEL + ")",
			new ManufacturerDetails(UpnpUtils.MANUFACTURER,
					UpnpUtils.MANUFACTURER_URL),
			new ModelDetails(UpnpUtils.DMR_MODEL_NAME,
					UpnpUtils.DMR_MODEL_DESCRIPTION, UpnpUtils.MODEL_NUMBER));
	LocalServiceBinder binder = new AnnotationLocalServiceBinder();
	LocalService<ConnectionService> connectionManagerService = binder
			.read(ConnectionService.class);
	ServiceManager<ConnectionService> connectionManager = new DefaultServiceManager<ConnectionService>(
			connectionManagerService, ConnectionService.class);
	connectionManagerService.setManager(connectionManager);

	LocalService<AvtransportService> avtransportService = binder
			.read(AvtransportService.class);
	mAVtransportServiceManager = new LastChangeAwareServiceManager<AvtransportService>(
			avtransportService, new AVTransportLastChangeParser()) {
		@Override
		protected AvtransportService createServiceInstance()
				throws Exception {
			return new AvtransportService(context, mAVTransportLastChange);
		}

		@Override
		protected int getLockTimeoutMillis() {
			return TIME_OUT;
		}
	};
	avtransportService.setManager(mAVtransportServiceManager);

	LocalService<RenderingControlService> renderercontrolService = binder
			.read(RenderingControlService.class);
	mRenderercontrolServiceManager = new LastChangeAwareServiceManager<RenderingControlService>(
			renderercontrolService, new RenderingControlLastChangeParser()) {
		@Override
		protected RenderingControlService createServiceInstance()
				throws Exception {
			return new RenderingControlService(context,
					mRendererControlLastChange);
		}

		@Override
		protected int getLockTimeoutMillis() {
			return TIME_OUT;
		}
	};
	renderercontrolService.setManager(mRenderercontrolServiceManager);

	try {
		LocalService serviceList[] = { connectionManagerService,
				avtransportService, renderercontrolService };
		mLocalDevice = new LocalDevice(new DeviceIdentity(UpnpUtils.R_UDN),
				type, details,
				new Icon[] { createDefaultDeviceIcon(context) },
				serviceList);
	} catch (ValidationException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
}
 
开发者ID:sky24987,项目名称:UPlayer,代码行数:64,代码来源:MediaRenderer.java


示例10: createDevice

import org.fourthline.cling.model.meta.ManufacturerDetails; //导入依赖的package包/类
public LocalDevice createDevice( ) 
		throws ValidationException,
		LocalServiceBindingException, 
		IOException {

	DeviceIdentity identity = new DeviceIdentity(
			UDN.uniqueSystemIdentifier(deviceIdentity));

	DeviceType type = new UDADeviceType("HVAC_System", 1);

	DeviceDetails details = new DeviceDetails(friendlyName,
			new ManufacturerDetails(manufacturerName), new ModelDetails(
					modelName, modelDescription, modelNumber));

	/*Icon icon = new Icon("image/png", 48, 48, 8, getClass().getResource(
			"icon.png"));*/

	// we have to have a ZoneUserMode HVAC_OperatingMode service
	LocalService zoneUserModeLocalService = 
			new AnnotationLocalServiceBinder().read(systemUserModeServiceClass);

	zoneUserModeLocalService.setManager(
			new DefaultServiceManager(
					zoneUserModeLocalService, systemUserModeServiceClass
			)
	);

	serviceList.add(zoneUserModeLocalService);
	LocalService[] serviceArray = new LocalService[ serviceList.size() ];
	serviceList.toArray(serviceArray);
	
	// create embedded devices
	ArrayList<LocalDevice> embeddedLocalDeviceList = new ArrayList<LocalDevice>();
	for (UpnpDevice d : embeddedDevicesList) {
		embeddedLocalDeviceList.add(d.createDevice());		
	}
	LocalDevice[] embeddedDeviceArray = new LocalDevice[ embeddedDevicesList.size() ];
	embeddedLocalDeviceList.toArray(embeddedDeviceArray);
	
	return new LocalDevice(identity, type, details, /*icon,*/
			serviceArray,embeddedDeviceArray);
}
 
开发者ID:cyclingengineer,项目名称:UpnpHomeAutomationBridge,代码行数:43,代码来源:HvacSystemDevice.java


示例11: createDevice

import org.fourthline.cling.model.meta.ManufacturerDetails; //导入依赖的package包/类
public LocalDevice createDevice( ) 
		throws ValidationException,
		LocalServiceBindingException, 
		IOException {

	DeviceIdentity identity = new DeviceIdentity(
			UDN.uniqueSystemIdentifier(deviceIdentity));

	DeviceType type = new UDADeviceType("HVAC_ZoneThermostat", 1);

	DeviceDetails details = new DeviceDetails(friendlyName,
			new ManufacturerDetails(manufacturerName), new ModelDetails(
					modelName, modelDescription, modelNumber));

	/*Icon icon = new Icon("image/png", 48, 48, 8, getClass().getResource(
			"icon.png"));*/

	// we have to have a ZoneUserMode HVAC_OperatingMode service
	LocalService zoneUserModeLocalService = 
			new AnnotationLocalServiceBinder().read(zoneUserModeServiceClass);

	zoneUserModeLocalService.setManager(
			new DefaultServiceManager(
					zoneUserModeLocalService, zoneUserModeServiceClass
			)
	);

	serviceList.add(zoneUserModeLocalService);
	LocalService[] serviceArray = new LocalService[ serviceList.size() ];
	serviceList.toArray(serviceArray);
	
	// create embedded devices
	ArrayList<LocalDevice> embeddedLocalDeviceList = new ArrayList<LocalDevice>();
	for (UpnpDevice d : embeddedDevicesList) {
		embeddedLocalDeviceList.add(d.createDevice());		
	}
	LocalDevice[] embeddedDeviceArray = new LocalDevice[ embeddedDevicesList.size() ];
	embeddedLocalDeviceList.toArray(embeddedDeviceArray);
	
	return new LocalDevice(identity, type, details, /*icon,*/
			serviceArray,embeddedDeviceArray);
}
 
开发者ID:cyclingengineer,项目名称:UpnpHomeAutomationBridge,代码行数:43,代码来源:HvacZoneThermostatDevice.java


示例12: createMediaServerDevice

import org.fourthline.cling.model.meta.ManufacturerDetails; //导入依赖的package包/类
private LocalDevice createMediaServerDevice() throws Exception {

        DeviceIdentity identity = new DeviceIdentity(UDN.uniqueSystemIdentifier("FutureSonic"));
        DeviceType type = new UDADeviceType("MediaServer", 1);

        // TODO: DLNACaps
        Version version = versionService.getLocalVersion();
        String versionString = version == null ? null : version.toString();
        String licenseEmail = "[email protected]"; //settingsService.getLicenseEmail();
        String licenseString = licenseEmail == null ? "Unlicensed" : ("Licensed to " + licenseEmail);

        DeviceDetails details = new DeviceDetails("FutureSonic Media Streamer", new ManufacturerDetails("FutureSonic"),
                new ModelDetails("FutureSonic", licenseString, versionString),
                new DLNADoc[]{new DLNADoc("DMS", DLNADoc.Version.V1_5)}, null);

        Icon icon = new Icon("image/png", 512, 512, 32, getClass().getResource("futuresonic-512.png"));

        LocalService<FolderBasedContentDirectory> contentDirectoryservice = new AnnotationLocalServiceBinder().read(FolderBasedContentDirectory.class);
        contentDirectoryservice.setManager(new DefaultServiceManager<FolderBasedContentDirectory>(contentDirectoryservice) {

            @Override
            protected FolderBasedContentDirectory createServiceInstance() throws Exception {
                return folderBasedContentDirectory;
            }
        });

        final ProtocolInfos protocols = new ProtocolInfos();
        for (DLNAProfiles dlnaProfile : DLNAProfiles.values()) {
            if (dlnaProfile == DLNAProfiles.NONE) {
                continue;
            }
            try {
                protocols.add(new DLNAProtocolInfo(dlnaProfile));
            } catch (Exception e) {
                // Silently ignored.
            }
        }

        LocalService<ConnectionManagerService> connetionManagerService = new AnnotationLocalServiceBinder().read(ConnectionManagerService.class);
        connetionManagerService.setManager(new DefaultServiceManager<ConnectionManagerService>(connetionManagerService) {
            @Override
            protected ConnectionManagerService createServiceInstance() throws Exception {
                return new ConnectionManagerService(protocols, null);
            }
        });

        // For compatibility with Microsoft
        LocalService<MSMediaReceiverRegistrarService> receiverService = new AnnotationLocalServiceBinder().read(MSMediaReceiverRegistrarService.class);
        receiverService.setManager(new DefaultServiceManager<MSMediaReceiverRegistrarService>(receiverService, MSMediaReceiverRegistrarService.class));

        return new LocalDevice(identity, type, details, new Icon[]{icon}, new LocalService[]{contentDirectoryservice, connetionManagerService, receiverService});
    }
 
开发者ID:FutureSonic,项目名称:FutureSonic-Server,代码行数:53,代码来源:UPnPService.java


示例13: createMediaServerDevice

import org.fourthline.cling.model.meta.ManufacturerDetails; //导入依赖的package包/类
private LocalDevice createMediaServerDevice() throws Exception {

        String serverName = settingsService.getDlnaServerName();
        DeviceIdentity identity = new DeviceIdentity(UDN.uniqueSystemIdentifier(serverName));
        DeviceType type = new UDADeviceType("MediaServer", 1);

        // TODO: DLNACaps
        Version version = versionService.getLocalVersion();
        String versionString = version == null ? null : version.toString();
        String licenseEmail = "[email protected]"; //settingsService.getLicenseEmail();
        String licenseString = licenseEmail == null ? "Unlicensed" : ("Licensed to " + licenseEmail);

        DeviceDetails details = new DeviceDetails("Madsonic Media Streamer", new ManufacturerDetails(serverName),
                new ModelDetails(serverName, licenseString, versionString),
                new DLNADoc[]{new DLNADoc("DMS", DLNADoc.Version.V1_5)}, null);

        Icon icon = new Icon("image/png", 512, 512, 32, getClass().getResource("madsonic-512.png"));

        @SuppressWarnings("unchecked")
		LocalService<FolderBasedContentDirectory> contentDirectoryservice = new AnnotationLocalServiceBinder().read(FolderBasedContentDirectory.class);
        contentDirectoryservice.setManager(new DefaultServiceManager<FolderBasedContentDirectory>(contentDirectoryservice) {

            @Override
            protected FolderBasedContentDirectory createServiceInstance() throws Exception {
                return folderBasedContentDirectory;
            }
        });

        final ProtocolInfos protocols = new ProtocolInfos();
        for (DLNAProfiles dlnaProfile : DLNAProfiles.values()) {
            if (dlnaProfile == DLNAProfiles.NONE) {
                continue;
            }
            try {
                protocols.add(new DLNAProtocolInfo(dlnaProfile));
            } catch (Exception e) {
                // Silently ignored.
            }
        }

        @SuppressWarnings("unchecked")
		LocalService<ConnectionManagerService> connetionManagerService = new AnnotationLocalServiceBinder().read(ConnectionManagerService.class);
        connetionManagerService.setManager(new DefaultServiceManager<ConnectionManagerService>(connetionManagerService) {
            @Override
            protected ConnectionManagerService createServiceInstance() throws Exception {
                return new ConnectionManagerService(protocols, null);
            }
        });

        // For compatibility with Microsoft
        @SuppressWarnings("unchecked")
		LocalService<MSMediaReceiverRegistrarService> receiverService = new AnnotationLocalServiceBinder().read(MSMediaReceiverRegistrarService.class);
        receiverService.setManager(new DefaultServiceManager<MSMediaReceiverRegistrarService>(receiverService, MSMediaReceiverRegistrarService.class));

        return new LocalDevice(identity, type, details, new Icon[]{icon}, new LocalService[]{contentDirectoryservice, connetionManagerService, receiverService});
    }
 
开发者ID:MadMarty,项目名称:madsonic-server-5.1,代码行数:57,代码来源:UPnPService.java


示例14: createMediaServerDevice

import org.fourthline.cling.model.meta.ManufacturerDetails; //导入依赖的package包/类
private LocalDevice createMediaServerDevice() throws Exception {

        DeviceIdentity identity = new DeviceIdentity(UDN.uniqueSystemIdentifier("Madsonic"));
        DeviceType type = new UDADeviceType("MediaServer", 1);

        // TODO: DLNACaps
        Version version = versionService.getLocalVersion();
        String versionString = version == null ? null : version.toString();
        String licenseEmail = "[email protected]"; //settingsService.getLicenseEmail();
        String licenseString = licenseEmail == null ? "Unlicensed" : ("Licensed to " + licenseEmail);

        DeviceDetails details = new DeviceDetails("Madsonic Media Streamer", new ManufacturerDetails("Madsonic"),
                new ModelDetails("Madsonic", licenseString, versionString),
                new DLNADoc[]{new DLNADoc("DMS", DLNADoc.Version.V1_5)}, null);

        Icon icon = new Icon("image/png", 512, 512, 32, getClass().getResource("madsonic-512.png"));

        LocalService<FolderBasedContentDirectory> contentDirectoryservice = new AnnotationLocalServiceBinder().read(FolderBasedContentDirectory.class);
        contentDirectoryservice.setManager(new DefaultServiceManager<FolderBasedContentDirectory>(contentDirectoryservice) {

            @Override
            protected FolderBasedContentDirectory createServiceInstance() throws Exception {
                return folderBasedContentDirectory;
            }
        });

        final ProtocolInfos protocols = new ProtocolInfos();
        for (DLNAProfiles dlnaProfile : DLNAProfiles.values()) {
            if (dlnaProfile == DLNAProfiles.NONE) {
                continue;
            }
            try {
                protocols.add(new DLNAProtocolInfo(dlnaProfile));
            } catch (Exception e) {
                // Silently ignored.
            }
        }

        LocalService<ConnectionManagerService> connetionManagerService = new AnnotationLocalServiceBinder().read(ConnectionManagerService.class);
        connetionManagerService.setManager(new DefaultServiceManager<ConnectionManagerService>(connetionManagerService) {
            @Override
            protected ConnectionManagerService createServiceInstance() throws Exception {
                return new ConnectionManagerService(protocols, null);
            }
        });

        // For compatibility with Microsoft
        LocalService<MSMediaReceiverRegistrarService> receiverService = new AnnotationLocalServiceBinder().read(MSMediaReceiverRegistrarService.class);
        receiverService.setManager(new DefaultServiceManager<MSMediaReceiverRegistrarService>(receiverService, MSMediaReceiverRegistrarService.class));

        return new LocalDevice(identity, type, details, new Icon[]{icon}, new LocalService[]{contentDirectoryservice, connetionManagerService, receiverService});
    }
 
开发者ID:MadMarty,项目名称:madsonic-server-5.0,代码行数:53,代码来源:UPnPService.java


示例15: createDevice

import org.fourthline.cling.model.meta.ManufacturerDetails; //导入依赖的package包/类
LocalDevice createDevice() throws ValidationException, LocalServiceBindingException, IOException {

		final DeviceIdentity identity = new DeviceIdentity(UDN.uniqueSystemIdentifier("Gnucash services"));

		final DeviceType type = new UDADeviceType("GnucashData", 1);

		final DeviceDetails details = new DeviceDetails("Gnucash device", new ManufacturerDetails("Gnucash GPL"), new ModelDetails("Gnucash",
				"Needs python impl of gnucash to run", "v2.4"));

		final LocalService<GnucashDataServer> switchPowerService = new AnnotationLocalServiceBinder().read(GnucashDataServer.class);

		switchPowerService.setManager(new GnucashServiceManager(switchPowerService, data));

		return new LocalDevice(identity, type, details, switchPowerService);

		/*
		 * Several services can be bound to the same device: return new LocalDevice( identity, type, details, icon, new LocalService[] {switchPowerService,
		 * myOtherService} );
		 */

	}
 
开发者ID:nhrdl,项目名称:gnucashMobile,代码行数:22,代码来源:Main.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java User类代码示例发布时间:2022-05-21
下一篇:
Java RenameParticipant类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap