def _handle_message(self, data):
if data.type == MSG_SERVER_SETTINGS:<EOL><INDENT>_LOGGER.info(data.payload)<EOL><DEDENT>elif data.type == MSG_SAMPLE_FORMAT:<EOL><INDENT>_LOGGER.info(data.payload)<EOL>self._connected = True<EOL><DEDENT>elif data.type == MSG_TIME:<EOL><INDENT>if not self._buffered:<EOL><INDENT>_LOGGER.info('<STR_LIT>')<EOL><DEDENT><DEDENT>elif data.type == MSG_HEADER:<EOL><INDENT>_LOGGER.info(data.payload.codec.decode('<STR_LIT:ascii>'))<EOL>self._source.push(data.payload.header)<EOL>self._source.play()<EOL><DEDENT>elif data.type == MSG_WIRE_CHUNK:<EOL><INDENT>self._buffer.put(data.payload.chunk)<EOL>if self._buffer.qsize() > BUFFER_SIZE:<EOL><INDENT>self._buffered = True<EOL><DEDENT>if self._buffer.empty():<EOL><INDENT>self._buffered = False<EOL><DEDENT><DEDENT>
Handle messages.