## BtPatternEditor

BtPatternEditor

## Synopsis

    #include "bt-edit.h"

    GtkWidget *         bt_pattern_editor_new               ();
    void                bt_pattern_editor_set_pattern       (BtPatternEditor *view,
                                                             gpointer pattern_data,
                                                             int num_rows,
                                                             int num_groups,
                                                             PatternColumnGroup *groups,
                                                             BtPatternEditorCallbacks *cb);
    gboolean            bt_pattern_editor_get_selection     (BtPatternEditor *self,
                                                             int *start,
                                                             int *end,
                                                             int *group,
                                                             int *param);

## Description

## Details

### bt_pattern_editor_new ()

    GtkWidget *         bt_pattern_editor_new               ();

Create a new pattern editor widget. Use `bt_pattern_editor_set_pattern()` to pass pattern data.

Returns : | the widget

### bt_pattern_editor_set_pattern ()

    void                bt_pattern_editor_set_pattern       (BtPatternEditor *view,
                                                             gpointer pattern_data,
                                                             int num_rows,
                                                             int num_groups,
                                                             PatternColumnGroup *groups,
                                                             BtPatternEditorCallbacks *cb);

Set pattern data to show in the widget.

`self` : | the widget
`pattern_data` : | memory block of values
`num_rows` : | number of tick rows (y axis)
`num_groups` : | number of groups (x axis)
`groups` : | group parameters
`cb` : | value transformation callbacks

### bt_pattern_editor_get_selection ()

    gboolean            bt_pattern_editor_get_selection     (BtPatternEditor *self,
                                                             int *start,
                                                             int *end,
                                                             int *group,
                                                             int *param);

Get selection rectangle.

`self` : | the widget
`start` : | location for start tick
`end` : | location for end tick
`group` : | location for group
`param` : | location for parameter in group
Returns : | `TRUE` if there was a selection.