#include <list>
#include <map>
#include <set>
+#include <stack>
#include <string>
#include <sys/time.h>
#include <cmath>
#include "ardour/types.h"
#include "canvas/fwd.h"
+#include "canvas/ruler.h"
-#include "gtk-custom-ruler.h"
#include "ardour_button.h"
#include "ardour_dialog.h"
#include "ardour_dropdown.h"
Gdk::Cursor* get_canvas_cursor () const { return current_canvas_cursor; }
void set_canvas_cursor (Gdk::Cursor*, bool save=false);
+
+ void push_canvas_cursor (Gdk::Cursor*);
+ void pop_canvas_cursor ();
+
void set_current_trimmable (boost::shared_ptr<ARDOUR::Trimmable>);
void set_current_movable (boost::shared_ptr<ARDOUR::Movable>);
_stepping_axis_view = v;
}
- ArdourCanvas::Group* get_trackview_group () const { return _trackview_group; }
- ArdourCanvas::Group* get_time_bars_group () const;
- ArdourCanvas::Group* get_track_canvas_group () const;
- ArdourCanvas::GtkCanvasViewport* get_time_bars_canvas () const;
+ ArdourCanvas::Group* get_trackview_group () const { return _trackview_group; }
+ ArdourCanvas::Group* get_hscroll_group () const { return h_scroll_group; }
+ ArdourCanvas::Group* get_vscroll_group () const { return v_scroll_group; }
+ ArdourCanvas::Group* get_hvscroll_group () const { return hv_scroll_group; }
+
ArdourCanvas::GtkCanvasViewport* get_track_canvas () const;
void override_visible_track_count ();
+ /* Ruler metrics methods */
+
+ void metric_get_timecode (std::vector<ArdourCanvas::Ruler::Mark>&, gdouble, gdouble, gint);
+ void metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>&, gdouble, gdouble, gint);
+ void metric_get_samples (std::vector<ArdourCanvas::Ruler::Mark>&, gdouble, gdouble, gint);
+ void metric_get_minsec (std::vector<ArdourCanvas::Ruler::Mark>&, gdouble, gdouble, gint);
+
protected:
void map_transport_state ();
void map_position_change (framepos_t);
Gtk::VBox global_vpacker;
Gtk::VBox vpacker;
+ std::stack<Gdk::Cursor*> _cursor_stack;
Gdk::Cursor* current_canvas_cursor;
Gdk::Cursor* which_grabber_cursor ();
void set_canvas_cursor ();
ArdourCanvas::GtkCanvas* _track_canvas;
ArdourCanvas::GtkCanvasViewport* _track_canvas_viewport;
- ArdourCanvas::GtkCanvas* _time_bars_canvas;
- ArdourCanvas::GtkCanvasViewport* _time_bars_canvas_viewport;
-
bool within_track_canvas;
friend class VerboseCursor;
VerboseCursor* _verbose_cursor;
void parameter_changed (std::string);
+ void ui_parameter_changed (std::string);
bool track_canvas_motion (GdkEvent*);
- Gtk::EventBox time_canvas_event_box;
Gtk::EventBox time_bars_event_box;
- Gtk::EventBox ruler_label_event_box;
+ Gtk::VBox time_bars_vbox;
- ArdourCanvas::Group *minsec_group;
ArdourCanvas::Pixbuf *logo_item;
+#if 0
+ /* these will be needed when we have canvas rulers */
+ ArdourCanvas::Group *minsec_group;
ArdourCanvas::Group *bbt_group;
ArdourCanvas::Group *timecode_group;
ArdourCanvas::Group *frame_group;
+#endif
+
ArdourCanvas::Group *tempo_group;
ArdourCanvas::Group *meter_group;
ArdourCanvas::Group *marker_group;
/* parent for groups which themselves contain time markers */
ArdourCanvas::Group* _time_markers_group;
- ArdourCanvas::Group* meter_bar_group;
- ArdourCanvas::Group* tempo_bar_group;
- ArdourCanvas::Group* marker_bar_group;
- ArdourCanvas::Group* range_marker_bar_group;
- ArdourCanvas::Group* transport_marker_bar_group;
- ArdourCanvas::Group* cd_marker_bar_group;
+ /* The group containing all other groups that are scrolled vertically
+ and horizontally.
+ */
+ ArdourCanvas::Group* hv_scroll_group;
+
+ /* The group containing all other groups that are scrolled vertically ONLY
+ */
+ ArdourCanvas::Group* v_scroll_group;
+
+ /* The group containing all other groups that are scrolled horizontally ONLY
+ */
+ ArdourCanvas::Group* h_scroll_group;
- /* The group containing all trackviews. Only scrolled vertically. */
+ /* The group containing all trackviews. */
ArdourCanvas::Group* _trackview_group;
- /* The group used for region motion. Sits on top of _trackview_group */
- ArdourCanvas::Group* _region_motion_group;
+ /* The group holding things (mostly regions) while dragging so they
+ * are on top of everything else
+ */
+ ArdourCanvas::Group* _drag_motion_group;
/* a rect that sits at the bottom of all tracks to act as a drag-no-drop/clickable
* target area.
*/
- ArdourCanvas::Rectangle* _canvas_bottom_rect;
- bool canvas_bottom_rect_event (GdkEvent* event);
+ ArdourCanvas::Rectangle* _canvas_drop_zone;
+ bool canvas_drop_zone_event (GdkEvent* event);
enum RulerType {
ruler_metric_timecode = 0,
ruler_video_timeline = 10,
};
- static GtkCustomMetric ruler_metrics[4];
Glib::RefPtr<Gtk::ToggleAction> ruler_timecode_action;
Glib::RefPtr<Gtk::ToggleAction> ruler_bbt_action;
Glib::RefPtr<Gtk::ToggleAction> ruler_samples_action;
Glib::RefPtr<Gtk::ToggleAction> ruler_cd_marker_action;
bool no_ruler_shown_update;
- bool ruler_button_press (GdkEventButton*);
- bool ruler_button_release (GdkEventButton*);
- bool ruler_mouse_motion (GdkEventMotion*);
- bool ruler_scroll (GdkEventScroll* event);
-
Gtk::Widget * ruler_grabbed_widget;
void initialize_rulers ();
void store_ruler_visibility ();
void restore_ruler_visibility ();
- static gint _metric_get_timecode (GtkCustomRulerMark **, gdouble, gdouble, gint);
- static gint _metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint);
- static gint _metric_get_samples (GtkCustomRulerMark **, gdouble, gdouble, gint);
- static gint _metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
-
enum MinsecRulerScale {
minsec_show_seconds,
minsec_show_minutes,
ARDOUR::TempoMap::BBTPointList::const_iterator current_bbt_points_begin,
ARDOUR::TempoMap::BBTPointList::const_iterator current_bbt_points_end);
- gint metric_get_timecode (GtkCustomRulerMark **, gdouble, gdouble, gint);
- gint metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint);
- gint metric_get_samples (GtkCustomRulerMark **, gdouble, gdouble, gint);
- gint metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
-
- Gtk::Widget *_ruler_separator;
- GtkWidget *_timecode_ruler;
- GtkWidget *_bbt_ruler;
- GtkWidget *_samples_ruler;
- GtkWidget *_minsec_ruler;
- Gtk::Widget *timecode_ruler;
- Gtk::Widget *bbt_ruler;
- Gtk::Widget *samples_ruler;
- Gtk::Widget *minsec_ruler;
- static Editor *ruler_editor;
+ ArdourCanvas::Ruler* timecode_ruler;
+ ArdourCanvas::Ruler* bbt_ruler;
+ ArdourCanvas::Ruler* samples_ruler;
+ ArdourCanvas::Ruler* minsec_ruler;
static const double timebar_height;
guint32 visible_timebars;
void export_video (bool range = false);
void toggle_region_video_lock ();
- Gtk::VBox time_bars_vbox;
-
friend class EditorCursor;
EditorCursor* playhead_cursor;
Gtk::Menu *edit_controls_left_menu;
Gtk::Menu *edit_controls_right_menu;
- Gtk::VBox ruler_label_vbox;
Gtk::VBox track_canvas_vbox;
- Gtk::VBox time_canvas_vbox;
Gtk::VBox edit_controls_vbox;
Gtk::HBox edit_controls_hbox;
/* track views */
TrackViewList track_views;
- std::pair<TimeAxisView*, double> trackview_by_y_position (double);
- TimeAxisView* axis_view_from_route (boost::shared_ptr<ARDOUR::Route>) const;
+ std::pair<TimeAxisView*, double> trackview_by_y_position (double, bool trackview_relative_offset = true);
+ RouteTimeAxisView* axis_view_from_route (boost::shared_ptr<ARDOUR::Route>) const;
TrackViewList get_tracks_for_range_action () const;
void escape ();
Gtk::Menu fade_context_menu;
- void popup_fade_context_menu (int, int, ArdourCanvas::Item*, ItemType);
Gtk::Menu xfade_in_context_menu;
Gtk::Menu xfade_out_context_menu;
/* Canvas event handlers */
+ bool canvas_scroll_event (GdkEventScroll* event, bool from_canvas);
bool canvas_control_point_event (GdkEvent* event,ArdourCanvas::Item*, ControlPoint*);
bool canvas_line_event (GdkEvent* event,ArdourCanvas::Item*, AutomationLine*);
bool canvas_selection_rect_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
bool canvas_start_xfade_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
bool canvas_end_xfade_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
bool canvas_fade_in_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
- bool canvas_fade_in_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
+ bool canvas_fade_in_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*, bool trim = false);
bool canvas_fade_out_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
- bool canvas_fade_out_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
+ bool canvas_fade_out_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*, bool trim = false);
bool canvas_region_view_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
bool canvas_frame_handle_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
bool canvas_region_view_name_highlight_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
bool canvas_automation_track_event(GdkEvent* event, ArdourCanvas::Item*, AutomationTimeAxisView*);
bool canvas_note_event (GdkEvent* event, ArdourCanvas::Item *);
+ bool canvas_ruler_event (GdkEvent* event, ArdourCanvas::Item *, ItemType);
bool canvas_tempo_bar_event (GdkEvent* event, ArdourCanvas::Item*);
bool canvas_meter_bar_event (GdkEvent* event, ArdourCanvas::Item*);
bool canvas_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
bool canvas_playhead_cursor_event (GdkEvent* event, ArdourCanvas::Item*);
bool track_canvas_scroll (GdkEventScroll* event);
- bool track_canvas_scroll_event (GdkEventScroll* event);
bool track_canvas_button_press_event (GdkEventButton* event);
bool track_canvas_button_release_event (GdkEventButton* event);
bool track_canvas_motion_notify_event (GdkEventMotion* event);