From: Takashi Iwai Subject: Re: mixer control - Captuer Source - rename item name in enumerated control Date: Tue, 13 Sep 2005 17:38:10 +0200 Message-ID: References: <4326EEA6.8070007@netvigator.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <4326EEA6.8070007@netvigator.com> Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Raymond Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org At Tue, 13 Sep 2005 23:22:14 +0800, Raymond wrote: > > Is it possible to rename "Video" to "MPU401" in enumerated "Capture > Source" mixer control by the au88x0 driver ? > > numid=39,iface=MIXER,name='Capture Source' > ; type=ENUMERATED,access=rw---,values=2,items=8 > ; Item #0 'Mic' > ; Item #1 'CD' > ; Item #2 'Video' <---------------MPU 401 / wavetable daugther card > ; Item #3 'Aux' > ; Item #4 'Line' > ; Item #5 'Mix' > ; Item #6 'Mix Mono' > ; Item #7 'Phone' > : values=0,0 Currently, you need an ugly hack. Find "Capture Source" control and replace the private_value field with the point to a new own struct ac97_enum. For example, /* taken from ac97/ac97_local.h */ #define AC97_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, xtexts) \ { .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \ .mask = xmask, .texts = xtexts } static const char *my_own_sel[] = { "Mic", "CD", "WaveTable", "Aux", "line", Mix", "Mix Mono", "Phone" }; static const struct ac97_enum my_own_enum = AC97_ENUM_DOUBLE(AC97_REC_SEL, 8, 0, 8, my_own_sel); Then use snd_ctl_find_id() to get a snd_kcontrol_t object, and replace its private_value field with (unsigned long)&my_own_enum. Takashi ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf