- -- To synchronize the state on startup, send the idle commands now. As a
- -- side effect, this will enable idle state.
- self:_send_idle_commands(true)
-
- return self
-end
-
-function mpc:_send_idle_commands(skip_stop_idle)
- -- We use a ping to unset this to make sure we never get into a busy
- -- loop sending idle / unidle commands. Next call to
- -- _send_idle_commands() might be ignored!
- if self._idle_commands_pending then
- return
- end
- if not skip_stop_idle then
- self:_stop_idle()
+ -- To synchronize the state on startup, send the idle commands now.
+ for i = 1, #self._idle_subsystems, 2 do
+ self._idle_subsystems[i+1](self)