/* GSI - general sound interface
 *
 * gsi_subcommands.h
 *
 * GSI sub command specification.
 *
 *
 * 1996-1999 by W.H.Scholten
 *
 * This file is released to the public domain.
 */


#ifndef _GSI__gsi_subcommands_h
#define _GSI__gsi_subcommands_h

/* Main */
#define GSI_CMD_CURRENT 32 /* 'OR' with a command to refer to the last accessed (started/changed settings) channel. Use this only in a LOCKED SECTION when using threads. */

/* CD playing */
#define GSI_CMD_CD_PLAY                   0 /* + <first track> <m> <s> <f> <last track> <m> <s> <f> 1 1 1 1 1 1 1 1 1; msf are offsets from the track. */
#define GSI_CMD_CD_STOP                   6
#define GSI_CMD_CD_PAUSE                  7
#define GSI_CMD_CD_RESUME                 8

#define GSI_CMD_CD_MUTE                   9
#define GSI_CMD_CD_LEFT_CHANNEL          10 /* 1; play left channel on L and R */
#define GSI_CMD_CD_RIGHT_CHANNEL         11 /* 1; play rigft channel on L and R */
#define GSI_CMD_CD_MONO                  12
#define GSI_CMD_CD_STEREO                13

#define GSI_CMD_CD_EJECT                 14
#define GSI_CMD_CD_INSERT                15
#define GSI_CMD_CHANGE_CD                16 /* <slotno> 1 1; */

//#define GSI_CMD_CD_GET_TRACKNO           18 /* total number of tracks on the CD. */
#define GSI_CMD_CD_GET_TRACKS            17 /* 1; get all tracks, with data type */
#define GSI_CMD_CD_GET_STATUS            18 /* 1; none, playing, paused, (no disk, no drive) =0,1,2,  3,4 */


/* Sub commands cmd: */
#  define GSI_CMD_RECORD_NOW              0 /* 1; */
#  define GSI_CMD_RECORD_AT               1 /* <sec> <musec> 1 4 4; gettimeofday values */
#  define GSI_CMD_RECORD_DURATION         2 /* <musec> 1 4; */
#  define GSI_CMD_RECORD_AUTO_START       3 /* 1; start when there's really something, otherwise throw it away */
#  define GSI_CMD_RECORD_AUTO_STOP        4 /* 1; once started, stop when there's silence */
#  define GSI_CMD_RECORD_AUTO_THRESHOLD   5 /* <8 bit level> 1 1; anything below this threshold is considered random noise, hence silence */
#  define GSI_CMD_RECORD_STOP             6 /* 1; */
#  define GSI_CMD_RECORD_FILE             7 /* <name> 1 strken+1; name of the file to save to */



/*---------------------------------------------------------------------------*
 *      Effect selection bitmasks.
 *
 *      This will only allow the given effects on a sound (must be sent to
 *      the server, not yet implemented).
 *---------------------------------------------------------------------------*/
#define GSI_FXMASK_SET_X                 1
#define GSI_FXMASK_SET_Z                 2
#define GSI_FXMASK_SET_Y                 4
#define GSI_FXMASK_ADJUST_X              8
#define GSI_FXMASK_ADJUST_Z             16
#define GSI_FXMASK_ADJUST_Y             32

#define GSI_FXMASK_SET_OBSERVER_X       64
#define GSI_FXMASK_SET_OBSERVER_Z      128
#define GSI_FXMASK_SET_OBSERVER_Y      256

#define GSI_FXMASK_SET_OBSERVER_ANGLE  512

#define GSI_FXMASK_DOPPLER            4096

/* are the following useful ?: */
#define GSI_FXMASK_ECHO               8192
#define GSI_FXMASK_ALL_DOPPLER       16384 /* doppler for all sounds */
#define GSI_FXMASK_ALL_ECHO          32768 /* echo for all sounds */
#define GSI_FXMASK_NOISE           (1<<20) /* distort the sound with noise? */
#define GSI_FXMASK_ENVELOPE        (1<<21) /* use envelope */


#endif /* _GSI__gsi_subcommands_h */
