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),
110 ignore_gain_adjustment (false)
116 lm.set_no_show_all();
120 playlist_action_menu = 0;
121 automation_action_menu = 0;
123 timestretch_rect = 0;
125 destructive_track_mode_item = 0;
126 normal_track_mode_item = 0;
128 gain_slider = manage (new HSliderController (slider, &gain_adjustment, _route->gain_control(), false));
130 ignore_toggle = false;
132 edit_group_button.set_name ("TrackGroupButton");
133 playlist_button.set_name ("TrackPlaylistButton");
134 automation_button.set_name ("TrackAutomationButton");
135 size_button.set_name ("TrackSizeButton");
136 visual_button.set_name ("TrackVisualButton");
137 hide_button.set_name ("TrackRemoveButton");
139 hide_button.add (*(manage (new Image (::get_icon("hide")))));
140 hide_button.show_all ();
142 edit_group_button.signal_button_release_event().connect (mem_fun(*this, &RouteTimeAxisView::edit_click), false);
143 playlist_button.signal_clicked().connect (mem_fun(*this, &RouteTimeAxisView::playlist_click));
144 automation_button.signal_clicked().connect (mem_fun(*this, &RouteTimeAxisView::automation_click));
145 size_button.signal_button_release_event().connect (mem_fun(*this, &RouteTimeAxisView::size_click), false);
146 visual_button.signal_clicked().connect (mem_fun(*this, &RouteTimeAxisView::visual_click));
147 hide_button.signal_clicked().connect (mem_fun(*this, &RouteTimeAxisView::hide_click));
149 solo_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::solo_press), false);
150 solo_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::solo_release));
151 mute_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::mute_press), false);
152 mute_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::mute_release));
158 rec_enable_button->remove ();
159 switch (track()->mode()) {
161 rec_enable_button->add (*(manage (new Image (::get_icon (X_("record_normal_red"))))));
163 case ARDOUR::Destructive:
164 rec_enable_button->add (*(manage (new Image (::get_icon (X_("record_tape_red"))))));
167 rec_enable_button->show_all ();
169 rec_enable_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::rec_enable_press), false);
170 rec_enable_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::rec_enable_release));
171 controls_table.attach (*rec_enable_button, 5, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
172 ARDOUR_UI::instance()->tooltips().set_tip(*rec_enable_button, _("Record"));
176 controls_hbox.pack_start(lm, false, false);
177 _route->meter_change.connect (mem_fun(*this, &RouteTimeAxisView::meter_changed));
178 _route->input_changed.connect (mem_fun(*this, &RouteTimeAxisView::io_changed));
179 _route->output_changed.connect (mem_fun(*this, &RouteTimeAxisView::io_changed));
181 controls_table.attach (*mute_button, 6, 7, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
182 controls_table.attach (*solo_button, 7, 8, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
184 controls_table.attach (edit_group_button, 7, 8, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
185 controls_table.attach (*gain_slider, 0, 5, 1, 2, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
187 ARDOUR_UI::instance()->tooltips().set_tip(*solo_button,_("Solo"));
188 ARDOUR_UI::instance()->tooltips().set_tip(*mute_button,_("Mute"));
189 ARDOUR_UI::instance()->tooltips().set_tip(edit_group_button,_("Edit Group"));
190 ARDOUR_UI::instance()->tooltips().set_tip(size_button,_("Display Height"));
191 ARDOUR_UI::instance()->tooltips().set_tip(playlist_button,_("Playlist"));
192 ARDOUR_UI::instance()->tooltips().set_tip(automation_button, _("Automation"));
193 ARDOUR_UI::instance()->tooltips().set_tip(visual_button, _("Visual options"));
194 ARDOUR_UI::instance()->tooltips().set_tip(hide_button, _("Hide this track"));
200 /* old school - when we used to put an extra row of buttons in place */
202 controls_table.attach (hide_button, 0, 1, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
203 controls_table.attach (visual_button, 1, 2, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
204 controls_table.attach (size_button, 2, 3, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
205 controls_table.attach (automation_button, 3, 4, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
209 controls_table.attach (automation_button, 6, 7, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
212 if (is_track() && track()->mode() == ARDOUR::Normal) {
213 controls_table.attach (playlist_button, 5, 6, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
218 _route->redirects_changed.connect (mem_fun(*this, &RouteTimeAxisView::redirects_changed));
219 _route->name_changed.connect (mem_fun(*this, &RouteTimeAxisView::route_name_changed));
223 track()->TrackModeChanged.connect (mem_fun(*this, &RouteTimeAxisView::track_mode_changed));
224 track()->FreezeChange.connect (mem_fun(*this, &RouteTimeAxisView::map_frozen));
225 track()->DiskstreamChanged.connect (mem_fun(*this, &RouteTimeAxisView::diskstream_changed));
226 get_diskstream()->SpeedChanged.connect (mem_fun(*this, &RouteTimeAxisView::speed_changed));
228 /* pick up the correct freeze state */
233 editor.ZoomChanged.connect (mem_fun(*this, &RouteTimeAxisView::reset_samples_per_unit));
234 ColorsChanged.connect (mem_fun (*this, &RouteTimeAxisView::color_handler));
236 gain_slider->signal_button_press_event().connect (mem_fun(*this, &RouteTimeAxisView::start_gain_touch));
237 gain_slider->signal_button_release_event().connect (mem_fun(*this, &RouteTimeAxisView::end_gain_touch));
238 gain_slider->set_name ("TrackGainFader");
240 gain_adjustment.signal_value_changed().connect (mem_fun(*this, &RouteTimeAxisView::gain_adjusted));
241 _route->gain_changed.connect (mem_fun(*this, &RouteTimeAxisView::gain_changed));
243 gain_slider->show_all();
246 RouteTimeAxisView::~RouteTimeAxisView ()
248 GoingAway (); /* EMIT_SIGNAL */
250 vector_delete (&redirect_automation_curves);
252 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
257 delete playlist_menu;
261 if (playlist_action_menu) {
262 delete playlist_action_menu;
263 playlist_action_menu = 0;
273 RouteTimeAxisView::post_construct ()
275 /* map current state of the route */
277 update_diskstream_display ();
278 _route->foreach_redirect (this, &RouteTimeAxisView::add_redirect_to_subplugin_menu);
279 _route->foreach_redirect (this, &RouteTimeAxisView::add_existing_redirect_automation_curves);
280 reset_redirect_automation_curves ();
284 RouteTimeAxisView::set_playlist (boost::shared_ptr<Playlist> newplaylist)
286 boost::shared_ptr<Playlist> pl = playlist();
289 modified_connection.disconnect ();
290 modified_connection = pl->Modified.connect (mem_fun(*this, &RouteTimeAxisView::playlist_modified));
294 RouteTimeAxisView::playlist_modified ()
299 RouteTimeAxisView::edit_click (GdkEventButton *ev)
301 if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
302 _route->set_edit_group (0, this);
306 using namespace Menu_Helpers;
308 MenuList& items = edit_group_menu.items ();
309 RadioMenuItem::Group group;
312 items.push_back (RadioMenuElem (group, _("No group"),
313 bind (mem_fun(*this, &RouteTimeAxisView::set_edit_group_from_menu), (RouteGroup *) 0)));
315 if (_route->edit_group() == 0) {
316 static_cast<RadioMenuItem*>(&items.back())->set_active ();
319 _session.foreach_edit_group (bind (mem_fun (*this, &RouteTimeAxisView::add_edit_group_menu_item), &group));
320 edit_group_menu.popup (ev->button, ev->time);
326 RouteTimeAxisView::add_edit_group_menu_item (RouteGroup *eg, RadioMenuItem::Group* group)
328 using namespace Menu_Helpers;
330 MenuList &items = edit_group_menu.items();
332 items.push_back (RadioMenuElem (*group, eg->name(), bind (mem_fun(*this, &RouteTimeAxisView::set_edit_group_from_menu), eg)));
333 if (_route->edit_group() == eg) {
334 static_cast<RadioMenuItem*>(&items.back())->set_active ();
339 RouteTimeAxisView::set_edit_group_from_menu (RouteGroup *eg)
341 _route->set_edit_group (eg, this);
345 RouteTimeAxisView::playlist_changed ()
350 set_playlist (get_diskstream()->playlist());
355 RouteTimeAxisView::label_view ()
357 string x = _route->name();
359 if (x != name_entry.get_text()) {
360 name_entry.set_text (x);
363 ARDOUR_UI::instance()->tooltips().set_tip (name_entry, x);
367 RouteTimeAxisView::route_name_changed (void *src)
369 editor.route_name_changed (this);
374 RouteTimeAxisView::take_name_changed (void *src)
383 RouteTimeAxisView::playlist_click ()
385 // always build a new action menu
387 if (playlist_action_menu != 0) {
388 delete playlist_action_menu;
391 playlist_action_menu = new Menu;
392 playlist_action_menu->set_name ("ArdourContextMenu");
394 build_playlist_menu (playlist_action_menu);
396 conditionally_add_to_selection ();
397 playlist_action_menu->popup (1, gtk_get_current_event_time());
401 RouteTimeAxisView::automation_click ()
403 if (automation_action_menu == 0) {
404 /* this seems odd, but the automation action
405 menu is built as part of the display menu.
407 build_display_menu ();
409 conditionally_add_to_selection ();
410 automation_action_menu->popup (1, gtk_get_current_event_time());
414 RouteTimeAxisView::build_automation_action_menu ()
416 using namespace Menu_Helpers;
418 automation_action_menu = manage (new Menu);
419 MenuList& automation_items = automation_action_menu->items();
420 automation_action_menu->set_name ("ArdourContextMenu");
422 automation_items.push_back (MenuElem (_("Show all automation"),
423 mem_fun(*this, &RouteTimeAxisView::show_all_automation)));
425 automation_items.push_back (MenuElem (_("Show existing automation"),
426 mem_fun(*this, &RouteTimeAxisView::show_existing_automation)));
428 automation_items.push_back (MenuElem (_("Hide all automation"),
429 mem_fun(*this, &RouteTimeAxisView::hide_all_automation)));
431 automation_items.push_back (MenuElem (_("Plugins"), subplugin_menu));
435 RouteTimeAxisView::build_display_menu ()
437 using namespace Menu_Helpers;
439 /* get the size menu ready */
445 TimeAxisView::build_display_menu ();
447 /* now fill it with our stuff */
449 MenuList& items = display_menu->items();
450 display_menu->set_name ("ArdourContextMenu");
452 items.push_back (MenuElem (_("Height"), *size_menu));
453 items.push_back (MenuElem (_("Color"), mem_fun(*this, &RouteTimeAxisView::select_track_color)));
455 items.push_back (SeparatorElem());
457 build_remote_control_menu ();
458 build_automation_action_menu ();
460 if (!Profile->get_sae()) {
461 items.push_back (MenuElem (_("Remote Control ID"), *remote_control_menu));
462 items.push_back (MenuElem (_("Automation"), *automation_action_menu));
463 items.push_back (SeparatorElem());
466 // Hook for derived classes to add type specific stuff
467 append_extra_display_menu_items ();
468 items.push_back (SeparatorElem());
472 Menu* alignment_menu = manage (new Menu);
473 MenuList& alignment_items = alignment_menu->items();
474 alignment_menu->set_name ("ArdourContextMenu");
476 RadioMenuItem::Group align_group;
478 alignment_items.push_back (RadioMenuElem (align_group, _("Align with existing material"),
479 bind (mem_fun(*this, &RouteTimeAxisView::set_align_style), ExistingMaterial)));
480 align_existing_item = dynamic_cast<RadioMenuItem*>(&alignment_items.back());
481 if (get_diskstream()->alignment_style() == ExistingMaterial)
482 align_existing_item->set_active();
484 alignment_items.push_back (RadioMenuElem (align_group, _("Align with capture time"),
485 bind (mem_fun(*this, &RouteTimeAxisView::set_align_style), CaptureTime)));
486 align_capture_item = dynamic_cast<RadioMenuItem*>(&alignment_items.back());
487 if (get_diskstream()->alignment_style() == CaptureTime)
488 align_capture_item->set_active();
490 if (!Profile->get_sae()) {
491 items.push_back (MenuElem (_("Alignment"), *alignment_menu));
492 get_diskstream()->AlignmentStyleChanged.connect (mem_fun(*this, &RouteTimeAxisView::align_style_changed));
494 RadioMenuItem::Group mode_group;
495 items.push_back (RadioMenuElem (mode_group, _("Normal mode"),
496 bind (mem_fun (*this, &RouteTimeAxisView::set_track_mode), ARDOUR::Normal)));
497 normal_track_mode_item = dynamic_cast<RadioMenuItem*>(&items.back());
498 items.push_back (RadioMenuElem (mode_group, _("Tape mode"),
499 bind (mem_fun (*this, &RouteTimeAxisView::set_track_mode), ARDOUR::Destructive)));
500 destructive_track_mode_item = dynamic_cast<RadioMenuItem*>(&items.back());
502 switch (track()->mode()) {
503 case ARDOUR::Destructive:
504 destructive_track_mode_item->set_active ();
507 normal_track_mode_item->set_active ();
511 items.push_back (SeparatorElem());
515 items.push_back (CheckMenuElem (_("Active"), mem_fun(*this, &RouteUI::toggle_route_active)));
516 route_active_menu_item = dynamic_cast<CheckMenuItem *> (&items.back());
517 route_active_menu_item->set_active (_route->active());
519 items.push_back (SeparatorElem());
520 items.push_back (MenuElem (_("Hide"), mem_fun(*this, &RouteTimeAxisView::hide_click)));
521 items.push_back (MenuElem (_("Remove"), mem_fun(*this, &RouteUI::remove_this_route)));
524 static bool __reset_item (RadioMenuItem* item)
531 RouteTimeAxisView::set_track_mode (TrackMode mode)
534 RadioMenuItem* other_item;
538 item = normal_track_mode_item;
539 other_item = destructive_track_mode_item;
541 case ARDOUR::Destructive:
542 item = destructive_track_mode_item;
543 other_item = normal_track_mode_item;
546 fatal << string_compose (_("programming error: %1 %2"), "illegal track mode in RouteTimeAxisView::set_track_mode", mode) << endmsg;
551 if (item && other_item && item->get_active () && track()->mode() != mode) {
552 _set_track_mode (track(), mode, other_item);
557 RouteTimeAxisView::_set_track_mode (boost::shared_ptr<Track> track, TrackMode mode, RadioMenuItem* reset_item)
561 if (!track->can_use_mode (mode, needs_bounce)) {
565 Glib::signal_idle().connect (bind (sigc::ptr_fun (__reset_item), reset_item));
568 cerr << "would bounce this one\n";
573 track->set_mode (mode);
575 rec_enable_button->remove ();
578 rec_enable_button->add (*(manage (new Image (::get_icon (X_("record_normal_red"))))));
580 case ARDOUR::Destructive:
581 rec_enable_button->add (*(manage (new Image (::get_icon (X_("record_tape_red"))))));
584 rec_enable_button->show_all ();
589 RouteTimeAxisView::track_mode_changed ()
593 switch (track()->mode()) {
595 item = normal_track_mode_item;
597 case ARDOUR::Destructive:
598 item = destructive_track_mode_item;
601 fatal << string_compose (_("programming error: %1 %2"), "illegal track mode in RouteTimeAxisView::set_track_mode", track()->mode()) << endmsg;
610 RouteTimeAxisView::show_timestretch (nframes_t start, nframes_t end)
616 TimeAxisView::show_timestretch (start, end);
626 /* check that the time selection was made in our route, or our edit group.
627 remember that edit_group() == 0 implies the route is *not* in a edit group.
630 if (!(ts.track == this || (ts.group != 0 && ts.group == _route->edit_group()))) {
631 /* this doesn't apply to us */
635 /* ignore it if our edit group is not active */
637 if ((ts.track != this) && _route->edit_group() && !_route->edit_group()->is_active()) {
642 if (timestretch_rect == 0) {
643 timestretch_rect = new SimpleRect (*canvas_display);
644 timestretch_rect->property_x1() = 0.0;
645 timestretch_rect->property_y1() = 0.0;
646 timestretch_rect->property_x2() = 0.0;
647 timestretch_rect->property_y2() = 0.0;
648 timestretch_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_TimeStretchFill.get();
649 timestretch_rect->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_TimeStretchOutline.get();
652 timestretch_rect->show ();
653 timestretch_rect->raise_to_top ();
655 x1 = start / editor.get_current_zoom();
656 x2 = (end - 1) / editor.get_current_zoom();
657 y2 = current_height() - 2;
659 timestretch_rect->property_x1() = x1;
660 timestretch_rect->property_y1() = 1.0;
661 timestretch_rect->property_x2() = x2;
662 timestretch_rect->property_y2() = y2;
666 RouteTimeAxisView::hide_timestretch ()
668 TimeAxisView::hide_timestretch ();
670 if (timestretch_rect) {
671 timestretch_rect->hide ();
676 RouteTimeAxisView::show_selection (TimeSelection& ts)
680 /* ignore it if our edit group is not active or if the selection was started
681 in some other track or edit group (remember that edit_group() == 0 means
682 that the track is not in an edit group).
685 if (((ts.track != this && !is_child (ts.track)) && _route->edit_group() && !_route->edit_group()->is_active()) ||
686 (!(ts.track == this || is_child (ts.track) || (ts.group != 0 && ts.group == _route->edit_group())))) {
692 TimeAxisView::show_selection (ts);
696 RouteTimeAxisView::set_height (uint32_t h)
699 bool height_changed = (height == 0) || (h != height);
700 lm.setup_meters (gmlen);
702 TimeAxisView::set_height (h);
707 _view->set_height ((double) current_height());
711 snprintf (buf, sizeof (buf), "%u", height);
712 xml_node->add_property ("height", buf);
714 if (height >= hNormal) {
722 if (rec_enable_button)
723 rec_enable_button->show();
725 edit_group_button.show();
727 visual_button.show();
729 automation_button.show();
731 if (is_track() && track()->mode() == ARDOUR::Normal) {
732 playlist_button.show();
735 } else if (height >= hSmaller) {
744 if (rec_enable_button)
745 rec_enable_button->show();
747 edit_group_button.hide ();
749 visual_button.hide ();
751 automation_button.hide ();
753 if (is_track() && track()->mode() == ARDOUR::Normal) {
754 playlist_button.hide ();
766 if (rec_enable_button)
767 rec_enable_button->hide();
769 edit_group_button.hide ();
771 visual_button.hide ();
773 automation_button.hide ();
774 playlist_button.hide ();
775 name_label.set_text (_route->name());
778 if (height_changed) {
779 /* only emit the signal if the height really changed */
780 _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
785 RouteTimeAxisView::select_track_color ()
787 if (RouteUI::choose_color ()) {
790 _view->apply_color (_color, StreamView::RegionColor);
796 RouteTimeAxisView::reset_samples_per_unit ()
798 set_samples_per_unit (editor.get_current_zoom());
802 RouteTimeAxisView::set_samples_per_unit (double spu)
806 if (get_diskstream() != 0) {
807 speed = get_diskstream()->speed();
811 _view->set_samples_per_unit (spu * speed);
814 TimeAxisView::set_samples_per_unit (spu * speed);
818 RouteTimeAxisView::align_style_changed ()
820 switch (get_diskstream()->alignment_style()) {
821 case ExistingMaterial:
822 if (!align_existing_item->get_active()) {
823 align_existing_item->set_active();
827 if (!align_capture_item->get_active()) {
828 align_capture_item->set_active();
835 RouteTimeAxisView::set_align_style (AlignStyle style)
840 case ExistingMaterial:
841 item = align_existing_item;
844 item = align_capture_item;
847 fatal << string_compose (_("programming error: %1 %2"), "illegal align style in RouteTimeAxisView::set_align_style", style) << endmsg;
852 if (item->get_active()) {
853 get_diskstream()->set_align_style (style);
858 RouteTimeAxisView::rename_current_playlist ()
860 ArdourPrompter prompter (true);
863 boost::shared_ptr<Diskstream> ds = get_diskstream();
864 if (!ds || ds->destructive())
867 boost::shared_ptr<Playlist> pl = ds->playlist();
871 prompter.set_prompt (_("Name for playlist"));
872 prompter.set_initial_text (pl->name());
873 prompter.add_button (_("Rename"), Gtk::RESPONSE_ACCEPT);
874 prompter.set_response_sensitive (Gtk::RESPONSE_ACCEPT, false);
876 switch (prompter.run ()) {
877 case Gtk::RESPONSE_ACCEPT:
878 prompter.get_result (name);
890 RouteTimeAxisView::use_copy_playlist (bool prompt)
894 boost::shared_ptr<Diskstream> ds = get_diskstream();
895 if (!ds || ds->destructive())
898 boost::shared_ptr<const Playlist> pl = ds->playlist();
905 name = Playlist::bump_name (name, _session);
906 } while (_session.playlist_by_name(name));
908 // TODO: The prompter "new" button should be de-activated if the user
909 // specifies a playlist name which already exists in the session.
913 ArdourPrompter prompter (true);
915 prompter.set_prompt (_("Name for Playlist"));
916 prompter.set_initial_text (name);
917 prompter.add_button (Gtk::Stock::NEW, Gtk::RESPONSE_ACCEPT);
918 prompter.set_response_sensitive (Gtk::RESPONSE_ACCEPT, true);
919 prompter.show_all ();
921 switch (prompter.run ()) {
922 case Gtk::RESPONSE_ACCEPT:
923 prompter.get_result (name);
932 ds->use_copy_playlist ();
933 ds->playlist()->set_name (name);
938 RouteTimeAxisView::use_new_playlist (bool prompt)
942 boost::shared_ptr<Diskstream> ds = get_diskstream();
943 if (!ds || ds->destructive())
946 boost::shared_ptr<const Playlist> pl = ds->playlist();
953 name = Playlist::bump_name (name, _session);
954 } while (_session.playlist_by_name(name));
959 ArdourPrompter prompter (true);
961 prompter.set_prompt (_("Name for Playlist"));
962 prompter.set_initial_text (name);
963 prompter.add_button (Gtk::Stock::NEW, Gtk::RESPONSE_ACCEPT);
964 prompter.set_response_sensitive (Gtk::RESPONSE_ACCEPT, true);
966 switch (prompter.run ()) {
967 case Gtk::RESPONSE_ACCEPT:
968 prompter.get_result (name);
977 ds->use_new_playlist ();
978 ds->playlist()->set_name (name);
983 RouteTimeAxisView::clear_playlist ()
985 boost::shared_ptr<Diskstream> ds = get_diskstream();
986 if (!ds || ds->destructive())
989 boost::shared_ptr<Playlist> pl = ds->playlist();
993 editor.clear_playlist (pl);
997 RouteTimeAxisView::speed_changed ()
999 Gtkmm2ext::UI::instance()->call_slot (mem_fun(*this, &RouteTimeAxisView::reset_samples_per_unit));
1003 RouteTimeAxisView::diskstream_changed ()
1005 Gtkmm2ext::UI::instance()->call_slot (mem_fun(*this, &RouteTimeAxisView::update_diskstream_display));
1009 RouteTimeAxisView::update_diskstream_display ()
1011 if (!get_diskstream()) // bus
1014 set_playlist (get_diskstream()->playlist());
1019 RouteTimeAxisView::selection_click (GdkEventButton* ev)
1021 if (Keyboard::modifier_state_equals (ev->state, (Keyboard::TertiaryModifier|Keyboard::PrimaryModifier))) {
1023 /* special case: select/deselect all tracks */
1024 if (editor.get_selection().selected (this)) {
1025 editor.get_selection().clear_tracks ();
1027 editor.select_all_tracks ();
1033 PublicEditor::TrackViewList* tracks = editor.get_valid_views (this, _route->edit_group());
1035 switch (Keyboard::selection_type (ev->state)) {
1036 case Selection::Toggle:
1037 editor.get_selection().toggle (*tracks);
1040 case Selection::Set:
1041 editor.get_selection().set (*tracks);
1044 case Selection::Extend:
1045 if (tracks->size() > 1) {
1046 /* add each one, do not "extend" */
1047 editor.get_selection().add (*tracks);
1049 /* extend to the single track */
1050 editor.extend_selection_to_track (*tracks->front());
1054 case Selection::Add:
1055 editor.get_selection().add (*tracks);
1063 RouteTimeAxisView::set_selected_points (PointSelection& points)
1065 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1066 (*i)->set_selected_points (points);
1071 RouteTimeAxisView::set_selected_regionviews (RegionSelection& regions)
1074 _view->set_selected_regionviews (regions);
1079 RouteTimeAxisView::get_selectables (nframes_t start, nframes_t end, double top, double bot, list<Selectable*>& results)
1083 if (get_diskstream() != 0) {
1084 speed = get_diskstream()->speed();
1087 nframes_t start_adjusted = session_frame_to_track_frame(start, speed);
1088 nframes_t end_adjusted = session_frame_to_track_frame(end, speed);
1090 if ((_view && ((top < 0.0 && bot < 0.0))) || touched (top, bot)) {
1091 _view->get_selectables (start_adjusted, end_adjusted, results);
1094 /* pick up visible automation tracks */
1096 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1097 if (!(*i)->hidden()) {
1098 (*i)->get_selectables (start_adjusted, end_adjusted, top, bot, results);
1104 RouteTimeAxisView::get_inverted_selectables (Selection& sel, list<Selectable*>& results)
1107 _view->get_inverted_selectables (sel, results);
1110 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1111 if (!(*i)->hidden()) {
1112 (*i)->get_inverted_selectables (sel, results);
1120 RouteTimeAxisView::edit_group() const
1122 return _route->edit_group();
1126 RouteTimeAxisView::name() const
1128 return _route->name();
1131 boost::shared_ptr<Playlist>
1132 RouteTimeAxisView::playlist () const
1134 boost::shared_ptr<Diskstream> ds;
1136 if ((ds = get_diskstream()) != 0) {
1137 return ds->playlist();
1139 return boost::shared_ptr<Playlist> ();
1144 RouteTimeAxisView::name_entry_changed ()
1148 x = name_entry.get_text ();
1150 if (x == _route->name()) {
1154 strip_whitespace_edges(x);
1156 if (x.length() == 0) {
1157 name_entry.set_text (_route->name());
1161 if (_session.route_name_unique (x)) {
1162 _route->set_name (x, this);
1164 ARDOUR_UI::instance()->popup_error (_("A track already exists with that name"));
1165 name_entry.set_text (_route->name());
1170 RouteTimeAxisView::visual_click ()
1172 popup_display_menu (0);
1176 RouteTimeAxisView::hide_click ()
1178 // LAME fix for hide_button refresh fix
1179 hide_button.set_sensitive(false);
1181 editor.hide_track_in_display (*this);
1183 hide_button.set_sensitive(true);
1186 boost::shared_ptr<Region>
1187 RouteTimeAxisView::find_next_region (nframes_t pos, RegionPoint point, int32_t dir)
1189 boost::shared_ptr<Diskstream> stream;
1190 boost::shared_ptr<Playlist> playlist;
1192 if ((stream = get_diskstream()) != 0 && (playlist = stream->playlist()) != 0) {
1193 return playlist->find_next_region (pos, point, dir);
1196 return boost::shared_ptr<Region> ();
1200 RouteTimeAxisView::find_next_region_boundary (nframes64_t pos, int32_t dir)
1202 boost::shared_ptr<Diskstream> stream;
1203 boost::shared_ptr<Playlist> playlist;
1205 if ((stream = get_diskstream()) != 0 && (playlist = stream->playlist()) != 0) {
1206 return playlist->find_next_region_boundary (pos, dir);
1213 RouteTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op)
1215 boost::shared_ptr<Playlist> what_we_got;
1216 boost::shared_ptr<Diskstream> ds = get_diskstream();
1217 boost::shared_ptr<Playlist> playlist;
1221 /* route is a bus, not a track */
1225 playlist = ds->playlist();
1227 TimeSelection time (selection.time);
1228 float speed = ds->speed();
1229 if (speed != 1.0f) {
1230 for (TimeSelection::iterator i = time.begin(); i != time.end(); ++i) {
1231 (*i).start = session_frame_to_track_frame((*i).start, speed);
1232 (*i).end = session_frame_to_track_frame((*i).end, speed);
1236 XMLNode &before = playlist->get_state();
1239 if ((what_we_got = playlist->cut (time)) != 0) {
1240 editor.get_cut_buffer().add (what_we_got);
1241 _session.add_command( new MementoCommand<Playlist>(*playlist.get(), &before, &playlist->get_state()));
1246 if ((what_we_got = playlist->copy (time)) != 0) {
1247 editor.get_cut_buffer().add (what_we_got);
1252 if ((what_we_got = playlist->cut (time)) != 0) {
1253 _session.add_command( new MementoCommand<Playlist>(*playlist, &before, &playlist->get_state()));
1254 what_we_got->release ();
1264 RouteTimeAxisView::paste (nframes_t pos, float times, Selection& selection, size_t nth)
1270 boost::shared_ptr<Playlist> playlist = get_diskstream()->playlist();
1271 PlaylistSelection::iterator p;
1273 for (p = selection.playlists.begin(); p != selection.playlists.end() && nth; ++p, --nth);
1275 if (p == selection.playlists.end()) {
1279 if (get_diskstream()->speed() != 1.0f)
1280 pos = session_frame_to_track_frame(pos, get_diskstream()->speed() );
1282 XMLNode &before = playlist->get_state();
1283 playlist->paste (*p, pos, times);
1284 _session.add_command( new MementoCommand<Playlist>(*playlist, &before, &playlist->get_state()));
1291 RouteTimeAxisView::get_child_list()
1294 list<TimeAxisView*>redirect_children;
1296 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1297 if (!(*i)->hidden()) {
1298 redirect_children.push_back(*i);
1301 return redirect_children;
1306 RouteTimeAxisView::build_playlist_menu (Gtk::Menu * menu)
1308 using namespace Menu_Helpers;
1310 if (!menu || !is_track()) {
1314 MenuList& playlist_items = menu->items();
1315 menu->set_name ("ArdourContextMenu");
1316 playlist_items.clear();
1318 if (playlist_menu) {
1319 delete playlist_menu;
1322 playlist_menu = new Menu;
1323 playlist_menu->set_name ("ArdourContextMenu");
1325 vector<boost::shared_ptr<Playlist> > playlists;
1326 boost::shared_ptr<Diskstream> ds = get_diskstream();
1327 RadioMenuItem::Group playlist_group;
1329 _session.get_playlists (playlists);
1331 for (vector<boost::shared_ptr<Playlist> >::iterator i = playlists.begin(); i != playlists.end(); ++i) {
1333 if ((*i)->get_orig_diskstream_id() == ds->id()) {
1334 playlist_items.push_back (RadioMenuElem (playlist_group, (*i)->name(), bind (mem_fun (*this, &RouteTimeAxisView::use_playlist),
1335 boost::weak_ptr<Playlist> (*i))));
1337 if (ds->playlist()->id() == (*i)->id()) {
1338 static_cast<RadioMenuItem*>(&playlist_items.back())->set_active();
1340 } else if (ds->playlist()->id() == (*i)->id()) {
1341 playlist_items.push_back (RadioMenuElem (playlist_group, (*i)->name(), bind (mem_fun (*this, &RouteTimeAxisView::use_playlist),
1342 boost::weak_ptr<Playlist>(*i))));
1343 static_cast<RadioMenuItem*>(&playlist_items.back())->set_active();
1348 playlist_items.push_back (SeparatorElem());
1349 playlist_items.push_back (MenuElem (_("Rename"), mem_fun(*this, &RouteTimeAxisView::rename_current_playlist)));
1350 playlist_items.push_back (SeparatorElem());
1352 playlist_items.push_back (MenuElem (_("New"), bind(mem_fun(editor, &PublicEditor::new_playlists), this)));
1353 playlist_items.push_back (MenuElem (_("New Copy"), bind(mem_fun(editor, &PublicEditor::copy_playlists), this)));
1354 playlist_items.push_back (SeparatorElem());
1355 playlist_items.push_back (MenuElem (_("Clear Current"), bind(mem_fun(editor, &PublicEditor::clear_playlists), this)));
1356 playlist_items.push_back (SeparatorElem());
1358 playlist_items.push_back (MenuElem(_("Select from all ..."), mem_fun(*this, &RouteTimeAxisView::show_playlist_selector)));
1362 RouteTimeAxisView::use_playlist (boost::weak_ptr<Playlist> wpl)
1364 assert (is_track());
1366 boost::shared_ptr<Playlist> pl (wpl.lock());
1372 boost::shared_ptr<AudioPlaylist> apl = boost::dynamic_pointer_cast<AudioPlaylist> (pl);
1375 get_diskstream()->use_playlist (apl);
1380 RouteTimeAxisView::show_playlist_selector ()
1382 editor.playlist_selector().show_for (this);
1386 RouteTimeAxisView::map_frozen ()
1392 ENSURE_GUI_THREAD (mem_fun(*this, &RouteTimeAxisView::map_frozen));
1394 switch (track()->freeze_state()) {
1396 playlist_button.set_sensitive (false);
1397 rec_enable_button->set_sensitive (false);
1400 playlist_button.set_sensitive (true);
1401 rec_enable_button->set_sensitive (true);
1407 RouteTimeAxisView::color_handler ()
1409 if (timestretch_rect) {
1410 timestretch_rect->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_TimeStretchOutline.get();
1413 if (timestretch_rect) {
1414 timestretch_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_TimeStretchFill.get();
1421 RouteTimeAxisView::show_all_automation ()
1425 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1426 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1427 if ((*ii)->view == 0) {
1428 add_redirect_automation_curve ((*i)->redirect, (*ii)->what);
1431 (*ii)->menu_item->set_active (true);
1437 _route->gui_changed ("visible_tracks", (void *) 0); /* EMIT_SIGNAL */
1441 RouteTimeAxisView::show_existing_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 (*ii)->menu_item->set_active (true);
1455 _route->gui_changed ("visible_tracks", (void *) 0); /* EMIT_SIGNAL */
1459 RouteTimeAxisView::hide_all_automation ()
1463 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1464 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1465 (*ii)->menu_item->set_active (false);
1470 _route->gui_changed ("visible_tracks", (void *) 0); /* EMIT_SIGNAL */
1475 RouteTimeAxisView::region_view_added (RegionView* rv)
1477 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1478 AutomationTimeAxisView* atv;
1480 if ((atv = dynamic_cast<AutomationTimeAxisView*> (*i)) != 0) {
1481 rv->add_ghost (*atv);
1487 RouteTimeAxisView::add_ghost_to_redirect (RegionView* rv, AutomationTimeAxisView* atv)
1489 rv->add_ghost (*atv);
1492 RouteTimeAxisView::RedirectAutomationInfo::~RedirectAutomationInfo ()
1494 for (vector<RedirectAutomationNode*>::iterator i = lines.begin(); i != lines.end(); ++i) {
1500 RouteTimeAxisView::RedirectAutomationNode::~RedirectAutomationNode ()
1502 parent.remove_ran (this);
1510 RouteTimeAxisView::remove_ran (RedirectAutomationNode* ran)
1513 remove_child (ran->view);
1517 RouteTimeAxisView::RedirectAutomationNode*
1518 RouteTimeAxisView::find_redirect_automation_node (boost::shared_ptr<Redirect> redirect, uint32_t what)
1520 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1522 if ((*i)->redirect == redirect) {
1524 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1525 if ((*ii)->what == what) {
1535 // FIXME: duplicated in midi_time_axis.cc
1537 legalize_for_xml_node (string str)
1539 string::size_type pos;
1540 string legal_chars = "abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_=:";
1546 while ((pos = legal.find_first_not_of (legal_chars, pos)) != string::npos) {
1547 legal.replace (pos, 1, "_");
1556 RouteTimeAxisView::add_redirect_automation_curve (boost::shared_ptr<Redirect> redirect, uint32_t what)
1558 RedirectAutomationLine* ral;
1560 RedirectAutomationNode* ran;
1562 if ((ran = find_redirect_automation_node (redirect, what)) == 0) {
1563 fatal << _("programming error: ")
1564 << string_compose (X_("redirect automation curve for %1:%2 not registered with audio track!"),
1565 redirect->name(), what)
1575 name = redirect->describe_parameter (what);
1577 /* create a string that is a legal XML node name that can be used to refer to this redirect+port combination */
1579 char state_name[256];
1580 snprintf (state_name, sizeof (state_name), "Redirect-%s-%" PRIu32, legalize_for_xml_node (redirect->name()).c_str(), what);
1582 ran->view = new RedirectAutomationTimeAxisView (_session, _route, editor, *this, parent_canvas, name, what, *redirect, state_name);
1584 ral = new RedirectAutomationLine (name,
1585 *redirect, what, _session, *ran->view,
1586 *ran->view->canvas_display, redirect->automation_list (what));
1588 ral->set_line_color (ARDOUR_UI::config()->canvasvar_RedirectAutomationLine.get());
1589 ral->queue_reset ();
1591 ran->view->add_line (*ral);
1593 ran->view->Hiding.connect (bind (mem_fun(*this, &RouteTimeAxisView::redirect_automation_track_hidden), ran, redirect));
1595 if (!ran->view->marked_for_display()) {
1598 ran->menu_item->set_active (true);
1601 add_child (ran->view);
1604 _view->foreach_regionview (bind (mem_fun(*this, &RouteTimeAxisView::add_ghost_to_redirect), ran->view));
1607 redirect->mark_automation_visible (what, true);
1611 RouteTimeAxisView::redirect_automation_track_hidden (RouteTimeAxisView::RedirectAutomationNode* ran, boost::shared_ptr<Redirect> r)
1614 ran->menu_item->set_active (false);
1617 r->mark_automation_visible (ran->what, false);
1619 _route->gui_changed ("visible_tracks", (void *) 0); /* EMIT_SIGNAL */
1623 RouteTimeAxisView::add_existing_redirect_automation_curves (boost::shared_ptr<Redirect> redirect)
1626 RedirectAutomationLine *ral;
1628 redirect->what_has_visible_automation (s);
1630 for (set<uint32_t>::iterator i = s.begin(); i != s.end(); ++i) {
1632 if ((ral = find_redirect_automation_curve (redirect, *i)) != 0) {
1633 ral->queue_reset ();
1635 add_redirect_automation_curve (redirect, (*i));
1641 RouteTimeAxisView::add_redirect_to_subplugin_menu (boost::shared_ptr<Redirect> r)
1643 using namespace Menu_Helpers;
1644 RedirectAutomationInfo *rai;
1645 list<RedirectAutomationInfo*>::iterator x;
1647 const std::set<uint32_t>& automatable = r->what_can_be_automated ();
1648 std::set<uint32_t> has_visible_automation;
1650 r->what_has_visible_automation(has_visible_automation);
1652 if (automatable.empty()) {
1656 for (x = redirect_automation.begin(); x != redirect_automation.end(); ++x) {
1657 if ((*x)->redirect == r) {
1662 if (x == redirect_automation.end()) {
1664 rai = new RedirectAutomationInfo (r);
1665 redirect_automation.push_back (rai);
1673 /* any older menu was deleted at the top of redirects_changed()
1674 when we cleared the subplugin menu.
1677 rai->menu = manage (new Menu);
1678 MenuList& items = rai->menu->items();
1679 rai->menu->set_name ("ArdourContextMenu");
1683 for (std::set<uint32_t>::const_iterator i = automatable.begin(); i != automatable.end(); ++i) {
1685 RedirectAutomationNode* ran;
1686 CheckMenuItem* mitem;
1688 string name = r->describe_parameter (*i);
1690 items.push_back (CheckMenuElem (name));
1691 mitem = dynamic_cast<CheckMenuItem*> (&items.back());
1693 if (has_visible_automation.find((*i)) != has_visible_automation.end()) {
1694 mitem->set_active(true);
1697 if ((ran = find_redirect_automation_node (r, *i)) == 0) {
1701 ran = new RedirectAutomationNode (*i, mitem, *this);
1703 rai->lines.push_back (ran);
1707 ran->menu_item = mitem;
1711 mitem->signal_toggled().connect (bind (mem_fun(*this, &RouteTimeAxisView::redirect_menu_item_toggled), rai, ran));
1714 /* add the menu for this redirect, because the subplugin
1715 menu is always cleared at the top of redirects_changed().
1716 this is the result of some poor design in gtkmm and/or
1720 subplugin_menu.items().push_back (MenuElem (r->name(), *rai->menu));
1725 RouteTimeAxisView::redirect_menu_item_toggled (RouteTimeAxisView::RedirectAutomationInfo* rai,
1726 RouteTimeAxisView::RedirectAutomationNode* ran)
1728 bool showit = ran->menu_item->get_active();
1729 bool redraw = false;
1731 if (ran->view == 0 && showit) {
1732 add_redirect_automation_curve (rai->redirect, ran->what);
1736 if (showit != ran->view->marked_for_display()) {
1739 ran->view->set_marked_for_display (true);
1740 ran->view->canvas_display->show();
1742 rai->redirect->mark_automation_visible (ran->what, true);
1743 ran->view->set_marked_for_display (false);
1751 if (redraw && !no_redraw) {
1753 /* now trigger a redisplay */
1755 _route->gui_changed ("visible_tracks", (void *) 0); /* EMIT_SIGNAL */
1761 RouteTimeAxisView::redirects_changed (void *src)
1763 using namespace Menu_Helpers;
1765 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1766 (*i)->valid = false;
1769 subplugin_menu.items().clear ();
1771 _route->foreach_redirect (this, &RouteTimeAxisView::add_redirect_to_subplugin_menu);
1772 _route->foreach_redirect (this, &RouteTimeAxisView::add_existing_redirect_automation_curves);
1774 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ) {
1776 list<RedirectAutomationInfo*>::iterator tmp;
1784 redirect_automation.erase (i);
1791 /* change in visibility was possible */
1793 _route->gui_changed ("visible_tracks", this);
1796 RedirectAutomationLine *
1797 RouteTimeAxisView::find_redirect_automation_curve (boost::shared_ptr<Redirect> redirect, uint32_t what)
1799 RedirectAutomationNode* ran;
1801 if ((ran = find_redirect_automation_node (redirect, what)) != 0) {
1803 return dynamic_cast<RedirectAutomationLine*> (ran->view->lines.front());
1811 RouteTimeAxisView::reset_redirect_automation_curves ()
1813 for (vector<RedirectAutomationLine*>::iterator i = redirect_automation_curves.begin(); i != redirect_automation_curves.end(); ++i) {
1819 RouteTimeAxisView::update_rec_display ()
1821 RouteUI::update_rec_display ();
1822 name_entry.set_sensitive (!_route->record_enabled());
1826 RouteTimeAxisView::fast_update ()
1828 lm.update_meters ();
1832 RouteTimeAxisView::hide_meter ()
1839 RouteTimeAxisView::show_meter ()
1845 RouteTimeAxisView::reset_meter ()
1847 if (Config->get_show_track_meters()) {
1848 lm.setup_meters (height-5);
1855 RouteTimeAxisView::clear_meter ()
1861 RouteTimeAxisView::meter_changed (void *src)
1863 ENSURE_GUI_THREAD (bind (mem_fun(*this, &RouteTimeAxisView::meter_changed), src));
1868 RouteTimeAxisView::io_changed (IOChange change, void *src)
1874 RouteTimeAxisView::start_gain_touch (GdkEventButton* ev)
1876 _route->start_gain_touch ();
1881 RouteTimeAxisView::end_gain_touch (GdkEventButton* ev)
1883 _route->end_gain_touch ();
1888 RouteTimeAxisView::gain_adjusted ()
1890 if (ignore_gain_adjustment) {
1894 _route->set_gain (slider_position_to_gain (gain_adjustment.get_value()), this);
1898 RouteTimeAxisView::gain_changed (void *src)
1900 Gtkmm2ext::UI::instance()->call_slot (mem_fun(*this, &RouteTimeAxisView::effective_gain_display));
1904 RouteTimeAxisView::effective_gain_display ()
1906 gfloat value = gain_to_slider_position (_route->effective_gain());
1907 ignore_gain_adjustment = true;
1908 gain_adjustment.set_value (value);
1909 ignore_gain_adjustment = false;