[Python-checkins] CVS: python/dist/src/Modules linuxaudiodev.c,2.11,2.12

Ka-Ping Yee ping@users.sourceforge.net
Mon, 15 Jan 2001 14:21:41 -0800


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv32544/Modules

Modified Files:
	linuxaudiodev.c 
Log Message:
better format names and error messages


Index: linuxaudiodev.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/linuxaudiodev.c,v
retrieving revision 2.11
retrieving revision 2.12
diff -C2 -r2.11 -r2.12
*** linuxaudiodev.c	2000/10/08 19:47:47	2.11
--- linuxaudiodev.c	2001/01/15 22:21:39	2.12
***************
*** 64,76 ****
      char       *a_name;
  } audio_types[] = {
!     {  8, 	AFMT_MU_LAW, "Logarithmic mu-law audio" },
!     {  8, 	AFMT_A_LAW,  "Logarithmic A-law audio" },
!     {  8,	AFMT_U8,     "Standard unsigned 8-bit audio" },
!     {  8, 	AFMT_S8,     "Standard signed 8-bit audio" },
!     { 16, 	AFMT_U16_BE, "Big-endian 16-bit unsigned audio" },
!     { 16, 	AFMT_U16_LE, "Little-endian 16-bit unsigned audio" },
!     { 16, 	AFMT_S16_BE, "Big-endian 16-bit signed audio" },
!     { 16, 	AFMT_S16_LE, "Little-endian 16-bit signed audio" },
!     { 16, 	AFMT_S16_NE, "Native-endian 16-bit signed audio" },
  };
  
--- 64,75 ----
      char       *a_name;
  } audio_types[] = {
!     {  8, 	AFMT_MU_LAW, "logarithmic mu-law 8-bit audio" },
!     {  8, 	AFMT_A_LAW,  "logarithmic A-law 8-bit audio" },
!     {  8,	AFMT_U8,     "linear unsigned 8-bit audio" },
!     {  8, 	AFMT_S8,     "linear signed 8-bit audio" },
!     { 16, 	AFMT_U16_BE, "linear unsigned 16-bit big-endian audio" },
!     { 16, 	AFMT_U16_LE, "linear unsigned 16-bit little-endian audio" },
!     { 16, 	AFMT_S16_BE, "linear signed 16-bit big-endian audio" },
!     { 16, 	AFMT_S16_LE, "linear signed 16-bit little-endian audio" },
  };
  
***************
*** 96,100 ****
          imode = O_WRONLY;
      else {
!         PyErr_SetString(LinuxAudioError, "Mode should be one of 'r', or 'w'");
          return NULL;
      }
--- 95,99 ----
          imode = O_WRONLY;
      else {
!         PyErr_SetString(LinuxAudioError, "mode should be 'r' or 'w'");
          return NULL;
      }
***************
*** 257,262 ****
      if (audio_types[n].a_bps != ssize) {
  	PyErr_Format(PyExc_ValueError, 
! 		     "sample size %d expected for %s: %d received",
! 		     audio_types[n].a_bps, audio_types[n].a_name, ssize);
  	return NULL;
      }
--- 256,261 ----
      if (audio_types[n].a_bps != ssize) {
  	PyErr_Format(PyExc_ValueError, 
! 		     "for %s, expected sample size %d, not %d",
! 		     audio_types[n].a_name, audio_types[n].a_bps, ssize);
  	return NULL;
      }
***************
*** 265,269 ****
  	if ((self->x_afmts & audio_types[n].a_fmt) == 0) {
  	    PyErr_Format(PyExc_ValueError, 
! 			 "format not supported by device: %s",
  			 audio_types[n].a_name);
  	    return NULL;
--- 264,268 ----
  	if ((self->x_afmts & audio_types[n].a_fmt) == 0) {
  	    PyErr_Format(PyExc_ValueError, 
! 			 "%s format not supported by device",
  			 audio_types[n].a_name);
  	    return NULL;