require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&AD1848_NPORT)) {
    sub AD1848_NPORT () {	4;}
}
unless(defined(&NOTRUNNING)) {
    sub NOTRUNNING () {	0;}
}
unless(defined(&DMARUNNING)) {
    sub DMARUNNING () {	1;}
}
unless(defined(&PCMRUNNING)) {
    sub PCMRUNNING () {	2;}
}
unless(defined(&MUTE_LEFT)) {
    sub MUTE_LEFT () {	1;}
}
unless(defined(&MUTE_RIGHT)) {
    sub MUTE_RIGHT () {	2;}
}
unless(defined(&MUTE_ALL)) {
    sub MUTE_ALL () {	( &MUTE_LEFT |  &MUTE_RIGHT);}
}
unless(defined(&MUTE_MONO)) {
    sub MUTE_MONO () {	 &MUTE_ALL;}
}
unless(defined(&AD1848_AUX2_CHANNEL)) {
    sub AD1848_AUX2_CHANNEL () {	0;}
}
unless(defined(&AD1848_AUX1_CHANNEL)) {
    sub AD1848_AUX1_CHANNEL () {	1;}
}
unless(defined(&AD1848_DAC_CHANNEL)) {
    sub AD1848_DAC_CHANNEL () {	2;}
}
unless(defined(&AD1848_LINE_CHANNEL)) {
    sub AD1848_LINE_CHANNEL () {	3;}
}
unless(defined(&AD1848_MONO_CHANNEL)) {
    sub AD1848_MONO_CHANNEL () {	4;}
}
unless(defined(&AD1848_MONITOR_CHANNEL)) {
    sub AD1848_MONITOR_CHANNEL () {	5;}
}
unless(defined(&MIC_IN_PORT)) {
    sub MIC_IN_PORT () {	0;}
}
unless(defined(&LINE_IN_PORT)) {
    sub LINE_IN_PORT () {	1;}
}
unless(defined(&AUX1_IN_PORT)) {
    sub AUX1_IN_PORT () {	2;}
}
unless(defined(&DAC_IN_PORT)) {
    sub DAC_IN_PORT () {	3;}
}
if(defined(&_KERNEL)) {
    eval 'sub AD1848_KIND_LVL () {0;}' unless defined(&AD1848_KIND_LVL);
    eval 'sub AD1848_KIND_MUTE () {1;}' unless defined(&AD1848_KIND_MUTE);
    eval 'sub AD1848_KIND_RECORDGAIN () {2;}' unless defined(&AD1848_KIND_RECORDGAIN);
    eval 'sub AD1848_KIND_MICGAIN () {3;}' unless defined(&AD1848_KIND_MICGAIN);
    eval 'sub AD1848_KIND_RECORDSOURCE () {4;}' unless defined(&AD1848_KIND_RECORDSOURCE);
    eval 'sub ad1848_to_vol {
        my($cp,$vol) = @_;
	    eval q(*$cp; \'struct ad1848_volume\' *$vol; {  &if ( ($cp->{un}->{value}->{num_channels}) == 1) {  ($vol->{left}) =  ($vol->{right}) =  ($cp->{un}->{value}->{level[&AUDIO_MIXER_LEVEL_MONO]}); (1); }  &else  &if ( ($cp->{un}->{value}->{num_channels}) == 2) {  ($vol->{left})  =  ($cp->{un}->{value}->{level[&AUDIO_MIXER_LEVEL_LEFT]});  ($vol->{right}) =  ($cp->{un}->{value}->{level[&AUDIO_MIXER_LEVEL_RIGHT]}); (1); } (0); });
    }' unless defined(&ad1848_to_vol);
    eval 'sub ad1848_from_vol {
        my($cp,$vol) = @_;
	    eval q(*$cp; \'struct ad1848_volume\' *$vol; {  &if ( ($cp->{un}->{value}->{num_channels}) == 1) {  ($cp->{un}->{value}->{level[&AUDIO_MIXER_LEVEL_MONO]}) =  ($vol->{left}); (1); }  &else  &if ( ($cp->{un}->{value}->{num_channels}) == 2) {  ($cp->{un}->{value}->{level[&AUDIO_MIXER_LEVEL_LEFT]}) =  ($vol->{left});  ($cp->{un}->{value}->{level[&AUDIO_MIXER_LEVEL_RIGHT]}) =  ($vol->{right}); (1); } (0); });
    }' unless defined(&ad1848_from_vol);
}
1;
