SwamiguiSampleCanvas

SwamiguiSampleCanvas

Synopsis

                    SwamiguiSampleCanvas;
void                swamigui_sample_canvas_set_sample   (SwamiguiSampleCanvas *canvas,
                                                         IpatchSampleData *sample);
int                 swamigui_sample_canvas_xpos_to_sample
                                                        (SwamiguiSampleCanvas *canvas,
                                                         int xpos,
                                                         int *onsample);
int                 swamigui_sample_canvas_sample_to_xpos
                                                        (SwamiguiSampleCanvas *canvas,
                                                         int index,
                                                         int *inview);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GnomeCanvasItem
                     +----SwamiguiSampleCanvas

Properties

  "adjustment"               GtkAdjustment*        : Read / Write
  "height"                   gint                  : Read / Write
  "line-color"               guint                 : Read / Write
  "loop-end"                 guint                 : Read / Write
  "loop-end-color"           guint                 : Read / Write
  "loop-mode"                gboolean              : Read / Write
  "loop-start"               guint                 : Read / Write
  "loop-start-color"         guint                 : Read / Write
  "peak-line-color"          guint                 : Read / Write
  "point-color"              guint                 : Read / Write
  "right-chan"               gboolean              : Read / Write
  "sample"                   IpatchSampleData*     : Read / Write
  "start"                    guint                 : Read / Write
  "update-adj"               gboolean              : Read / Write
  "width"                    gint                  : Read / Write
  "x"                        gint                  : Read / Write
  "y"                        gint                  : Read / Write
  "zoom"                     gdouble               : Read / Write
  "zoom-ampl"                gdouble               : Read / Write

Description

Details

SwamiguiSampleCanvas

typedef struct _SwamiguiSampleCanvas SwamiguiSampleCanvas;

swamigui_sample_canvas_set_sample ()

void                swamigui_sample_canvas_set_sample   (SwamiguiSampleCanvas *canvas,
                                                         IpatchSampleData *sample);

Set the sample data source of a sample canvas item.

canvas :

Sample data canvas item

sample :

Sample data to assign to the canvas

swamigui_sample_canvas_xpos_to_sample ()

int                 swamigui_sample_canvas_xpos_to_sample
                                                        (SwamiguiSampleCanvas *canvas,
                                                         int xpos,
                                                         int *onsample);

Convert an X pixel position to sample index.

canvas :

Sample canvas item

xpos :

X pixel position

onsample :

Output: Pointer to store value indicating if given xpos is within sample (0 if within sample, -1 if less than 0 or no active sample, 1 if off the end, 2 if last value after sample - useful for loop end which is valid up to the position following the data), NULL to ignore

Returns :

Sample index, index may be out of range of sample, use onsample parameter to determine that.

swamigui_sample_canvas_sample_to_xpos ()

int                 swamigui_sample_canvas_sample_to_xpos
                                                        (SwamiguiSampleCanvas *canvas,
                                                         int index,
                                                         int *inview);

Convert a sample index to x pixel position.

canvas :

Sample canvas item

index :

Sample index

inview :

Output: Pointer to store value indicating if given sample index is in view (0 if in view, -1 if too low, 1 if too high).

Returns :

X position. Note that values outside of current view may be returned (including negative numbers), inview can be used to determine if value is in view or not.

Property Details

The "adjustment" property

  "adjustment"               GtkAdjustment*        : Read / Write

Adjustment control for scrolling.


The "height" property

  "height"                   gint                  : Read / Write

Height in pixels.

Allowed values: >= 0

Default value: 1


The "line-color" property

  "line-color"               guint                 : Read / Write

Color of sample connecting lines.

Default value: 1061552127


The "loop-end" property

  "loop-end"                 guint                 : Read / Write

End of loop in samples.

Default value: 0


The "loop-end-color" property

  "loop-end-color"           guint                 : Read / Write

Color of loop end sample points.

Default value: 4278190335


The "loop-mode" property

  "loop-mode"                gboolean              : Read / Write

Enable/disable loop mode.

Default value: FALSE


The "loop-start" property

  "loop-start"               guint                 : Read / Write

Start of loop in samples.

Default value: 0


The "loop-start-color" property

  "loop-start-color"         guint                 : Read / Write

Color of loop start sample points.

Default value: 16711935


The "peak-line-color" property

  "peak-line-color"          guint                 : Read / Write

Color of peak sample lines.

Default value: 1061552127


The "point-color" property

  "point-color"              guint                 : Read / Write

Color of sample points.

Default value: 2863333375


The "right-chan" property

  "right-chan"               gboolean              : Read / Write

Use right channel of stereo samples.

Default value: FALSE


The "sample" property

  "sample"                   IpatchSampleData*     : Read / Write

Sample object.


The "start" property

  "start"                    guint                 : Read / Write

Start of view in samples.

Default value: 0


The "update-adj" property

  "update-adj"               gboolean              : Read / Write

Update adjustment object.

Default value: FALSE


The "width" property

  "width"                    gint                  : Read / Write

Width in pixels.

Allowed values: >= 0

Default value: 1


The "x" property

  "x"                        gint                  : Read / Write

X position in pixels.

Allowed values: >= 0

Default value: 0


The "y" property

  "y"                        gint                  : Read / Write

Y position in pixels.

Allowed values: >= 0

Default value: 0


The "zoom" property

  "zoom"                     gdouble               : Read / Write

Zoom factor in samples per pixel.

Allowed values: >= 0

Default value: 1


The "zoom-ampl" property

  "zoom-ampl"                gdouble               : Read / Write

Amplitude zoom factor.

Allowed values: >= 0

Default value: 1