forked from auracaster/pyalsaaudio
Decided that getenum should return the selected item and the available
items. Argument parsing errors are reported with the methodname (minor improvement). Smallish documentation improvements. git-svn-id: svn://svn.code.sf.net/p/pyalsaaudio/code/trunk@23 ec2f30ec-7544-0410-870e-f70ca00c83f0
This commit is contained in:
@@ -383,6 +383,43 @@ To manipulate these swithes use the \method{setrec} or
|
||||
|
||||
\end{methoddesc}
|
||||
|
||||
\begin{methoddesc}[Mixer]{getenum}{}
|
||||
For enumerated controls, return the currently selected item and
|
||||
the list of items available.
|
||||
|
||||
Returns a tuple \textit{(string, list of strings)}.
|
||||
|
||||
For example, my soundcard has a Mixer called \textit{Mono Output Select}.
|
||||
Using \textit{amixer}, I get:
|
||||
|
||||
\begin{verbatim}
|
||||
$ amixer get "Mono Output Select"
|
||||
Simple mixer control 'Mono Output Select',0
|
||||
Capabilities: enum
|
||||
Items: 'Mix' 'Mic'
|
||||
Item0: 'Mix'
|
||||
\end{verbatim}
|
||||
|
||||
Using \module{alsaaudio}, one could do:
|
||||
\begin{verbatim}
|
||||
>>> import alsaaudio
|
||||
>>> m = alsaaudio.Mixer('Mono Output Select')
|
||||
>>> m.getenum()
|
||||
('Mix', ['Mix', 'Mic'])
|
||||
\end{verbatim}
|
||||
|
||||
This method will return an empty tuple if the mixer is not an
|
||||
enumerated control.
|
||||
\end{methoddesc}
|
||||
|
||||
\begin{methoddesc}[Mixer]{getmute}{}
|
||||
Return a list indicating the current mute setting for each channel.
|
||||
0 means not muted, 1 means muted.
|
||||
|
||||
This method will fail if the mixer has no playback switch
|
||||
capabilities.
|
||||
\end{methoddesc}
|
||||
|
||||
\begin{methoddesc}[Mixer]{getrange}{\optional{direction}}
|
||||
Return the volume range of the ALSA mixer controlled by this object.
|
||||
|
||||
@@ -393,6 +430,14 @@ To manipulate these swithes use the \method{setrec} or
|
||||
|
||||
\end{methoddesc}
|
||||
|
||||
\begin{methoddesc}[Mixer]{getrec}{}
|
||||
Return a list indicating the current record mute setting for each
|
||||
channel. 0 means not recording, 1 means recording.
|
||||
|
||||
This method will fail if the mixer has no capture switch
|
||||
capabilities.
|
||||
\end{methoddesc}
|
||||
|
||||
\begin{methoddesc}[Mixer]{getvolume}{\optional{direction}}
|
||||
Returns a list with the current volume settings for each channel.
|
||||
The list elements are integer percentages.
|
||||
@@ -404,22 +449,6 @@ To manipulate these swithes use the \method{setrec} or
|
||||
|
||||
\end{methoddesc}
|
||||
|
||||
\begin{methoddesc}[Mixer]{getmute}{}
|
||||
Return a list indicating the current mute setting for each channel.
|
||||
0 means not muted, 1 means muted.
|
||||
|
||||
This method will fail if the mixer has no playback switch
|
||||
capabilities.
|
||||
\end{methoddesc}
|
||||
|
||||
\begin{methoddesc}[Mixer]{getrec}{}
|
||||
Return a list indicating the current record mute setting for each
|
||||
channel. 0 means not recording, 1 means recording.
|
||||
|
||||
This method will fail if the mixer has no capture switch
|
||||
capabilities.
|
||||
\end{methoddesc}
|
||||
|
||||
\begin{methoddesc}[Mixer]{setvolume}{volume,\optional{channel},
|
||||
\optional{direction}}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
\title{PyAlsaAudio}
|
||||
|
||||
\release{0.3}
|
||||
\release{0.4}
|
||||
|
||||
% At minimum, give your name and an email address. You can include a
|
||||
% snail-mail address if you like.
|
||||
|
||||
Reference in New Issue
Block a user