commit 59e86ffbff3a421127aae4df5645dd0912c076b6
parent 96de46140806d36883615b001acff89452c1bd8d
Author: Christos Margiolis <christos@margiolis.net>
Date: Tue, 27 Jul 2021 15:54:31 +0300
added manpage section for mixer_getstatus
Diffstat:
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/mixer_lib/mixer.3 b/mixer_lib/mixer.3
@@ -33,6 +33,7 @@
.Nm mixer_modrecsrc ,
.Nm mixer_getdunit ,
.Nm mixer_setdunit ,
+.Nm mixer_getstatus ,
.Nm mixer_getnmixers ,
.Nm MIX_ISDEV ,
.Nm MIX_ISMUTE ,
@@ -62,6 +63,8 @@ Mixer library (libmixer, -lmixer)
.Ft int
.Fn mixer_setdunit "struct mixer *m" "int unit"
.Ft int
+.Fn mixer_getstatus "int unit"
+.Ft int
.Fn mixer_getnmixers "void"
.Ft int
.Fn MIX_ISDEV "struct mixer *m" "int devno"
@@ -101,6 +104,10 @@ struct mixer {
#define MIX_TOGGLERECSRC 0x08
int recsrc;
int f_default;
+#define MIX_STATUS_NONE 0x00
+#define MIX_STATUS_PLAY 0x01
+#define MIX_STATUS_REC 0x02
+ int status;
};
.Ed
.Ss Mixer device
@@ -219,6 +226,21 @@ the
controls.
.Pp
The
+.Fn mixer_getstatus
+function returns the playback/recording status of the audio device the mixer
+belongs to. The available values are the following:
+.Bl -tag -width "MIX_STATUS_PLAY | MIX_STATUS_REC" -offset indent
+.It Dv MIX_STATUS_NONE
+Neither playback nor recording.
+.It Dv MIX_STATUS_PLAY
+Playback.
+.It Dv MIX_STATUS_REC
+Recording.
+.It Dv MIX_STATUS_PLAY | MIX_STATUS_REC
+Playback and recording.
+.El
+.Pp
+The
.Fn mixer_getnmixers
function returns the total number of mixer devices in the system.
.Pp
diff --git a/mixer_lib/mixer.h b/mixer_lib/mixer.h
@@ -74,7 +74,7 @@ struct mixer {
#define MIX_SETRECSRC 0x04
#define MIX_TOGGLERECSRC 0x08
int recsrc;
- int f_default;
+ int f_default; /* TODO: combine with status? */
#define MIX_STATUS_NONE 0x00
#define MIX_STATUS_PLAY 0x01
#define MIX_STATUS_REC 0x02