From alsa-devel-owner@alsa.jcu.cz  Sat Oct  3 18:41:37 1998
Received: from entry.jcu.cz (IDENT:perex@entry.jcu.cz [160.217.1.111])
	by marvin.jcu.cz (8.9.1a/8.9.1) with SMTP id SAA14794;
	Sat, 3 Oct 1998 18:41:29 +0200
Date: Sat, 3 Oct 1998 18:41:29 +0200 (CEST)
From: Jaroslav Kysela <perex@jcu.cz>
To: "Christopher T. Lansdown" <lansdoct@screech.cs.alfred.edu>
cc: Brion Vibber <brion@pobox.com>, alsa-devel@jcu.cz
Subject: Re: XAmixer
In-Reply-To: <Pine.LNX.4.05.9810031211500.8496-100000@screech.cs.alfred.edu>
Message-ID: <Pine.LNX.3.96.981003183558.1610L-100000@entry.jcu.cz>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

On Sat, 3 Oct 1998, Christopher T. Lansdown wrote:

> > ...
> > int channels, index;
> > snd_mixer_channel_info_t info;
> > 
> > channels = snd_mixer_channels( mixer_handle );
> > if ( channel < 0 ) { perror( "channels" ); exit( 1 ); }
> > /* track all channels for name and other info */
> > for ( index = 0; index < channels; index++ ) {
> >   if ( snd_mixer_channel_info( mixer_handle, index, &info ) < 0 ) {
> >     perror( "info" );
> >     exit( 1 );
> >   }
> >   printf( "Channel ID: %s\n", info.name );
> > }
> > ...
> > 
> 	Do the names in SND_MIXER_ID_* match the names in info.name?  Will 

Of course.. SND_MIXER_ID is defined for this purpose.

> this be reliable?  I.e. will pcm always be pcm, or at least does it have
> a shot at it?  I want to be able to figure out what the channels are, so
> that I can use my own names\pixmaps.  How reasonable a shot do I have of
> the code still working over different releases of the ALSA driver?

Mixer IDs will not be changed, but they may be expaded for some others (if
new soundcard have some special input for example).

> 	Obviously it would  be better to have a mixer that will
> automatically manage all present channels, but I don't want to have to
> give up asthetics, either.  Thanks.

You can use both text and pixmap representation for mixer channel. Simply
if your program doesn't find mixer channel pixmap, use text (name) from
channel info. Primary is functionality - thus user must be able work all
mixer channels (not only known in coding time).

						Jaroslav

-----
Jaroslav Kysela <perex@jcu.cz>
Academic Computer Centre, University of South Bohemia
Branisovska 31, C. Budejovice, CZ-370 05 Czech Republic


