AgsNoteEdit

AgsNoteEdit — edit notes

Synopsis

#include <ags/X/editor/ags_note_edit.h>

#define             AGS_NOTE_EDIT_MAX_CONTROLS
struct              AgsNoteEdit;
struct              AgsNoteEditClass;
enum                AgsNoteEditFlags;
enum                AgsNoteEditResetFlags;
void                ags_note_edit_draw_notation         (AgsNoteEdit *note_edit,
                                                         cairo_t *cr);
void                ags_note_edit_draw_position         (AgsNoteEdit *note_edit,
                                                         cairo_t *cr);
void                ags_note_edit_draw_scroll           (AgsNoteEdit *note_edit,
                                                         cairo_t *cr,
                                                         gdouble position);
void                ags_note_edit_draw_segment          (AgsNoteEdit *note_edit,
                                                         cairo_t *cr);
AgsNoteEdit *       ags_note_edit_new                   ();
void                ags_note_edit_reset_horizontally    (AgsNoteEdit *note_edit,
                                                         guint flags);
void                ags_note_edit_reset_vertically      (AgsNoteEdit *note_edit,
                                                         guint flags);
void                ags_note_edit_set_map_height        (AgsNoteEdit *note_edit,
                                                         guint map_height);

Description

The AgsNoteEdit lets you edit notes.

Details

AGS_NOTE_EDIT_MAX_CONTROLS

#define AGS_NOTE_EDIT_MAX_CONTROLS 1200

struct AgsNoteEdit

struct AgsNoteEdit {
  GtkTable table;

  guint flags;

  AgsRuler *ruler;
  GtkDrawingArea *drawing_area;

  struct _AgsNoteEditControl{ // values retrieved by mouse pressed and released callback
    AgsNote *note;

    guint x0_offset;
    guint y0_offset;
    guint x0;
    guint y0;

    guint x1_offset;
    guint y1_offset;
    guint x1;
    guint y1;
  }control;

  guint width;
  guint height;
  guint map_width;
  guint map_height;

  guint control_height;
  guint control_margin_y;

  guint control_width;

  guint y0;
  guint y1;

  guint nth_y;
  guint stop_y;

  struct _AgsNoteEditControlCurrent{ // values for drawing refering to current tic and zoom
    guint control_count;

    guint control_width;

    guint x0;
    guint x1;

    guint nth_x;
  }control_current;

  struct _AgsNoteEditControlUnit{ // values for drawing refering to smallest tic and current zoom
    guint control_count;

    guint control_width;

    guint x0;
    guint x1;

    guint nth_x;
    guint stop_x;
  }control_unit;

  guint selected_x;
  guint selected_y;
  
  GtkVScrollbar *vscrollbar;
  GtkHScrollbar *hscrollbar;
};

struct AgsNoteEditClass

struct AgsNoteEditClass {
  GtkTableClass table;
};

enum AgsNoteEditFlags

typedef enum {
  AGS_NOTE_EDIT_RESETING_VERTICALLY    = 1,
  AGS_NOTE_EDIT_RESETING_HORIZONTALLY  = 1 <<  1,
  AGS_NOTE_EDIT_POSITION_CURSOR        = 1 <<  2,
  AGS_NOTE_EDIT_ADDING_NOTE            = 1 <<  3,
  AGS_NOTE_EDIT_DELETING_NOTE          = 1 <<  4,
  AGS_NOTE_EDIT_SELECTING_NOTES        = 1 <<  5,
} AgsNoteEditFlags;

enum AgsNoteEditResetFlags

typedef enum {
  AGS_NOTE_EDIT_RESET_VSCROLLBAR   = 1,
  AGS_NOTE_EDIT_RESET_HSCROLLBAR   = 1 <<  1,
  AGS_NOTE_EDIT_RESET_WIDTH        = 1 <<  2,
  AGS_NOTE_EDIT_RESET_HEIGHT       = 1 <<  3, // reserved
} AgsNoteEditResetFlags;

ags_note_edit_draw_notation ()

void                ags_note_edit_draw_notation         (AgsNoteEdit *note_edit,
                                                         cairo_t *cr);

Draw the AgsNotation of selected AgsMachine on note_edit.

note_edit :

the AgsNoteEdit

cr :

the cairo_t surface

Since 0.4


ags_note_edit_draw_position ()

void                ags_note_edit_draw_position         (AgsNoteEdit *note_edit,
                                                         cairo_t *cr);

Draws the cursor.

note_edit :

the AgsNoteEdit

cr :

the cairo_t surface

Since 0.4


ags_note_edit_draw_scroll ()

void                ags_note_edit_draw_scroll           (AgsNoteEdit *note_edit,
                                                         cairo_t *cr,
                                                         gdouble position);

Change visible x-position of note_edit.

note_edit :

the AgsNoteEdit

cr :

the cairo_t surface

position :

the new position

Since 0.4


ags_note_edit_draw_segment ()

void                ags_note_edit_draw_segment          (AgsNoteEdit *note_edit,
                                                         cairo_t *cr);

Draws horizontal and vertical lines.

note_edit :

the AgsNoteEdit

cr :

the cairo_t surface

Since 0.4


ags_note_edit_new ()

AgsNoteEdit *       ags_note_edit_new                   ();

Create a new AgsNoteEdit.

Since 0.4


ags_note_edit_reset_horizontally ()

void                ags_note_edit_reset_horizontally    (AgsNoteEdit *note_edit,
                                                         guint flags);

Reset note_edit as configured horizontally.

note_edit :

the AgsNoteEdit

flags :

the AgsNoteEditResetFlags

Since 0.4


ags_note_edit_reset_vertically ()

void                ags_note_edit_reset_vertically      (AgsNoteEdit *note_edit,
                                                         guint flags);

Reset note_edit as configured vertically.

note_edit :

the AgsNoteEdit

flags :

the AgsNoteEditResetFlags

Since 0.4


ags_note_edit_set_map_height ()

void                ags_note_edit_set_map_height        (AgsNoteEdit *note_edit,
                                                         guint map_height);

Set the map height in pixel.

note_edit :

the AgsNoteEdit

map_height :

the new height

Since 0.4