FreeBSD/contrib/ntp/libntp/audio.c
/*
 * audio_show - display audio parameters
 *
 * This code doesn't really do anything, except satisfy curiousity and
 * verify the ioctl's work.
 */
display audio parameters
This code doesn't really do anything, except satisfy curiousity and
verify the ioctl's work.
display audio parameters This code doesn ' t really do anything except satisfy curiousity and verify the ioctl ' s work .
void
audio_show(void)
{
#ifdef PCM_STYLE_SOUND
	int recsrc = 0;
	printf("audio_show: ctl_fd %d\n", ctl_fd);
	if (ioctl(ctl_fd, SOUND_MIXER_READ_RECSRC, &recsrc) == -1)
	    printf("SOUND_MIXER_READ_RECSRC: %s\n", strerror(errno));
#else 
# ifdef HAVE_SYS_AUDIOIO_H
	ioctl(ctl_fd, (int)AUDIO_GETDEV, &device);
	printf("audio: name %s, version %s, config %s\n",
	    device.name, device.version, device.config);
# endif 
	ioctl(ctl_fd, (int)AUDIO_GETINFO, (char *)&info);
	printf(
	    "audio: rate %d, chan %d, prec %d, code %d, gain %d, mon %d, port %d\n",
	    info.record.sample_rate, info.record.channels,
	    info.record.precision, info.record.encoding,
	    info.record.gain, info.monitor_gain, info.record.port);
	printf(
	    "audio: samples %d, eof %d, pause %d, error %d, waiting %d, balance %d\n",
	    info.record.samples, info.record.eof,
	    info.record.pause, info.record.error,
	    info.record.waiting, info.record.balance);
#endif 
}
void audio_show ( void ) { #ifdef PCM_STYLE_SOUND int recsrc = 0 ; printf ( " \n " , ctl_fd ) ; if ( ioctl ( ctl_fd , SOUND_MIXER_READ_RECSRC , & recsrc ) == -1 ) printf ( " \n " , strerror ( errno ) ) ; #else # ifdef HAVE_SYS_AUDIOIO_H ioctl ( ctl_fd , ( int ) AUDIO_GETDEV , & device ) ; printf ( " \n " , device . name , device . version , device . config ) ; # endif ioctl ( ctl_fd , ( int ) AUDIO_GETINFO , ( char * ) & info ) ; printf ( " \n " , info . record . sample_rate , info . record . channels , info . record . precision , info . record . encoding , info . record . gain , info . monitor_gain , info . record . port ) ; printf ( " \n " , info . record . samples , info . record . eof , info . record . pause , info . record . error , info . record . waiting , info . record . balance ) ; #endif }
audio_show - display audio parameters
 This code doesn't really do anything, except satisfy curiousity and
 verify the ioctl's work.
audio_show - display audio parameters This code doesn ' t really do anything except satisfy curiousity and verify the ioctl ' s work .
/* not PCM_STYLE_SOUND */ /* HAVE_SYS_AUDIOIO_H */ /* not PCM_STYLE_SOUND */