
![]() 
  
  
  
  Home  /  Autodocs  /  audio.device
  NAME
  
    
      - CMD_FLUSH
- 
        cancel all pending I/O
 
 
 
  FUNCTION
  
    CMD_FLUSH is a standard command for multiple audio channels.  For each selected channel (io_Unit), if the allocation key (ioa_AllocKey) is correct, CMD_FLUSH aborts all writes (CMD_WRITE) in progress or queued and any I/O requests waiting to synchronize with the end of the cycle (ADCMD_WAITCYCLE); otherwise, CMD_FLUSH returns an error (ADIOERR_NOALLOCATION).  CMD_FLUSH is synchronous and only replies (mn_ReplyPort) if the quick flag (IOF_QUICK) is clear.  Do not use CMD_FLUSH in interrupt code at interrupt level 5 or higher.
  
  INPUTS
  
    
      - io_Device
- 
        Pointer to device node, must be set by (or copied from I/O block set by) OpenDevice function
 
 
- io_Unit
- 
        Bit map of channels to flush (bits 0 thru 3 correspond to channels 0 thru 3)
 
 
- io_Command
- 
        Command number for CMD_FLUSH
 
 
- io_Flags
- 
        Flags, must be cleared if not used: IOF_QUICK - (CLEAR) reply I/O request
 
 
- ioa_AllocKey
- 
        Allocation key, must be set by (or copied from I/O block set by) OpenDevice function or ADCMD_ALLOCATE command
 
 
 
  RESULT
  
    
      - io_Unit
- 
        Bit map of channels successfully flushed (bits 0 thru 3 correspond to channels 0 thru 3)
 
 
- io_Error
- 
        Error number: 0                    - no error ADIOERR_NOALLOCATION - allocation key (ioa_AllocKey)
 
 
            does not match key for channel