BtSequenceGridModel

BtSequenceGridModel — data model class for widgets showing the pattern sequence of a song

Synopsis

#include "bt-edit.h"

struct              BtSequenceGridModel;
enum                BtSequenceGridModelPosFormat;
BtSequenceGridModel * bt_sequence_grid_model_new        (BtSequence *sequence,
                                                         gulong bars);

Object Hierarchy

  GObject
   +----BtSequenceGridModel

Implemented Interfaces

BtSequenceGridModel implements GtkTreeModel.

Properties

  "bars"                     gulong                : Read / Write
  "length"                   gulong                : Read / Write
  "pos-format"               BtSequenceGridModelPosFormat  : Read / Write

Description

A generic model representing the track x time grid of patterns of a song. Can be shown by a treeview.

The visible length can be greater then the real length of the underlying sequence, by setting the BtSequenceGridModel::length property.

Details

struct BtSequenceGridModel

struct BtSequenceGridModel;

Data model for GtkTreeView or GtkComboBox.


enum BtSequenceGridModelPosFormat

typedef enum {
  BT_SEQUENCE_GRID_MODEL_POS_FORMAT_TICKS=0,
  BT_SEQUENCE_GRID_MODEL_POS_FORMAT_TIME,
  BT_SEQUENCE_GRID_MODEL_POS_FORMAT_BEATS
} BtSequenceGridModelPosFormat;

Format type for time values in the sequencer.

BT_SEQUENCE_GRID_MODEL_POS_FORMAT_TICKS

show as number of ticks

BT_SEQUENCE_GRID_MODEL_POS_FORMAT_TIME

show as "min:sec.msec"

BT_SEQUENCE_GRID_MODEL_POS_FORMAT_BEATS

show as "beats.ticks"

bt_sequence_grid_model_new ()

BtSequenceGridModel * bt_sequence_grid_model_new        (BtSequence *sequence,
                                                         gulong bars);

Creates a grid model for the sequence. The model is automatically updated on changes in the content. It also expands its length in sync to the sequence.

To make the row-shading work, the application has to update "bars" when it changed on the view.

When setting "length" to a value greater than the real sequence, the model will append dummy rows. This allows the cursor to go beyond the end to expand the sequence.

sequence :

the sequence

bars :

the intial bar-filtering for the view

Returns :

the sequence model.

Property Details

The "bars" property

  "bars"                     gulong                : Read / Write

tick stepping for the color shading.

Allowed values: >= 1


The "length" property

  "length"                   gulong                : Read / Write

visible length of the sequence (>= real length).


The "pos-format" property

  "pos-format"               BtSequenceGridModelPosFormat  : Read / Write

the display format for position columns.

Default value: BT_SEQUENCE_GRID_MODEL_POS_FORMAT_TICKS