ChriD / node-raumkernel

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

Create "confirm" option #22

Closed ChriD closed 7 years ago

ChriD commented 7 years ago

Create "confirm" option eg. to be sure if you set play on a renderer it will return only if state has changed to play

ChriD commented 7 years ago

In fact it's better to create a "trigger" manager? With those we may achieve what we want with this issue and we may use it later on on incident based stuff

e.g.

trigger[0] = {  
"type" : "rendererStateValue",
"key" : "Volume",
"value" : "25" // <-- can be expression?
"callback" : callbackMethod
"oneShot" : true <-- one shot triggers will be removed after they shot once
}

setupRendererStateTrigger("Volume", "25", function(){
  _resolve()
})
setupZoneConfigurationTrigger(????, function(){ 
 _resolve()
})

manager.trigger("rendererStateValue", "Volume", {...})

We have to care about the performance when we implement this!!!

ChriD commented 7 years ago

Added and tested triggers for play, stop, pause, setPlayMode But there is a pitfall/problem when trying to set the value to a state that will never occour, so i have created a timeout too which will reject in a certain amount of time.

Other methods will follow

ChriD commented 7 years ago

Added and tested triggers for muteand setVolume

ChriD commented 7 years ago

Okay, i will add it for setAvTransportUri and bendAvTransportUri on the renderer (this should cover loadPlayist, loadSingle,... too). And then there are the ones missing for the zone.

This has to be done for thsi ticket

ChriD commented 7 years ago

added loadPlaylist, loadShuffle, loadUri, loadLineIn, loadSingle

ChriD commented 7 years ago

Added for zone updates