alsa-utils/alsactl/alsactl.h

105 lines
2.5 KiB
C
Raw Normal View History

1998-10-29 23:45:59 +01:00
/*
* Advanced Linux Sound Architecture Control Program
* Copyright (c) 1997 by Perex, APS, University of South Bohemia
*
*
* This program 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 of the License, or
* (at your option) any later version.
*
* This program 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 this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
1999-03-27 20:45:01 +01:00
#include <errno.h>
1998-10-29 23:45:59 +01:00
#include <sys/asoundlib.h>
#define ALSACTL_FILE "/etc/asound.conf"
1999-03-08 17:51:53 +01:00
#define LEFT 1
#define RIGHT 2
#define OUTPUT 0
#define INPUT 1
1998-10-29 23:45:59 +01:00
extern int debugflag;
1998-11-27 16:13:57 +01:00
extern void error(const char *fmt,...);
1998-10-29 23:45:59 +01:00
struct ctl_switch {
1998-11-27 16:13:57 +01:00
int change;
1999-03-27 20:45:01 +01:00
snd_switch_t s;
1998-11-27 16:13:57 +01:00
struct ctl_switch *next;
1998-10-29 23:45:59 +01:00
};
struct ctl {
1998-11-27 16:13:57 +01:00
snd_ctl_hw_info_t hwinfo;
struct ctl_switch *switches;
1998-10-29 23:45:59 +01:00
};
struct mixer_element {
snd_mixer_element_info_t info;
snd_mixer_element_t element;
struct mixer_element *next;
1998-10-29 23:45:59 +01:00
};
struct mixer {
1998-11-27 16:13:57 +01:00
int no;
snd_mixer_info_t info;
struct mixer_element *elements;
1999-03-27 20:45:01 +01:00
struct ctl_switch *switches;
1998-11-27 16:13:57 +01:00
struct mixer *next;
1998-10-29 23:45:59 +01:00
};
struct pcm {
1998-11-27 16:13:57 +01:00
int no;
snd_pcm_info_t info;
1999-03-27 20:45:01 +01:00
struct ctl_switch *pswitches;
struct ctl_switch *rswitches;
1998-11-27 16:13:57 +01:00
struct pcm *next;
1998-10-29 23:45:59 +01:00
};
struct rawmidi {
1998-11-27 16:13:57 +01:00
int no;
snd_rawmidi_info_t info;
1999-03-27 20:45:01 +01:00
struct ctl_switch *iswitches;
struct ctl_switch *oswitches;
1998-11-27 16:13:57 +01:00
struct rawmidi *next;
1998-10-29 23:45:59 +01:00
};
struct soundcard {
1998-11-27 16:13:57 +01:00
int no; /* card number */
struct ctl control;
struct mixer *mixers;
struct pcm *pcms;
struct rawmidi *rawmidis;
struct soundcard *next;
1998-10-29 23:45:59 +01:00
};
extern struct soundcard *soundcards;
extern struct soundcard *rsoundcards; /* read soundcards */
1998-10-29 23:45:59 +01:00
1998-11-27 16:13:57 +01:00
void soundcard_setup_init(void);
void soundcard_setup_done(void);
int soundcard_setup_load(const char *filename, int skip);
int soundcard_setup_write(const char *filename, int cardno);
int soundcard_setup_collect_switches(int cardno);
int soundcard_setup_collect_data(int cardno);
int soundcard_setup_merge_switches(int cardno);
int soundcard_setup_merge_data(int cardno);
int soundcard_setup_process_switches(int cardno);
int soundcard_setup_process_data(int cardno);
char *mixer_element_id(snd_mixer_eid_t *eid);