blob: dca5a429f360f071f82bd5478563aeb494e70c9b [file] [log] [blame]
Zachary Ware73f8cfb2015-05-13 01:21:21 -05001/*[clinic input]
2preserve
3[clinic start generated code]*/
4
5PyDoc_STRVAR(winsound_PlaySound__doc__,
6"PlaySound($module, sound, flags, /)\n"
7"--\n"
8"\n"
9"A wrapper around the Windows PlaySound API.\n"
10"\n"
11" sound\n"
12" The sound to play; a filename, data, or None.\n"
13" flags\n"
14" Flag values, ored together. See module documentation.");
15
16#define WINSOUND_PLAYSOUND_METHODDEF \
17 {"PlaySound", (PyCFunction)winsound_PlaySound, METH_VARARGS, winsound_PlaySound__doc__},
18
19static PyObject *
20winsound_PlaySound_impl(PyModuleDef *module, Py_UNICODE *sound, int flags);
21
22static PyObject *
23winsound_PlaySound(PyModuleDef *module, PyObject *args)
24{
25 PyObject *return_value = NULL;
26 Py_UNICODE *sound;
27 int flags;
28
Zachary Ware77772c02015-05-13 10:58:35 -050029 if (!PyArg_ParseTuple(args, "Zi:PlaySound",
Zachary Ware73f8cfb2015-05-13 01:21:21 -050030 &sound, &flags))
31 goto exit;
32 return_value = winsound_PlaySound_impl(module, sound, flags);
33
34exit:
35 return return_value;
36}
37
38PyDoc_STRVAR(winsound_Beep__doc__,
39"Beep($module, frequency, duration, /)\n"
40"--\n"
41"\n"
42"A wrapper around the Windows Beep API.\n"
43"\n"
44" frequency\n"
45" Frequency of the sound in hertz.\n"
46" Must be in the range 37 through 32,767.\n"
47" duration\n"
48" How long the sound should play, in milliseconds.");
49
50#define WINSOUND_BEEP_METHODDEF \
51 {"Beep", (PyCFunction)winsound_Beep, METH_VARARGS, winsound_Beep__doc__},
52
53static PyObject *
54winsound_Beep_impl(PyModuleDef *module, int frequency, int duration);
55
56static PyObject *
57winsound_Beep(PyModuleDef *module, PyObject *args)
58{
59 PyObject *return_value = NULL;
60 int frequency;
61 int duration;
62
Zachary Ware77772c02015-05-13 10:58:35 -050063 if (!PyArg_ParseTuple(args, "ii:Beep",
Zachary Ware73f8cfb2015-05-13 01:21:21 -050064 &frequency, &duration))
65 goto exit;
66 return_value = winsound_Beep_impl(module, frequency, duration);
67
68exit:
69 return return_value;
70}
71
72PyDoc_STRVAR(winsound_MessageBeep__doc__,
73"MessageBeep($module, x=MB_OK, /)\n"
74"--\n"
75"\n"
76"Call Windows MessageBeep(x).\n"
77"\n"
78"x defaults to MB_OK.");
79
80#define WINSOUND_MESSAGEBEEP_METHODDEF \
81 {"MessageBeep", (PyCFunction)winsound_MessageBeep, METH_VARARGS, winsound_MessageBeep__doc__},
82
83static PyObject *
84winsound_MessageBeep_impl(PyModuleDef *module, int x);
85
86static PyObject *
87winsound_MessageBeep(PyModuleDef *module, PyObject *args)
88{
89 PyObject *return_value = NULL;
90 int x = MB_OK;
91
Zachary Ware77772c02015-05-13 10:58:35 -050092 if (!PyArg_ParseTuple(args, "|i:MessageBeep",
Zachary Ware73f8cfb2015-05-13 01:21:21 -050093 &x))
94 goto exit;
95 return_value = winsound_MessageBeep_impl(module, x);
96
97exit:
98 return return_value;
99}
Zachary Ware77772c02015-05-13 10:58:35 -0500100/*[clinic end generated code: output=c5b018ac9dc1f500 input=a9049054013a1b77]*/