util

util

Synopsis

GType *             swami_util_get_child_types          (GType type,
                                                         guint *n_types);
GValue *            swami_util_new_value                (void);
void                swami_util_free_value               (GValue *value);
void                swami_util_midi_note_to_str         (int note,
                                                         char *str);
int                 swami_util_midi_str_to_note         (const char *str);

Description

Details

swami_util_get_child_types ()

GType *             swami_util_get_child_types          (GType type,
                                                         guint *n_types);

Recursively get all child types of a type.

type :

Type to get all children from

n_types :

Location to store count of types or NULL to ignore

Returns :

Newly allocated and 0 terminated array of types

swami_util_new_value ()

GValue *            swami_util_new_value                (void);

Allocate a new GValue using a GMemChunk.

Returns :

New uninitialized (zero) GValue

swami_util_free_value ()

void                swami_util_free_value               (GValue *value);

Free a GValue that was allocated with swami_util_new_value().

value :

GValue created from swami_util_new_value().

swami_util_midi_note_to_str ()

void                swami_util_midi_note_to_str         (int note,
                                                         char *str);

note :

MIDI note number (0-127)

str :

Buffer to store string to (at least 5 bytes in length)

swami_util_midi_str_to_note ()

int                 swami_util_midi_str_to_note         (const char *str);

Parse a string in the form "[A-Ga-g][b#]n" or "0"-"127" as a MIDI note. Where 'n' is the octave number between -2 and 8. '#' is used to indicate "sharp". 'b' means "flat". Examples: "C3" is middle C (note 60), "F-2" is note 5, "Db-2" is the same as "C-2" (note 0). Any chars following a valid MIDI note string are ignored.

str :

String to parse as a MIDI note

Returns :

The MIDI note # or -1 on error (str is malformed).