2 Copyright (C) 2006 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.
27 #include <sigc++/bind.h>
29 #include <pbd/error.h>
30 #include <pbd/stl_delete.h>
31 #include <pbd/whitespace.h>
32 #include <pbd/memento_command.h>
34 #include <gtkmm/menu.h>
35 #include <gtkmm/menuitem.h>
36 #include <gtkmm2ext/gtk_ui.h>
37 #include <gtkmm2ext/selector.h>
38 #include <gtkmm2ext/stop_signal.h>
39 #include <gtkmm2ext/bindable_button.h>
40 #include <gtkmm2ext/utils.h>
42 #include <ardour/playlist.h>
43 #include <ardour/audioplaylist.h>
44 #include <ardour/diskstream.h>
45 #include <ardour/insert.h>
46 #include <ardour/ladspa_plugin.h>
47 #include <ardour/location.h>
48 #include <ardour/panner.h>
49 #include <ardour/playlist.h>
50 #include <ardour/session.h>
51 #include <ardour/session_playlist.h>
52 #include <ardour/utils.h>
53 #include <ardour/profile.h>
55 #include "ardour_ui.h"
56 #include "route_time_axis.h"
57 #include "automation_time_axis.h"
58 #include "redirect_automation_time_axis.h"
59 #include "redirect_automation_line.h"
60 #include "canvas_impl.h"
61 #include "crossfade_view.h"
63 #include "gui_thread.h"
65 #include "playlist_selector.h"
66 #include "point_selection.h"
68 #include "public_editor.h"
69 #include "region_view.h"
70 #include "rgb_macros.h"
71 #include "selection.h"
72 #include "simplerect.h"
73 #include "streamview.h"
76 #include <ardour/track.h>
80 using namespace ARDOUR;
82 using namespace Gtkmm2ext;
84 using namespace Editing;
87 Glib::RefPtr<Gdk::Pixbuf> RouteTimeAxisView::slider;
90 RouteTimeAxisView::setup_slider_pix ()
92 slider = ::get_icon ("fader_belt_h");
96 RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::shared_ptr<Route> rt, Canvas& canvas)
98 RouteUI(rt, sess, _("m"), _("s"), _("r")), // mute, solo, and record
99 TimeAxisView(sess,ed,(TimeAxisView*) 0, canvas),
100 parent_canvas (canvas),
102 edit_group_button (_("g")), // group
103 playlist_button (_("p")),
104 size_button (_("h")), // height
105 automation_button (_("a")),
106 visual_button (_("v")),
109 gain_adjustment (0.781787, 0.0, 1.0, 0.01, 0.1)
115 lm.set_no_show_all();
119 playlist_action_menu = 0;
120 automation_action_menu = 0;
122 timestretch_rect = 0;
124 destructive_track_mode_item = 0;
125 normal_track_mode_item = 0;
127 gain_slider = manage (new HSliderController (slider, &gain_adjustment, _route->gain_control(), false));
129 ignore_toggle = false;
131 edit_group_button.set_name ("TrackGroupButton");
132 playlist_button.set_name ("TrackPlaylistButton");
133 automation_button.set_name ("TrackAutomationButton");
134 size_button.set_name ("TrackSizeButton");
135 visual_button.set_name ("TrackVisualButton");
136 hide_button.set_name ("TrackRemoveButton");
138 hide_button.add (*(manage (new Image (::get_icon("hide")))));
139 hide_button.show_all ();
141 edit_group_button.signal_button_release_event().connect (mem_fun(*this, &RouteTimeAxisView::edit_click), false);
142 playlist_button.signal_clicked().connect (mem_fun(*this, &RouteTimeAxisView::playlist_click));
143 automation_button.signal_clicked().connect (mem_fun(*this, &RouteTimeAxisView::automation_click));
144 size_button.signal_button_release_event().connect (mem_fun(*this, &RouteTimeAxisView::size_click), false);
145 visual_button.signal_clicked().connect (mem_fun(*this, &RouteTimeAxisView::visual_click));
146 hide_button.signal_clicked().connect (mem_fun(*this, &RouteTimeAxisView::hide_click));
148 solo_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::solo_press), false);
149 solo_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::solo_release));
150 mute_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::mute_press), false);
151 mute_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::mute_release));
157 rec_enable_button->remove ();
158 switch (track()->mode()) {
160 rec_enable_button->add (*(manage (new Image (::get_icon (X_("record_normal_red"))))));
162 case ARDOUR::Destructive:
163 rec_enable_button->add (*(manage (new Image (::get_icon (X_("record_tape_red"))))));
166 rec_enable_button->show_all ();
168 rec_enable_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::rec_enable_press), false);
169 rec_enable_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::rec_enable_release));
170 controls_table.attach (*rec_enable_button, 5, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
171 ARDOUR_UI::instance()->tooltips().set_tip(*rec_enable_button, _("Record"));
175 controls_hbox.pack_start(lm, false, false);
176 _route->meter_change.connect (mem_fun(*this, &RouteTimeAxisView::meter_changed));
177 _route->input_changed.connect (mem_fun(*this, &RouteTimeAxisView::io_changed));
178 _route->output_changed.connect (mem_fun(*this, &RouteTimeAxisView::io_changed));
180 controls_table.attach (*mute_button, 6, 7, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
181 controls_table.attach (*solo_button, 7, 8, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
183 controls_table.attach (edit_group_button, 7, 8, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
184 controls_table.attach (*gain_slider, 0, 5, 1, 2, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
186 ARDOUR_UI::instance()->tooltips().set_tip(*solo_button,_("Solo"));
187 ARDOUR_UI::instance()->tooltips().set_tip(*mute_button,_("Mute"));
188 ARDOUR_UI::instance()->tooltips().set_tip(edit_group_button,_("Edit Group"));
189 ARDOUR_UI::instance()->tooltips().set_tip(size_button,_("Display Height"));
190 ARDOUR_UI::instance()->tooltips().set_tip(playlist_button,_("Playlist"));
191 ARDOUR_UI::instance()->tooltips().set_tip(automation_button, _("Automation"));
192 ARDOUR_UI::instance()->tooltips().set_tip(visual_button, _("Visual options"));
193 ARDOUR_UI::instance()->tooltips().set_tip(hide_button, _("Hide this track"));
199 /* old school - when we used to put an extra row of buttons in place */
201 controls_table.attach (hide_button, 0, 1, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
202 controls_table.attach (visual_button, 1, 2, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
203 controls_table.attach (size_button, 2, 3, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
204 controls_table.attach (automation_button, 3, 4, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
208 controls_table.attach (automation_button, 6, 7, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
211 if (is_track() && track()->mode() == ARDOUR::Normal) {
212 controls_table.attach (playlist_button, 5, 6, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
217 _route->redirects_changed.connect (mem_fun(*this, &RouteTimeAxisView::redirects_changed));
218 _route->name_changed.connect (mem_fun(*this, &RouteTimeAxisView::route_name_changed));
222 track()->TrackModeChanged.connect (mem_fun(*this, &RouteTimeAxisView::track_mode_changed));
223 track()->FreezeChange.connect (mem_fun(*this, &RouteTimeAxisView::map_frozen));
224 track()->DiskstreamChanged.connect (mem_fun(*this, &RouteTimeAxisView::diskstream_changed));
225 get_diskstream()->SpeedChanged.connect (mem_fun(*this, &RouteTimeAxisView::speed_changed));
227 /* pick up the correct freeze state */
232 editor.ZoomChanged.connect (mem_fun(*this, &RouteTimeAxisView::reset_samples_per_unit));
233 ColorsChanged.connect (mem_fun (*this, &RouteTimeAxisView::color_handler));
235 gain_slider->signal_button_press_event().connect (mem_fun(*this, &RouteTimeAxisView::start_gain_touch));
236 gain_slider->signal_button_release_event().connect (mem_fun(*this, &RouteTimeAxisView::end_gain_touch));
237 gain_slider->set_name ("TrackGainFader");
239 gain_adjustment.signal_value_changed().connect (mem_fun(*this, &RouteTimeAxisView::gain_adjusted));
240 _route->gain_changed.connect (mem_fun(*this, &RouteTimeAxisView::gain_changed));
242 gain_slider->show_all();
245 RouteTimeAxisView::~RouteTimeAxisView ()
247 GoingAway (); /* EMIT_SIGNAL */
249 vector_delete (&redirect_automation_curves);
251 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
256 delete playlist_menu;
260 if (playlist_action_menu) {
261 delete playlist_action_menu;
262 playlist_action_menu = 0;
272 RouteTimeAxisView::post_construct ()
274 /* map current state of the route */
276 update_diskstream_display ();
277 _route->foreach_redirect (this, &RouteTimeAxisView::add_redirect_to_subplugin_menu);
278 _route->foreach_redirect (this, &RouteTimeAxisView::add_existing_redirect_automation_curves);
279 reset_redirect_automation_curves ();
283 RouteTimeAxisView::set_playlist (boost::shared_ptr<Playlist> newplaylist)
285 boost::shared_ptr<Playlist> pl = playlist();
288 modified_connection.disconnect ();
289 modified_connection = pl->Modified.connect (mem_fun(*this, &RouteTimeAxisView::playlist_modified));
293 RouteTimeAxisView::playlist_modified ()
298 RouteTimeAxisView::edit_click (GdkEventButton *ev)
300 if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
301 _route->set_edit_group (0, this);
305 using namespace Menu_Helpers;
307 MenuList& items = edit_group_menu.items ();
308 RadioMenuItem::Group group;
311 items.push_back (RadioMenuElem (group, _("No group"),
312 bind (mem_fun(*this, &RouteTimeAxisView::set_edit_group_from_menu), (RouteGroup *) 0)));
314 if (_route->edit_group() == 0) {
315 static_cast<RadioMenuItem*>(&items.back())->set_active ();
318 _session.foreach_edit_group (bind (mem_fun (*this, &RouteTimeAxisView::add_edit_group_menu_item), &group));
319 edit_group_menu.popup (ev->button, ev->time);
325 RouteTimeAxisView::add_edit_group_menu_item (RouteGroup *eg, RadioMenuItem::Group* group)
327 using namespace Menu_Helpers;
329 MenuList &items = edit_group_menu.items();
331 items.push_back (RadioMenuElem (*group, eg->name(), bind (mem_fun(*this, &RouteTimeAxisView::set_edit_group_from_menu), eg)));
332 if (_route->edit_group() == eg) {
333 static_cast<RadioMenuItem*>(&items.back())->set_active ();
338 RouteTimeAxisView::set_edit_group_from_menu (RouteGroup *eg)
340 _route->set_edit_group (eg, this);
344 RouteTimeAxisView::playlist_changed ()
349 set_playlist (get_diskstream()->playlist());
354 RouteTimeAxisView::label_view ()
356 string x = _route->name();
358 if (x != name_entry.get_text()) {
359 name_entry.set_text (x);
362 ARDOUR_UI::instance()->tooltips().set_tip (name_entry, x);
366 RouteTimeAxisView::route_name_changed (void *src)
368 editor.route_name_changed (this);
373 RouteTimeAxisView::take_name_changed (void *src)
382 RouteTimeAxisView::playlist_click ()
384 // always build a new action menu
386 if (playlist_action_menu != 0) {
387 delete playlist_action_menu;
390 playlist_action_menu = new Menu;
391 playlist_action_menu->set_name ("ArdourContextMenu");
393 build_playlist_menu (playlist_action_menu);
394 editor.set_selected_track (*this, Selection::Add);
395 playlist_action_menu->popup (1, gtk_get_current_event_time());
399 RouteTimeAxisView::automation_click ()
401 if (automation_action_menu == 0) {
402 /* this seems odd, but the automation action
403 menu is built as part of the display menu.
405 build_display_menu ();
407 editor.set_selected_track (*this, Selection::Add);
408 automation_action_menu->popup (1, gtk_get_current_event_time());
412 RouteTimeAxisView::build_automation_action_menu ()
414 using namespace Menu_Helpers;
416 automation_action_menu = manage (new Menu);
417 MenuList& automation_items = automation_action_menu->items();
418 automation_action_menu->set_name ("ArdourContextMenu");
420 automation_items.push_back (MenuElem (_("Show all automation"),
421 mem_fun(*this, &RouteTimeAxisView::show_all_automation)));
423 automation_items.push_back (MenuElem (_("Show existing automation"),
424 mem_fun(*this, &RouteTimeAxisView::show_existing_automation)));
426 automation_items.push_back (MenuElem (_("Hide all automation"),
427 mem_fun(*this, &RouteTimeAxisView::hide_all_automation)));
429 automation_items.push_back (MenuElem (_("Plugins"), subplugin_menu));
433 RouteTimeAxisView::build_display_menu ()
435 using namespace Menu_Helpers;
437 /* get the size menu ready */
443 TimeAxisView::build_display_menu ();
445 /* now fill it with our stuff */
447 MenuList& items = display_menu->items();
448 display_menu->set_name ("ArdourContextMenu");
450 items.push_back (MenuElem (_("Height"), *size_menu));
451 items.push_back (MenuElem (_("Color"), mem_fun(*this, &RouteTimeAxisView::select_track_color)));
453 items.push_back (SeparatorElem());
455 build_remote_control_menu ();
456 build_automation_action_menu ();
458 if (!Profile->get_sae()) {
459 items.push_back (MenuElem (_("Remote Control ID"), *remote_control_menu));
460 items.push_back (MenuElem (_("Automation"), *automation_action_menu));
461 items.push_back (SeparatorElem());
464 // Hook for derived classes to add type specific stuff
465 append_extra_display_menu_items ();
466 items.push_back (SeparatorElem());
470 Menu* alignment_menu = manage (new Menu);
471 MenuList& alignment_items = alignment_menu->items();
472 alignment_menu->set_name ("ArdourContextMenu");
474 RadioMenuItem::Group align_group;
476 alignment_items.push_back (RadioMenuElem (align_group, _("Align with existing material"),
477 bind (mem_fun(*this, &RouteTimeAxisView::set_align_style), ExistingMaterial)));
478 align_existing_item = dynamic_cast<RadioMenuItem*>(&alignment_items.back());
479 if (get_diskstream()->alignment_style() == ExistingMaterial)
480 align_existing_item->set_active();
482 alignment_items.push_back (RadioMenuElem (align_group, _("Align with capture time"),
483 bind (mem_fun(*this, &RouteTimeAxisView::set_align_style), CaptureTime)));
484 align_capture_item = dynamic_cast<RadioMenuItem*>(&alignment_items.back());
485 if (get_diskstream()->alignment_style() == CaptureTime)
486 align_capture_item->set_active();
488 if (!Profile->get_sae()) {
489 items.push_back (MenuElem (_("Alignment"), *alignment_menu));
490 get_diskstream()->AlignmentStyleChanged.connect (mem_fun(*this, &RouteTimeAxisView::align_style_changed));
492 RadioMenuItem::Group mode_group;
493 items.push_back (RadioMenuElem (mode_group, _("Normal mode"),
494 bind (mem_fun (*this, &RouteTimeAxisView::set_track_mode), ARDOUR::Normal)));
495 normal_track_mode_item = dynamic_cast<RadioMenuItem*>(&items.back());
496 items.push_back (RadioMenuElem (mode_group, _("Tape mode"),
497 bind (mem_fun (*this, &RouteTimeAxisView::set_track_mode), ARDOUR::Destructive)));
498 destructive_track_mode_item = dynamic_cast<RadioMenuItem*>(&items.back());
500 switch (track()->mode()) {
501 case ARDOUR::Destructive:
502 destructive_track_mode_item->set_active ();
505 normal_track_mode_item->set_active ();
509 items.push_back (SeparatorElem());
513 items.push_back (CheckMenuElem (_("Active"), mem_fun(*this, &RouteUI::toggle_route_active)));
514 route_active_menu_item = dynamic_cast<CheckMenuItem *> (&items.back());
515 route_active_menu_item->set_active (_route->active());
517 items.push_back (SeparatorElem());
518 items.push_back (MenuElem (_("Remove"), mem_fun(*this, &RouteUI::remove_this_route)));
521 static bool __reset_item (RadioMenuItem* item)
528 RouteTimeAxisView::set_track_mode (TrackMode mode)
531 RadioMenuItem* other_item;
535 item = normal_track_mode_item;
536 other_item = destructive_track_mode_item;
538 case ARDOUR::Destructive:
539 item = destructive_track_mode_item;
540 other_item = normal_track_mode_item;
543 fatal << string_compose (_("programming error: %1 %2"), "illegal track mode in RouteTimeAxisView::set_track_mode", mode) << endmsg;
548 if (item && other_item && item->get_active () && track()->mode() != mode) {
549 _set_track_mode (track(), mode, other_item);
554 RouteTimeAxisView::_set_track_mode (boost::shared_ptr<Track> track, TrackMode mode, RadioMenuItem* reset_item)
558 if (!track->can_use_mode (mode, needs_bounce)) {
562 Glib::signal_idle().connect (bind (sigc::ptr_fun (__reset_item), reset_item));
565 cerr << "would bounce this one\n";
570 track->set_mode (mode);
572 rec_enable_button->remove ();
575 rec_enable_button->add (*(manage (new Image (::get_icon (X_("record_normal_red"))))));
577 case ARDOUR::Destructive:
578 rec_enable_button->add (*(manage (new Image (::get_icon (X_("record_tape_red"))))));
581 rec_enable_button->show_all ();
586 RouteTimeAxisView::track_mode_changed ()
590 switch (track()->mode()) {
592 item = normal_track_mode_item;
594 case ARDOUR::Destructive:
595 item = destructive_track_mode_item;
598 fatal << string_compose (_("programming error: %1 %2"), "illegal track mode in RouteTimeAxisView::set_track_mode", track()->mode()) << endmsg;
607 RouteTimeAxisView::show_timestretch (nframes_t start, nframes_t end)
613 TimeAxisView::show_timestretch (start, end);
623 /* check that the time selection was made in our route, or our edit group.
624 remember that edit_group() == 0 implies the route is *not* in a edit group.
627 if (!(ts.track == this || (ts.group != 0 && ts.group == _route->edit_group()))) {
628 /* this doesn't apply to us */
632 /* ignore it if our edit group is not active */
634 if ((ts.track != this) && _route->edit_group() && !_route->edit_group()->is_active()) {
639 if (timestretch_rect == 0) {
640 timestretch_rect = new SimpleRect (*canvas_display);
641 timestretch_rect->property_x1() = 0.0;
642 timestretch_rect->property_y1() = 0.0;
643 timestretch_rect->property_x2() = 0.0;
644 timestretch_rect->property_y2() = 0.0;
645 timestretch_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_TimeStretchFill.get();
646 timestretch_rect->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_TimeStretchOutline.get();
649 timestretch_rect->show ();
650 timestretch_rect->raise_to_top ();
652 x1 = start / editor.get_current_zoom();
653 x2 = (end - 1) / editor.get_current_zoom();
656 timestretch_rect->property_x1() = x1;
657 timestretch_rect->property_y1() = 1.0;
658 timestretch_rect->property_x2() = x2;
659 timestretch_rect->property_y2() = y2;
663 RouteTimeAxisView::hide_timestretch ()
665 TimeAxisView::hide_timestretch ();
667 if (timestretch_rect) {
668 timestretch_rect->hide ();
673 RouteTimeAxisView::show_selection (TimeSelection& ts)
677 /* ignore it if our edit group is not active or if the selection was started
678 in some other track or edit group (remember that edit_group() == 0 means
679 that the track is not in an edit group).
682 if (((ts.track != this && !is_child (ts.track)) && _route->edit_group() && !_route->edit_group()->is_active()) ||
683 (!(ts.track == this || is_child (ts.track) || (ts.group != 0 && ts.group == _route->edit_group())))) {
689 TimeAxisView::show_selection (ts);
693 RouteTimeAxisView::set_height (TrackHeight h)
695 int gmlen = (height_to_pixels (h)) - 5;
696 bool height_changed = (height == 0) || (h != height_style);
697 lm.setup_meters (gmlen);
698 TimeAxisView::set_height (h);
703 _view->set_height ((double) height);
706 switch (height_style) {
708 xml_node->add_property ("track_height", "largest");
712 xml_node->add_property ("track_height", "large");
716 xml_node->add_property ("track_height", "larger");
720 xml_node->add_property ("track_height", "normal");
724 xml_node->add_property ("track_height", "smaller");
728 xml_node->add_property ("track_height", "small");
732 switch (height_style) {
743 if (rec_enable_button)
744 rec_enable_button->show();
746 edit_group_button.show();
748 visual_button.show();
750 automation_button.show();
752 if (is_track() && track()->mode() == ARDOUR::Normal) {
753 playlist_button.show();
764 if (rec_enable_button)
765 rec_enable_button->show();
767 edit_group_button.hide ();
769 visual_button.hide ();
771 automation_button.hide ();
773 if (is_track() && track()->mode() == ARDOUR::Normal) {
774 playlist_button.hide ();
785 if (rec_enable_button)
786 rec_enable_button->hide();
788 edit_group_button.hide ();
790 visual_button.hide ();
792 automation_button.hide ();
793 playlist_button.hide ();
794 name_label.set_text (_route->name());
798 if (height_changed) {
799 /* only emit the signal if the height really changed */
800 _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
805 RouteTimeAxisView::select_track_color ()
807 if (RouteUI::choose_color ()) {
810 _view->apply_color (_color, StreamView::RegionColor);
816 RouteTimeAxisView::reset_samples_per_unit ()
818 set_samples_per_unit (editor.get_current_zoom());
822 RouteTimeAxisView::set_samples_per_unit (double spu)
826 if (get_diskstream() != 0) {
827 speed = get_diskstream()->speed();
831 _view->set_samples_per_unit (spu * speed);
834 TimeAxisView::set_samples_per_unit (spu * speed);
838 RouteTimeAxisView::align_style_changed ()
840 switch (get_diskstream()->alignment_style()) {
841 case ExistingMaterial:
842 if (!align_existing_item->get_active()) {
843 align_existing_item->set_active();
847 if (!align_capture_item->get_active()) {
848 align_capture_item->set_active();
855 RouteTimeAxisView::set_align_style (AlignStyle style)
860 case ExistingMaterial:
861 item = align_existing_item;
864 item = align_capture_item;
867 fatal << string_compose (_("programming error: %1 %2"), "illegal align style in RouteTimeAxisView::set_align_style", style) << endmsg;
872 if (item->get_active()) {
873 get_diskstream()->set_align_style (style);
878 RouteTimeAxisView::rename_current_playlist ()
880 ArdourPrompter prompter (true);
883 boost::shared_ptr<Diskstream> ds = get_diskstream();
884 if (!ds || ds->destructive())
887 boost::shared_ptr<Playlist> pl = ds->playlist();
891 prompter.set_prompt (_("Name for playlist"));
892 prompter.set_initial_text (pl->name());
893 prompter.add_button (_("Rename"), Gtk::RESPONSE_ACCEPT);
894 prompter.set_response_sensitive (Gtk::RESPONSE_ACCEPT, false);
896 switch (prompter.run ()) {
897 case Gtk::RESPONSE_ACCEPT:
898 prompter.get_result (name);
910 RouteTimeAxisView::use_copy_playlist (bool prompt)
914 boost::shared_ptr<Diskstream> ds = get_diskstream();
915 if (!ds || ds->destructive())
918 boost::shared_ptr<const Playlist> pl = ds->playlist();
925 name = Playlist::bump_name (name, _session);
926 } while (_session.playlist_by_name(name));
928 // TODO: The prompter "new" button should be de-activated if the user
929 // specifies a playlist name which already exists in the session.
933 ArdourPrompter prompter (true);
935 prompter.set_prompt (_("Name for Playlist"));
936 prompter.set_initial_text (name);
937 prompter.add_button (Gtk::Stock::NEW, Gtk::RESPONSE_ACCEPT);
938 prompter.set_response_sensitive (Gtk::RESPONSE_ACCEPT, true);
939 prompter.show_all ();
941 switch (prompter.run ()) {
942 case Gtk::RESPONSE_ACCEPT:
943 prompter.get_result (name);
952 ds->use_copy_playlist ();
953 ds->playlist()->set_name (name);
958 RouteTimeAxisView::use_new_playlist (bool prompt)
962 boost::shared_ptr<Diskstream> ds = get_diskstream();
963 if (!ds || ds->destructive())
966 boost::shared_ptr<const Playlist> pl = ds->playlist();
973 name = Playlist::bump_name (name, _session);
974 } while (_session.playlist_by_name(name));
979 ArdourPrompter prompter (true);
981 prompter.set_prompt (_("Name for Playlist"));
982 prompter.set_initial_text (name);
983 prompter.add_button (Gtk::Stock::NEW, Gtk::RESPONSE_ACCEPT);
984 prompter.set_response_sensitive (Gtk::RESPONSE_ACCEPT, true);
986 switch (prompter.run ()) {
987 case Gtk::RESPONSE_ACCEPT:
988 prompter.get_result (name);
997 ds->use_new_playlist ();
998 ds->playlist()->set_name (name);
1003 RouteTimeAxisView::clear_playlist ()
1005 boost::shared_ptr<Diskstream> ds = get_diskstream();
1006 if (!ds || ds->destructive())
1009 boost::shared_ptr<Playlist> pl = ds->playlist();
1013 editor.clear_playlist (pl);
1017 RouteTimeAxisView::speed_changed ()
1019 Gtkmm2ext::UI::instance()->call_slot (mem_fun(*this, &RouteTimeAxisView::reset_samples_per_unit));
1023 RouteTimeAxisView::diskstream_changed ()
1025 Gtkmm2ext::UI::instance()->call_slot (mem_fun(*this, &RouteTimeAxisView::update_diskstream_display));
1029 RouteTimeAxisView::update_diskstream_display ()
1031 if (!get_diskstream()) // bus
1034 set_playlist (get_diskstream()->playlist());
1039 RouteTimeAxisView::selection_click (GdkEventButton* ev)
1041 if (Keyboard::modifier_state_equals (ev->state, (Keyboard::TertiaryModifier|Keyboard::PrimaryModifier))) {
1043 /* special case: select/deselect all tracks */
1044 if (editor.get_selection().selected (this)) {
1045 editor.get_selection().clear_tracks ();
1047 editor.select_all_tracks ();
1053 PublicEditor::TrackViewList* tracks = editor.get_valid_views (this, _route->edit_group());
1055 switch (Keyboard::selection_type (ev->state)) {
1056 case Selection::Toggle:
1057 editor.get_selection().toggle (*tracks);
1060 case Selection::Set:
1061 editor.get_selection().set (*tracks);
1064 case Selection::Extend:
1065 if (tracks->size() > 1) {
1066 /* add each one, do not "extend" */
1067 editor.get_selection().add (*tracks);
1069 /* extend to the single track */
1070 editor.extend_selection_to_track (*tracks->front());
1074 case Selection::Add:
1075 editor.get_selection().add (*tracks);
1083 RouteTimeAxisView::set_selected_points (PointSelection& points)
1085 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1086 (*i)->set_selected_points (points);
1091 RouteTimeAxisView::set_selected_regionviews (RegionSelection& regions)
1094 _view->set_selected_regionviews (regions);
1099 RouteTimeAxisView::get_selectables (nframes_t start, nframes_t end, double top, double bot, list<Selectable*>& results)
1103 if (get_diskstream() != 0) {
1104 speed = get_diskstream()->speed();
1107 nframes_t start_adjusted = session_frame_to_track_frame(start, speed);
1108 nframes_t end_adjusted = session_frame_to_track_frame(end, speed);
1110 if (_view && ((top < 0.0 && bot < 0.0)) || touched (top, bot)) {
1111 _view->get_selectables (start_adjusted, end_adjusted, results);
1114 /* pick up visible automation tracks */
1116 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1117 if (!(*i)->hidden()) {
1118 (*i)->get_selectables (start_adjusted, end_adjusted, top, bot, results);
1124 RouteTimeAxisView::get_inverted_selectables (Selection& sel, list<Selectable*>& results)
1127 _view->get_inverted_selectables (sel, results);
1130 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1131 if (!(*i)->hidden()) {
1132 (*i)->get_inverted_selectables (sel, results);
1140 RouteTimeAxisView::edit_group() const
1142 return _route->edit_group();
1146 RouteTimeAxisView::name() const
1148 return _route->name();
1151 boost::shared_ptr<Playlist>
1152 RouteTimeAxisView::playlist () const
1154 boost::shared_ptr<Diskstream> ds;
1156 if ((ds = get_diskstream()) != 0) {
1157 return ds->playlist();
1159 return boost::shared_ptr<Playlist> ();
1164 RouteTimeAxisView::name_entry_changed ()
1168 x = name_entry.get_text ();
1170 if (x == _route->name()) {
1174 strip_whitespace_edges(x);
1176 if (x.length() == 0) {
1177 name_entry.set_text (_route->name());
1181 if (_session.route_name_unique (x)) {
1182 _route->set_name (x, this);
1184 ARDOUR_UI::instance()->popup_error (_("A track already exists with that name"));
1185 name_entry.set_text (_route->name());
1190 RouteTimeAxisView::visual_click ()
1192 popup_display_menu (0);
1196 RouteTimeAxisView::hide_click ()
1198 // LAME fix for hide_button refresh fix
1199 hide_button.set_sensitive(false);
1201 editor.hide_track_in_display (*this);
1203 hide_button.set_sensitive(true);
1206 boost::shared_ptr<Region>
1207 RouteTimeAxisView::find_next_region (nframes_t pos, RegionPoint point, int32_t dir)
1209 boost::shared_ptr<Diskstream> stream;
1210 boost::shared_ptr<Playlist> playlist;
1212 if ((stream = get_diskstream()) != 0 && (playlist = stream->playlist()) != 0) {
1213 return playlist->find_next_region (pos, point, dir);
1216 return boost::shared_ptr<Region> ();
1220 RouteTimeAxisView::find_next_region_boundary (nframes64_t pos, int32_t dir)
1222 boost::shared_ptr<Diskstream> stream;
1223 boost::shared_ptr<Playlist> playlist;
1225 if ((stream = get_diskstream()) != 0 && (playlist = stream->playlist()) != 0) {
1226 return playlist->find_next_region_boundary (pos, dir);
1233 RouteTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op)
1235 boost::shared_ptr<Playlist> what_we_got;
1236 boost::shared_ptr<Diskstream> ds = get_diskstream();
1237 boost::shared_ptr<Playlist> playlist;
1241 /* route is a bus, not a track */
1245 playlist = ds->playlist();
1247 TimeSelection time (selection.time);
1248 float speed = ds->speed();
1249 if (speed != 1.0f) {
1250 for (TimeSelection::iterator i = time.begin(); i != time.end(); ++i) {
1251 (*i).start = session_frame_to_track_frame((*i).start, speed);
1252 (*i).end = session_frame_to_track_frame((*i).end, speed);
1256 XMLNode &before = playlist->get_state();
1259 if ((what_we_got = playlist->cut (time)) != 0) {
1260 editor.get_cut_buffer().add (what_we_got);
1261 _session.add_command( new MementoCommand<Playlist>(*playlist.get(), &before, &playlist->get_state()));
1266 if ((what_we_got = playlist->copy (time)) != 0) {
1267 editor.get_cut_buffer().add (what_we_got);
1272 if ((what_we_got = playlist->cut (time)) != 0) {
1273 _session.add_command( new MementoCommand<Playlist>(*playlist, &before, &playlist->get_state()));
1274 what_we_got->release ();
1284 RouteTimeAxisView::paste (nframes_t pos, float times, Selection& selection, size_t nth)
1290 boost::shared_ptr<Playlist> playlist = get_diskstream()->playlist();
1291 PlaylistSelection::iterator p;
1293 for (p = selection.playlists.begin(); p != selection.playlists.end() && nth; ++p, --nth);
1295 if (p == selection.playlists.end()) {
1299 if (get_diskstream()->speed() != 1.0f)
1300 pos = session_frame_to_track_frame(pos, get_diskstream()->speed() );
1302 XMLNode &before = playlist->get_state();
1303 playlist->paste (*p, pos, times);
1304 _session.add_command( new MementoCommand<Playlist>(*playlist, &before, &playlist->get_state()));
1311 RouteTimeAxisView::get_child_list()
1314 list<TimeAxisView*>redirect_children;
1316 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1317 if (!(*i)->hidden()) {
1318 redirect_children.push_back(*i);
1321 return redirect_children;
1326 RouteTimeAxisView::build_playlist_menu (Gtk::Menu * menu)
1328 using namespace Menu_Helpers;
1330 if (!menu || !is_track()) {
1334 MenuList& playlist_items = menu->items();
1335 menu->set_name ("ArdourContextMenu");
1336 playlist_items.clear();
1338 if (playlist_menu) {
1339 delete playlist_menu;
1342 playlist_menu = new Menu;
1343 playlist_menu->set_name ("ArdourContextMenu");
1345 vector<boost::shared_ptr<Playlist> > playlists;
1346 boost::shared_ptr<Diskstream> ds = get_diskstream();
1347 RadioMenuItem::Group playlist_group;
1349 _session.get_playlists (playlists);
1351 for (vector<boost::shared_ptr<Playlist> >::iterator i = playlists.begin(); i != playlists.end(); ++i) {
1353 if ((*i)->get_orig_diskstream_id() == ds->id()) {
1354 playlist_items.push_back (RadioMenuElem (playlist_group, (*i)->name(), bind (mem_fun (*this, &RouteTimeAxisView::use_playlist),
1355 boost::weak_ptr<Playlist> (*i))));
1357 if (ds->playlist()->id() == (*i)->id()) {
1358 static_cast<RadioMenuItem*>(&playlist_items.back())->set_active();
1360 } else if (ds->playlist()->id() == (*i)->id()) {
1361 playlist_items.push_back (RadioMenuElem (playlist_group, (*i)->name(), bind (mem_fun (*this, &RouteTimeAxisView::use_playlist),
1362 boost::weak_ptr<Playlist>(*i))));
1363 static_cast<RadioMenuItem*>(&playlist_items.back())->set_active();
1368 playlist_items.push_back (SeparatorElem());
1369 playlist_items.push_back (MenuElem (_("Rename"), mem_fun(*this, &RouteTimeAxisView::rename_current_playlist)));
1370 playlist_items.push_back (SeparatorElem());
1372 playlist_items.push_back (MenuElem (_("New"), bind(mem_fun(editor, &PublicEditor::new_playlists), this)));
1373 playlist_items.push_back (MenuElem (_("New Copy"), bind(mem_fun(editor, &PublicEditor::copy_playlists), this)));
1374 playlist_items.push_back (SeparatorElem());
1375 playlist_items.push_back (MenuElem (_("Clear Current"), bind(mem_fun(editor, &PublicEditor::clear_playlists), this)));
1376 playlist_items.push_back (SeparatorElem());
1378 playlist_items.push_back (MenuElem(_("Select from all ..."), mem_fun(*this, &RouteTimeAxisView::show_playlist_selector)));
1382 RouteTimeAxisView::use_playlist (boost::weak_ptr<Playlist> wpl)
1384 assert (is_track());
1386 boost::shared_ptr<Playlist> pl (wpl.lock());
1392 boost::shared_ptr<AudioPlaylist> apl = boost::dynamic_pointer_cast<AudioPlaylist> (pl);
1395 get_diskstream()->use_playlist (apl);
1400 RouteTimeAxisView::show_playlist_selector ()
1402 editor.playlist_selector().show_for (this);
1406 RouteTimeAxisView::map_frozen ()
1412 ENSURE_GUI_THREAD (mem_fun(*this, &RouteTimeAxisView::map_frozen));
1414 switch (track()->freeze_state()) {
1416 playlist_button.set_sensitive (false);
1417 rec_enable_button->set_sensitive (false);
1420 playlist_button.set_sensitive (true);
1421 rec_enable_button->set_sensitive (true);
1427 RouteTimeAxisView::color_handler ()
1429 if (timestretch_rect) {
1430 timestretch_rect->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_TimeStretchOutline.get();
1433 if (timestretch_rect) {
1434 timestretch_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_TimeStretchFill.get();
1441 RouteTimeAxisView::show_all_automation ()
1445 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1446 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1447 if ((*ii)->view == 0) {
1448 add_redirect_automation_curve ((*i)->redirect, (*ii)->what);
1451 (*ii)->menu_item->set_active (true);
1457 _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1461 RouteTimeAxisView::show_existing_automation ()
1465 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1466 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1467 if ((*ii)->view != 0) {
1468 (*ii)->menu_item->set_active (true);
1475 _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1479 RouteTimeAxisView::hide_all_automation ()
1483 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1484 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1485 (*ii)->menu_item->set_active (false);
1490 _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1495 RouteTimeAxisView::region_view_added (RegionView* rv)
1497 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1498 AutomationTimeAxisView* atv;
1500 if ((atv = dynamic_cast<AutomationTimeAxisView*> (*i)) != 0) {
1501 rv->add_ghost (*atv);
1507 RouteTimeAxisView::add_ghost_to_redirect (RegionView* rv, AutomationTimeAxisView* atv)
1509 rv->add_ghost (*atv);
1512 RouteTimeAxisView::RedirectAutomationInfo::~RedirectAutomationInfo ()
1514 for (vector<RedirectAutomationNode*>::iterator i = lines.begin(); i != lines.end(); ++i) {
1520 RouteTimeAxisView::RedirectAutomationNode::~RedirectAutomationNode ()
1522 parent.remove_ran (this);
1530 RouteTimeAxisView::remove_ran (RedirectAutomationNode* ran)
1533 remove_child (ran->view);
1537 RouteTimeAxisView::RedirectAutomationNode*
1538 RouteTimeAxisView::find_redirect_automation_node (boost::shared_ptr<Redirect> redirect, uint32_t what)
1540 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1542 if ((*i)->redirect == redirect) {
1544 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1545 if ((*ii)->what == what) {
1555 // FIXME: duplicated in midi_time_axis.cc
1557 legalize_for_xml_node (string str)
1559 string::size_type pos;
1560 string legal_chars = "abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_=:";
1566 while ((pos = legal.find_first_not_of (legal_chars, pos)) != string::npos) {
1567 legal.replace (pos, 1, "_");
1576 RouteTimeAxisView::add_redirect_automation_curve (boost::shared_ptr<Redirect> redirect, uint32_t what)
1578 RedirectAutomationLine* ral;
1580 RedirectAutomationNode* ran;
1582 if ((ran = find_redirect_automation_node (redirect, what)) == 0) {
1583 fatal << _("programming error: ")
1584 << string_compose (X_("redirect automation curve for %1:%2 not registered with audio track!"),
1585 redirect->name(), what)
1595 name = redirect->describe_parameter (what);
1597 /* create a string that is a legal XML node name that can be used to refer to this redirect+port combination */
1599 char state_name[256];
1600 snprintf (state_name, sizeof (state_name), "Redirect-%s-%" PRIu32, legalize_for_xml_node (redirect->name()).c_str(), what);
1602 ran->view = new RedirectAutomationTimeAxisView (_session, _route, editor, *this, parent_canvas, name, what, *redirect, state_name);
1604 ral = new RedirectAutomationLine (name,
1605 *redirect, what, _session, *ran->view,
1606 *ran->view->canvas_display, redirect->automation_list (what));
1608 ral->set_line_color (ARDOUR_UI::config()->canvasvar_RedirectAutomationLine.get());
1609 ral->queue_reset ();
1611 ran->view->add_line (*ral);
1613 ran->view->Hiding.connect (bind (mem_fun(*this, &RouteTimeAxisView::redirect_automation_track_hidden), ran, redirect));
1615 if (!ran->view->marked_for_display()) {
1618 ran->menu_item->set_active (true);
1621 add_child (ran->view);
1624 _view->foreach_regionview (bind (mem_fun(*this, &RouteTimeAxisView::add_ghost_to_redirect), ran->view));
1627 redirect->mark_automation_visible (what, true);
1631 RouteTimeAxisView::redirect_automation_track_hidden (RouteTimeAxisView::RedirectAutomationNode* ran, boost::shared_ptr<Redirect> r)
1634 ran->menu_item->set_active (false);
1637 r->mark_automation_visible (ran->what, false);
1639 _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1643 RouteTimeAxisView::add_existing_redirect_automation_curves (boost::shared_ptr<Redirect> redirect)
1646 RedirectAutomationLine *ral;
1648 redirect->what_has_visible_automation (s);
1650 for (set<uint32_t>::iterator i = s.begin(); i != s.end(); ++i) {
1652 if ((ral = find_redirect_automation_curve (redirect, *i)) != 0) {
1653 ral->queue_reset ();
1655 add_redirect_automation_curve (redirect, (*i));
1661 RouteTimeAxisView::add_redirect_to_subplugin_menu (boost::shared_ptr<Redirect> r)
1663 using namespace Menu_Helpers;
1664 RedirectAutomationInfo *rai;
1665 list<RedirectAutomationInfo*>::iterator x;
1667 const std::set<uint32_t>& automatable = r->what_can_be_automated ();
1668 std::set<uint32_t> has_visible_automation;
1670 r->what_has_visible_automation(has_visible_automation);
1672 if (automatable.empty()) {
1676 for (x = redirect_automation.begin(); x != redirect_automation.end(); ++x) {
1677 if ((*x)->redirect == r) {
1682 if (x == redirect_automation.end()) {
1684 rai = new RedirectAutomationInfo (r);
1685 redirect_automation.push_back (rai);
1693 /* any older menu was deleted at the top of redirects_changed()
1694 when we cleared the subplugin menu.
1697 rai->menu = manage (new Menu);
1698 MenuList& items = rai->menu->items();
1699 rai->menu->set_name ("ArdourContextMenu");
1703 for (std::set<uint32_t>::const_iterator i = automatable.begin(); i != automatable.end(); ++i) {
1705 RedirectAutomationNode* ran;
1706 CheckMenuItem* mitem;
1708 string name = r->describe_parameter (*i);
1710 items.push_back (CheckMenuElem (name));
1711 mitem = dynamic_cast<CheckMenuItem*> (&items.back());
1713 if (has_visible_automation.find((*i)) != has_visible_automation.end()) {
1714 mitem->set_active(true);
1717 if ((ran = find_redirect_automation_node (r, *i)) == 0) {
1721 ran = new RedirectAutomationNode (*i, mitem, *this);
1723 rai->lines.push_back (ran);
1727 ran->menu_item = mitem;
1731 mitem->signal_toggled().connect (bind (mem_fun(*this, &RouteTimeAxisView::redirect_menu_item_toggled), rai, ran));
1734 /* add the menu for this redirect, because the subplugin
1735 menu is always cleared at the top of redirects_changed().
1736 this is the result of some poor design in gtkmm and/or
1740 subplugin_menu.items().push_back (MenuElem (r->name(), *rai->menu));
1745 RouteTimeAxisView::redirect_menu_item_toggled (RouteTimeAxisView::RedirectAutomationInfo* rai,
1746 RouteTimeAxisView::RedirectAutomationNode* ran)
1748 bool showit = ran->menu_item->get_active();
1749 bool redraw = false;
1751 if (ran->view == 0 && showit) {
1752 add_redirect_automation_curve (rai->redirect, ran->what);
1756 if (showit != ran->view->marked_for_display()) {
1759 ran->view->set_marked_for_display (true);
1760 ran->view->canvas_display->show();
1762 rai->redirect->mark_automation_visible (ran->what, true);
1763 ran->view->set_marked_for_display (false);
1771 if (redraw && !no_redraw) {
1773 /* now trigger a redisplay */
1775 _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1781 RouteTimeAxisView::redirects_changed (void *src)
1783 using namespace Menu_Helpers;
1785 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1786 (*i)->valid = false;
1789 subplugin_menu.items().clear ();
1791 _route->foreach_redirect (this, &RouteTimeAxisView::add_redirect_to_subplugin_menu);
1792 _route->foreach_redirect (this, &RouteTimeAxisView::add_existing_redirect_automation_curves);
1794 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ) {
1796 list<RedirectAutomationInfo*>::iterator tmp;
1804 redirect_automation.erase (i);
1811 /* change in visibility was possible */
1813 _route->gui_changed ("track_height", this);
1816 RedirectAutomationLine *
1817 RouteTimeAxisView::find_redirect_automation_curve (boost::shared_ptr<Redirect> redirect, uint32_t what)
1819 RedirectAutomationNode* ran;
1821 if ((ran = find_redirect_automation_node (redirect, what)) != 0) {
1823 return dynamic_cast<RedirectAutomationLine*> (ran->view->lines.front());
1831 RouteTimeAxisView::reset_redirect_automation_curves ()
1833 for (vector<RedirectAutomationLine*>::iterator i = redirect_automation_curves.begin(); i != redirect_automation_curves.end(); ++i) {
1839 RouteTimeAxisView::update_rec_display ()
1841 RouteUI::update_rec_display ();
1842 name_entry.set_sensitive (!_route->record_enabled());
1846 RouteTimeAxisView::fast_update ()
1848 lm.update_meters ();
1852 RouteTimeAxisView::hide_meter ()
1859 RouteTimeAxisView::show_meter ()
1865 RouteTimeAxisView::reset_meter ()
1867 if (Config->get_show_track_meters()) {
1868 lm.setup_meters (height-5);
1875 RouteTimeAxisView::clear_meter ()
1881 RouteTimeAxisView::meter_changed (void *src)
1883 ENSURE_GUI_THREAD (bind (mem_fun(*this, &RouteTimeAxisView::meter_changed), src));
1888 RouteTimeAxisView::io_changed (IOChange change, void *src)
1894 RouteTimeAxisView::start_gain_touch (GdkEventButton* ev)
1896 _route->start_gain_touch ();
1901 RouteTimeAxisView::end_gain_touch (GdkEventButton* ev)
1903 _route->end_gain_touch ();
1908 RouteTimeAxisView::gain_adjusted ()
1910 _route->set_gain (slider_position_to_gain (gain_adjustment.get_value()), this);
1914 RouteTimeAxisView::gain_changed (void *src)
1916 Gtkmm2ext::UI::instance()->call_slot (mem_fun(*this, &RouteTimeAxisView::effective_gain_display));
1920 RouteTimeAxisView::effective_gain_display ()
1922 gfloat value = gain_to_slider_position (_route->effective_gain());
1923 gain_adjustment.set_value (value);