Skip to content

Commit e4f6a2f

Browse files
committed
docs: convert comments into function docstrings in helper module
Signed-off-by: Christopher Arndt <chris@chrisarndt.de>
1 parent 009df2a commit e4f6a2f

1 file changed

Lines changed: 8 additions & 22 deletions

File tree

jacklib/helpers.py

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,12 @@
1515
#
1616
# For a full copy of the GNU General Public License see the file COPYING.md.
1717

18-
# -------------------------------------------------------------------------------------------------
19-
# Try Import jacklib
20-
2118
from . import api as jacklib
2219

23-
# -------------------------------------------------------------------------------------------------
24-
# Get JACK error status as string
25-
2620

2721
def get_jack_status_error_string(cStatus):
22+
"""Get JACK error status as string."""
23+
2824
status = cStatus.value
2925

3026
if status == 0x0:
@@ -63,11 +59,8 @@ def get_jack_status_error_string(cStatus):
6359
return ";\n".join(errorString) + "."
6460

6561

66-
# -------------------------------------------------------------------------------------------------
67-
# Convert C char** -> Python list
68-
69-
7062
def c_char_p_p_to_list(c_char_p_p, encoding=jacklib.ENCODING, errors="ignore"):
63+
"""Convert C char** -> Python list of strings."""
7164
i = 0
7265
retList = []
7366

@@ -86,29 +79,22 @@ def c_char_p_p_to_list(c_char_p_p, encoding=jacklib.ENCODING, errors="ignore"):
8679
return retList
8780

8881

89-
# -------------------------------------------------------------------------------------------------
90-
# Convert C void* -> string
91-
92-
9382
def voidptr2str(void_p):
83+
"""Convert C void* -> string."""
9484
char_p = jacklib.cast(void_p, jacklib.c_char_p)
9585
string = str(char_p.value, encoding="utf-8")
9686
return string
9787

9888

99-
# -------------------------------------------------------------------------------------------------
100-
# Convert C void* -> jack_default_audio_sample_t*
101-
102-
10389
def translate_audio_port_buffer(void_p):
104-
return jacklib.cast(void_p, jacklib.POINTER(jacklib.jack_default_audio_sample_t))
90+
"""Convert C void* -> jack_default_audio_sample_t*."""
10591

106-
107-
# -------------------------------------------------------------------------------------------------
108-
# Convert a JACK midi buffer into a python variable-size list
92+
return jacklib.cast(void_p, jacklib.POINTER(jacklib.jack_default_audio_sample_t))
10993

11094

11195
def translate_midi_event_buffer(void_p, size):
96+
"""Convert a JACK MIDI buffer into a Python tuple of 0-4 elements."""
97+
11298
if not void_p:
11399
return ()
114100
elif size == 1:

0 commit comments

Comments
 (0)