2 Copyright (C) 2000 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 $Id: audio_time_axis.h 664 2006-07-05 19:47:25Z drobilla $
21 #ifndef __ardour_route_time_axis_h__
22 #define __ardour_route_time_axis_h__
24 #include <gtkmm/table.h>
25 #include <gtkmm/button.h>
26 #include <gtkmm/box.h>
27 #include <gtkmm/menu.h>
28 #include <gtkmm/menuitem.h>
29 #include <gtkmm/radiomenuitem.h>
30 #include <gtkmm/checkmenuitem.h>
32 #include <gtkmm2ext/selector.h>
35 #include <ardour/types.h>
36 #include <ardour/region.h>
38 #include "ardour_dialog.h"
41 #include "time_axis_view.h"
63 class RouteTimeAxisView : public RouteUI, public TimeAxisView
66 RouteTimeAxisView (PublicEditor&, ARDOUR::Session&, ARDOUR::Route&, ArdourCanvas::Canvas& canvas);
67 virtual ~RouteTimeAxisView ();
69 void show_selection (TimeSelection&);
71 void set_samples_per_unit (double);
72 void set_height (TimeAxisView::TrackHeight);
73 void show_timestretch (jack_nframes_t start, jack_nframes_t end);
74 void hide_timestretch ();
75 void selection_click (GdkEventButton*);
76 void set_selected_points (PointSelection&);
77 void get_selectables (jack_nframes_t start, jack_nframes_t end, double top, double bot, list<Selectable *>&);
78 void get_inverted_selectables (Selection&, list<Selectable*>&);
80 ARDOUR::Region* find_next_region (jack_nframes_t pos, ARDOUR::RegionPoint, int32_t dir);
84 ARDOUR::RouteGroup* edit_group() const;
86 void build_playlist_menu (Gtk::Menu *);
87 ARDOUR::Playlist* playlist() const;
89 StreamView* view() { return _view; }
91 /* editing operations */
93 bool cut_copy_clear (Selection&, Editing::CutCopyOp);
94 bool paste (jack_nframes_t, float times, Selection&, size_t nth);
96 list<TimeAxisView*> get_child_list();
98 /* the editor calls these when mapping an operation across multiple tracks */
100 void use_new_playlist (bool prompt);
101 void use_copy_playlist (bool prompt);
102 void clear_playlist ();
105 friend class StreamView;
109 ArdourCanvas::Canvas& parent_canvas;
113 Gtk::HBox other_button_hbox;
114 Gtk::Table button_table;
115 Gtk::Button redirect_button;
116 Gtk::Button edit_group_button;
117 Gtk::Button playlist_button;
118 Gtk::Button size_button;
119 Gtk::Button automation_button;
120 Gtk::Button hide_button;
121 Gtk::Button visual_button;
123 void diskstream_changed (void *src);
124 void update_diskstream_display ();
126 gint edit_click (GdkEventButton *);
128 void build_redirect_window ();
129 void redirect_click ();
130 void redirect_add ();
131 void redirect_remove ();
132 void redirect_edit ();
133 void redirect_relist ();
134 void redirect_row_selected (gint row, gint col, GdkEvent *ev);
135 void add_to_redirect_display (ARDOUR::Redirect *);
136 //void redirects_changed (void *);
138 sigc::connection modified_connection;
139 sigc::connection state_changed_connection;
141 void take_name_changed (void *);
142 void route_name_changed (void *);
143 void name_entry_changed ();
145 void on_area_realize ();
147 virtual void label_view ();
149 Gtk::Menu edit_group_menu;
151 void add_edit_group_menu_item (ARDOUR::RouteGroup *, Gtk::RadioMenuItem::Group*);
152 void set_edit_group_from_menu (ARDOUR::RouteGroup *);
154 void reset_samples_per_unit ();
156 void select_track_color();
158 virtual void build_display_menu () = 0;
160 Gtk::RadioMenuItem* align_existing_item;
161 Gtk::RadioMenuItem* align_capture_item;
163 void align_style_changed ();
164 void set_align_style (ARDOUR::AlignStyle);
166 Gtk::Menu *playlist_menu;
167 Gtk::Menu *playlist_action_menu;
168 Gtk::MenuItem *playlist_item;
172 virtual void set_playlist (ARDOUR::Playlist *);
173 void playlist_click ();
174 void show_playlist_selector ();
176 void playlist_changed ();
177 void playlist_state_changed (ARDOUR::Change);
178 void playlist_modified ();
180 void add_playlist_to_playlist_menu (ARDOUR::Playlist*);
181 void rename_current_playlist ();
183 Gtk::Menu* automation_action_menu;
184 void automation_click ();
186 ArdourCanvas::SimpleRect *timestretch_rect;
188 void timestretch (jack_nframes_t start, jack_nframes_t end);
190 void visual_click ();
192 gint when_displayed (GdkEventAny*);
194 void speed_changed ();
198 void color_handler (ColorID, uint32_t);
199 bool select_me (GdkEventButton*);
201 virtual void region_view_added (RegionView*) = 0;
204 #endif /* __ardour_route_time_axis_h__ */