BEAST/BSE - Better Audio System and Sound Engine  0.8.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
bsttrackroll.hh
Go to the documentation of this file.
00001  // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html
00002 #ifndef __BST_TRACK_ROLL_H__
00003 #define __BST_TRACK_ROLL_H__
00004 
00005 #include "bstutils.hh"
00006 
00007 G_BEGIN_DECLS
00008 
00009 /* --- type macros --- */
00010 #define BST_TYPE_TRACK_ROLL              (bst_track_roll_get_type ())
00011 #define BST_TRACK_ROLL(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), BST_TYPE_TRACK_ROLL, BstTrackRoll))
00012 #define BST_TRACK_ROLL_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), BST_TYPE_TRACK_ROLL, BstTrackRollClass))
00013 #define BST_IS_TRACK_ROLL(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), BST_TYPE_TRACK_ROLL))
00014 #define BST_IS_TRACK_ROLL_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), BST_TYPE_TRACK_ROLL))
00015 #define BST_TRACK_ROLL_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), BST_TYPE_TRACK_ROLL, BstTrackRollClass))
00016 
00017 
00018 /* --- typedefs & enums --- */
00019 typedef struct _BstTrackRoll              BstTrackRoll;
00020 typedef struct _BstTrackRollClass         BstTrackRollClass;
00021 typedef SfiProxy (*BstTrackRollTrackFunc)   (gpointer proxy_data,
00022                                              gint     row);
00023 
00024 
00025 /* --- structures & typedefs --- */
00026 typedef enum    /*< skip >*/
00027 {
00028   BST_TRACK_ROLL_MARKER_NONE,
00029   BST_TRACK_ROLL_MARKER_POS,
00030   BST_TRACK_ROLL_MARKER_LOOP,
00031   BST_TRACK_ROLL_MARKER_SELECT
00032 } BstTrackRollMarkerType;
00033 typedef struct {
00034   GXK_SCROLL_CANVAS_DRAG_FIELDS;
00035   guint         start_row;
00036   SfiProxy      start_track;
00037   guint         start_tick;
00038   gboolean      start_valid;
00039   guint         current_row;
00040   SfiProxy      current_track;
00041   guint         current_tick;
00042   gboolean      current_valid;
00043   /* convenience: */
00044   BstTrackRoll *troll;
00045 } BstTrackRollDrag;
00046 struct _BstTrackRoll
00047 {
00048   GxkScrollCanvas   parent_instance;
00049 
00050   SfiProxy          proxy;
00051   GtkTreeView      *tree;
00052   guint             n_scopes;   /* does not always reflect number of rows */
00053   GtkWidget       **scopes;
00054   guint             scope_update;
00055 
00056   /* horizontal layout */
00057   guint          tpt;           /* ticks (parts) per tact */
00058   guint          max_ticks;
00059   gdouble        hzoom;
00060   guint          draw_tact_grid : 1;
00061 
00062   guint          prelight_row;
00063   guint          hpanel_height;
00064 
00065   /* editable popup */
00066   GtkCellEditable *ecell;
00067   guint            ecell_row;
00068   guint            ecell_tick;
00069   guint            ecell_duration;
00070 
00071   /* size queries */
00072   gint                  area_offset;
00073 
00074   /* BseTrack retrieval */
00075   gpointer              proxy_data;
00076   BstTrackRollTrackFunc get_track;
00077 
00078   /* last drag state */
00079   guint         start_row;
00080   SfiProxy      start_track;
00081   guint         start_tick;
00082   gboolean      start_valid;
00083 };
00084 struct _BstTrackRollClass
00085 {
00086   GxkScrollCanvasClass parent_class;
00087 
00088   void          (*select_row)                   (BstTrackRoll     *troll,
00089                                                  gint              row);
00090   void          (*drag)                         (BstTrackRoll     *self,
00091                                                  BstTrackRollDrag *drag);
00092   void          (*clicked)                      (BstTrackRoll     *troll,
00093                                                  guint             button,
00094                                                  guint             row,
00095                                                  guint             tick_position,
00096                                                  GdkEvent         *event);
00097   void          (*stop_edit)                    (BstTrackRoll     *self,
00098                                                  gboolean          canceled,
00099                                                  GtkCellEditable  *ecell);
00100 };
00101 
00102 
00103 /* --- prototypes --- */
00104 GType   bst_track_roll_get_type            (void);
00105 void    bst_track_roll_setup               (BstTrackRoll           *troll,
00106                                             GtkTreeView            *tree,
00107                                             SfiProxy                song);
00108 gdouble bst_track_roll_set_hzoom           (BstTrackRoll           *troll,
00109                                             gdouble                 hzoom);
00110 void    bst_track_roll_set_track_callback  (BstTrackRoll           *self,
00111                                             gpointer                data,
00112                                             BstTrackRollTrackFunc   get_track);
00113 void    bst_track_roll_check_update_scopes (BstTrackRoll           *self);
00114 void    bst_track_roll_reselect            (BstTrackRoll           *self);
00115 void    bst_track_roll_queue_row_change    (BstTrackRoll           *self,
00116                                             guint                   row);
00117 void    bst_track_roll_set_prelight_row    (BstTrackRoll           *self,
00118                                             guint                   row);
00119 void    bst_track_roll_start_edit          (BstTrackRoll           *self,
00120                                             guint                   row,
00121                                             guint                   tick,
00122                                             guint                   duration,
00123                                             GtkCellEditable        *ecell);
00124 void    bst_track_roll_stop_edit           (BstTrackRoll           *self);
00125 void    bst_track_roll_abort_edit          (BstTrackRoll           *self);
00126 void    bst_track_roll_set_marker          (BstTrackRoll           *self,
00127                                             guint                   mark_index,
00128                                             guint                   position,
00129                                             BstTrackRollMarkerType  mtype);
00130 
00131 
00132 G_END_DECLS
00133 
00134 #endif /* __BST_TRACK_ROLL_H__ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines