Beast - Music Synthesizer and Composer  0.11.1+10.g2da35
bstpatternview.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_PATTERN_VIEW_H__
3 #define __BST_PATTERN_VIEW_H__
4 
5 #include "bstpatterncolumns.hh"
6 
7 /* --- type macros --- */
8 #define BST_TYPE_PATTERN_VIEW (bst_pattern_view_get_type ())
9 #define BST_PATTERN_VIEW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), BST_TYPE_PATTERN_VIEW, BstPatternView))
10 #define BST_PATTERN_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BST_TYPE_PATTERN_VIEW, BstPatternViewClass))
11 #define BST_IS_PATTERN_VIEW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), BST_TYPE_PATTERN_VIEW))
12 #define BST_IS_PATTERN_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BST_TYPE_PATTERN_VIEW))
13 #define BST_PATTERN_VIEW_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), BST_TYPE_PATTERN_VIEW, BstPatternViewClass))
14 
15 
16 /* --- typedefs & enums --- */
17 /* bstpatterncolumns.hh: typedef struct _BstPatternView BstPatternView; */
18 typedef struct _BstPatternViewClass BstPatternViewClass;
19 
20 
21 /* --- structures & typedefs --- */
22 typedef enum /*< skip >*/
23 {
24  BST_PATTERN_VIEW_MARKER_NONE,
25  BST_PATTERN_VIEW_MARKER_FOCUS,
26 } BstPatternViewMarkerType;
27 typedef struct {
28  GXK_SCROLL_CANVAS_DRAG_FIELDS;
29  guint start_col;
30  guint start_row;
31  guint start_tick;
32  guint start_duration;
33  gboolean start_valid;
34  guint current_col;
35  guint current_row;
36  int current_tick;
37  int current_duration;
38  bool current_valid;
39  /* convenience: */
40  BstPatternView *pview;
43 {
44  GxkScrollCanvas parent_instance;
45 
46  Bse::PartH part;
47 
48  /* vertical layout */
49  guint row_height;
50  guint tpqn; /* ticks per quarter note */
51  guint tpt; /* ticks per tact */
52  gint vticks; /* ticks per row */
53  guint max_ticks;
54 
55  /* horizontal layout */
56  guint n_cols;
57  BstPatternColumn **cols;
58  gchar *layout_string;
59 
60  /* focus cell */
61  guint focus_col;
62  guint focus_row;
63  int n_focus_cols;
64  BstPatternColumn **focus_cols;
65 
66  /* shading */
67  guint16 srow1, srow2;
68 
69  /* last drag state */
70  guint start_col;
71  guint start_row;
72  guint start_tick;
73  guint start_duration;
74  gboolean start_valid;
75 };
77 {
78  GxkScrollCanvasClass parent_class;
79 
80  void (*drag) (BstPatternView *self,
81  BstPatternViewDrag *drag);
82  void (*clicked) (BstPatternView *tview,
83  guint button,
84  guint row,
85  guint tick_position,
86  GdkEvent *event);
87 };
88 
89 
90 /* --- prototypes --- */
91 GType bst_pattern_view_get_type (void);
92 void bst_pattern_view_set_part (BstPatternView *self, Bse::PartH part = Bse::PartH());
93 void bst_pattern_view_vsetup (BstPatternView *self,
94  guint tpqn,
95  guint qnpt,
96  guint max_ticks,
97  guint vticks);
98 void bst_pattern_view_set_shading (BstPatternView *self,
99  guint row1,
100  guint row2,
101  guint row3,
102  guint row4);
103 void bst_pattern_view_set_marker (BstPatternView *self,
104  guint mark_index,
105  guint position,
106  BstPatternViewMarkerType mtype);
107 void bst_pattern_view_set_pixmarker (BstPatternView *self,
108  guint mark_index,
109  BstPatternViewMarkerType mtype,
110  gint x,
111  gint y,
112  gint width,
113  gint height);
114 void bst_pattern_view_add_column (BstPatternView *self,
115  BstPatternLType ltype,
116  gint num,
117  BstPatternLFlags lflags);
118 void bst_pattern_view_set_focus (BstPatternView *self, int focus_col, int focus_row);
119 gint bst_pattern_view_get_focus_width (BstPatternView *self);
120 BstPatternColumn* bst_pattern_view_get_focus_cell (BstPatternView *self, int *tick, int *duration);
121 gboolean bst_pattern_view_dispatch_key (BstPatternView *self,
122  guint keyval,
123  GdkModifierType modifier,
124  BstPatternFunction action,
125  gdouble param,
126  BstPatternFunction *movement);
127 gint bst_pattern_view_get_last_row (BstPatternView *self);
128 const gchar* bst_pattern_view_get_layout (BstPatternView *self);
129 guint bst_pattern_view_set_layout (BstPatternView *self,
130  const gchar *layout);
131 
132 
133 #endif /* __BST_PATTERN_VIEW_H__ */
Definition: bstpatternview.hh:27
int width() const
int height() const
uint32_t * row(uint y)
Definition: bstpatternview.hh:76
Definition: gxkscrollcanvas.hh:108
Definition: bstpatternview.hh:42