A new day, a new Emacs-Lisp mile-stone. :) I've collapsed all my ecasound
related elisp code into one file now, because it is actually not that large.

QUICKSTART:
Load this file (eval-buffer or load-library) and set ecasound-program
to the path where your int-output-mode-wellformed capable ecasound binary is.

(setq ecasound-path "...")

Then do M-x ecasound RET

To see the greatest improvment, try the Menu -> ChainOp -> Add...
or do M-x ecasound-cop-add RET.

To see examples of the ECI implementation in action, use M-x eci-example RET
to get the example from the ecidoc.latex file or have a
look at ecasound-normalize, which is a elisp implementation of
the python example.

(note, the eci library stuff uses a different executable path right now, see
eci-program, you will also want to set this. In the future, we will
use the ECASOUND env.var.)

ecasound-cop-add is really the feature I always wanted and needed,
lets see where we can go from here.
(<wink> I'll be more productive if I get feedback :-) )

;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.

;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to
;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.

;;; Commentary:

;; This file implements several aspects of ecasound use:
;;
;; * A derived-major-mode, from comint mode for an inferior ecasound
;; process (ecasound-aim-mode). Complete with context sensitive
;; completion and interactive features to control the current process
;; using ECI.
;;
;; * Ecasound Control Interface (ECI) library for programmatic control
;; of a Ecasound process. This allows you to write Ecasound batch
;; jobs in Emacs-Lisp with Lisp functions and return values. Have a
;; look at eci-example and ecasound-normalize.
;;
;; * ecasound-ewf-mode, a mode for editing .ewf files.
;;
;; NEWS:
;;
;; Since the last public release:
;;
;; * ecasound.el, ecasound-ewf.el and eci.el were merged into a single
;; file, ecasound.el. Code was integrated (ecasound-aim-mode uses eci-*
;; functions to offer interactive features).
;;
;; * To work correctly, an ecasound version implementing the
;; int-output-mode-wellformed command is expected. Older versions are
;; only supported in a limited way. So, you probably want to do
;; (setq ecasound-program "/path/to/cvs/built/version")
;; first.
;;
;; * ecasound-cop-add: An interactive version of eci-cop-add, with a
;; completion based menu and separate prompts for arguments. This
;; uses eci-cop-register to get the information and is a first attempt
;; to show how much ecasound.el can actually make ecasound more fun!
;;
;; Todo:
;;
;; * Write eci-cop-register alike support for preset-register and
;; ladspa-register.
;; * Copy documentation for ECI commands into eci-* docstrings and menu
;; :help keywords.
;; * Expand the menu.
;; * Bind most important interactive functions in ecasound-aim-mode-map
;; (which layout to use?)
;; * Collapse all the duplicate code into a macro and an alist which
;; defines the available eci commands. (This seems rather complicated and
;; is probably not worth the effort.

;;; Code:

(require 'comint)
(require 'easymenu)
(require 'pcomplete)

(defgroup ecasound nil
"Ecasound is a multitrack audio recorder.

Variables in this group affect inferior ecasound processes started from
within Emacs using the command `ecasound'.

See the subgroup `eci' for settings which affect the programmatic interface
to ECI."
:prefix "ecasound-"
:group 'processes)

;;;###autoload
(defun ecasound (&optional buffer)
"Run an inferior ecasound, with I/O through BUFFER (which defaults to `*ecasound*').
Interactively, a prefix arg means to prompt for BUFFER.
If BUFFER exists but ecasound process is not running, make new ecasound
process using `ecasound-arguments'.
If BUFFER exists and ecasound process is running, just switch to BUFFER.
The buffer is put in ecasound mode, giving commands for sending input and
completing IAM commands. See `ecasound-iam-mode'.

(defcustom eci-parse-cleanup-buffer t
"*Indicates if `eci-parse' should cleanup the buffer.
This means the loglevel, msgsize and return type will get removed if
parsed successfully."
:group 'eci
:type 'boolean)

(defun eci-interactive-startup ()
"Used to interactively startup a ECI session using `eci-init'.
This will mostly be used for testing sessions and is equivalent
to `ecasound'."
(interactive)
(switch-to-buffer (eci-init)))