## BtPresetListModel

BtPresetListModel — data model class for widgets showing presets of a machine

## Functions

BtPresetListModel * | bt_preset_list_model_new ()
void | bt_preset_list_model_add ()
void | bt_preset_list_model_remove ()
void | bt_preset_list_model_rename ()
gboolean | bt_preset_list_model_find_iter ()

## Types and Values

struct | BtPresetListModel

## Object Hierarchy

        GObject
        ╰── BtPresetListModel

## Implemented Interfaces

BtPresetListModel implements GtkTreeModel.

## Includes

    #include "bt-edit.h"

## Description

A generic model representing the presets of a machine, suitable for combo-boxes and treeview widgets.

One needs to manually tell the model of new, removed and changed presets.

## Functions

### bt_preset_list_model_new ()

    BtPresetListModel *
    bt_preset_list_model_new (GstElement *machine);

Creates a list model of presets for the `machine` . The model is automatically updated when presets are added, removed or renamed.

#### Parameters

machine | the gstreamer element of the machine |

#### Returns

the preset model.

### bt_preset_list_model_add ()

    void
    bt_preset_list_model_add (BtPresetListModel *model,
                              gchar *preset);

Notifies the model that a new preset was added.

#### Parameters

model | the model |
preset | the new preset |

### bt_preset_list_model_remove ()

    void
    bt_preset_list_model_remove (BtPresetListModel *model,
                                 gchar *preset);

Notifies the model that a preset was removed.

#### Parameters

model | the model |
preset | the removed preset |

### bt_preset_list_model_rename ()

    void
    bt_preset_list_model_rename (BtPresetListModel *model,
                                 gchar *o_preset,
                                 gchar *n_preset);

Notifies the model that a preset was renamed.

#### Parameters

model | the model |
o_preset | the previous preset name |
n_preset | the new preset name |

### bt_preset_list_model_find_iter ()

    gboolean
    bt_preset_list_model_find_iter (BtPresetListModel *model,
                                    gchar *preset,
                                    GtkTreeIter *iter);

Find the preset and return the iter to the row.

#### Parameters

model | the model |
preset | the selected preset |
iter | the tree iter for the selection |

#### Returns

TRUE of the preset has been found and `iter` is set.

## Types and Values

### struct BtPresetListModel

    struct BtPresetListModel;

Data model for GtkTreeView or GtkComboBox.