comparison src/libsst.c @ 771:943eaba38521

[xemacs-hg @ 2002-03-13 08:51:24 by ben] The big ben-mule-21-5 check-in! Various files were added and deleted. See CHANGES-ben-mule. There are still some test suite failures. No crashes, though. Many of the failures have to do with problems in the test suite itself rather than in the actual code. I'll be addressing these in the next day or so -- none of the test suite failures are at all critical. Meanwhile I'll be trying to address the biggest issues -- i.e. build or run failures, which will almost certainly happen on various platforms. All comments should be sent to ben@xemacs.org -- use a Cc: if necessary when sending to mailing lists. There will be pre- and post- tags, something like pre-ben-mule-21-5-merge-in, and post-ben-mule-21-5-merge-in.
author ben
date Wed, 13 Mar 2002 08:54:06 +0000
parents 183866b06e0b
children ecf1ebac70d8
comparison
equal deleted inserted replaced
770:336a418893b5 771:943eaba38521
35 { 35 {
36 int fd, i, gr, ger, gx; 36 int fd, i, gr, ger, gx;
37 struct audio_ioctl ai; 37 struct audio_ioctl ai;
38 Extbyte *ep; 38 Extbyte *ep;
39 39
40 fd = open( "/dev/audio", O_RDWR ); 40 fd = open ("/dev/audio", O_RDWR);
41 if ( fd < 0 ) 41 if ( fd < 0 )
42 { 42 {
43 sound_perror( "sst_open: open /dev/audio" ); 43 sound_perror( "sst_open: open /dev/audio" );
44 return( fd ); 44 return( fd );
45 } 45 }
57 57
58 /* Set gains. -10 <= ger <= 18, -18 <= gr <= 12, -18 <= gx <= 12. */ 58 /* Set gains. -10 <= ger <= 18, -18 <= gr <= 12, -18 <= gx <= 12. */
59 if (!play_level) 59 if (!play_level)
60 { 60 {
61 play_level = 75; 61 play_level = 75;
62 if ( (ep = getenv( "SST_PLAY" )) != NULL ) 62 if ( (ep = egetenv( "SST_PLAY" )) != NULL )
63 { 63 {
64 play_level = atoi( ep ); 64 play_level = atoi( ep );
65 if ( play_level < 0 || play_level > 99 ) 65 if ( play_level < 0 || play_level > 99 )
66 { 66 {
67 sound_warn( "sst_open: SST_PLAY must be between 0 and 99" ); 67 sound_warn( "sst_open: SST_PLAY must be between 0 and 99" );
70 } 70 }
71 } 71 }
72 if (!record_level) 72 if (!record_level)
73 { 73 {
74 record_level = 75; 74 record_level = 75;
75 if ( (ep = getenv( "SST_RECORD" )) != NULL ) 75 if ( (ep = egetenv( "SST_RECORD" )) != NULL )
76 { 76 {
77 record_level = atoi( ep ); 77 record_level = atoi( ep );
78 if ( record_level < 0 || record_level > 99 ) 78 if ( record_level < 0 || record_level > 99 )
79 { 79 {
80 sound_warn( "sst_open: SST_RECORD must be between 0 and 99" ); 80 sound_warn( "sst_open: SST_RECORD must be between 0 and 99" );
108 if ( ioctl( fd, AUDIOGETREG, &ai ) < 0 ) 108 if ( ioctl( fd, AUDIOGETREG, &ai ) < 0 )
109 { 109 {
110 sound_perror( "sst_open: GETREG MMR2" ); 110 sound_perror( "sst_open: GETREG MMR2" );
111 return( -1 ); 111 return( -1 );
112 } 112 }
113 if ( (ep = getenv( "SST_EARPHONES" )) != NULL ) 113 if ( (ep = egetenv( "SST_EARPHONES" )) != NULL )
114 ai.data[0] &= ~AUDIO_MMR2_BITS_LS; 114 ai.data[0] &= ~AUDIO_MMR2_BITS_LS;
115 else 115 else
116 ai.data[0] |= AUDIO_MMR2_BITS_LS; 116 ai.data[0] |= AUDIO_MMR2_BITS_LS;
117 if ( ioctl( fd, AUDIOSETREG, &ai ) < 0 ) 117 if ( ioctl( fd, AUDIOSETREG, &ai ) < 0 )
118 { 118 {