[Python-3000-checkins] r56685 - in python/branches/p3yk: Demo/scripts/morse.py Demo/scripts/toaiff.py Doc/Makefile.deps Doc/lib/lib.tex Doc/lib/libaudioop.tex Doc/lib/libsun.tex Doc/lib/libsunaudio.tex Doc/lib/libundoc.tex Lib/audiodev.py Lib/plat-sunos5/SUNAUDIODEV.py Lib/test/README Lib/test/output/test_linuxaudiodev Lib/test/regrtest.py Lib/test/test___all__.py Lib/test/test_linuxaudiodev.py Lib/test/test_sunaudiodev.py Lib/test/test_sundry.py Lib/toaiff.py Makefile.pre.in Misc/BeOS-setup.py Misc/NEWS Misc/cheatsheet Modules/Setup.dist Modules/linuxaudiodev.c Modules/sunaudiodev.c PC/os2vacpp/makefile PC/os2vacpp/makefile.omk Tools/audiopy setup.py
neal.norwitz
python-3000-checkins at python.org
Fri Aug 3 07:20:26 CEST 2007
Author: neal.norwitz
Date: Fri Aug 3 07:20:23 2007
New Revision: 56685
Added:
python/branches/p3yk/Demo/scripts/toaiff.py
- copied unchanged from r56683, python/branches/p3yk/Lib/toaiff.py
Removed:
python/branches/p3yk/Demo/scripts/morse.py
python/branches/p3yk/Doc/lib/libsun.tex
python/branches/p3yk/Doc/lib/libsunaudio.tex
python/branches/p3yk/Lib/audiodev.py
python/branches/p3yk/Lib/plat-sunos5/SUNAUDIODEV.py
python/branches/p3yk/Lib/test/output/test_linuxaudiodev
python/branches/p3yk/Lib/test/test_linuxaudiodev.py
python/branches/p3yk/Lib/test/test_sunaudiodev.py
python/branches/p3yk/Lib/toaiff.py
python/branches/p3yk/Modules/linuxaudiodev.c
python/branches/p3yk/Modules/sunaudiodev.c
python/branches/p3yk/Tools/audiopy/
Modified:
python/branches/p3yk/Doc/Makefile.deps
python/branches/p3yk/Doc/lib/lib.tex
python/branches/p3yk/Doc/lib/libaudioop.tex
python/branches/p3yk/Doc/lib/libundoc.tex
python/branches/p3yk/Lib/test/README
python/branches/p3yk/Lib/test/regrtest.py
python/branches/p3yk/Lib/test/test___all__.py
python/branches/p3yk/Lib/test/test_sundry.py
python/branches/p3yk/Makefile.pre.in
python/branches/p3yk/Misc/BeOS-setup.py
python/branches/p3yk/Misc/NEWS
python/branches/p3yk/Misc/cheatsheet
python/branches/p3yk/Modules/Setup.dist
python/branches/p3yk/PC/os2vacpp/makefile
python/branches/p3yk/PC/os2vacpp/makefile.omk
python/branches/p3yk/setup.py
Log:
Remove several h/w and o/s specific modules that are undocumented, obsolete,
and/or not widely used:
linuxaudiodev.c, sunaudiodev.c Lib/plat-sunos5/SUNAUDIODEV.py
Lib/audiodev.py Tools/audiopy/audiopy
Move Lib/toaiff.py to Demo.
See PEP 3108 for most of the details.
Deleted: /python/branches/p3yk/Demo/scripts/morse.py
==============================================================================
--- /python/branches/p3yk/Demo/scripts/morse.py Fri Aug 3 07:20:23 2007
+++ (empty file)
@@ -1,149 +0,0 @@
-# DAH should be three DOTs.
-# Space between DOTs and DAHs should be one DOT.
-# Space between two letters should be one DAH.
-# Space between two words should be DOT DAH DAH.
-
-import sys, math, audiodev
-
-DOT = 30
-DAH = 3 * DOT
-OCTAVE = 2 # 1 == 441 Hz, 2 == 882 Hz, ...
-
-morsetab = {
- 'A': '.-', 'a': '.-',
- 'B': '-...', 'b': '-...',
- 'C': '-.-.', 'c': '-.-.',
- 'D': '-..', 'd': '-..',
- 'E': '.', 'e': '.',
- 'F': '..-.', 'f': '..-.',
- 'G': '--.', 'g': '--.',
- 'H': '....', 'h': '....',
- 'I': '..', 'i': '..',
- 'J': '.---', 'j': '.---',
- 'K': '-.-', 'k': '-.-',
- 'L': '.-..', 'l': '.-..',
- 'M': '--', 'm': '--',
- 'N': '-.', 'n': '-.',
- 'O': '---', 'o': '---',
- 'P': '.--.', 'p': '.--.',
- 'Q': '--.-', 'q': '--.-',
- 'R': '.-.', 'r': '.-.',
- 'S': '...', 's': '...',
- 'T': '-', 't': '-',
- 'U': '..-', 'u': '..-',
- 'V': '...-', 'v': '...-',
- 'W': '.--', 'w': '.--',
- 'X': '-..-', 'x': '-..-',
- 'Y': '-.--', 'y': '-.--',
- 'Z': '--..', 'z': '--..',
- '0': '-----',
- '1': '.----',
- '2': '..---',
- '3': '...--',
- '4': '....-',
- '5': '.....',
- '6': '-....',
- '7': '--...',
- '8': '---..',
- '9': '----.',
- ',': '--..--',
- '.': '.-.-.-',
- '?': '..--..',
- ';': '-.-.-.',
- ':': '---...',
- "'": '.----.',
- '-': '-....-',
- '/': '-..-.',
- '(': '-.--.-',
- ')': '-.--.-',
- '_': '..--.-',
- ' ': ' '
-}
-
-# If we play at 44.1 kHz (which we do), then if we produce one sine
-# wave in 100 samples, we get a tone of 441 Hz. If we produce two
-# sine waves in these 100 samples, we get a tone of 882 Hz. 882 Hz
-# appears to be a nice one for playing morse code.
-def mkwave(octave):
- global sinewave, nowave
- sinewave = ''
- for i in range(100):
- val = int(math.sin(math.pi * float(i) * octave / 50.0) * 30000)
- sinewave = sinewave + chr((val >> 8) & 255) + chr(val & 255)
- nowave = '\0' * 200
-
-mkwave(OCTAVE)
-
-def main():
- import getopt, string
- try:
- opts, args = getopt.getopt(sys.argv[1:], 'o:p:')
- except getopt.error:
- sys.stderr.write('Usage ' + sys.argv[0] +
- ' [ -o outfile ] [ args ] ...\n')
- sys.exit(1)
- dev = None
- for o, a in opts:
- if o == '-o':
- import aifc
- dev = aifc.open(a, 'w')
- dev.setframerate(44100)
- dev.setsampwidth(2)
- dev.setnchannels(1)
- if o == '-p':
- mkwave(string.atoi(a))
- if not dev:
- import audiodev
- dev = audiodev.AudioDev()
- dev.setoutrate(44100)
- dev.setsampwidth(2)
- dev.setnchannels(1)
- dev.close = dev.stop
- dev.writeframesraw = dev.writeframes
- if args:
- line = string.join(args)
- else:
- line = sys.stdin.readline()
- while line:
- mline = morse(line)
- play(mline, dev)
- if hasattr(dev, 'wait'):
- dev.wait()
- if not args:
- line = sys.stdin.readline()
- else:
- line = ''
- dev.close()
-
-# Convert a string to morse code with \001 between the characters in
-# the string.
-def morse(line):
- res = ''
- for c in line:
- try:
- res = res + morsetab[c] + '\001'
- except KeyError:
- pass
- return res
-
-# Play a line of morse code.
-def play(line, dev):
- for c in line:
- if c == '.':
- sine(dev, DOT)
- elif c == '-':
- sine(dev, DAH)
- else: # space
- pause(dev, DAH + DOT)
- pause(dev, DOT)
-
-def sine(dev, length):
- for i in range(length):
- dev.writeframesraw(sinewave)
-
-def pause(dev, length):
- for i in range(length):
- dev.writeframesraw(nowave)
-
-if __name__ == '__main__' or sys.argv[0] == __name__:
- main()
Modified: python/branches/p3yk/Doc/Makefile.deps
==============================================================================
--- python/branches/p3yk/Doc/Makefile.deps (original)
+++ python/branches/p3yk/Doc/Makefile.deps Fri Aug 3 07:20:23 2007
@@ -199,7 +199,6 @@
lib/libcrypto.tex \
lib/libhashlib.tex \
lib/libhmac.tex \
- lib/libsun.tex \
lib/libxdrlib.tex \
lib/libimghdr.tex \
lib/libformatter.tex \
@@ -259,7 +258,6 @@
lib/libsymbol.tex \
lib/libbinhex.tex \
lib/libuu.tex \
- lib/libsunaudio.tex \
lib/libfileinput.tex \
lib/libimaplib.tex \
lib/libpoplib.tex \
Modified: python/branches/p3yk/Doc/lib/lib.tex
==============================================================================
--- python/branches/p3yk/Doc/lib/lib.tex (original)
+++ python/branches/p3yk/Doc/lib/lib.tex Fri Aug 3 07:20:23 2007
@@ -416,10 +416,6 @@
% OTHER PLATFORM-SPECIFIC STUFF
% =============
-\input{libsun} % SUNOS ONLY
-\input{libsunaudio}
-% XXX(nnorwitz): the modules below this comment should be kept.
-
\input{windows} % MS Windows ONLY
\input{libmsilib}
\input{libmsvcrt}
@@ -430,9 +426,6 @@
\input{libundoc}
%\chapter{Obsolete Modules}
-%\input{libcmpcache}
-%\input{libcmp}
-%\input{libni}
\chapter{Reporting Bugs}
\input{reportingbugs}
Modified: python/branches/p3yk/Doc/lib/libaudioop.tex
==============================================================================
--- python/branches/p3yk/Doc/lib/libaudioop.tex (original)
+++ python/branches/p3yk/Doc/lib/libaudioop.tex Fri Aug 3 07:20:23 2007
@@ -7,9 +7,8 @@
The \module{audioop} module contains some useful operations on sound
fragments. It operates on sound fragments consisting of signed
-integer samples 8, 16 or 32 bits wide, stored in Python strings. This
-is the same format as used by the \refmodule{al} and \refmodule{sunaudiodev}
-modules. All scalar items are integers, unless specified otherwise.
+integer samples 8, 16 or 32 bits wide, stored in Python strings.
+All scalar items are integers, unless specified otherwise.
% This para is mostly here to provide an excuse for the index entries...
This module provides support for a-LAW, u-LAW and Intel/DVI ADPCM encodings.
Deleted: /python/branches/p3yk/Doc/lib/libsun.tex
==============================================================================
--- /python/branches/p3yk/Doc/lib/libsun.tex Fri Aug 3 07:20:23 2007
+++ (empty file)
@@ -1,7 +0,0 @@
-\chapter{SunOS Specific Services}
-\label{sunos}
-
-The modules described in this chapter provide interfaces to features
-that are unique to SunOS 5 (also known as Solaris version 2).
-
-\localmoduletable
Deleted: /python/branches/p3yk/Doc/lib/libsunaudio.tex
==============================================================================
--- /python/branches/p3yk/Doc/lib/libsunaudio.tex Fri Aug 3 07:20:23 2007
+++ (empty file)
@@ -1,146 +0,0 @@
-\section{\module{sunaudiodev} ---
- Access to Sun audio hardware}
-
-\declaremodule{builtin}{sunaudiodev}
- \platform{SunOS}
-\modulesynopsis{Access to Sun audio hardware.}
-
-
-This module allows you to access the Sun audio interface. The Sun
-audio hardware is capable of recording and playing back audio data
-in u-LAW\index{u-LAW} format with a sample rate of 8K per second. A
-full description can be found in the \manpage{audio}{7I} manual page.
-
-The module
-\refmodule[sunaudiodev-constants]{SUNAUDIODEV}\refstmodindex{SUNAUDIODEV}
-defines constants which may be used with this module.
-
-This module defines the following variables and functions:
-
-\begin{excdesc}{error}
-This exception is raised on all errors. The argument is a string
-describing what went wrong.
-\end{excdesc}
-
-\begin{funcdesc}{open}{mode}
-This function opens the audio device and returns a Sun audio device
-object. This object can then be used to do I/O on. The \var{mode} parameter
-is one of \code{'r'} for record-only access, \code{'w'} for play-only
-access, \code{'rw'} for both and \code{'control'} for access to the
-control device. Since only one process is allowed to have the recorder
-or player open at the same time it is a good idea to open the device
-only for the activity needed. See \manpage{audio}{7I} for details.
-
-As per the manpage, this module first looks in the environment
-variable \code{AUDIODEV} for the base audio device filename. If not
-found, it falls back to \file{/dev/audio}. The control device is
-calculated by appending ``ctl'' to the base audio device.
-\end{funcdesc}
-
-
-\subsection{Audio Device Objects \label{audio-device-objects}}
-
-The audio device objects are returned by \function{open()} define the
-following methods (except \code{control} objects which only provide
-\method{getinfo()}, \method{setinfo()}, \method{fileno()}, and
-\method{drain()}):
-
-\begin{methoddesc}[audio device]{close}{}
-This method explicitly closes the device. It is useful in situations
-where deleting the object does not immediately close it since there
-are other references to it. A closed device should not be used again.
-\end{methoddesc}
-
-\begin{methoddesc}[audio device]{fileno}{}
-Returns the file descriptor associated with the device. This can be
-used to set up \code{SIGPOLL} notification, as described below.
-\end{methoddesc}
-
-\begin{methoddesc}[audio device]{drain}{}
-This method waits until all pending output is processed and then returns.
-Calling this method is often not necessary: destroying the object will
-automatically close the audio device and this will do an implicit drain.
-\end{methoddesc}
-
-\begin{methoddesc}[audio device]{flush}{}
-This method discards all pending output. It can be used avoid the
-slow response to a user's stop request (due to buffering of up to one
-second of sound).
-\end{methoddesc}
-
-\begin{methoddesc}[audio device]{getinfo}{}
-This method retrieves status information like input and output volume,
-etc. and returns it in the form of
-an audio status object. This object has no methods but it contains a
-number of attributes describing the current device status. The names
-and meanings of the attributes are described in
-\code{<sun/audioio.h>} and in the \manpage{audio}{7I}
-manual page. Member names
-are slightly different from their C counterparts: a status object is
-only a single structure. Members of the \cdata{play} substructure have
-\samp{o_} prepended to their name and members of the \cdata{record}
-structure have \samp{i_}. So, the C member \cdata{play.sample_rate} is
-accessed as \member{o_sample_rate}, \cdata{record.gain} as \member{i_gain}
-and \cdata{monitor_gain} plainly as \member{monitor_gain}.
-\end{methoddesc}
-
-\begin{methoddesc}[audio device]{ibufcount}{}
-This method returns the number of samples that are buffered on the
-recording side, i.e.\ the program will not block on a
-\function{read()} call of so many samples.
-\end{methoddesc}
-
-\begin{methoddesc}[audio device]{obufcount}{}
-This method returns the number of samples buffered on the playback
-side. Unfortunately, this number cannot be used to determine a number
-of samples that can be written without blocking since the kernel
-output queue length seems to be variable.
-\end{methoddesc}
-
-\begin{methoddesc}[audio device]{read}{size}
-This method reads \var{size} samples from the audio input and returns
-them as a Python string. The function blocks until enough data is available.
-\end{methoddesc}
-
-\begin{methoddesc}[audio device]{setinfo}{status}
-This method sets the audio device status parameters. The \var{status}
-parameter is an device status object as returned by \function{getinfo()} and
-possibly modified by the program.
-\end{methoddesc}
-
-\begin{methoddesc}[audio device]{write}{samples}
-Write is passed a Python string containing audio samples to be played.
-If there is enough buffer space free it will immediately return,
-otherwise it will block.
-\end{methoddesc}
-
-The audio device supports asynchronous notification of various events,
-through the SIGPOLL signal. Here's an example of how you might enable
-this in Python:
-
-\begin{verbatim}
-def handle_sigpoll(signum, frame):
- print 'I got a SIGPOLL update'
-
-import fcntl, signal, STROPTS
-
-signal.signal(signal.SIGPOLL, handle_sigpoll)
-fcntl.ioctl(audio_obj.fileno(), STROPTS.I_SETSIG, STROPTS.S_MSG)
-\end{verbatim}
-
-
-\section{\module{SUNAUDIODEV} ---
- Constants used with \module{sunaudiodev}}
-
-\declaremodule[sunaudiodev-constants]{standard}{SUNAUDIODEV}
- \platform{SunOS}
-\modulesynopsis{Constants for use with \refmodule{sunaudiodev}.}
-
-
-This is a companion module to
-\refmodule{sunaudiodev}\refbimodindex{sunaudiodev} which defines
-useful symbolic constants like \constant{MIN_GAIN},
-\constant{MAX_GAIN}, \constant{SPEAKER}, etc. The names of the
-constants are the same names as used in the C include file
-\code{<sun/audioio.h>}, with the leading string \samp{AUDIO_}
-stripped.
Modified: python/branches/p3yk/Doc/lib/libundoc.tex
==============================================================================
--- python/branches/p3yk/Doc/lib/libundoc.tex (original)
+++ python/branches/p3yk/Doc/lib/libundoc.tex Fri Aug 3 07:20:23 2007
@@ -52,19 +52,8 @@
\section{Multimedia}
\begin{description}
-\item[\module{audiodev}]
---- Platform-independent API for playing audio data.
-
-\item[\module{linuxaudiodev}]
---- Play audio data on the Linux audio device. Replaced in Python 2.3
- by the \module{ossaudiodev} module.
-
\item[\module{sunaudio}]
--- Interpret Sun audio headers (may become obsolete or a tool/demo).
-
-\item[\module{toaiff}]
---- Convert "arbitrary" sound files to AIFF files; should probably
- become a tool or demo. Requires the external program \program{sox}.
\end{description}
Deleted: /python/branches/p3yk/Lib/audiodev.py
==============================================================================
--- /python/branches/p3yk/Lib/audiodev.py Fri Aug 3 07:20:23 2007
+++ (empty file)
@@ -1,257 +0,0 @@
-"""Classes for manipulating audio devices (currently only for Sun and SGI)"""
-
-__all__ = ["error","AudioDev"]
-
-class error(Exception):
- pass
-
-class Play_Audio_sgi:
- # Private instance variables
-## if 0: access frameratelist, nchannelslist, sampwidthlist, oldparams, \
-## params, config, inited_outrate, inited_width, \
-## inited_nchannels, port, converter, classinited: private
-
- classinited = 0
- frameratelist = nchannelslist = sampwidthlist = None
-
- def initclass(self):
- import AL
- self.frameratelist = [
- (48000, AL.RATE_48000),
- (44100, AL.RATE_44100),
- (32000, AL.RATE_32000),
- (22050, AL.RATE_22050),
- (16000, AL.RATE_16000),
- (11025, AL.RATE_11025),
- ( 8000, AL.RATE_8000),
- ]
- self.nchannelslist = [
- (1, AL.MONO),
- (2, AL.STEREO),
- (4, AL.QUADRO),
- ]
- self.sampwidthlist = [
- (1, AL.SAMPLE_8),
- (2, AL.SAMPLE_16),
- (3, AL.SAMPLE_24),
- ]
- self.classinited = 1
-
- def __init__(self):
- import al, AL
- if not self.classinited:
- self.initclass()
- self.oldparams = []
- self.params = [AL.OUTPUT_RATE, 0]
- self.config = al.newconfig()
- self.inited_outrate = 0
- self.inited_width = 0
- self.inited_nchannels = 0
- self.converter = None
- self.port = None
- return
-
- def __del__(self):
- if self.port:
- self.stop()
- if self.oldparams:
- import al, AL
- al.setparams(AL.DEFAULT_DEVICE, self.oldparams)
- self.oldparams = []
-
- def wait(self):
- if not self.port:
- return
- import time
- while self.port.getfilled() > 0:
- time.sleep(0.1)
- self.stop()
-
- def stop(self):
- if self.port:
- self.port.closeport()
- self.port = None
- if self.oldparams:
- import al, AL
- al.setparams(AL.DEFAULT_DEVICE, self.oldparams)
- self.oldparams = []
-
- def setoutrate(self, rate):
- for (raw, cooked) in self.frameratelist:
- if rate == raw:
- self.params[1] = cooked
- self.inited_outrate = 1
- break
- else:
- raise error, 'bad output rate'
-
- def setsampwidth(self, width):
- for (raw, cooked) in self.sampwidthlist:
- if width == raw:
- self.config.setwidth(cooked)
- self.inited_width = 1
- break
- else:
- if width == 0:
- import AL
- self.inited_width = 0
- self.config.setwidth(AL.SAMPLE_16)
- self.converter = self.ulaw2lin
- else:
- raise error, 'bad sample width'
-
- def setnchannels(self, nchannels):
- for (raw, cooked) in self.nchannelslist:
- if nchannels == raw:
- self.config.setchannels(cooked)
- self.inited_nchannels = 1
- break
- else:
- raise error, 'bad # of channels'
-
- def writeframes(self, data):
- if not (self.inited_outrate and self.inited_nchannels):
- raise error, 'params not specified'
- if not self.port:
- import al, AL
- self.port = al.openport('Python', 'w', self.config)
- self.oldparams = self.params[:]
- al.getparams(AL.DEFAULT_DEVICE, self.oldparams)
- al.setparams(AL.DEFAULT_DEVICE, self.params)
- if self.converter:
- data = self.converter(data)
- self.port.writesamps(data)
-
- def getfilled(self):
- if self.port:
- return self.port.getfilled()
- else:
- return 0
-
- def getfillable(self):
- if self.port:
- return self.port.getfillable()
- else:
- return self.config.getqueuesize()
-
- # private methods
-## if 0: access *: private
-
- def ulaw2lin(self, data):
- import audioop
- return audioop.ulaw2lin(data, 2)
-
-class Play_Audio_sun:
-## if 0: access outrate, sampwidth, nchannels, inited_outrate, inited_width, \
-## inited_nchannels, converter: private
-
- def __init__(self):
- self.outrate = 0
- self.sampwidth = 0
- self.nchannels = 0
- self.inited_outrate = 0
- self.inited_width = 0
- self.inited_nchannels = 0
- self.converter = None
- self.port = None
- return
-
- def __del__(self):
- self.stop()
-
- def setoutrate(self, rate):
- self.outrate = rate
- self.inited_outrate = 1
-
- def setsampwidth(self, width):
- self.sampwidth = width
- self.inited_width = 1
-
- def setnchannels(self, nchannels):
- self.nchannels = nchannels
- self.inited_nchannels = 1
-
- def writeframes(self, data):
- if not (self.inited_outrate and self.inited_width and self.inited_nchannels):
- raise error, 'params not specified'
- if not self.port:
- import sunaudiodev, SUNAUDIODEV
- self.port = sunaudiodev.open('w')
- info = self.port.getinfo()
- info.o_sample_rate = self.outrate
- info.o_channels = self.nchannels
- if self.sampwidth == 0:
- info.o_precision = 8
- self.o_encoding = SUNAUDIODEV.ENCODING_ULAW
- # XXX Hack, hack -- leave defaults
- else:
- info.o_precision = 8 * self.sampwidth
- info.o_encoding = SUNAUDIODEV.ENCODING_LINEAR
- self.port.setinfo(info)
- if self.converter:
- data = self.converter(data)
- self.port.write(data)
-
- def wait(self):
- if not self.port:
- return
- self.port.drain()
- self.stop()
-
- def stop(self):
- if self.port:
- self.port.flush()
- self.port.close()
- self.port = None
-
- def getfilled(self):
- if self.port:
- return self.port.obufcount()
- else:
- return 0
-
-## # Nobody remembers what this method does, and it's broken. :-(
-## def getfillable(self):
-## return BUFFERSIZE - self.getfilled()
-
-def AudioDev():
- # Dynamically try to import and use a platform specific module.
- try:
- import al
- except ImportError:
- try:
- import sunaudiodev
- return Play_Audio_sun()
- except ImportError:
- try:
- import Audio_mac
- except ImportError:
- raise error, 'no audio device'
- else:
- return Audio_mac.Play_Audio_mac()
- else:
- return Play_Audio_sgi()
-
-def test(fn = None):
- import sys
- if sys.argv[1:]:
- fn = sys.argv[1]
- else:
- fn = 'f:just samples:just.aif'
- import aifc
- af = aifc.open(fn, 'r')
- print(fn, af.getparams())
- p = AudioDev()
- p.setoutrate(af.getframerate())
- p.setsampwidth(af.getsampwidth())
- p.setnchannels(af.getnchannels())
- BUFSIZ = af.getframerate()/af.getsampwidth()/af.getnchannels()
- while 1:
- data = af.readframes(BUFSIZ)
- if not data: break
- print(len(data))
- p.writeframes(data)
- p.wait()
-
-if __name__ == '__main__':
- test()
Deleted: /python/branches/p3yk/Lib/plat-sunos5/SUNAUDIODEV.py
==============================================================================
--- /python/branches/p3yk/Lib/plat-sunos5/SUNAUDIODEV.py Fri Aug 3 07:20:23 2007
+++ (empty file)
@@ -1,40 +0,0 @@
-# Symbolic constants for use with sunaudiodev module
-# The names are the same as in audioio.h with the leading AUDIO_
-# removed.
-
-# Not all values are supported on all releases of SunOS.
-
-# Encoding types, for fields i_encoding and o_encoding
-
-ENCODING_NONE = 0 # no encoding assigned
-ENCODING_ULAW = 1 # u-law encoding
-ENCODING_ALAW = 2 # A-law encoding
-ENCODING_LINEAR = 3 # Linear PCM encoding
-
-# Gain ranges for i_gain, o_gain and monitor_gain
-
-MIN_GAIN = 0 # minimum gain value
-MAX_GAIN = 255 # maximum gain value
-
-# Balance values for i_balance and o_balance
-
-LEFT_BALANCE = 0 # left channel only
-MID_BALANCE = 32 # equal left/right channel
-RIGHT_BALANCE = 64 # right channel only
-BALANCE_SHIFT = 3
-
-# Port names for i_port and o_port
-
-PORT_A = 1
-PORT_B = 2
-PORT_C = 3
-PORT_D = 4
-
-SPEAKER = 0x01 # output to built-in speaker
-HEADPHONE = 0x02 # output to headphone jack
-LINE_OUT = 0x04 # output to line out
-
-MICROPHONE = 0x01 # input from microphone
-LINE_IN = 0x02 # input from line in
-CD = 0x04 # input from on-board CD inputs
-INTERNAL_CD_IN = CD # input from internal CDROM
Modified: python/branches/p3yk/Lib/test/README
==============================================================================
--- python/branches/p3yk/Lib/test/README (original)
+++ python/branches/p3yk/Lib/test/README Fri Aug 3 07:20:23 2007
@@ -372,7 +372,7 @@
* ``findfile(file)`` - you can call this function to locate a file
somewhere along sys.path or in the Lib/test tree - see
- test_linuxaudiodev.py for an example of its use.
+ test_ossaudiodev.py for an example of its use.
* ``fcmp(x,y)`` - you can call this function to compare two floating
point numbers when you expect them to only be approximately equal
Deleted: /python/branches/p3yk/Lib/test/output/test_linuxaudiodev
==============================================================================
--- /python/branches/p3yk/Lib/test/output/test_linuxaudiodev Fri Aug 3 07:20:23 2007
+++ (empty file)
@@ -1,7 +0,0 @@
-test_linuxaudiodev
-expected rate >= 0, not -1
-expected sample size >= 0, not -2
-nchannels must be 1 or 2, not 3
-unknown audio encoding: 177
-for linear unsigned 16-bit little-endian audio, expected sample size 16, not 8
-for linear unsigned 8-bit audio, expected sample size 8, not 16
Modified: python/branches/p3yk/Lib/test/regrtest.py
==============================================================================
--- python/branches/p3yk/Lib/test/regrtest.py (original)
+++ python/branches/p3yk/Lib/test/regrtest.py Fri Aug 3 07:20:23 2007
@@ -1106,8 +1106,6 @@
self.expected = set(s.split())
# expected to be skipped on every platform, even Linux
- self.expected.add('test_linuxaudiodev')
-
if not os.path.supports_unicode_filenames:
self.expected.add('test_pep277')
@@ -1134,7 +1132,6 @@
self.expected.add(skip)
if sys.platform != 'sunos5':
- self.expected.add('test_sunaudiodev')
self.expected.add('test_nis')
self.valid = True
Modified: python/branches/p3yk/Lib/test/test___all__.py
==============================================================================
--- python/branches/p3yk/Lib/test/test___all__.py (original)
+++ python/branches/p3yk/Lib/test/test___all__.py Fri Aug 3 07:20:23 2007
@@ -39,7 +39,6 @@
self.check_all("StringIO")
self.check_all("UserString")
self.check_all("aifc")
- self.check_all("audiodev")
self.check_all("base64")
self.check_all("bdb")
self.check_all("binhex")
@@ -135,7 +134,6 @@
self.check_all("textwrap")
self.check_all("threading")
self.check_all("timeit")
- self.check_all("toaiff")
self.check_all("tokenize")
self.check_all("traceback")
self.check_all("tty")
Deleted: /python/branches/p3yk/Lib/test/test_linuxaudiodev.py
==============================================================================
--- /python/branches/p3yk/Lib/test/test_linuxaudiodev.py Fri Aug 3 07:20:23 2007
+++ (empty file)
@@ -1,92 +0,0 @@
-from test import test_support
-test_support.requires('audio')
-
-from test.test_support import verbose, findfile, TestFailed, TestSkipped
-
-import errno
-import fcntl
-import linuxaudiodev
-import os
-import sys
-import select
-import sunaudio
-import time
-import audioop
-
-SND_FORMAT_MULAW_8 = 1
-
-def play_sound_file(path):
- fp = open(path, 'r')
- size, enc, rate, nchannels, extra = sunaudio.gethdr(fp)
- data = fp.read()
- fp.close()
-
- if enc != SND_FORMAT_MULAW_8:
- print("Expect .au file with 8-bit mu-law samples")
- return
-
- try:
- a = linuxaudiodev.open('w')
- except linuxaudiodev.error as msg:
- if msg.args[0] in (errno.EACCES, errno.ENOENT, errno.ENODEV, errno.EBUSY):
- raise TestSkipped, msg
- raise TestFailed, msg
-
- # convert the data to 16-bit signed
- data = audioop.ulaw2lin(data, 2)
-
- # set the data format
- if sys.byteorder == 'little':
- fmt = linuxaudiodev.AFMT_S16_LE
- else:
- fmt = linuxaudiodev.AFMT_S16_BE
-
- # at least check that these methods can be invoked
- a.bufsize()
- a.obufcount()
- a.obuffree()
- a.getptr()
- a.fileno()
-
- # set parameters based on .au file headers
- a.setparameters(rate, 16, nchannels, fmt)
- a.write(data)
- a.flush()
- a.close()
-
-def test_errors():
- a = linuxaudiodev.open("w")
- size = 8
- fmt = linuxaudiodev.AFMT_U8
- rate = 8000
- nchannels = 1
- try:
- a.setparameters(-1, size, nchannels, fmt)
- except ValueError as msg:
- print(msg)
- try:
- a.setparameters(rate, -2, nchannels, fmt)
- except ValueError as msg:
- print(msg)
- try:
- a.setparameters(rate, size, 3, fmt)
- except ValueError as msg:
- print(msg)
- try:
- a.setparameters(rate, size, nchannels, 177)
- except ValueError as msg:
- print(msg)
- try:
- a.setparameters(rate, size, nchannels, linuxaudiodev.AFMT_U16_LE)
- except ValueError as msg:
- print(msg)
- try:
- a.setparameters(rate, 16, nchannels, fmt)
- except ValueError as msg:
- print(msg)
-
-def test():
- play_sound_file(findfile('audiotest.au'))
- test_errors()
-
-test()
Deleted: /python/branches/p3yk/Lib/test/test_sunaudiodev.py
==============================================================================
--- /python/branches/p3yk/Lib/test/test_sunaudiodev.py Fri Aug 3 07:20:23 2007
+++ (empty file)
@@ -1,28 +0,0 @@
-from test.test_support import verbose, findfile, TestFailed, TestSkipped
-import sunaudiodev
-import os
-
-try:
- audiodev = os.environ["AUDIODEV"]
-except KeyError:
- audiodev = "/dev/audio"
-
-if not os.path.exists(audiodev):
- raise TestSkipped("no audio device found!")
-
-def play_sound_file(path):
- fp = open(path, 'r')
- data = fp.read()
- fp.close()
- try:
- a = sunaudiodev.open('w')
- except sunaudiodev.error as msg:
- raise TestFailed, msg
- else:
- a.write(data)
- a.close()
-
-def test():
- play_sound_file(findfile('audiotest.au'))
-
-test()
Modified: python/branches/p3yk/Lib/test/test_sundry.py
==============================================================================
--- python/branches/p3yk/Lib/test/test_sundry.py (original)
+++ python/branches/p3yk/Lib/test/test_sundry.py Fri Aug 3 07:20:23 2007
@@ -13,7 +13,6 @@
import SimpleHTTPServer
import SimpleXMLRPCServer
import aifc
- import audiodev
import bdb
import cgitb
import cmd
@@ -99,7 +98,6 @@
import tabnanny
import telnetlib
import timeit
- import toaiff
import token
try:
import tty # not available on Windows
Deleted: /python/branches/p3yk/Lib/toaiff.py
==============================================================================
--- /python/branches/p3yk/Lib/toaiff.py Fri Aug 3 07:20:23 2007
+++ (empty file)
@@ -1,107 +0,0 @@
-"""Convert "arbitrary" sound files to AIFF (Apple and SGI's audio format).
-
-Input may be compressed.
-Uncompressed file type may be AIFF, WAV, VOC, 8SVX, NeXT/Sun, and others.
-An exception is raised if the file is not of a recognized type.
-Returned filename is either the input filename or a temporary filename;
-in the latter case the caller must ensure that it is removed.
-Other temporary files used are removed by the function.
-"""
-
-import os
-import tempfile
-import pipes
-import sndhdr
-
-__all__ = ["error", "toaiff"]
-
-table = {}
-
-t = pipes.Template()
-t.append('sox -t au - -t aiff -r 8000 -', '--')
-table['au'] = t
-
-# XXX The following is actually sub-optimal.
-# XXX The HCOM sampling rate can be 22k, 22k/2, 22k/3 or 22k/4.
-# XXX We must force the output sampling rate else the SGI won't play
-# XXX files sampled at 5.5k or 7.333k; however this means that files
-# XXX sampled at 11k are unnecessarily expanded.
-# XXX Similar comments apply to some other file types.
-t = pipes.Template()
-t.append('sox -t hcom - -t aiff -r 22050 -', '--')
-table['hcom'] = t
-
-t = pipes.Template()
-t.append('sox -t voc - -t aiff -r 11025 -', '--')
-table['voc'] = t
-
-t = pipes.Template()
-t.append('sox -t wav - -t aiff -', '--')
-table['wav'] = t
-
-t = pipes.Template()
-t.append('sox -t 8svx - -t aiff -r 16000 -', '--')
-table['8svx'] = t
-
-t = pipes.Template()
-t.append('sox -t sndt - -t aiff -r 16000 -', '--')
-table['sndt'] = t
-
-t = pipes.Template()
-t.append('sox -t sndr - -t aiff -r 16000 -', '--')
-table['sndr'] = t
-
-uncompress = pipes.Template()
-uncompress.append('uncompress', '--')
-
-
-class error(Exception):
- pass
-
-def toaiff(filename):
- temps = []
- ret = None
- try:
- ret = _toaiff(filename, temps)
- finally:
- for temp in temps[:]:
- if temp != ret:
- try:
- os.unlink(temp)
- except os.error:
- pass
- temps.remove(temp)
- return ret
-
-def _toaiff(filename, temps):
- if filename[-2:] == '.Z':
- (fd, fname) = tempfile.mkstemp()
- os.close(fd)
- temps.append(fname)
- sts = uncompress.copy(filename, fname)
- if sts:
- raise error, filename + ': uncompress failed'
- else:
- fname = filename
- try:
- ftype = sndhdr.whathdr(fname)
- if ftype:
- ftype = ftype[0] # All we're interested in
- except IOError as msg:
- if type(msg) == type(()) and len(msg) == 2 and \
- type(msg[0]) == type(0) and type(msg[1]) == type(''):
- msg = msg[1]
- if type(msg) != type(''):
- msg = repr(msg)
- raise error, filename + ': ' + msg
- if ftype == 'aiff':
- return fname
- if ftype is None or not ftype in table:
- raise error, '%s: unsupported audio file type %r' % (filename, ftype)
- (fd, temp) = tempfile.mkstemp()
- os.close(fd)
- temps.append(temp)
- sts = table[ftype].copy(fname, temp)
- if sts:
- raise error, filename + ': conversion to aiff failed'
- return temp
Modified: python/branches/p3yk/Makefile.pre.in
==============================================================================
--- python/branches/p3yk/Makefile.pre.in (original)
+++ python/branches/p3yk/Makefile.pre.in Fri Aug 3 07:20:23 2007
@@ -608,7 +608,7 @@
QUICKTESTOPTS= $(TESTOPTS) -x test_thread test_signal test_strftime \
test_unicodedata test_re test_sre test_select test_poll \
- test_linuxaudiodev test_struct test_sunaudiodev test_zlib
+ test_struct test_zlib
quicktest: all platform
-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
-$(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
Modified: python/branches/p3yk/Misc/BeOS-setup.py
==============================================================================
--- python/branches/p3yk/Misc/BeOS-setup.py (original)
+++ python/branches/p3yk/Misc/BeOS-setup.py Fri Aug 3 07:20:23 2007
@@ -445,15 +445,6 @@
define_macros = expat_defs,
libraries = ['expat']) )
- # Platform-specific libraries
- if platform == 'linux2':
- # Linux-specific modules
- exts.append( Extension('linuxaudiodev', ['linuxaudiodev.c']) )
-
- if platform == 'sunos5':
- # SunOS specific modules
- exts.append( Extension('sunaudiodev', ['sunaudiodev.c']) )
-
self.extensions.extend(exts)
# Call the method for detecting whether _tkinter can be compiled
Modified: python/branches/p3yk/Misc/NEWS
==============================================================================
--- python/branches/p3yk/Misc/NEWS (original)
+++ python/branches/p3yk/Misc/NEWS Fri Aug 3 07:20:23 2007
@@ -184,8 +184,12 @@
AST -> bytecode mechanism.
- Removed these modules:
- * Bastion, bsddb185, exceptions, md5, MimeWriter, mimify, popen2, rexec,
- sets, sha, stringold, strop, timing, xmllib.
+ * audiodev, Bastion, bsddb185, exceptions, linuxaudiodev,
+ md5, MimeWriter, mimify, popen2,
+ rexec, sets, sha, stringold, strop, sunaudiodev, timing, xmllib.
+
+- Moved these modules to Tools/Demos:
+ * toaiff
- Remove obsolete IRIX modules: al/AL, cd/CD, cddb, cdplayer, cl/CL, DEVICE,
ERRNO, FILE, fl/FL, flp, fm, GET, gl/GL, GLWS, IN, imgfile, IOCTL, jpeg,
Modified: python/branches/p3yk/Misc/cheatsheet
==============================================================================
--- python/branches/p3yk/Misc/cheatsheet (original)
+++ python/branches/p3yk/Misc/cheatsheet Fri Aug 3 07:20:23 2007
@@ -1808,7 +1808,6 @@
asynchat Support for 'chat' style protocols
asyncore Asynchronous File I/O (in select style)
atexit Register functions to be called at exit of Python interpreter.
-audiodev Audio support for a few platforms.
base64 Conversions to/from base64 RFC-MIME transport encoding .
BaseHTTPServer Base class forhttp services.
Bastion "Bastionification" utility (control access to instance vars)
@@ -1871,7 +1870,6 @@
inspect Tool for probing live Python objects.
keyword List of Python keywords.
linecache Cache lines from files.
-linuxaudiodev Lunix /dev/audio support.
locale Support for number formatting using the current locale
settings.
logging Python logging facility.
@@ -1946,7 +1944,6 @@
textwrap Object for wrapping and filling text.
threading Proposed new higher-level threading interfaces
threading_api (doc of the threading module)
-toaiff Convert "arbitrary" sound files to AIFF files .
token Tokens (from "token.h").
tokenize Compiles a regular expression that recognizes Python tokens.
traceback Format and print Python stack traces.
@@ -2042,10 +2039,6 @@
DEVICE More constants for gl
imgfile Imglib image file interface
-* Suns *
-
- sunaudiodev Access to sun audio interface
-
Workspace exploration and idiom hints
Modified: python/branches/p3yk/Modules/Setup.dist
==============================================================================
--- python/branches/p3yk/Modules/Setup.dist (original)
+++ python/branches/p3yk/Modules/Setup.dist Fri Aug 3 07:20:23 2007
@@ -235,17 +235,6 @@
#_sha shamodule.c
-# SunOS specific modules -- off by default:
-
-#sunaudiodev sunaudiodev.c
-
-
-# A Linux specific module -- off by default; this may also work on
-# some *BSDs.
-
-#linuxaudiodev linuxaudiodev.c
-
-
# The _tkinter module.
#
# The command for _tkinter is long and site specific. Please
Deleted: /python/branches/p3yk/Modules/linuxaudiodev.c
==============================================================================
--- /python/branches/p3yk/Modules/linuxaudiodev.c Fri Aug 3 07:20:23 2007
+++ (empty file)
@@ -1,501 +0,0 @@
-/* Hey Emacs, this is -*-C-*-
- ******************************************************************************
- * linuxaudiodev.c -- Linux audio device for python.
- *
- * Author : Peter Bosch
- * Created On : Thu Mar 2 21:10:33 2000
- * Status : Unknown, Use with caution!
- *
- * Unless other notices are present in any part of this file
- * explicitly claiming copyrights for other people and/or
- * organizations, the contents of this file is fully copyright
- * (C) 2000 Peter Bosch, all rights reserved.
- ******************************************************************************
- */
-
-#include "Python.h"
-#include "structmember.h"
-
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#else
-#define O_RDONLY 00
-#define O_WRONLY 01
-#endif
-
-
-#include <sys/ioctl.h>
-#if defined(linux)
-#include <linux/soundcard.h>
-
-#ifndef HAVE_STDINT_H
-typedef unsigned long uint32_t;
-#endif
-
-#elif defined(__FreeBSD__)
-#include <machine/soundcard.h>
-
-#ifndef SNDCTL_DSP_CHANNELS
-#define SNDCTL_DSP_CHANNELS SOUND_PCM_WRITE_CHANNELS
-#endif
-
-#endif
-
-typedef struct {
- PyObject_HEAD
- int x_fd; /* The open file */
- int x_mode; /* file mode */
- int x_icount; /* Input count */
- int x_ocount; /* Output count */
- uint32_t x_afmts; /* Audio formats supported by hardware*/
-} lad_t;
-
-/* XXX several format defined in soundcard.h are not supported,
- including _NE (native endian) options and S32 options
-*/
-
-static struct {
- int a_bps;
- uint32_t a_fmt;
- 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" },
- { 16, AFMT_S16_NE, "linear signed 16-bit native-endian audio" },
-};
-
-static int n_audio_types = sizeof(audio_types) / sizeof(audio_types[0]);
-
-static PyTypeObject Ladtype;
-
-static PyObject *LinuxAudioError;
-
-static lad_t *
-newladobject(PyObject *arg)
-{
- lad_t *xp;
- int fd, afmts, imode;
- char *basedev = NULL;
- char *mode = NULL;
-
- /* Two ways to call linuxaudiodev.open():
- open(device, mode) (for consistency with builtin open())
- open(mode) (for backwards compatibility)
- because the *first* argument is optional, parsing args is
- a wee bit tricky. */
- if (!PyArg_ParseTuple(arg, "s|s:open", &basedev, &mode))
- return NULL;
- if (mode == NULL) { /* only one arg supplied */
- mode = basedev;
- basedev = NULL;
- }
-
- if (strcmp(mode, "r") == 0)
- imode = O_RDONLY;
- else if (strcmp(mode, "w") == 0)
- imode = O_WRONLY;
- else {
- PyErr_SetString(LinuxAudioError, "mode should be 'r' or 'w'");
- return NULL;
- }
-
- /* Open the correct device. The base device name comes from the
- * AUDIODEV environment variable first, then /dev/dsp. The
- * control device tacks "ctl" onto the base device name.
- *
- * Note that the only difference between /dev/audio and /dev/dsp
- * is that the former uses logarithmic mu-law encoding and the
- * latter uses 8-bit unsigned encoding.
- */
-
- if (basedev == NULL) { /* called with one arg */
- basedev = getenv("AUDIODEV");
- if (basedev == NULL) /* $AUDIODEV not set */
- basedev = "/dev/dsp";
- }
-
- if ((fd = open(basedev, imode)) == -1) {
- PyErr_SetFromErrnoWithFilename(LinuxAudioError, basedev);
- return NULL;
- }
- if (imode == O_WRONLY && ioctl(fd, SNDCTL_DSP_NONBLOCK, NULL) == -1) {
- PyErr_SetFromErrnoWithFilename(LinuxAudioError, basedev);
- return NULL;
- }
- if (ioctl(fd, SNDCTL_DSP_GETFMTS, &afmts) == -1) {
- PyErr_SetFromErrnoWithFilename(LinuxAudioError, basedev);
- return NULL;
- }
- /* Create and initialize the object */
- if ((xp = PyObject_New(lad_t, &Ladtype)) == NULL) {
- close(fd);
- return NULL;
- }
- xp->x_fd = fd;
- xp->x_mode = imode;
- xp->x_icount = xp->x_ocount = 0;
- xp->x_afmts = afmts;
- return xp;
-}
-
-static void
-lad_dealloc(lad_t *xp)
-{
- /* if already closed, don't reclose it */
- if (xp->x_fd != -1)
- close(xp->x_fd);
- PyObject_Del(xp);
-}
-
-static PyObject *
-lad_read(lad_t *self, PyObject *args)
-{
- int size, count;
- char *cp;
- PyObject *rv;
-
- if (!PyArg_ParseTuple(args, "i:read", &size))
- return NULL;
- rv = PyString_FromStringAndSize(NULL, size);
- if (rv == NULL)
- return NULL;
- cp = PyString_AS_STRING(rv);
- if ((count = read(self->x_fd, cp, size)) < 0) {
- PyErr_SetFromErrno(LinuxAudioError);
- Py_DECREF(rv);
- return NULL;
- }
- self->x_icount += count;
- _PyString_Resize(&rv, count);
- return rv;
-}
-
-static PyObject *
-lad_write(lad_t *self, PyObject *args)
-{
- char *cp;
- int rv, size;
- fd_set write_set_fds;
- struct timeval tv;
- int select_retval;
-
- if (!PyArg_ParseTuple(args, "s#:write", &cp, &size))
- return NULL;
-
- /* use select to wait for audio device to be available */
- FD_ZERO(&write_set_fds);
- FD_SET(self->x_fd, &write_set_fds);
- tv.tv_sec = 4; /* timeout values */
- tv.tv_usec = 0;
-
- while (size > 0) {
- select_retval = select(self->x_fd+1, NULL, &write_set_fds, NULL, &tv);
- tv.tv_sec = 1; tv.tv_usec = 0; /* willing to wait this long next time*/
- if (select_retval) {
- if ((rv = write(self->x_fd, cp, size)) == -1) {
- if (errno != EAGAIN) {
- PyErr_SetFromErrno(LinuxAudioError);
- return NULL;
- } else {
- errno = 0; /* EAGAIN: buffer is full, try again */
- }
- } else {
- self->x_ocount += rv;
- size -= rv;
- cp += rv;
- }
- } else {
- /* printf("Not able to write to linux audio device within %ld seconds\n", tv.tv_sec); */
- PyErr_SetFromErrno(LinuxAudioError);
- return NULL;
- }
- }
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-static PyObject *
-lad_close(lad_t *self, PyObject *unused)
-{
- if (self->x_fd >= 0) {
- close(self->x_fd);
- self->x_fd = -1;
- }
- Py_RETURN_NONE;
-}
-
-static PyObject *
-lad_fileno(lad_t *self, PyObject *unused)
-{
- return PyInt_FromLong(self->x_fd);
-}
-
-static PyObject *
-lad_setparameters(lad_t *self, PyObject *args)
-{
- int rate, ssize, nchannels, n, fmt, emulate=0;
-
- if (!PyArg_ParseTuple(args, "iiii|i:setparameters",
- &rate, &ssize, &nchannels, &fmt, &emulate))
- return NULL;
-
- if (rate < 0) {
- PyErr_Format(PyExc_ValueError, "expected rate >= 0, not %d",
- rate);
- return NULL;
- }
- if (ssize < 0) {
- PyErr_Format(PyExc_ValueError, "expected sample size >= 0, not %d",
- ssize);
- return NULL;
- }
- if (nchannels != 1 && nchannels != 2) {
- PyErr_Format(PyExc_ValueError, "nchannels must be 1 or 2, not %d",
- nchannels);
- return NULL;
- }
-
- for (n = 0; n < n_audio_types; n++)
- if (fmt == audio_types[n].a_fmt)
- break;
- if (n == n_audio_types) {
- PyErr_Format(PyExc_ValueError, "unknown audio encoding: %d", fmt);
- return NULL;
- }
- 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;
- }
-
- if (emulate == 0) {
- 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;
- }
- }
- if (ioctl(self->x_fd, SNDCTL_DSP_SETFMT,
- &audio_types[n].a_fmt) == -1) {
- PyErr_SetFromErrno(LinuxAudioError);
- return NULL;
- }
- if (ioctl(self->x_fd, SNDCTL_DSP_CHANNELS, &nchannels) == -1) {
- PyErr_SetFromErrno(LinuxAudioError);
- return NULL;
- }
- if (ioctl(self->x_fd, SNDCTL_DSP_SPEED, &rate) == -1) {
- PyErr_SetFromErrno(LinuxAudioError);
- return NULL;
- }
-
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-static int
-_ssize(lad_t *self, int *nchannels, int *ssize)
-{
- int fmt;
-
- fmt = 0;
- if (ioctl(self->x_fd, SNDCTL_DSP_SETFMT, &fmt) < 0)
- return -errno;
-
- switch (fmt) {
- case AFMT_MU_LAW:
- case AFMT_A_LAW:
- case AFMT_U8:
- case AFMT_S8:
- *ssize = sizeof(char);
- break;
- case AFMT_S16_LE:
- case AFMT_S16_BE:
- case AFMT_U16_LE:
- case AFMT_U16_BE:
- *ssize = sizeof(short);
- break;
- case AFMT_MPEG:
- case AFMT_IMA_ADPCM:
- default:
- return -EOPNOTSUPP;
- }
- if (ioctl(self->x_fd, SNDCTL_DSP_CHANNELS, nchannels) < 0)
- return -errno;
- return 0;
-}
-
-
-/* bufsize returns the size of the hardware audio buffer in number
- of samples */
-static PyObject *
-lad_bufsize(lad_t *self, PyObject *unused)
-{
- audio_buf_info ai;
- int nchannels=0, ssize=0;
-
- if (_ssize(self, &nchannels, &ssize) < 0 || !ssize || !nchannels) {
- PyErr_SetFromErrno(LinuxAudioError);
- return NULL;
- }
- if (ioctl(self->x_fd, SNDCTL_DSP_GETOSPACE, &ai) < 0) {
- PyErr_SetFromErrno(LinuxAudioError);
- return NULL;
- }
- return PyInt_FromLong((ai.fragstotal * ai.fragsize) / (nchannels * ssize));
-}
-
-/* obufcount returns the number of samples that are available in the
- hardware for playing */
-static PyObject *
-lad_obufcount(lad_t *self, PyObject *unused)
-{
- audio_buf_info ai;
- int nchannels=0, ssize=0;
-
- if (_ssize(self, &nchannels, &ssize) < 0 || !ssize || !nchannels) {
- PyErr_SetFromErrno(LinuxAudioError);
- return NULL;
- }
- if (ioctl(self->x_fd, SNDCTL_DSP_GETOSPACE, &ai) < 0) {
- PyErr_SetFromErrno(LinuxAudioError);
- return NULL;
- }
- return PyInt_FromLong((ai.fragstotal * ai.fragsize - ai.bytes) /
- (ssize * nchannels));
-}
-
-/* obufcount returns the number of samples that can be played without
- blocking */
-static PyObject *
-lad_obuffree(lad_t *self, PyObject *unused)
-{
- audio_buf_info ai;
- int nchannels=0, ssize=0;
-
- if (_ssize(self, &nchannels, &ssize) < 0 || !ssize || !nchannels) {
- PyErr_SetFromErrno(LinuxAudioError);
- return NULL;
- }
- if (ioctl(self->x_fd, SNDCTL_DSP_GETOSPACE, &ai) < 0) {
- PyErr_SetFromErrno(LinuxAudioError);
- return NULL;
- }
- return PyInt_FromLong(ai.bytes / (ssize * nchannels));
-}
-
-/* Flush the device */
-static PyObject *
-lad_flush(lad_t *self, PyObject *unused)
-{
- if (ioctl(self->x_fd, SNDCTL_DSP_SYNC, NULL) == -1) {
- PyErr_SetFromErrno(LinuxAudioError);
- return NULL;
- }
- Py_RETURN_NONE;
-}
-
-static PyObject *
-lad_getptr(lad_t *self, PyObject *unused)
-{
- count_info info;
- int req;
-
- if (self->x_mode == O_RDONLY)
- req = SNDCTL_DSP_GETIPTR;
- else
- req = SNDCTL_DSP_GETOPTR;
- if (ioctl(self->x_fd, req, &info) == -1) {
- PyErr_SetFromErrno(LinuxAudioError);
- return NULL;
- }
- return Py_BuildValue("iii", info.bytes, info.blocks, info.ptr);
-}
-
-static PyMethodDef lad_methods[] = {
- { "read", (PyCFunction)lad_read, METH_VARARGS },
- { "write", (PyCFunction)lad_write, METH_VARARGS },
- { "setparameters", (PyCFunction)lad_setparameters, METH_VARARGS },
- { "bufsize", (PyCFunction)lad_bufsize, METH_VARARGS },
- { "obufcount", (PyCFunction)lad_obufcount, METH_NOARGS },
- { "obuffree", (PyCFunction)lad_obuffree, METH_NOARGS },
- { "flush", (PyCFunction)lad_flush, METH_NOARGS },
- { "close", (PyCFunction)lad_close, METH_NOARGS },
- { "fileno", (PyCFunction)lad_fileno, METH_NOARGS },
- { "getptr", (PyCFunction)lad_getptr, METH_NOARGS },
- { NULL, NULL} /* sentinel */
-};
-
-static PyObject *
-lad_getattr(lad_t *xp, char *name)
-{
- return Py_FindMethod(lad_methods, (PyObject *)xp, name);
-}
-
-static PyTypeObject Ladtype = {
- PyVarObject_HEAD_INIT(&PyType_Type, 0)
- "linuxaudiodev.linux_audio_device", /*tp_name*/
- sizeof(lad_t), /*tp_size*/
- 0, /*tp_itemsize*/
- /* methods */
- (destructor)lad_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
- (getattrfunc)lad_getattr, /*tp_getattr*/
- 0, /*tp_setattr*/
- 0, /*tp_compare*/
- 0, /*tp_repr*/
-};
-
-static PyObject *
-ladopen(PyObject *self, PyObject *args)
-{
- return (PyObject *)newladobject(args);
-}
-
-static PyMethodDef linuxaudiodev_methods[] = {
- { "open", ladopen, METH_VARARGS },
- { 0, 0 },
-};
-
-void
-initlinuxaudiodev(void)
-{
- PyObject *m;
-
- m = Py_InitModule("linuxaudiodev", linuxaudiodev_methods);
- if (m == NULL)
- return;
-
- LinuxAudioError = PyErr_NewException("linuxaudiodev.error", NULL, NULL);
- if (LinuxAudioError)
- PyModule_AddObject(m, "error", LinuxAudioError);
-
- if (PyModule_AddIntConstant(m, "AFMT_MU_LAW", (long)AFMT_MU_LAW) == -1)
- return;
- if (PyModule_AddIntConstant(m, "AFMT_A_LAW", (long)AFMT_A_LAW) == -1)
- return;
- if (PyModule_AddIntConstant(m, "AFMT_U8", (long)AFMT_U8) == -1)
- return;
- if (PyModule_AddIntConstant(m, "AFMT_S8", (long)AFMT_S8) == -1)
- return;
- if (PyModule_AddIntConstant(m, "AFMT_U16_BE", (long)AFMT_U16_BE) == -1)
- return;
- if (PyModule_AddIntConstant(m, "AFMT_U16_LE", (long)AFMT_U16_LE) == -1)
- return;
- if (PyModule_AddIntConstant(m, "AFMT_S16_BE", (long)AFMT_S16_BE) == -1)
- return;
- if (PyModule_AddIntConstant(m, "AFMT_S16_LE", (long)AFMT_S16_LE) == -1)
- return;
- if (PyModule_AddIntConstant(m, "AFMT_S16_NE", (long)AFMT_S16_NE) == -1)
- return;
-
- return;
-}
Deleted: /python/branches/p3yk/Modules/sunaudiodev.c
==============================================================================
--- /python/branches/p3yk/Modules/sunaudiodev.c Fri Aug 3 07:20:23 2007
+++ (empty file)
@@ -1,463 +0,0 @@
-
-/* Sad objects */
-
-#include "Python.h"
-#include "structmember.h"
-
-#ifdef HAVE_SYS_AUDIOIO_H
-#define SOLARIS
-#endif
-
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-
-#include <stropts.h>
-#include <sys/ioctl.h>
-#ifdef SOLARIS
-#include <sys/audioio.h>
-#else
-#include <sun/audioio.h>
-#endif
-
-/* #define offsetof(str,mem) ((int)(((str *)0)->mem)) */
-
-typedef struct {
- PyObject_HEAD
- int x_fd; /* The open file */
- int x_icount; /* # samples read */
- int x_ocount; /* # samples written */
- int x_isctl; /* True if control device */
-
-} sadobject;
-
-typedef struct {
- PyObject_HEAD
- audio_info_t ai;
-} sadstatusobject;
-
-static PyTypeObject Sadtype;
-static PyTypeObject Sadstatustype;
-static sadstatusobject *sads_alloc(void); /* Forward */
-
-static PyObject *SunAudioError;
-
-#define is_sadobject(v) (Py_Type(v) == &Sadtype)
-#define is_sadstatusobject(v) (Py_Type(v) == &Sadstatustype)
-
-
-static sadobject *
-newsadobject(PyObject *args)
-{
- sadobject *xp;
- int fd;
- char *mode;
- int imode;
- char* basedev;
- char* ctldev;
- char* opendev;
-
- /* Check arg for r/w/rw */
- if (!PyArg_ParseTuple(args, "s", &mode))
- return NULL;
- if (strcmp(mode, "r") == 0)
- imode = 0;
- else if (strcmp(mode, "w") == 0)
- imode = 1;
- else if (strcmp(mode, "rw") == 0)
- imode = 2;
- else if (strcmp(mode, "control") == 0)
- imode = -1;
- else {
- PyErr_SetString(SunAudioError,
- "Mode should be one of 'r', 'w', 'rw' or 'control'");
- return NULL;
- }
-
- /* Open the correct device. The base device name comes from the
- * AUDIODEV environment variable first, then /dev/audio. The
- * control device tacks "ctl" onto the base device name.
- */
- basedev = getenv("AUDIODEV");
- if (!basedev)
- basedev = "/dev/audio";
- ctldev = PyMem_NEW(char, strlen(basedev) + 4);
- if (!ctldev) {
- PyErr_NoMemory();
- return NULL;
- }
- strcpy(ctldev, basedev);
- strcat(ctldev, "ctl");
-
- if (imode < 0) {
- opendev = ctldev;
- fd = open(ctldev, 2);
- }
- else {
- opendev = basedev;
- fd = open(basedev, imode);
- }
- if (fd < 0) {
- PyErr_SetFromErrnoWithFilename(SunAudioError, opendev);
- PyMem_DEL(ctldev);
- return NULL;
- }
- PyMem_DEL(ctldev);
-
- /* Create and initialize the object */
- xp = PyObject_New(sadobject, &Sadtype);
- if (xp == NULL) {
- close(fd);
- return NULL;
- }
- xp->x_fd = fd;
- xp->x_icount = xp->x_ocount = 0;
- xp->x_isctl = (imode < 0);
-
- return xp;
-}
-
-/* Sad methods */
-
-static void
-sad_dealloc(sadobject *xp)
-{
- close(xp->x_fd);
- PyObject_Del(xp);
-}
-
-static PyObject *
-sad_read(sadobject *self, PyObject *args)
-{
- int size, count;
- char *cp;
- PyObject *rv;
-
- if (!PyArg_ParseTuple(args, "i:read", &size))
- return NULL;
- rv = PyString_FromStringAndSize(NULL, size);
- if (rv == NULL)
- return NULL;
-
- if (!(cp = PyString_AsString(rv)))
- goto finally;
-
- count = read(self->x_fd, cp, size);
- if (count < 0) {
- PyErr_SetFromErrno(SunAudioError);
- goto finally;
- }
-#if 0
- /* TBD: why print this message if you can handle the condition?
- * assume it's debugging info which we can just as well get rid
- * of. in any case this message should *not* be using printf!
- */
- if (count != size)
- printf("sunaudio: funny read rv %d wtd %d\n", count, size);
-#endif
- self->x_icount += count;
- return rv;
-
- finally:
- Py_DECREF(rv);
- return NULL;
-}
-
-static PyObject *
-sad_write(sadobject *self, PyObject *args)
-{
- char *cp;
- int count, size;
-
- if (!PyArg_ParseTuple(args, "s#:write", &cp, &size))
- return NULL;
-
- count = write(self->x_fd, cp, size);
- if (count < 0) {
- PyErr_SetFromErrno(SunAudioError);
- return NULL;
- }
-#if 0
- if (count != size)
- printf("sunaudio: funny write rv %d wanted %d\n", count, size);
-#endif
- self->x_ocount += count;
-
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-static PyObject *
-sad_getinfo(sadobject *self)
-{
- sadstatusobject *rv;
-
- if (!(rv = sads_alloc()))
- return NULL;
-
- if (ioctl(self->x_fd, AUDIO_GETINFO, &rv->ai) < 0) {
- PyErr_SetFromErrno(SunAudioError);
- Py_DECREF(rv);
- return NULL;
- }
- return (PyObject *)rv;
-}
-
-static PyObject *
-sad_setinfo(sadobject *self, sadstatusobject *arg)
-{
- if (!is_sadstatusobject(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "Must be sun audio status object");
- return NULL;
- }
- if (ioctl(self->x_fd, AUDIO_SETINFO, &arg->ai) < 0) {
- PyErr_SetFromErrno(SunAudioError);
- return NULL;
- }
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-static PyObject *
-sad_ibufcount(sadobject *self)
-{
- audio_info_t ai;
-
- if (ioctl(self->x_fd, AUDIO_GETINFO, &ai) < 0) {
- PyErr_SetFromErrno(SunAudioError);
- return NULL;
- }
- return PyInt_FromLong(ai.record.samples - self->x_icount);
-}
-
-static PyObject *
-sad_obufcount(sadobject *self)
-{
- audio_info_t ai;
-
- if (ioctl(self->x_fd, AUDIO_GETINFO, &ai) < 0) {
- PyErr_SetFromErrno(SunAudioError);
- return NULL;
- }
- /* x_ocount is in bytes, whereas play.samples is in frames */
- /* we want frames */
- return PyInt_FromLong(self->x_ocount / (ai.play.channels *
- ai.play.precision / 8) -
- ai.play.samples);
-}
-
-static PyObject *
-sad_drain(sadobject *self)
-{
- if (ioctl(self->x_fd, AUDIO_DRAIN, 0) < 0) {
- PyErr_SetFromErrno(SunAudioError);
- return NULL;
- }
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-#ifdef SOLARIS
-static PyObject *
-sad_getdev(sadobject *self)
-{
- struct audio_device ad;
-
- if (ioctl(self->x_fd, AUDIO_GETDEV, &ad) < 0) {
- PyErr_SetFromErrno(SunAudioError);
- return NULL;
- }
- return Py_BuildValue("(sss)", ad.name, ad.version, ad.config);
-}
-#endif
-
-static PyObject *
-sad_flush(sadobject *self)
-{
- if (ioctl(self->x_fd, I_FLUSH, FLUSHW) < 0) {
- PyErr_SetFromErrno(SunAudioError);
- return NULL;
- }
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-static PyObject *
-sad_close(sadobject *self)
-{
-
- if (self->x_fd >= 0) {
- close(self->x_fd);
- self->x_fd = -1;
- }
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-static PyObject *
-sad_fileno(sadobject *self)
-{
- return PyInt_FromLong(self->x_fd);
-}
-
-
-static PyMethodDef sad_methods[] = {
- { "read", (PyCFunction)sad_read, METH_VARARGS },
- { "write", (PyCFunction)sad_write, METH_VARARGS },
- { "ibufcount", (PyCFunction)sad_ibufcount, METH_NOARGS },
- { "obufcount", (PyCFunction)sad_obufcount, METH_NOARGS },
-#define CTL_METHODS 4
- { "getinfo", (PyCFunction)sad_getinfo, METH_NOARGS },
- { "setinfo", (PyCFunction)sad_setinfo, METH_O},
- { "drain", (PyCFunction)sad_drain, METH_NOARGS },
- { "flush", (PyCFunction)sad_flush, METH_NOARGS },
-#ifdef SOLARIS
- { "getdev", (PyCFunction)sad_getdev, METH_NOARGS },
-#endif
- { "close", (PyCFunction)sad_close, METH_NOARGS },
- { "fileno", (PyCFunction)sad_fileno, METH_NOARGS },
- {NULL, NULL} /* sentinel */
-};
-
-static PyObject *
-sad_getattr(sadobject *xp, char *name)
-{
- if (xp->x_isctl)
- return Py_FindMethod(sad_methods+CTL_METHODS,
- (PyObject *)xp, name);
- else
- return Py_FindMethod(sad_methods, (PyObject *)xp, name);
-}
-
-/* ----------------------------------------------------------------- */
-
-static sadstatusobject *
-sads_alloc(void) {
- return PyObject_New(sadstatusobject, &Sadstatustype);
-}
-
-static void
-sads_dealloc(sadstatusobject *xp)
-{
- PyMem_DEL(xp);
-}
-
-#define OFF(x) offsetof(audio_info_t,x)
-static struct memberlist sads_ml[] = {
- { "i_sample_rate", T_UINT, OFF(record.sample_rate) },
- { "i_channels", T_UINT, OFF(record.channels) },
- { "i_precision", T_UINT, OFF(record.precision) },
- { "i_encoding", T_UINT, OFF(record.encoding) },
- { "i_gain", T_UINT, OFF(record.gain) },
- { "i_port", T_UINT, OFF(record.port) },
- { "i_samples", T_UINT, OFF(record.samples) },
- { "i_eof", T_UINT, OFF(record.eof) },
- { "i_pause", T_UBYTE, OFF(record.pause) },
- { "i_error", T_UBYTE, OFF(record.error) },
- { "i_waiting", T_UBYTE, OFF(record.waiting) },
- { "i_open", T_UBYTE, OFF(record.open) , RO},
- { "i_active", T_UBYTE, OFF(record.active) , RO},
-#ifdef SOLARIS
- { "i_buffer_size", T_UINT, OFF(record.buffer_size) },
- { "i_balance", T_UBYTE, OFF(record.balance) },
- { "i_avail_ports", T_UINT, OFF(record.avail_ports) },
-#endif
-
- { "o_sample_rate", T_UINT, OFF(play.sample_rate) },
- { "o_channels", T_UINT, OFF(play.channels) },
- { "o_precision", T_UINT, OFF(play.precision) },
- { "o_encoding", T_UINT, OFF(play.encoding) },
- { "o_gain", T_UINT, OFF(play.gain) },
- { "o_port", T_UINT, OFF(play.port) },
- { "o_samples", T_UINT, OFF(play.samples) },
- { "o_eof", T_UINT, OFF(play.eof) },
- { "o_pause", T_UBYTE, OFF(play.pause) },
- { "o_error", T_UBYTE, OFF(play.error) },
- { "o_waiting", T_UBYTE, OFF(play.waiting) },
- { "o_open", T_UBYTE, OFF(play.open) , RO},
- { "o_active", T_UBYTE, OFF(play.active) , RO},
-#ifdef SOLARIS
- { "o_buffer_size", T_UINT, OFF(play.buffer_size) },
- { "o_balance", T_UBYTE, OFF(play.balance) },
- { "o_avail_ports", T_UINT, OFF(play.avail_ports) },
-#endif
-
- { "monitor_gain", T_UINT, OFF(monitor_gain) },
- { NULL, 0, 0},
-};
-
-static PyObject *
-sads_getattr(sadstatusobject *xp, char *name)
-{
- return PyMember_Get((char *)&xp->ai, sads_ml, name);
-}
-
-static int
-sads_setattr(sadstatusobject *xp, char *name, PyObject *v)
-{
-
- if (v == NULL) {
- PyErr_SetString(PyExc_TypeError,
- "can't delete sun audio status attributes");
- return -1;
- }
- return PyMember_Set((char *)&xp->ai, sads_ml, name, v);
-}
-
-/* ------------------------------------------------------------------- */
-
-
-static PyTypeObject Sadtype = {
- PyVarObject_HEAD_INIT(&PyType_Type, 0)
- "sunaudiodev.sun_audio_device", /*tp_name*/
- sizeof(sadobject), /*tp_size*/
- 0, /*tp_itemsize*/
- /* methods */
- (destructor)sad_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
- (getattrfunc)sad_getattr, /*tp_getattr*/
- 0, /*tp_setattr*/
- 0, /*tp_compare*/
- 0, /*tp_repr*/
-};
-
-static PyTypeObject Sadstatustype = {
- PyVarObject_HEAD_INIT(&PyType_Type, 0)
- "sunaudiodev.sun_audio_device_status", /*tp_name*/
- sizeof(sadstatusobject), /*tp_size*/
- 0, /*tp_itemsize*/
- /* methods */
- (destructor)sads_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
- (getattrfunc)sads_getattr, /*tp_getattr*/
- (setattrfunc)sads_setattr, /*tp_setattr*/
- 0, /*tp_compare*/
- 0, /*tp_repr*/
-};
-/* ------------------------------------------------------------------- */
-
-static PyObject *
-sadopen(PyObject *self, PyObject *args)
-{
- return (PyObject *)newsadobject(args);
-}
-
-static PyMethodDef sunaudiodev_methods[] = {
- { "open", sadopen, METH_VARARGS },
- { 0, 0 },
-};
-
-void
-initsunaudiodev(void)
-{
- PyObject *m, *d;
-
- m = Py_InitModule("sunaudiodev", sunaudiodev_methods);
- if (m == NULL)
- return;
- d = PyModule_GetDict(m);
- SunAudioError = PyErr_NewException("sunaudiodev.error", NULL, NULL);
- if (SunAudioError)
- PyDict_SetItemString(d, "error", SunAudioError);
-}
Modified: python/branches/p3yk/PC/os2vacpp/makefile
==============================================================================
--- python/branches/p3yk/PC/os2vacpp/makefile (original)
+++ python/branches/p3yk/PC/os2vacpp/makefile Fri Aug 3 07:20:23 2007
@@ -856,20 +856,6 @@
$(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
$(PY_INCLUDE)\tupleobject.h
-sunaudiodev.obj: $(PY_INCLUDE)\abstract.h $(OS2TCPIP)\Include\sys\ioctl.h $(PY_INCLUDE)\ceval.h \
- $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
- pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
- $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
- $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
- $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
- $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
- $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
- $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
- $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
- $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
- $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\structmember.h \
- $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
-
syslogmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
$(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
Modified: python/branches/p3yk/PC/os2vacpp/makefile.omk
==============================================================================
--- python/branches/p3yk/PC/os2vacpp/makefile.omk (original)
+++ python/branches/p3yk/PC/os2vacpp/makefile.omk Fri Aug 3 07:20:23 2007
@@ -171,8 +171,6 @@
#
# Multimedia:
# audioop.c -- Various Compute Operations on Audio Samples
- # imageop.c -- Various Compute Operations on Video Samples
- # sunaudiodev.c -- Wrapper of Sun Audio Device API
# Database:
# dbmmodule.c -- Wrapper of DBM Database API (Generic Flavor)
@@ -627,15 +625,6 @@
pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \
stringobject.h sysmodule.h traceback.h tupleobject.h
-sunaudiodev.obj: abstract.h c:\mptn\include\sys\ioctl.h ceval.h \
- classobject.h cobject.h complexobject.h pyconfig.h dictobject.h \
- fileobject.h floatobject.h funcobject.h import.h intobject.h \
- intrcheck.h listobject.h longobject.h methodobject.h modsupport.h \
- moduleobject.h mymalloc.h myproto.h object.h objimpl.h pydebug.h \
- pyerrors.h pyfpe.h pystate.h python.h pythonrun.h rangeobject.h \
- sliceobject.h stringobject.h structmember.h sysmodule.h \
- traceback.h tupleobject.h
-
syslogmodule.obj: abstract.h ceval.h classobject.h cobject.h \
complexobject.h pyconfig.h dictobject.h fileobject.h floatobject.h \
funcobject.h import.h intobject.h intrcheck.h listobject.h \
Modified: python/branches/p3yk/setup.py
==============================================================================
--- python/branches/p3yk/setup.py (original)
+++ python/branches/p3yk/setup.py Fri Aug 3 07:20:23 2007
@@ -1088,24 +1088,12 @@
exts.append(Extension('_fileio', ['_fileio.c']))
# Platform-specific libraries
- if platform == 'linux2':
- # Linux-specific modules
- exts.append( Extension('linuxaudiodev', ['linuxaudiodev.c']) )
- else:
- missing.append('linuxaudiodev')
-
if platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
'freebsd7'):
exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
else:
missing.append('ossaudiodev')
- if platform == 'sunos5':
- # SunOS specific modules
- exts.append( Extension('sunaudiodev', ['sunaudiodev.c']) )
- else:
- missing.append('sunaudiodev')
-
if platform == 'darwin' and ("--disable-toolbox-glue" not in
sysconfig.get_config_var("CONFIG_ARGS")):
More information about the Python-3000-checkins
mailing list