Re: [ecasound] telnet is all you need

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [ecasound] telnet is all you need
From: Kai Vehmanen (k_AT_eca.cx)
Date: Thu Nov 07 2002 - 16:45:02 EET


On Thu, 7 Nov 2002, Mario Lang wrote:

> if only 256 messages are returned with NetECI.

Yes, only messages with loglevel 256 will come through.

> Reason is, in ecasound.el, I use the prompt of ecasound
> to determine when output from a command is finished.
> This is done because I could encounter <256 messages, and
> wouldn't know when to return a value from eci-command.

Actually, after you issue int-output-mode-wellformed, messages from all
loglevels are sent using the wellformed syntax. So you shouldn't need to
rely on getting the command prompt. For instance ecasoundc_sa (the C ECI
impl) treats the command prompt as an invalid message and ignores it.

In ecamonitor, which is modelled after your lisp parser, I've used the
following:

m = re.match('256 ([0-9]{1,5}) (.+)\r\n(.*)\r\n\r\n.*', str, re.MULTILINE | re.S)

... if the above regexp fails, we'll just read more data from the socket
and try again. This is repeated until a valid message is found. We can
further validate the received messages by checking that expected message
length (1st regex subgroup) matches the actual content length (3rd
subgroup).

-- 
 http://www.eca.cx
 Audio software for Linux!


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Thu Nov 07 2002 - 16:42:28 EET