/* Pause the jack device */ static void jack_pause (bool_t p) { TRACE("p == %d\n", p); paused = p; /* pause the device if p is non-zero, unpause the device if p is zero and */ /* we are currently paused */ if(p) JACK_SetState(driver, PAUSED); else if(JACK_GetState(driver) == PAUSED) JACK_SetState(driver, PLAYING); }
/* current playing position of the mp3 */ static void jack_flush(int ms_offset_time) { TRACE("setting values for ms_offset_time of %d\n", ms_offset_time); JACK_Reset(driver); /* flush buffers and set state to STOPPED */ /* update the internal driver values to correspond to the input time given */ JACK_SetPosition(driver, MILLISECONDS, ms_offset_time); if (paused) JACK_SetState(driver, PAUSED); else JACK_SetState(driver, PLAYING); }
CAMLprim value caml_bjack_set_state(value d, value state) { CAMLparam2(d,state); int ret = JACK_SetState(Bjack_drv_val(d),Int_val(state)); if (ret != 0) caml_failwith("state"); CAMLreturn(Val_unit); }