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