function dmx_create_state_file($dstate_file, &$dmx_inputs, &$dmx_outputs1, &$dmx_outputs2) { $dmx_inputs = str_pad('', 256, '0'); $dmx_outputs1 = str_pad('', 256, '0'); $dmx_outputs2 = str_pad('', 256, '0'); return dmx_write_state_file($dstate_file, $dmx_inputs, $dmx_outputs1, $dmx_outputs2); }
//something changed in shm for ($i = 0; $i < 128; $i++) { if (substr($do1, $i * 2, 2) != substr($dmx_outputs1, $i * 2, 2)) { //send xap dmx level change message for universe 1 send_dmx_output_level_event_message($i, XAPSRC_DMX_OUT1, XAPUID_DMX_OUT1, $do1, $donames1); $outs1_changed = 1; } if (substr($do2, $i * 2, 2) != substr($dmx_outputs2, $i * 2, 2)) { //send xap dmx level change message for universe 2 send_dmx_output_level_event_message($i, XAPSRC_DMX_OUT2, XAPUID_DMX_OUT2, $do2, $donames2); $outs2_changed = 1; } } } if ($outs1_changed) { $dmx_outputs1 = $do1; dmx_set_levels_U1(bcd_to_chr($dmx_outputs1)); } if ($outs2_changed) { $dmx_outputs2 = $do2; dmx_set_levels_U2(bcd_to_chr($dmx_outputs2)); } usleep(5000); } } dmx_set_dmx_receive_mode(SEND_ON_CHANGE_ONLY); dmx_close(); dmx_write_state_file($dstate_file, $dmx_inputs, $dmx_outputs1, $dmx_outputs2); socket_close($xap_sock_in); shmop_close($shm_id); logformat("hac_dmx exiting cleanly.\n");