/* GSI - general sound interface
 *
 * gsimixer.h
 *
 * 1996 - 2000 by W.H.Scholten
 *
 * This file is released to the public domain.
 */


#ifndef _GSI__gsimixer__gsimixer_h
#define _GSI__gsimixer__gsimixer_h

#ifdef _cplusplus
extern "C" {
#endif /* __cplusplus */

#include <gsi/mixer_data.h>



#define GSIMIXER_HW_S struct gsi_mixer_device *hw, struct gsi_mixer_devicedata *hw_status
typedef struct gsi_mixer_devicedata {
	int  dev; /* weg ? */
	int  fd;
	int  fd_ct;
} gsi_mixer_devicedata_t;

typedef struct gsi_mixer_device {
	char *device; /* the device to open, e.g. /dev/mixer */
	char id[32]; /* e.g. mixer/(OSS) */

	int  (*init) (GSIMIXER_HW_S);
	int  (*close) (GSIMIXER_HW_S);
	int  (*set_volume) (GSIMIXER_HW_S, int dev_type, int devno, int vol);
} gsi_mixer_device_t;


extern gsi_mixer_device_t *mixer_devices;







extern int  gsimixer_ok;
extern char *gsimixer_device;

extern int  gsimixer_num_devices [ GSIMIXER_NUM_DEVICE_TYPES ];

/* extern int  gsi_mixer_volume [ _RECORD_DEVICE_OFFSET + GSIMIXER_NUM_DEVICE_TYPES ]; */
extern int  *gsimixer_volume [ _RECORD_DEVICE_OFFSET + GSIMIXER_NUM_DEVICE_TYPES ];

/* Mixer volumes are 0-256 */

int  gsimixer_init(void);
int  gsimixer_close(void);

int  gsimixer_set_device_volume(int device_type, int device_no, int vol);
int  gsimixer_get_device_volume(int device_type, int device_no);

int  gsimixer_mute(void);
int  gsimixer_unmute(void);
int  gsimixer_set_balance(int new_balance);

#ifdef _cplusplus
}
#endif /* __cplusplus */

#endif /* _GSI__gsimixer__gsimixer_h */
