Debian Codegraph @

PC/clinic/winsound.c.h

raw
1 /*[clinic input]
2 preserve
3 [clinic start generated code]*/
4
5 PyDoc_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)(void(*)(void))winsound_PlaySound, METH_VARARGS|METH_KEYWORDS, winsound_PlaySound__doc__},
18
19 static PyObject *
20 winsound_PlaySound_impl(PyObject *module, PyObject *sound, int flags);
21
22 static PyObject *
23 winsound_PlaySound(PyObject *module, PyObject *args, PyObject *kwargs)
24 {
25 PyObject *return_value = NULL;
26 static char *_keywords[] = {"sound", "flags", NULL};
27 PyObject *sound;
28 int flags;
29
30 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "Oi:PlaySound", _keywords,
31 &sound, &flags))
32 goto exit;
33 return_value = winsound_PlaySound_impl(module, sound, flags);
34
35 exit:
36 return return_value;
37 }
38
39 PyDoc_STRVAR(winsound_Beep__doc__,
40 "Beep($module, /, frequency, duration)\n"
41 "--\n"
42 "\n"
43 "A wrapper around the Windows Beep API.\n"
44 "\n"
45 " frequency\n"
46 " Frequency of the sound in hertz.\n"
47 " Must be in the range 37 through 32,767.\n"
48 " duration\n"
49 " How long the sound should play, in milliseconds.");
50
51 #define WINSOUND_BEEP_METHODDEF \
52 {"Beep", (PyCFunction)(void(*)(void))winsound_Beep, METH_VARARGS|METH_KEYWORDS, winsound_Beep__doc__},
53
54 static PyObject *
55 winsound_Beep_impl(PyObject *module, int frequency, int duration);
56
57 static PyObject *
58 winsound_Beep(PyObject *module, PyObject *args, PyObject *kwargs)
59 {
60 PyObject *return_value = NULL;
61 static char *_keywords[] = {"frequency", "duration", NULL};
62 int frequency;
63 int duration;
64
65 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ii:Beep", _keywords,
66 &frequency, &duration))
67 goto exit;
68 return_value = winsound_Beep_impl(module, frequency, duration);
69
70 exit:
71 return return_value;
72 }
73
74 PyDoc_STRVAR(winsound_MessageBeep__doc__,
75 "MessageBeep($module, /, type=MB_OK)\n"
76 "--\n"
77 "\n"
78 "Call Windows MessageBeep(x).\n"
79 "\n"
80 "x defaults to MB_OK.");
81
82 #define WINSOUND_MESSAGEBEEP_METHODDEF \
83 {"MessageBeep", (PyCFunction)(void(*)(void))winsound_MessageBeep, METH_VARARGS|METH_KEYWORDS, winsound_MessageBeep__doc__},
84
85 static PyObject *
86 winsound_MessageBeep_impl(PyObject *module, int type);
87
88 static PyObject *
89 winsound_MessageBeep(PyObject *module, PyObject *args, PyObject *kwargs)
90 {
91 PyObject *return_value = NULL;
92 static char *_keywords[] = {"type", NULL};
93 int type = MB_OK;
94
95 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i:MessageBeep", _keywords,
96 &type))
97 goto exit;
98 return_value = winsound_MessageBeep_impl(module, type);
99
100 exit:
101 return return_value;
102 }
103 /*[clinic end generated code: output=18a3771b34cdf97d input=a9049054013a1b77]*/