1 #ifndef INCLUDED_AUDIO_IO_BARRIER_H 2 #define INCLUDED_AUDIO_IO_BARRIER_H 3 4 /** 5 * Interface class that introduces audio i/o barriers. 6 * The barriers are used to signal that processing 7 * will be started or stopped. 8 */ 9 class AUDIO_IO_BARRIER { 10 11 public: 12 13 /** 14 * Starts I/O processing. 15 * 16 * The read_buffer()/write_buffer() functions will not be called 17 * before I/O started. Also, it is guaranteed that stop_io() will 18 * be called from the same thread as start_io() was called from. 19 */ 20 virtual void start_io(void) = 0; 21 22 /** 23 * Stops I/O processing. 24 * 25 * The read_buffer()/write_buffer() functions will not be called 26 * after I/O has been stopped. 27 */ 28 virtual void stop_io(void) = 0; 29 ~AUDIO_IO_BARRIER(void)30 virtual ~AUDIO_IO_BARRIER(void) {} 31 }; 32 33 #endif 34