hzeller / gmrender-resurrect

Resource efficient UPnP/DLNA renderer, optimal for Raspberry Pi, CuBox or a general MediaServer. Fork of GMediaRenderer to add some features to make it usable.
GNU General Public License v2.0
832 stars 202 forks source link

Event detection mechanisms #89

Closed hu55a1n1 closed 8 years ago

hu55a1n1 commented 8 years ago

Hi, I was wondering if there's a way to detect when the renderer starts/stops playing an audio file. Currently I'm planning on having a shell script monitor gmediarenderer's log file for some predefined patterns (using grep).

I wanted to know the right way to accomplish this.

Use-case: Basically, I want to be able to switch ON an external amplifier when the renderer starts to stream and switch it OFF when the streaming is complete.

hzeller commented 8 years ago

You should be able to write a little UPnP program that just listens for events on the network; I have done a similar thing with this display ( https://github.com/hzeller/upnp-display ). It has the advantage that you don't even have to run it on the same machine.

Of course, it would be nice if such things could be done locally via some socket or something, but that is not implemented at this point.