More > JRiver Media Center 32 for Windows

MCWS Feature Request - Notifications on state change

<< < (2/9) > >>

Hendrik:

--- Quote from: Striker on February 14, 2024, 05:39:01 pm ---I will still have to do the first MCWS Playback/Info?Fields call every second to know if the info has changed and to check if the playback status changed.  Yes if the next key did not change I wouldn't have to do the 2nd call.

--- End quote ---

Indeed, however the request in question in this thread would not actually impact this at all. You will still need to continue to do so. But caching and checking NextFileKey should alleviate any concerns about additional calls, as you need to do one per track change, which is one in several minutes in normal operation.

Polling Playback/Info or similar calls is how any remote controls or remote displays work, and while not "perfect", it has shown to work just fine for several use-cases. Media Center is not currently setup to really "push" information in a generic manner, or run an external program. These things would have to be done very carefully as to not impact playback. And running a local program also doesn't really solve the issue for anyone wanting to receive such events remotely.

Striker:

--- Quote from: Hendrik on February 14, 2024, 06:45:27 pm ---Indeed, however the request in question in this thread would not actually impact this at all. You will still need to continue to do so. But caching and checking NextFileKey should alleviate any concerns about additional calls, as you need to do one per track change, which is one in several minutes in normal operation.

Polling Playback/Info or similar calls is how any remote controls or remote displays work, and while not "perfect", it has shown to work just fine for several use-cases. Media Center is not currently setup to really "push" information in a generic manner, or run an external program. These things would have to be done very carefully as to not impact playback. And running a local program also doesn't really solve the issue for anyone wanting to receive such events remotely.

--- End quote ---

Thank you for the reply.

While I know it's done, and I've done it more often than I like, I always try to find an event driven solution rather than polling.

If MC were to run a user program... I would think MC would run it as a totally disconnected background process.  Any issues with that program running or causing problems with MediaCenter would of course be the user problem.

I bought the "PlayingNow" plugin in 2007 and it, running within MediaCenter has successfully been calling my user configured program on track change since 2007 without issue.

zybex:

--- Quote from: Striker on February 14, 2024, 05:52:18 pm ---Feature Request - MC option to call a user program on track or state change

--- End quote ---

+1

Either that or some kind of event broadcast system that could be picked up by an external app.

mattkhan:
a full featured push api (websocket would sit alongside mcws neatly) would be great

a minimal version could provide the equivalent of MCWS/v1/Playback/Info in ws form

e.g.

client sends subscribe message containing optional list of fields
server replies with current state (i.e. equivalent to calling Playback/Info)
server sends an update whenever the value in any of those fields changes (coalescing multiple changes into a single message + throttled to some reasonable interval like 250ms)

JimH:

--- Quote from: Striker on February 14, 2024, 07:31:14 pm ---While I know it's done, and I've done it more often than I like, I always try to find an event driven solution rather than polling.

--- End quote ---
Is there a reason for this?  While polling may be more "expensive", I can't imagine that it has a significant impact on performance.  Modern computers are capable of lots of simultaneous computing tasks without breaking a sweat.

Any evidence to the contrary?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version