ChriD / node-raumkernel

A nodeJs lib for controlling the raumfeld multiroom system
MIT License
17 stars 7 forks source link

Question: Getting room renderer #38

Closed Alex9779 closed 6 years ago

Alex9779 commented 6 years ago

I am searching how I can get a room renderer. I use getRoomObjectFromMediaRendererUdnOrName to to get the "RoomObject" for a specified name. But that is not the renderer. For other things after that I use the roomUdn from that object to add that room to a virtual media renderer aka a zone. I know must things should be done with that virtual thing, but for what I wanna do I need the room renderer to set the volume or mute in that room. If the room is in a virtual I can use the function of the virtual to set that for a room udn. But not if the room is not in a virtual. The thing is that I want to add a room to a virtual but set its volume before adding it so that the volume does not overshoot over something. Is that possible? For now I would be thankful for a hint in which array of the kernel I will find this, a function to do this seems not to exist. I browsed all the stuff but have no real idea what would be best to get this...

Alex9779 commented 6 years ago

Or maybe there isn't something like a room renderer? Do I just have to loop over all renderers in a room?

ChriD commented 6 years ago

A room can consists of more than one renderer. In the roomObject you should have a map called "renderers" and in this renderer object (the one in the array) there should be the room-renderer UDN. With this you can use the getMediaRenderer method on the device manager

BTW: it should also work if you do something like that:
renderer = deviceManager.getMediaRenderer("Wohnzimmer")

Alex9779 commented 6 years ago

Yeah ok so I have to loop over all those renderers within the room? There is no renderer for the room in a whole?

ChriD commented 6 years ago

Yeah ok so I have to loop over all those renderers within the room?

No. If you have the room name you can get the renderer like renderer = deviceManager.getMediaRenderer("Wohnzimmer")

There is no renderer for the room in a whole?

Nope. There are only virtualRenderers and normalRenderers. A room itself is no renderer. It has a UDN but thats it. In most cases a room will have one renderer (other case is for e.g. if you have a teufel subwoofer)

Alex9779 commented 6 years ago

Ahhhhhhhh ok thanks for clarifying 😃 think I got it a little bit more...