Search in sources :

Example 1 with UpnpAudioSink

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());
    }
}
Also used : UpnpNotificationAudioSink(org.openhab.binding.upnpcontrol.internal.audiosink.UpnpNotificationAudioSink) AudioSink(org.openhab.core.audio.AudioSink) UpnpAudioSink(org.openhab.binding.upnpcontrol.internal.audiosink.UpnpAudioSink) UpnpAudioSink(org.openhab.binding.upnpcontrol.internal.audiosink.UpnpAudioSink) Hashtable(java.util.Hashtable) UpnpNotificationAudioSink(org.openhab.binding.upnpcontrol.internal.audiosink.UpnpNotificationAudioSink) Thing(org.openhab.core.thing.Thing) ServiceRegistration(org.osgi.framework.ServiceRegistration)

Aggregations

Hashtable (java.util.Hashtable)1 UpnpAudioSink (org.openhab.binding.upnpcontrol.internal.audiosink.UpnpAudioSink)1 UpnpNotificationAudioSink (org.openhab.binding.upnpcontrol.internal.audiosink.UpnpNotificationAudioSink)1 AudioSink (org.openhab.core.audio.AudioSink)1 Thing (org.openhab.core.thing.Thing)1 ServiceRegistration (org.osgi.framework.ServiceRegistration)1