BtValueGroup

BtValueGroup — a GValue array of parameter values

Functions

Properties

gulong length Read / Write / Construct
BtParameterGroup * parameter-group Read / Write / Construct Only

Signals

void group-changed No Hooks
void param-changed No Hooks

Types and Values

struct BtValueGroup

Object Hierarchy

    GObject
    ╰── BtValueGroup

Includes

#include <libbtcore/core.h>

Description

A group of GValues, such as used in patterns. The class provides a variety of methods to manipulate the data fields.

The value group maintains two blocks of data values. One for validated fields and one for plain fields. This allows step wise entry of data (multi column entry of sparse enums). The validated cells are only set as the plain value becomes valid. Invalid values are not copied nor are they stored in the song.

Functions

bt_value_group_blend_column ()

void
bt_value_group_blend_column (const BtValueGroup * const self,
                             const gulong start_tick,
                             const gulong end_tick,
                             const gulong param);

Fade values from start_tick to end_tick for param .

Parameters

self

the pattern

 

start_tick

the start position for the range

 

end_tick

the end position for the range

 

param

the parameter

 

Since: 0.7


bt_value_group_blend_columns ()

void
bt_value_group_blend_columns (const BtValueGroup * const self,
                              const gulong start_tick,
                              const gulong end_tick);

Fade values from start_tick to end_tick for all params.

Parameters

self

the pattern

 

start_tick

the start position for the range

 

end_tick

the end position for the range

 

Since: 0.7


bt_value_group_copy ()

BtValueGroup *
bt_value_group_copy (const BtValueGroup * const self);

Create a new instance as a copy of the given instance.

Parameters

self

the value-group to create a copy from

 

Returns

the new instance or NULL in case of an error.

[transfer full]

Since: 0.7


bt_value_group_clear_column ()

void
bt_value_group_clear_column (const BtValueGroup * const self,
                             const gulong start_tick,
                             const gulong end_tick,
                             const gulong param);

Clears values from start_tick to end_tick for param .

Parameters

self

the pattern

 

start_tick

the start position for the range

 

end_tick

the end position for the range

 

param

the parameter

 

Since: 0.7


bt_value_group_clear_columns ()

void
bt_value_group_clear_columns (const BtValueGroup * const self,
                              const gulong start_tick,
                              const gulong end_tick);

Clear values from start_tick to end_tick for all params.

Parameters

self

the pattern

 

start_tick

the start position for the range

 

end_tick

the end position for the range

 

Since: 0.7


bt_value_group_delete_full_row ()

void
bt_value_group_delete_full_row (const BtValueGroup * const self,
                                const gulong tick);

Delete row for all parameters.

Parameters

self

the pattern

 

tick

the position to delete

 

Since: 0.7


bt_value_group_delete_row ()

void
bt_value_group_delete_row (const BtValueGroup * const self,
                           const gulong tick,
                           const gulong param);

Delete row for given param .

Parameters

self

the pattern

 

tick

the position to delete

 

param

the parameter

 

Since: 0.7


bt_value_group_deserialize_column ()

gboolean
bt_value_group_deserialize_column (const BtValueGroup * const self,
                                   const gulong start_tick,
                                   const gulong end_tick,
                                   const gulong param,
                                   const gchar *data);

Deserializes values to start_tick to end_tick for param from data .

Parameters

self

the pattern

 

start_tick

the start position for the range

 

end_tick

the end position for the range

 

param

the parameter

 

data

the source data

 

Returns

TRUE for success, FALSE e.g. to indicate incompatible GType values for the column specified by param and the data .

Since: 0.7


bt_value_group_flip_column ()

void
bt_value_group_flip_column (const BtValueGroup * const self,
                            const gulong start_tick,
                            const gulong end_tick,
                            const gulong param);

Flips values from start_tick to end_tick for param up-side down.

Parameters

self

the pattern

 

start_tick

the start position for the range

 

end_tick

the end position for the range

 

param

the parameter

 

Since: 0.7


bt_value_group_flip_columns ()

void
bt_value_group_flip_columns (const BtValueGroup * const self,
                             const gulong start_tick,
                             const gulong end_tick);

Flips values from start_tick to end_tick for all params up-side down.

Parameters

self

the pattern

 

start_tick

the start position for the range

 

end_tick

the end position for the range

 

Since: 0.7


bt_value_group_get_event ()

gchar *
bt_value_group_get_event (const BtValueGroup * const self,
                          const gulong tick,
                          const gulong param);

Returns the string representation of the specified cell. Free it when done.

Parameters

self

the pattern the cell belongs to

 

tick

the tick (time) position starting with 0

 

param

the number of the parameter starting with 0

 

Returns

a newly allocated string with the data or NULL on error

Since: 0.7


bt_value_group_get_event_data ()

GValue *
bt_value_group_get_event_data (const BtValueGroup * const self,
                               const gulong tick,
                               const gulong param);

Fetches a cell from the given location in the pattern. If there is no event there, then the GValue is uninitialized. Test with BT_IS_GVALUE(event).

Parameters

self

the pattern to search for the param

 

tick

the tick (time) position starting with 0

 

param

the number of the parameter starting with 0

 

Returns

the GValue or NULL if out of the pattern range

Since: 0.7


bt_value_group_insert_full_row ()

void
bt_value_group_insert_full_row (const BtValueGroup * const self,
                                const gulong tick);

Insert one empty row for all parameters.

Parameters

self

the pattern

 

tick

the position to insert at

 

Since: 0.7


bt_value_group_insert_row ()

void
bt_value_group_insert_row (const BtValueGroup * const self,
                           const gulong tick,
                           const gulong param);

Insert one empty row for given param .

Parameters

self

the pattern

 

tick

the position to insert at

 

param

the parameter

 

Since: 0.7


bt_value_group_new ()

BtValueGroup *
bt_value_group_new (const BtParameterGroup * const param_group,
                    const gulong length);

Create a new instance.

Parameters

param_group

the parameter-group

 

length

the number of ticks

 

Returns

the new instance or NULL in case of an error.

[transfer full]

Since: 0.7


bt_value_group_randomize_column ()

void
bt_value_group_randomize_column (const BtValueGroup * const self,
                                 const gulong start_tick,
                                 const gulong end_tick,
                                 const gulong param);

Randomize values from start_tick to end_tick for param .

Parameters

self

the pattern

 

start_tick

the start position for the range

 

end_tick

the end position for the range

 

param

the parameter

 

Since: 0.7


bt_value_group_randomize_columns ()

void
bt_value_group_randomize_columns (const BtValueGroup * const self,
                                  const gulong start_tick,
                                  const gulong end_tick);

Randomize values from start_tick to end_tick for all params.

Parameters

self

the pattern

 

start_tick

the start position for the range

 

end_tick

the end position for the range

 

Since: 0.7


bt_value_group_range_randomize_column ()

void
bt_value_group_range_randomize_column (const BtValueGroup * const self,
                                       const gulong start_tick,
                                       const gulong end_tick,
                                       const gulong param);

Randomize values from start_tick to end_tick for param using the first and last value as bounds for the random values.

Parameters

self

the pattern

 

start_tick

the start position for the range

 

end_tick

the end position for the range

 

param

the parameter

 

Since: 0.7


bt_value_group_range_randomize_columns ()

void
bt_value_group_range_randomize_columns
                               (const BtValueGroup * const self,
                                const gulong start_tick,
                                const gulong end_tick);

Randomize values from start_tick to end_tick for all params using the first and last value as bounds for the random values.

Parameters

self

the pattern

 

start_tick

the start position for the range

 

end_tick

the end position for the range

 

Since: 0.7


bt_value_group_serialize_column ()

void
bt_value_group_serialize_column (const BtValueGroup * const self,
                                 const gulong start_tick,
                                 const gulong end_tick,
                                 const gulong param,
                                 GString *data);

Serializes values from start_tick to end_tick for param into data .

Parameters

self

the pattern

 

start_tick

the start position for the range

 

end_tick

the end position for the range

 

param

the parameter

 

data

the target

 

Since: 0.7


bt_value_group_serialize_columns ()

void
bt_value_group_serialize_columns (const BtValueGroup * const self,
                                  const gulong start_tick,
                                  const gulong end_tick,
                                  GString *data);

Serializes values from start_tick to end_tick for all params into data .

Parameters

self

the pattern

 

start_tick

the start position for the range

 

end_tick

the end position for the range

 

data

the target

 

Since: 0.7


bt_value_group_set_event ()

gboolean
bt_value_group_set_event (const BtValueGroup * const self,
                          const gulong tick,
                          const gulong param,
                          const gchar * const value);

Stores the supplied value into the specified pattern cell.

Parameters

self

the pattern the cell belongs to

 

tick

the tick (time) position starting with 0

 

param

the number of the parameter starting with 0

 

value

the string representation of the value to store

 

Returns

TRUE for success

Since: 0.7


bt_value_group_test_event ()

gboolean
bt_value_group_test_event (const BtValueGroup * const self,
                           const gulong tick,
                           const gulong param);

Tests if there is an event in the specified cell.

Parameters

self

the pattern the cell belongs to

 

tick

the tick (time) position starting with 0

 

param

the number of the parameter starting with 0

 

Returns

TRUE if there is an event

Since: 0.7


bt_value_group_test_tick ()

gboolean
bt_value_group_test_tick (const BtValueGroup * const self,
                          const gulong tick);

Check if there are any event in the given pattern-row.

Parameters

self

the pattern to check

 

tick

the tick index in the pattern

 

Returns

TRUE is there are events, FALSE otherwise

Since: 0.7

Types and Values

struct BtValueGroup

struct BtValueGroup;

A group of parameters, such as used in machines or wires.

Property Details

The “length” property

  “length”                   gulong

length of the pattern in ticks.

Flags: Read / Write / Construct


The “parameter-group” property

  “parameter-group”          BtParameterGroup *

Parameter group for the values.

Flags: Read / Write / Construct Only

Signal Details

The “group-changed” signal

void
user_function (BtValueGroup     *self,
               BtParameterGroup *param_group,
               gboolean          intermediate,
               gpointer          user_data)

Signals that this value-group has been changed (more than in one place). When doing e.g. line inserts, one will receive two updates, one before and one after. The first will have intermediate =TRUE. Applications can use that to defer change-consolidation.

Parameters

self

the value-group object that emitted the signal

 

param_group

the related BtParameterGroup

 

intermediate

flag that is TRUE to signal that more change are coming

 

user_data

user data set when the signal handler was connected.

 

Flags: No Hooks


The “param-changed” signal

void
user_function (BtValueGroup     *self,
               BtParameterGroup *param_group,
               gulong            tick,
               gulong            param,
               gpointer          user_data)

Signals that a param of this value-group has been changed.

Parameters

self

the value-group object that emitted the signal

 

param_group

the parameter group

 

tick

the tick position inside the pattern

 

param

the parameter index

 

user_data

user data set when the signal handler was connected.

 

Flags: No Hooks