swamigui Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties |
SwamiguiSplitsEntry; #define SWAMIGUI_SPLITS_WHITE_KEY_COUNT enum SwamiguiSplitsMode; enum SwamiguiSplitsStatus; enum SwamiguiSplitsMoveFlags; gboolean (*SwamiguiSplitsHandler) (SwamiguiSplits *splits
); SwamiguiSplits; GtkWidget * swamigui_splits_new (void
); void swamigui_splits_set_mode (SwamiguiSplits *splits
,SwamiguiSplitsMode mode
); void swamigui_splits_set_width (SwamiguiSplits *splits
,int width
); void swamigui_splits_set_selection (SwamiguiSplits *splits
,IpatchList *items
); IpatchList * swamigui_splits_get_selection (SwamiguiSplits *splits
); void swamigui_splits_select_items (SwamiguiSplits *splits
,GList *items
); void swamigui_splits_select_all (SwamiguiSplits *splits
); void swamigui_splits_unselect_all (SwamiguiSplits *splits
); void swamigui_splits_item_changed (SwamiguiSplits *splits
); void swamigui_splits_register_handler (SwamiguiSplitsHandler handler
); void swamigui_splits_unregister_handler (SwamiguiSplitsHandler handler
); #define swamigui_splits_add (splits, item) SwamiguiSplitsEntry * swamigui_splits_insert (SwamiguiSplits *splits
,GObject *item
,int index
); SwamiguiSplitsEntry * swamigui_splits_lookup_entry (SwamiguiSplits *splits
,GObject *item
); void swamigui_splits_remove (SwamiguiSplits *splits
,GObject *item
); void swamigui_splits_remove_all (SwamiguiSplits *splits
); void swamigui_splits_set_span_range (SwamiguiSplits *splits
,GObject *item
,int low
,int high
); void swamigui_splits_set_root_note (SwamiguiSplits *splits
,GObject *item
,int val
); SwamiControl * swamigui_splits_entry_get_span_control (SwamiguiSplitsEntry *entry
); SwamiControl * swamigui_splits_entry_get_root_note_control (SwamiguiSplitsEntry *entry
); int swamigui_splits_entry_get_index (SwamiguiSplitsEntry *entry
);
GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkContainer +----GtkBox +----GtkVBox +----SwamiguiSplits
SwamiguiSplits implements AtkImplementorIface, GtkBuildable and GtkOrientable.
"item-selection" IpatchList* : Read / Write "piano" SwamiguiPiano* : Read "splits-item" IpatchItem* : Read / Write
typedef enum { SWAMIGUI_SPLITS_NOTE, SWAMIGUI_SPLITS_VELOCITY } SwamiguiSplitsMode;
typedef enum { SWAMIGUI_SPLITS_NORMAL, /* no particular status */ SWAMIGUI_SPLITS_INIT, /* check selection and initialize splits */ SWAMIGUI_SPLITS_MODE, /* note/velocity mode change */ SWAMIGUI_SPLITS_UPDATE, /* selection changed */ SWAMIGUI_SPLITS_CHANGED /* splits-item changed */ } SwamiguiSplitsStatus;
typedef enum { SWAMIGUI_SPLITS_MOVE_RANGES = 1 << 0, SWAMIGUI_SPLITS_MOVE_PARAM1 = 1 << 1 } SwamiguiSplitsMoveFlags;
gboolean (*SwamiguiSplitsHandler) (SwamiguiSplits *splits
);
This function type is used to handle specific patch item types with note
or velocity split parameters. The splits
object
status
field indicates the current operation
which is one of:
SWAMIGUI_SPLITS_INIT
- Check selection and install splits and note
pointers if the selection can be handled. Return TRUE
if selection
was handled, which will activate this handler, FALSE
otherwise.
SWAMIGUI_SPLITS_MODE
- Split mode change (from note to velocity mode for
example). Re-configure splits and note pointers. Return TRUE
if mode
change was handled, FALSE
otherwise which will de-activate this handler.
SWAMIGUI_SPLITS_UPDATE
- Item selection has changed, update splits and
note pointers. Return TRUE
if selection change was handled, FALSE
otherwise which will de-activate this handler.
Other useful fields of a SwamiguiSplits object include
mode
which defines the current mode
(SwamiguiSplitsMode) and selection
which
defines the current item selection.
typedef struct { SwamiguiSplitsStatus status; /* current status (for handlers) */ int mode; /* current mode (SWAMIGUI_SPLITS_NOTE or SWAMIGUI_SPLITS_VELOCITY) */ int move_flags; /* current move flags (SwamiguiSplitsMoveFlags) */ IpatchList *selection; /* selected items (parent OR child splits) */ IpatchItem *splits_item; /* active item which contains splits */ SwamiguiSplitsHandler handler; /* active splits handler or NULL */ gpointer handler_data; /* handler defined pointer */ } SwamiguiSplits;
GtkWidget * swamigui_splits_new (void
);
Create new note/velocity splits widget.
Returns : |
New splits widget. |
void swamigui_splits_set_mode (SwamiguiSplits *splits
,SwamiguiSplitsMode mode
);
Set the mode of a splits object.
|
Splits object |
|
Velocity or key mode enum |
void swamigui_splits_set_width (SwamiguiSplits *splits
,int width
);
Set the width of the splits widget in pixels.
|
Splits object |
|
Width in pixels |
void swamigui_splits_set_selection (SwamiguiSplits *splits
,IpatchList *items
);
Set the items of a splits widget. The items
list can contain
an item that is a parent of items with split parameters (a
SoundFont IpatchSF2Preset or IpatchSF2Inst for example) and/or a list
of children split item's with the same parent (for example
SoundFont IpatchSF2PZone items), any other selection list will de-activate
the splits widget.
|
Splits object |
|
List of selected items (selected splits and/or the parent of
split items) or NULL to unset selection.
|
IpatchList * swamigui_splits_get_selection (SwamiguiSplits *splits
);
Get the list of active items in a splits widget (a parent of split items and/or split items).
|
Splits widget |
Returns : |
New list containing splits with a ref count of one which the
caller owns or NULL if no active splits.
|
void swamigui_splits_select_items (SwamiguiSplits *splits
,GList *items
);
Set the list of splits currently selected. Usually only used by SwamiguiSplit handlers.
|
Splits widget |
|
List of objects to select (NULL to unselect all)
|
void swamigui_splits_select_all (SwamiguiSplits *splits
);
Select all splits in a splits widget.
|
Splits widget |
void swamigui_splits_unselect_all (SwamiguiSplits *splits
);
Unselect all splits in a splits widget.
|
Splits widget |
void swamigui_splits_item_changed (SwamiguiSplits *splits
);
Called to indicate that the active "splits-item" has changed and the splits should therefore be updated.
|
Splits widget |
void swamigui_splits_register_handler (SwamiguiSplitsHandler handler
);
Registers a new handler for splits widgets. Split handlers interface patch item's of particular types with note/velocity split parameters and note pointer controls (such as a root note parameter).
MT: This function is multi-thread safe and can be called from outside of the GUI thread.
|
Splits handler function to register |
void swamigui_splits_unregister_handler (SwamiguiSplitsHandler handler
);
Unregisters a handler previously registered with
swamigui_splits_register_handler()
.
MT: This function is multi-thread safe and can be called from outside of the GUI thread.
|
Handler function to unregister |
SwamiguiSplitsEntry * swamigui_splits_insert (SwamiguiSplits *splits
,GObject *item
,int index
);
Adds a new entry to a splits widget associated with a given object
item
. An entry is a place holder for a split range (key or velocity)
and/or root note controls.
|
Splits widget |
|
Object for this split |
|
Index in list of existing splits in widget (-1 to append). |
Returns : |
Splits entry which is internal and should only be used with public accessor functions and should not be modified or freed. |
SwamiguiSplitsEntry * swamigui_splits_lookup_entry (SwamiguiSplits *splits
,GObject *item
);
void swamigui_splits_remove (SwamiguiSplits *splits
,GObject *item
);
Remove a split from a splits object by its associated object.
|
Splits widget |
|
Object of split to remove |
void swamigui_splits_remove_all (SwamiguiSplits *splits
);
Remove all splits from a splits object.
|
Splits widget |
void swamigui_splits_set_span_range (SwamiguiSplits *splits
,GObject *item
,int low
,int high
);
A convenience function to set a span control range. One could also set this directly via the control.
|
Splits object |
|
Item of span to set |
|
Low value of span range |
|
High value of span range |
void swamigui_splits_set_root_note (SwamiguiSplits *splits
,GObject *item
,int val
);
A convenience function to set the root note value of a splits entry.
|
Splits widget |
|
Item of the splits entry to change the root note of |
|
MIDI root note value (0-127) |
SwamiControl * swamigui_splits_entry_get_span_control
(SwamiguiSplitsEntry *entry
);
SwamiControl * swamigui_splits_entry_get_root_note_control
(SwamiguiSplitsEntry *entry
);
Get the root note control for a given splits entry. The root note control is created if it hasn't already been.
|
Splits entry pointer |
Returns : |
The root note control for the given entry . The control has not been
referenced and is only valid while the GUI split exists.
|
int swamigui_splits_entry_get_index (SwamiguiSplitsEntry *entry
);