BEAST/BSE - Better Audio System and Sound Engine  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
bsttrackroll.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_TRACK_ROLL_H__
3 #define __BST_TRACK_ROLL_H__
4 
5 #include "bstutils.hh"
6 
7 G_BEGIN_DECLS
8 
9 /* --- type macros --- */
10 #define BST_TYPE_TRACK_ROLL (bst_track_roll_get_type ())
11 #define BST_TRACK_ROLL(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), BST_TYPE_TRACK_ROLL, BstTrackRoll))
12 #define BST_TRACK_ROLL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BST_TYPE_TRACK_ROLL, BstTrackRollClass))
13 #define BST_IS_TRACK_ROLL(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), BST_TYPE_TRACK_ROLL))
14 #define BST_IS_TRACK_ROLL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BST_TYPE_TRACK_ROLL))
15 #define BST_TRACK_ROLL_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), BST_TYPE_TRACK_ROLL, BstTrackRollClass))
16 
17 
18 /* --- typedefs & enums --- */
19 typedef struct _BstTrackRoll BstTrackRoll;
20 typedef struct _BstTrackRollClass BstTrackRollClass;
21 typedef SfiProxy (*BstTrackRollTrackFunc) (gpointer proxy_data,
22  gint row);
23 
24 
25 /* --- structures & typedefs --- */
26 typedef enum /*< skip >*/
27 {
28  BST_TRACK_ROLL_MARKER_NONE,
29  BST_TRACK_ROLL_MARKER_POS,
30  BST_TRACK_ROLL_MARKER_LOOP,
31  BST_TRACK_ROLL_MARKER_SELECT
32 } BstTrackRollMarkerType;
33 typedef struct {
34  GXK_SCROLL_CANVAS_DRAG_FIELDS;
35  guint start_row;
36  SfiProxy start_track;
37  guint start_tick;
38  gboolean start_valid;
39  guint current_row;
40  SfiProxy current_track;
41  guint current_tick;
42  gboolean current_valid;
43  /* convenience: */
44  BstTrackRoll *troll;
47 {
48  GxkScrollCanvas parent_instance;
49 
50  SfiProxy proxy;
51  GtkTreeView *tree;
52  guint n_scopes; /* does not always reflect number of rows */
53  GtkWidget **scopes;
54  guint scope_update;
55 
56  /* horizontal layout */
57  guint tpt; /* ticks (parts) per tact */
58  guint max_ticks;
59  gdouble hzoom;
60  guint draw_tact_grid : 1;
61 
62  guint prelight_row;
63  guint hpanel_height;
64 
65  /* editable popup */
66  GtkCellEditable *ecell;
67  guint ecell_row;
68  guint ecell_tick;
69  guint ecell_duration;
70 
71  /* size queries */
72  gint area_offset;
73 
74  /* BseTrack retrieval */
75  gpointer proxy_data;
76  BstTrackRollTrackFunc get_track;
77 
78  /* last drag state */
79  guint start_row;
80  SfiProxy start_track;
81  guint start_tick;
82  gboolean start_valid;
83 };
85 {
86  GxkScrollCanvasClass parent_class;
87 
88  void (*select_row) (BstTrackRoll *troll,
89  gint row);
90  void (*drag) (BstTrackRoll *self,
91  BstTrackRollDrag *drag);
92  void (*clicked) (BstTrackRoll *troll,
93  guint button,
94  guint row,
95  guint tick_position,
96  GdkEvent *event);
97  void (*stop_edit) (BstTrackRoll *self,
98  gboolean canceled,
99  GtkCellEditable *ecell);
100 };
101 
102 
103 /* --- prototypes --- */
104 GType bst_track_roll_get_type (void);
105 void bst_track_roll_setup (BstTrackRoll *troll,
106  GtkTreeView *tree,
107  SfiProxy song);
108 gdouble bst_track_roll_set_hzoom (BstTrackRoll *troll,
109  gdouble hzoom);
110 void bst_track_roll_set_track_callback (BstTrackRoll *self,
111  gpointer data,
112  BstTrackRollTrackFunc get_track);
113 void bst_track_roll_check_update_scopes (BstTrackRoll *self);
114 void bst_track_roll_reselect (BstTrackRoll *self);
115 void bst_track_roll_queue_row_change (BstTrackRoll *self,
116  guint row);
117 void bst_track_roll_set_prelight_row (BstTrackRoll *self,
118  guint row);
119 void bst_track_roll_start_edit (BstTrackRoll *self,
120  guint row,
121  guint tick,
122  guint duration,
123  GtkCellEditable *ecell);
124 void bst_track_roll_stop_edit (BstTrackRoll *self);
125 void bst_track_roll_abort_edit (BstTrackRoll *self);
126 void bst_track_roll_set_marker (BstTrackRoll *self,
127  guint mark_index,
128  guint position,
129  BstTrackRollMarkerType mtype);
130 
131 
132 G_END_DECLS
133 
134 #endif /* __BST_TRACK_ROLL_H__ */
Definition: bsttrackroll.hh:46
Definition: bsttrackroll.hh:84
uint32_t * row(uint y)
Definition: bsttrackroll.hh:33
Definition: gxkscrollcanvas.hh:110