use of org.openhab.binding.upnpcontrol.internal.audiosink.UpnpAudioSink in project openhab-addons by openhab.
the class UpnpControlHandlerFactory method registerAudioSink.
@Override
public void registerAudioSink(UpnpRendererHandler handler) {
if (!(callbackUrl.isEmpty())) {
UpnpAudioSink audioSink = new UpnpAudioSink(handler, audioHTTPServer, callbackUrl);
@SuppressWarnings("unchecked") ServiceRegistration<AudioSink> reg = (ServiceRegistration<AudioSink>) bundleContext.registerService(AudioSink.class.getName(), audioSink, new Hashtable<String, Object>());
Thing thing = handler.getThing();
audioSinkRegistrations.put(thing.getUID().toString(), reg);
logger.debug("Audio sink added for media renderer {}", thing.getLabel());
UpnpNotificationAudioSink notificationAudioSink = new UpnpNotificationAudioSink(handler, audioHTTPServer, callbackUrl);
@SuppressWarnings("unchecked") ServiceRegistration<AudioSink> notificationReg = (ServiceRegistration<AudioSink>) bundleContext.registerService(AudioSink.class.getName(), notificationAudioSink, new Hashtable<String, Object>());
audioSinkRegistrations.put(thing.getUID().toString() + NOTIFICATION_AUDIOSINK_EXTENSION, notificationReg);
logger.debug("Notification audio sink added for media renderer {}", thing.getLabel());
}
}
Aggregations