BEAST - Free Software Audio Synthesizer and Tracker  0.9.2
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 Bse::TrackH (*BstTrackRollTrackFunc) (void *proxy_data, int row);
22 
23 
24 /* --- structures & typedefs --- */
25 typedef enum /*< skip >*/
26 {
27  BST_TRACK_ROLL_MARKER_NONE,
28  BST_TRACK_ROLL_MARKER_POS,
29  BST_TRACK_ROLL_MARKER_LOOP,
30  BST_TRACK_ROLL_MARKER_SELECT
31 } BstTrackRollMarkerType;
33  GXK_SCROLL_CANVAS_DRAG_FIELDS;
34  uint start_row;
35  Bse::TrackH start_track;
36  uint start_tick;
37  bool start_valid;
38  uint current_row;
39  Bse::TrackH current_track;
40  uint current_tick;
41  bool current_valid;
42  // convenience:
43  BstTrackRoll *troll;
44  BstTrackRollDrag() : start_row (~uint (0)), start_tick (0), start_valid (0),
45  current_row (~uint (0)), current_tick (0), current_valid (0), troll (NULL) {}
46 };
48 {
49  GxkScrollCanvas parent_instance;
50 
51  SfiProxy proxy;
52  GtkTreeView *tree;
53  guint n_scopes; /* does not always reflect number of rows */
54  GtkWidget **scopes;
55  guint scope_update;
56 
57  /* horizontal layout */
58  guint tpt; /* ticks (parts) per tact */
59  guint max_ticks;
60  gdouble hzoom;
61  guint draw_tact_grid : 1;
62 
63  guint prelight_row;
64  guint hpanel_height;
65 
66  /* editable popup */
67  GtkCellEditable *ecell;
68  guint ecell_row;
69  guint ecell_tick;
70  guint ecell_duration;
71 
72  /* size queries */
73  gint area_offset;
74 
75  /* BseTrack retrieval */
76  gpointer proxy_data;
77  BstTrackRollTrackFunc get_track;
78 
79  /* last drag state */
80  uint start_row;
81  Bse::TrackH start_track;
82  uint start_tick;
83  bool start_valid;
84 };
86 {
87  GxkScrollCanvasClass parent_class;
88 
89  void (*select_row) (BstTrackRoll *troll,
90  gint row);
91  void (*drag) (BstTrackRoll *self,
92  BstTrackRollDrag *drag);
93  void (*clicked) (BstTrackRoll *troll,
94  guint button,
95  guint row,
96  guint tick_position,
97  GdkEvent *event);
98  void (*stop_edit) (BstTrackRoll *self,
99  gboolean canceled,
100  GtkCellEditable *ecell);
101 };
102 
103 
104 /* --- prototypes --- */
105 GType bst_track_roll_get_type (void);
106 void bst_track_roll_setup (BstTrackRoll *troll,
107  GtkTreeView *tree,
108  SfiProxy song);
109 gdouble bst_track_roll_set_hzoom (BstTrackRoll *troll,
110  gdouble hzoom);
111 void bst_track_roll_set_track_callback (BstTrackRoll *self,
112  gpointer data,
113  BstTrackRollTrackFunc get_track);
114 void bst_track_roll_check_update_scopes (BstTrackRoll *self);
115 void bst_track_roll_reselect (BstTrackRoll *self);
116 void bst_track_roll_queue_row_change (BstTrackRoll *self, int 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:47
Definition: bsttrackroll.hh:85
Definition: bsttrackroll.hh:32
See also the corresponding IDL class Track.
Definition: bseclientapi.hh:760
TrackHandle TrackH
Convenience alias for the IDL type Track.
Definition: bseclientapi.hh:783
Definition: gxkscrollcanvas.hh:110