Zachary Ware | 73f8cfb | 2015-05-13 01:21:21 -0500 | [diff] [blame] | 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)winsound_PlaySound, METH_VARARGS, winsound_PlaySound__doc__}, |
| 18 | |
| 19 | static PyObject * |
| 20 | winsound_PlaySound_impl(PyModuleDef *module, Py_UNICODE *sound, int flags); |
| 21 | |
| 22 | static PyObject * |
| 23 | winsound_PlaySound(PyModuleDef *module, PyObject *args) |
| 24 | { |
| 25 | PyObject *return_value = NULL; |
| 26 | Py_UNICODE *sound; |
| 27 | int flags; |
| 28 | |
Zachary Ware | 77772c0 | 2015-05-13 10:58:35 -0500 | [diff] [blame] | 29 | if (!PyArg_ParseTuple(args, "Zi:PlaySound", |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 30 | &sound, &flags)) { |
Zachary Ware | 73f8cfb | 2015-05-13 01:21:21 -0500 | [diff] [blame] | 31 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 32 | } |
Zachary Ware | 73f8cfb | 2015-05-13 01:21:21 -0500 | [diff] [blame] | 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)winsound_Beep, METH_VARARGS, winsound_Beep__doc__}, |
| 53 | |
| 54 | static PyObject * |
| 55 | winsound_Beep_impl(PyModuleDef *module, int frequency, int duration); |
| 56 | |
| 57 | static PyObject * |
| 58 | winsound_Beep(PyModuleDef *module, PyObject *args) |
| 59 | { |
| 60 | PyObject *return_value = NULL; |
| 61 | int frequency; |
| 62 | int duration; |
| 63 | |
Zachary Ware | 77772c0 | 2015-05-13 10:58:35 -0500 | [diff] [blame] | 64 | if (!PyArg_ParseTuple(args, "ii:Beep", |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 65 | &frequency, &duration)) { |
Zachary Ware | 73f8cfb | 2015-05-13 01:21:21 -0500 | [diff] [blame] | 66 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 67 | } |
Zachary Ware | 73f8cfb | 2015-05-13 01:21:21 -0500 | [diff] [blame] | 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, x=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)winsound_MessageBeep, METH_VARARGS, winsound_MessageBeep__doc__}, |
| 84 | |
| 85 | static PyObject * |
| 86 | winsound_MessageBeep_impl(PyModuleDef *module, int x); |
| 87 | |
| 88 | static PyObject * |
| 89 | winsound_MessageBeep(PyModuleDef *module, PyObject *args) |
| 90 | { |
| 91 | PyObject *return_value = NULL; |
| 92 | int x = MB_OK; |
| 93 | |
Zachary Ware | 77772c0 | 2015-05-13 10:58:35 -0500 | [diff] [blame] | 94 | if (!PyArg_ParseTuple(args, "|i:MessageBeep", |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 95 | &x)) { |
Zachary Ware | 73f8cfb | 2015-05-13 01:21:21 -0500 | [diff] [blame] | 96 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 97 | } |
Zachary Ware | 73f8cfb | 2015-05-13 01:21:21 -0500 | [diff] [blame] | 98 | return_value = winsound_MessageBeep_impl(module, x); |
| 99 | |
| 100 | exit: |
| 101 | return return_value; |
| 102 | } |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 103 | /*[clinic end generated code: output=a5f53e42d4396bb4 input=a9049054013a1b77]*/ |