[pulseaudio-commits] r1424 - /trunk/src/modules/module-waveout.c
svnmailer-noreply at 0pointer.de
svnmailer-noreply at 0pointer.de
Mon Feb 12 01:37:35 PST 2007
Author: ossman
Date: Mon Feb 12 10:37:34 2007
New Revision: 1424
URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=3D1424&root=3Dpulseaudio&vi=
ew=3Drev
Log:
Allow specification of device number.
Modified:
trunk/src/modules/module-waveout.c
Modified: trunk/src/modules/module-waveout.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-waveou=
t.c?rev=3D1424&root=3Dpulseaudio&r1=3D1423&r2=3D1424&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/src/modules/module-waveout.c (original)
+++ trunk/src/modules/module-waveout.c Mon Feb 12 10:37:34 2007
@@ -47,7 +47,8 @@
PA_MODULE_VERSION(PACKAGE_VERSION)
PA_MODULE_USAGE(
"sink_name=3D<name for the sink> "
- "source_name=3D<name for the source>"
+ "source_name=3D<name for the source> "
+ "device=3D<device number> "
"record=3D<enable source?> "
"playback=3D<enable sink?> "
"format=3D<sample format> "
@@ -90,6 +91,7 @@
static const char* const valid_modargs[] =3D {
"sink_name",
"source_name",
+ "device",
"record",
"playback",
"fragments",
@@ -432,6 +434,7 @@
WAVEFORMATEX wf;
int nfrags, frag_size;
int record =3D 1, playback =3D 1;
+ unsigned int device;
pa_sample_spec ss;
pa_channel_map map;
pa_modargs *ma =3D NULL;
@@ -455,6 +458,12 @@
goto fail;
}
=
+ device =3D WAVE_MAPPER;
+ if (pa_modargs_get_value_u32(ma, "device", &device) < 0) {
+ pa_log("failed to parse device argument");
+ goto fail;
+ }
+
nfrags =3D 5;
frag_size =3D 8192;
if (pa_modargs_get_value_s32(ma, "fragments", &nfrags) < 0 || pa_modar=
gs_get_value_s32(ma, "fragment_size", &frag_size) < 0) {
@@ -474,7 +483,7 @@
u =3D pa_xmalloc(sizeof(struct userdata));
=
if (record) {
- if (waveInOpen(&hwi, WAVE_MAPPER, &wf, (DWORD_PTR)chunk_ready_cb, =
(DWORD_PTR)u, CALLBACK_FUNCTION) !=3D MMSYSERR_NOERROR) {
+ if (waveInOpen(&hwi, device, &wf, (DWORD_PTR)chunk_ready_cb, (DWOR=
D_PTR)u, CALLBACK_FUNCTION) !=3D MMSYSERR_NOERROR) {
pa_log("failed to open waveIn");
goto fail;
}
@@ -486,7 +495,7 @@
}
=
if (playback) {
- if (waveOutOpen(&hwo, WAVE_MAPPER, &wf, (DWORD_PTR)chunk_done_cb, =
(DWORD_PTR)u, CALLBACK_FUNCTION) !=3D MMSYSERR_NOERROR) {
+ if (waveOutOpen(&hwo, device, &wf, (DWORD_PTR)chunk_done_cb, (DWOR=
D_PTR)u, CALLBACK_FUNCTION) !=3D MMSYSERR_NOERROR) {
pa_log("failed to open waveOut");
goto fail;
}
More information about the pulseaudio-commits
mailing list