BEAST - Free Software Audio Synthesizer and Tracker  0.9.2
bsteventroll.hh
Go to the documentation of this file.
1  // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html
2 #ifndef __BST_EVENT_ROLL_H__
3 #define __BST_EVENT_ROLL_H__
4 
5 #include "bstsegment.hh"
6 
7 G_BEGIN_DECLS
8 
9 /* --- type macros --- */
10 #define BST_TYPE_EVENT_ROLL (bst_event_roll_get_type ())
11 #define BST_EVENT_ROLL(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), BST_TYPE_EVENT_ROLL, BstEventRoll))
12 #define BST_EVENT_ROLL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BST_TYPE_EVENT_ROLL, BstEventRollClass))
13 #define BST_IS_EVENT_ROLL(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), BST_TYPE_EVENT_ROLL))
14 #define BST_IS_EVENT_ROLL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BST_TYPE_EVENT_ROLL))
15 #define BST_EVENT_ROLL_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), BST_TYPE_EVENT_ROLL, BstEventRollClass))
16 
17 
18 /* --- typedefs & enums --- */
19 typedef struct _BstEventRoll BstEventRoll;
20 typedef struct _BstEventRollClass BstEventRollClass;
21 
22 
23 /* --- structures & typedefs --- */
24 typedef struct {
25  GXK_SCROLL_CANVAS_DRAG_FIELDS;
26  gint tick_width;
27  guint start_tick;
28  gfloat start_value;
29  guint start_valid : 1;
30  guint current_tick;
31  gfloat current_value; /* between -1 and +1 if valid */
32  gfloat current_value_raw;
33  guint current_valid : 1; /* value out of range */
34  /* convenience: */
35  BstEventRoll *eroll;
38 {
39  GxkScrollCanvas parent_instance;
40 
41  Bse::PartH part;
42  Bse::MidiSignalType control_type;
43  GtkWidget *child;
44 
45  /* horizontal layout */
46  guint ppqn; /* parts per quarter note */
47  guint qnpt; /* quarter notes per tact */
48  guint max_ticks; /* in ticks */
49  gfloat hzoom;
50  guint draw_qn_grid : 1;
51  guint draw_qqn_grid : 1;
52 
53  /* drag data */
54  guint start_valid : 1;
55  guint start_tick;
56  gfloat start_value;
57 
58  /* vpanel width sync */
59  gint (*fetch_vpanel_width) (gpointer data);
60  gpointer fetch_vpanel_width_data;
61 
62  /* line drawing */
63  BstSegment segment;
64 
65  /* selection rectangle */
66  guint selection_tick;
67  guint selection_duration;
68  gint selection_min_note;
69  gint selection_max_note;
70 };
72 {
73  GxkScrollCanvasClass parent_class;
74 
75  void (*canvas_drag) (BstEventRoll *self,
76  BstEventRollDrag *drag);
77  void (*canvas_clicked) (BstEventRoll *eroll,
78  guint button,
79  guint tick_position,
80  gfloat value,
81  GdkEvent *event);
82  void (*vpanel_drag) (BstEventRoll *self,
83  BstEventRollDrag *drag);
84  void (*vpanel_clicked) (BstEventRoll *eroll,
85  guint button,
86  gfloat value,
87  GdkEvent *event);
88 };
89 
90 
91 /* --- prototypes --- */
92 GType bst_event_roll_get_type (void);
93 void bst_event_roll_set_part (BstEventRoll *self, Bse::PartH part = Bse::PartH());
94 gfloat bst_event_roll_set_hzoom (BstEventRoll *self,
95  gfloat hzoom);
96 void bst_event_roll_set_view_selection (BstEventRoll *self,
97  guint tick,
98  guint duration);
99 void bst_event_roll_set_vpanel_width_hook (BstEventRoll *self,
100  gint (*fetch_vpanel_width) (gpointer data),
101  gpointer data);
102 void bst_event_roll_set_control_type (BstEventRoll *self, Bse::MidiSignalType control_type);
103 void bst_event_roll_init_segment (BstEventRoll *self,
104  BstSegmentType type);
105 void bst_event_roll_segment_start (BstEventRoll *self,
106  guint tick,
107  gfloat value);
108 void bst_event_roll_segment_move_to (BstEventRoll *self,
109  guint tick,
110  gfloat value);
111 void bst_event_roll_segment_tick_range (BstEventRoll *self,
112  guint *tick,
113  guint *duration);
114 gdouble bst_event_roll_segment_value (BstEventRoll *self,
115  guint tick);
116 void bst_event_roll_clear_segment (BstEventRoll *self);
117 
118 G_END_DECLS
119 
120 #endif /* __BST_EVENT_ROLL_H__ */
See also the corresponding IDL class Part.
Definition: bseclientapi.hh:516
Definition: bstsegment.hh:25
Definition: bsteventroll.hh:71
Definition: bsteventroll.hh:37
Definition: gxkscrollcanvas.hh:110
Definition: bsteventroll.hh:24