swamigui Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties |
enum SwamiguiSampleEditorStatus; gboolean (*SwamiguiSampleEditorHandler) (SwamiguiSampleEditor *editor
); SwamiguiSampleEditor; enum SwamiguiSampleEditorMarkerFlags; enum SwamiguiSampleEditorMarkerId; GtkWidget * swamigui_sample_editor_new (void
); void swamigui_sample_editor_zoom_ofs (SwamiguiSampleEditor *editor
,double zoom_amt
,double zoom_xpos
); void swamigui_sample_editor_scroll_ofs (SwamiguiSampleEditor *editor
,int sample_ofs
); void swamigui_sample_editor_loop_zoom (SwamiguiSampleEditor *editor
,double zoom_amt
); void swamigui_sample_editor_set_selection (SwamiguiSampleEditor *editor
,IpatchList *items
); IpatchList * swamigui_sample_editor_get_selection (SwamiguiSampleEditor *editor
); void swamigui_sample_editor_register_handler (SwamiguiSampleEditorHandler handler
,SwamiguiPanelCheckFunc check_func
); void swamigui_sample_editor_unregister_handler (SwamiguiSampleEditorHandler handler
); void swamigui_sample_editor_reset (SwamiguiSampleEditor *editor
); void swamigui_sample_editor_get_loop_controls (SwamiguiSampleEditor *editor
,SwamiControl **loop_start
,SwamiControl **loop_end
); int swamigui_sample_editor_add_track (SwamiguiSampleEditor *editor
,IpatchSampleData *sample
,gboolean right_chan
); gboolean swamigui_sample_editor_get_track_info (SwamiguiSampleEditor *editor
,guint track
,IpatchSampleData **sample
,SwamiguiSampleCanvas **sample_view
,SwamiguiSampleCanvas **loop_view
); void swamigui_sample_editor_remove_track (SwamiguiSampleEditor *editor
,guint track
); void swamigui_sample_editor_remove_all_tracks (SwamiguiSampleEditor *editor
); guint swamigui_sample_editor_add_marker (SwamiguiSampleEditor *editor
,guint flags
,SwamiControl **start
,SwamiControl **end
); gboolean swamigui_sample_editor_get_marker_info (SwamiguiSampleEditor *editor
,guint marker
,guint *flags
,GnomeCanvasItem **start_line
,GnomeCanvasItem **end_line
,SwamiControl **start_ctrl
,SwamiControl **end_ctrl
); void swamigui_sample_editor_set_marker (SwamiguiSampleEditor *editor
,guint marker
,guint start
,guint end
); void swamigui_sample_editor_remove_marker (SwamiguiSampleEditor *editor
,guint marker
); void swamigui_sample_editor_remove_all_markers (SwamiguiSampleEditor *editor
); void swamigui_sample_editor_show_marker (SwamiguiSampleEditor *editor
,guint marker
,gboolean show_marker
); void swamigui_sample_editor_set_loop_types (SwamiguiSampleEditor *editor
,int *types
,gboolean loop_play_btn
); void swamigui_sample_editor_set_active_loop_type (SwamiguiSampleEditor *editor
,int type
);
GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkContainer +----GtkBox +----GtkHBox +----SwamiguiSampleEditor
SwamiguiSampleEditor implements AtkImplementorIface, GtkBuildable, GtkOrientable and SwamiguiPanel.
typedef enum { SWAMIGUI_SAMPLE_EDITOR_NORMAL, /* no particular status */ SWAMIGUI_SAMPLE_EDITOR_INIT, /* check selection and initialize */ SWAMIGUI_SAMPLE_EDITOR_UPDATE /* selection changed */ } SwamiguiSampleEditorStatus;
gboolean (*SwamiguiSampleEditorHandler) (SwamiguiSampleEditor *editor
);
This function type is used to handle specific patch item types with
sample data and loop info. The editor
object
status
field indicates the current
operation which is one of:
SWAMIGUI_SAMPLE_EDITOR_INIT
- Check selection and initialize the
sample editor if the selection can be handled. Return TRUE
if
selection was handled, which will activate this handler, FALSE
otherwise.
SWAMIGUI_SAMPLE_EDITOR_UPDATE
- Item selection has changed, update
sample editor. Return TRUE
if selection change was handled, FALSE
otherwise which will de-activate this handler.
Other useful fields of a SwamiguiSplits object include
selection
which defines the current item
selection.
typedef enum { SWAMIGUI_SAMPLE_EDITOR_MARKER_SINGLE = 1 << 0, /* Single value (not range) */ SWAMIGUI_SAMPLE_EDITOR_MARKER_VIEW = 1 << 1, /* view only marker */ SWAMIGUI_SAMPLE_EDITOR_MARKER_SIZE = 1 << 2 /* a start/size marker */ } SwamiguiSampleEditorMarkerFlags;
typedef enum { SWAMIGUI_SAMPLE_EDITOR_MARKER_ID_SELECTION, /* selection marker */ SWAMIGUI_SAMPLE_EDITOR_MARKER_ID_LOOP_FIND_START, /* loop find start window */ SWAMIGUI_SAMPLE_EDITOR_MARKER_ID_LOOP_FIND_END /* loop find end window */ } SwamiguiSampleEditorMarkerId;
GtkWidget * swamigui_sample_editor_new (void
);
Create a new sample view object
Returns : |
new widget of type SwamiguiSampleEditor |
void swamigui_sample_editor_zoom_ofs (SwamiguiSampleEditor *editor
,double zoom_amt
,double zoom_xpos
);
Zoom the sample canvas the specified scale amount and modify the start sample position to keep the given X coordinate stationary.
|
Sample editor object |
|
Zoom multiplier (> 1 = zoom in, < 1 = zoom out) |
|
X coordinate position to keep stationary |
void swamigui_sample_editor_scroll_ofs (SwamiguiSampleEditor *editor
,int sample_ofs
);
Scroll the sample canvas by a given offset.
|
Sample editor object |
|
Offset amount in samples |
void swamigui_sample_editor_loop_zoom (SwamiguiSampleEditor *editor
,double zoom_amt
);
Zoom the loop viewer canvas the specified scale amount. Zoom always occurs around center of loop cross overlap.
|
Sample editor object |
|
Zoom multiplier (> 1 = zoom in, < 1 = zoom out) |
void swamigui_sample_editor_set_selection (SwamiguiSampleEditor *editor
,IpatchList *items
);
Set the items of a sample editor widget. The items
list will usually
contain a single patch item that has sample data associated with it,
although sometimes multiple items will be handled as in the case of
stereo pairs.
|
Sample editor object |
|
List of selected items or NULL to unset selection
|
IpatchList * swamigui_sample_editor_get_selection
(SwamiguiSampleEditor *editor
);
Get the list of active items in a sample editor widget.
|
Sample editor widget |
Returns : |
New list containing selected items which has a ref count of one
which the caller owns or NULL if no items selected. Remove the
reference when finished with it.
|
void swamigui_sample_editor_register_handler (SwamiguiSampleEditorHandler handler
,SwamiguiPanelCheckFunc check_func
);
Registers a new handler for sample editor widgets. Sample editor handlers interface patch item's of particular types with sample data and related parameters (such as looping params).
MT: This function should only be called within GUI thread.
|
Sample editor handler function to register |
|
Function used to check if an item selection is valid for this handler |
void swamigui_sample_editor_unregister_handler
(SwamiguiSampleEditorHandler handler
);
Unregisters a handler previously registered with
swamigui_sample_editor_register_handler()
.
MT: This function should only be called in GUI thread.
|
Handler function to unregister |
void swamigui_sample_editor_reset (SwamiguiSampleEditor *editor
);
Resets a sample editor by removing all tracks and markers and disconnecting loop view controls. Usually only used by sample editor handlers.
|
Sample editor widget |
void swamigui_sample_editor_get_loop_controls (SwamiguiSampleEditor *editor
,SwamiControl **loop_start
,SwamiControl **loop_end
);
Get the loop start and end controls that are connected to all loop view start and end properties. Essentially controls for the loop view start and end points.
int swamigui_sample_editor_add_track (SwamiguiSampleEditor *editor
,IpatchSampleData *sample
,gboolean right_chan
);
Add a sample track to a sample editor. Usually only done by sample editor handlers. This function can be used to add multiple samples for stereo or multi-track audio.
gboolean swamigui_sample_editor_get_track_info (SwamiguiSampleEditor *editor
,guint track
,IpatchSampleData **sample
,SwamiguiSampleCanvas **sample_view
,SwamiguiSampleCanvas **loop_view
);
Get info for a sample track. No reference counting is done, since track will not get removed unless the sample editor handler does so. Returned object pointers should only be used within editor callback or references should be added.
|
Sample editor object |
|
Track index to get info from (starting from 0) |
|
Output - Sample object (NULL to ignore)
|
|
Output - The sample view canvas (NULL to ignore)
|
|
Output - The loop view canvas (NULL to ignore)
|
Returns : |
TRUE if index is a valid sample index, FALSE otherwise in
which case the returned pointers are undefined.
|
void swamigui_sample_editor_remove_track (SwamiguiSampleEditor *editor
,guint track
);
Remove a track from a sample editor by its index (starts from 0).
|
Sample editor object |
|
Index of track to remove |
void swamigui_sample_editor_remove_all_tracks
(SwamiguiSampleEditor *editor
);
Remove all tracks from a sample editor.
|
Sample editor object |
guint swamigui_sample_editor_add_marker (SwamiguiSampleEditor *editor
,guint flags
,SwamiControl **start
,SwamiControl **end
);
Add a new marker to a sample editor. Markers can be used for loop points, sample start/end points, selections and other position indicators/controls. Marker 0 is the sample selection marker and it is always present although it may be hidden.
|
Sample editor object |
|
SwamiguiSampleEditorMarkerFlags - SWAMIGUI_SAMPLE_EDITOR_MARKER_SINGLE is used for markers which define a single value. - SWAMIGUI_SAMPLE_EDITOR_MARKER_VIEW is used for markers which are view only and not controllable by user. - SWAMIGUI_SAMPLE_EDITOR_MARKER_SIZE is used to define a start/size marker instead of a start/end marker. This causes the second control to be the current size of the marker instead of the end position. Note that passing 0 defines a interactive range marker. |
|
Output - New control for start of marker or NULL to ignore
|
|
Output - New control for end/size of marker (ranges only) or NULL to
ignore
|
Returns : |
New marker index |
gboolean swamigui_sample_editor_get_marker_info (SwamiguiSampleEditor *editor
,guint marker
,guint *flags
,GnomeCanvasItem **start_line
,GnomeCanvasItem **end_line
,SwamiControl **start_ctrl
,SwamiControl **end_ctrl
);
Get info for the given marker
index. No reference counting is
done, since marker will not get removed unless the sample editor
handler does so. Returned object pointers should only be used
within editor callback or references should be added.
|
Sample editor object |
|
Marker index to get info on (starts at 0 - the selection marker) |
|
SwamiguiSampleEditorMarkerFlags |
|
Output - Gnome canvas line for the start marker (NULL to ignore)
|
|
Output - Gnome canvas line for the end marker (NULL to ignore),
will be NULL for single markers (non ranges)
|
|
Output - Control for the start marker (NULL to ignore)
|
|
Output - Control for the end/size marker (NULL to ignore), will be
NULL for single markers (non ranges)
|
Returns : |
TRUE if a marker with the given index exists, FALSE otherwise.
|
void swamigui_sample_editor_set_marker (SwamiguiSampleEditor *editor
,guint marker
,guint start
,guint end
);
Set the marker start and end positions.
|
Sample editor widget |
|
Marker number |
|
Marker start position |
|
Marker end position |
void swamigui_sample_editor_remove_marker (SwamiguiSampleEditor *editor
,guint marker
);
Remove a marker.
|
Sample editor object |
|
Index of marker to remove (builtin markers are hidden rather than removed) |
void swamigui_sample_editor_remove_all_markers
(SwamiguiSampleEditor *editor
);
Remove all markers (except selection marker 0, which is always present).
|
Sample editor object |
void swamigui_sample_editor_show_marker (SwamiguiSampleEditor *editor
,guint marker
,gboolean show_marker
);
Set the visibility of a marker.
void swamigui_sample_editor_set_loop_types (SwamiguiSampleEditor *editor
,int *types
,gboolean loop_play_btn
);
Usually only used by sample editor handlers. Sets the available loop types in the loop selector menu.
|
Sample editor object |
|
-1 terminated array of IpatchSampleLoopType values to show in
loop selector (NULL to hide loop selector)
|
|
If types is NULL , setting this to TRUE will cause a
play loop toggle button to be shown (for items that dont have a loop type
property, but it is desirable for the user to be able to listen to the loop).
|
void swamigui_sample_editor_set_active_loop_type (SwamiguiSampleEditor *editor
,int type
);
Set the active loop type in the loop type selector or loop play button. Usually only used by sample editor handlers.
|
Sample editor widget |
|
IpatchSampleLoopType or TRUE/FALSE if using loop play button. |
"marker-bar-height"
property"marker-bar-height" gint : Read / Write
Height of marker and loop meter bar.
Allowed values: [0,100]
Default value: 24