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.
28 #include <sigc++/bind.h>
30 #include <pbd/error.h>
31 #include <pbd/stl_delete.h>
33 #include <gtkmm2ext/utils.h>
34 #include <gtkmm2ext/selector.h>
35 #include <gtkmm2ext/gtk_ui.h>
36 #include <gtkmm2ext/stop_signal.h>
37 #include <gtkmm2ext/bindable_button.h>
39 #include <ardour/session.h>
40 #include <ardour/session_playlist.h>
41 #include <ardour/audioplaylist.h>
42 #include <ardour/diskstream.h>
43 #include <ardour/utils.h>
44 #include <ardour/playlist.h>
45 #include <ardour/ladspa_plugin.h>
46 #include <ardour/insert.h>
47 #include <ardour/location.h>
48 #include <ardour/panner.h>
50 #include "ardour_ui.h"
51 #include "public_editor.h"
52 #include "audio_time_axis.h"
53 #include "streamview.h"
54 #include "simplerect.h"
55 #include "playlist_selector.h"
56 #include "plugin_selector.h"
57 #include "plugin_ui.h"
58 #include "regionview.h"
59 #include "automation_gain_line.h"
60 #include "automation_pan_line.h"
61 #include "automation_time_axis.h"
62 #include "redirect_automation_time_axis.h"
63 #include "gain_automation_time_axis.h"
64 #include "pan_automation_time_axis.h"
65 #include "redirect_automation_line.h"
66 #include "selection.h"
67 #include "point_selection.h"
71 #include "rgb_macros.h"
73 #include "crossfade_view.h"
74 #include "gui_thread.h"
75 #include "canvas_impl.h"
77 #include <ardour/audio_track.h>
81 using namespace ARDOUR;
82 //using namespace sigc;
83 using namespace LADSPA;
85 using namespace Editing;
87 static const gchar * small_x_xpm[] = {
103 AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, Route& rt, Canvas& canvas)
105 RouteUI(rt, sess, _("m"), _("s"), _("r")), // mute, solo, and record
106 TimeAxisView(sess,ed,(TimeAxisView*) 0, canvas),
107 parent_canvas (canvas),
109 edit_group_button (_("g")), // group
110 playlist_button (_("p")),
111 size_button (_("h")), // height
112 automation_button (_("a")),
113 visual_button (_("v"))
117 subplugin_menu.set_name ("ArdourContextMenu");
119 playlist_action_menu = 0;
120 automation_action_menu = 0;
124 timestretch_rect = 0;
126 pan_automation_item = 0;
127 gain_automation_item = 0;
130 view = new StreamView (*this);
132 add_gain_automation_child ();
133 add_pan_automation_child ();
135 ignore_toggle = false;
137 rec_enable_button->set_active (false);
138 mute_button->set_active (false);
139 solo_button->set_active (false);
141 rec_enable_button->set_name ("TrackRecordEnableButton");
142 mute_button->set_name ("TrackMuteButton");
143 solo_button->set_name ("SoloButton");
144 edit_group_button.set_name ("TrackGroupButton");
145 playlist_button.set_name ("TrackPlaylistButton");
146 automation_button.set_name ("TrackAutomationButton");
147 size_button.set_name ("TrackSizeButton");
148 visual_button.set_name ("TrackVisualButton");
149 hide_button.set_name ("TrackRemoveButton");
151 hide_button.add (*(manage (new Image (Gdk::Pixbuf::create_from_xpm_data(small_x_xpm)))));
153 _route.mute_changed.connect (mem_fun(*this, &RouteUI::mute_changed));
154 _route.solo_changed.connect (mem_fun(*this, &RouteUI::solo_changed));
155 _route.solo_safe_changed.connect (mem_fun(*this, &RouteUI::solo_changed));
157 _route.panner().Changed.connect (mem_fun(*this, &AudioTimeAxisView::update_pans));
159 solo_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::solo_press));
160 solo_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::solo_release));
161 mute_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::mute_press));
162 mute_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::mute_release));
163 rec_enable_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::rec_enable_press));
164 edit_group_button.signal_button_release_event().connect (mem_fun(*this, &AudioTimeAxisView::edit_click), false);
165 playlist_button.signal_clicked().connect (mem_fun(*this, &AudioTimeAxisView::playlist_click));
166 automation_button.signal_clicked().connect (mem_fun(*this, &AudioTimeAxisView::automation_click));
167 size_button.signal_button_release_event().connect (mem_fun(*this, &AudioTimeAxisView::size_click), false);
168 visual_button.signal_clicked().connect (mem_fun(*this, &AudioTimeAxisView::visual_click));
169 hide_button.signal_clicked().connect (mem_fun(*this, &AudioTimeAxisView::hide_click));
171 if (is_audio_track()) {
172 controls_table.attach (*rec_enable_button, 6, 7, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
174 controls_table.attach (*mute_button, 7, 8, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
175 controls_table.attach (*solo_button, 8, 9, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::FILL|Gtk::EXPAND, 0, 0);
177 controls_table.attach (edit_group_button, 7, 8, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
179 ARDOUR_UI::instance()->tooltips().set_tip(*rec_enable_button, _("Record"));
180 ARDOUR_UI::instance()->tooltips().set_tip(*solo_button,_("Solo"));
181 ARDOUR_UI::instance()->tooltips().set_tip(*mute_button,_("Mute"));
182 ARDOUR_UI::instance()->tooltips().set_tip(edit_group_button,_("Edit Group"));
183 ARDOUR_UI::instance()->tooltips().set_tip(size_button,_("Display Height"));
184 ARDOUR_UI::instance()->tooltips().set_tip(playlist_button,_("Playlist"));
185 ARDOUR_UI::instance()->tooltips().set_tip(automation_button, _("Automation"));
186 ARDOUR_UI::instance()->tooltips().set_tip(visual_button, _("Visual options"));
187 ARDOUR_UI::instance()->tooltips().set_tip(hide_button, _("Hide this track"));
191 controls_table.attach (hide_button, 0, 1, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
192 controls_table.attach (visual_button, 1, 2, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
193 controls_table.attach (size_button, 2, 3, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
194 controls_table.attach (automation_button, 3, 4, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
196 if (is_audio_track()) {
197 controls_table.attach (playlist_button, 6, 7, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
201 /* remove focus from the buttons */
203 automation_button.unset_flags (Gtk::CAN_FOCUS);
204 solo_button->unset_flags (Gtk::CAN_FOCUS);
205 mute_button->unset_flags (Gtk::CAN_FOCUS);
206 edit_group_button.unset_flags (Gtk::CAN_FOCUS);
207 size_button.unset_flags (Gtk::CAN_FOCUS);
208 playlist_button.unset_flags (Gtk::CAN_FOCUS);
209 hide_button.unset_flags (Gtk::CAN_FOCUS);
210 visual_button.unset_flags (Gtk::CAN_FOCUS);
212 /* map current state of the route */
214 update_diskstream_display ();
217 redirects_changed (0);
218 reset_redirect_automation_curves ();
223 set_state (*xml_node);
225 _route.mute_changed.connect (mem_fun(*this, &RouteUI::mute_changed));
226 _route.solo_changed.connect (mem_fun(*this, &RouteUI::solo_changed));
227 _route.redirects_changed.connect (mem_fun(*this, &AudioTimeAxisView::redirects_changed));
229 _route.name_changed.connect (mem_fun(*this, &AudioTimeAxisView::route_name_changed));
231 if (is_audio_track()) {
235 audio_track()->FreezeChange.connect (mem_fun(*this, &AudioTimeAxisView::map_frozen));
237 audio_track()->diskstream_changed.connect (mem_fun(*this, &AudioTimeAxisView::diskstream_changed));
238 get_diskstream()->speed_changed.connect (mem_fun(*this, &AudioTimeAxisView::speed_changed));
240 controls_ebox.set_name ("AudioTrackControlsBaseUnselected");
241 controls_base_selected_name = "AudioTrackControlsBaseSelected";
242 controls_base_unselected_name = "AudioTrackControlsBaseUnselected";
244 /* ask for notifications of any new RegionViews */
246 view->AudioRegionViewAdded.connect (mem_fun(*this, &AudioTimeAxisView::region_view_added));
250 /* pick up the correct freeze state */
258 controls_ebox.set_name ("BusControlsBaseUnselected");
259 controls_base_selected_name = "BusControlsBaseSelected";
260 controls_base_unselected_name = "BusControlsBaseUnselected";
263 editor.ZoomChanged.connect (mem_fun(*this, &AudioTimeAxisView::reset_samples_per_unit));
266 AudioTimeAxisView::~AudioTimeAxisView ()
268 GoingAway (); /* EMIT_SIGNAL */
271 delete playlist_menu;
275 if (playlist_action_menu) {
276 delete playlist_action_menu;
277 playlist_action_menu = 0;
280 vector_delete (&redirect_automation_curves);
282 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
293 AudioTimeAxisView::show_at (double y, int& nth, Gtk::VBox *parent)
296 xml_node->add_property ("shown_editor", "yes");
298 return TimeAxisView::show_at (y, nth, parent);
302 AudioTimeAxisView::hide ()
305 xml_node->add_property ("shown_editor", "no");
307 TimeAxisView::hide ();
311 AudioTimeAxisView::set_playlist (AudioPlaylist *newplaylist)
315 modified_connection.disconnect ();
316 state_changed_connection.disconnect ();
318 if ((pl = dynamic_cast<AudioPlaylist*> (playlist())) != 0) {
319 state_changed_connection = pl->StateChanged.connect (mem_fun(*this, &AudioTimeAxisView::playlist_state_changed));
320 modified_connection = pl->Modified.connect (mem_fun(*this, &AudioTimeAxisView::playlist_modified));
325 AudioTimeAxisView::playlist_modified ()
330 AudioTimeAxisView::edit_click (GdkEventButton *ev)
332 if (Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) {
333 _route.set_edit_group (0, this);
337 using namespace Menu_Helpers;
339 MenuList& items = edit_group_menu.items ();
342 items.push_back (RadioMenuElem (edit_group_menu_radio_group, _("No group"),
343 bind (mem_fun(*this, &AudioTimeAxisView::set_edit_group_from_menu), (RouteGroup *) 0)));
345 if (_route.edit_group() == 0) {
346 static_cast<RadioMenuItem*>(&items.back())->set_active ();
349 _session.foreach_edit_group (this, &AudioTimeAxisView::add_edit_group_menu_item);
350 edit_group_menu.popup (ev->button, ev->time);
356 AudioTimeAxisView::add_edit_group_menu_item (RouteGroup *eg)
358 using namespace Menu_Helpers;
360 MenuList &items = edit_group_menu.items();
361 items.push_back (RadioMenuElem (edit_group_menu_radio_group,
362 eg->name(), bind (mem_fun(*this, &AudioTimeAxisView::set_edit_group_from_menu), eg)));
363 if (_route.edit_group() == eg) {
364 static_cast<RadioMenuItem*>(&items.back())->set_active ();
369 AudioTimeAxisView::set_edit_group_from_menu (RouteGroup *eg)
372 _route.set_edit_group (eg, this);
376 AudioTimeAxisView::playlist_state_changed (Change ignored)
378 // ENSURE_GUI_THREAD (bind (mem_fun(*this, &AudioTimeAxisView::playlist_state_changed), ignored));
383 AudioTimeAxisView::playlist_changed ()
388 if (is_audio_track()) {
389 set_playlist (get_diskstream()->playlist());
394 AudioTimeAxisView::label_view ()
396 string x = _route.name();
398 if (x != name_entry.get_text()) {
399 name_entry.set_text (x);
402 ARDOUR_UI::instance()->tooltips().set_tip (name_entry, x);
406 AudioTimeAxisView::route_name_changed (void *src)
408 editor.route_name_changed (this);
413 AudioTimeAxisView::take_name_changed (void *src)
422 AudioTimeAxisView::playlist_click ()
424 // always build a new action menu
426 if (playlist_action_menu == 0) {
427 playlist_action_menu = new Menu;
428 playlist_action_menu->set_name ("ArdourContextMenu");
431 build_playlist_menu(playlist_action_menu);
433 playlist_action_menu->popup (1, 0);
437 AudioTimeAxisView::automation_click ()
439 if (automation_action_menu == 0) {
440 /* this seems odd, but the automation action
441 menu is built as part of the display menu.
443 build_display_menu ();
445 automation_action_menu->popup (1, 0);
449 AudioTimeAxisView::show_timestretch (jack_nframes_t start, jack_nframes_t end)
455 TimeAxisView::show_timestretch (start, end);
465 /* check that the time selection was made in our route, or our edit group.
466 remember that edit_group() == 0 implies the route is *not* in a edit group.
469 if (!(ts.track == this || (ts.group != 0 && ts.group == _route.edit_group()))) {
470 /* this doesn't apply to us */
474 /* ignore it if our edit group is not active */
476 if ((ts.track != this) && _route.edit_group() && !_route.edit_group()->is_active()) {
481 if (timestretch_rect == 0) {
482 timestretch_rect = new SimpleRect (*canvas_display);
483 timestretch_rect->property_x1() = 0.0;
484 timestretch_rect->property_y1() = 0.0;
485 timestretch_rect->property_x2() = 0.0;
486 timestretch_rect->property_y2() = 0.0;
487 timestretch_rect->property_fill_color_rgba() = color_map[cTimeStretchFill];
488 timestretch_rect->property_outline_color_rgba() = color_map[cTimeStretchOutline];
491 timestretch_rect->show ();
492 timestretch_rect->raise_to_top ();
494 x1 = start / editor.get_current_zoom();
495 x2 = (end - 1) / editor.get_current_zoom();
498 timestretch_rect->property_x1() = x1;
499 timestretch_rect->property_y1() = 1.0;
500 timestretch_rect->property_x2() = x2;
501 timestretch_rect->property_y2() = y2;
505 AudioTimeAxisView::hide_timestretch ()
507 TimeAxisView::hide_timestretch ();
509 if (timestretch_rect) {
510 timestretch_rect->hide ();
515 AudioTimeAxisView::show_selection (TimeSelection& ts)
519 /* ignore it if our edit group is not active or if the selection was started
520 in some other track or edit group (remember that edit_group() == 0 means
521 that the track is not in an edit group).
524 if (((ts.track != this && !is_child (ts.track)) && _route.edit_group() && !_route.edit_group()->is_active()) ||
525 (!(ts.track == this || is_child (ts.track) || (ts.group != 0 && ts.group == _route.edit_group())))) {
531 TimeAxisView::show_selection (ts);
535 AudioTimeAxisView::set_state (const XMLNode& node)
537 const XMLProperty *prop;
539 TimeAxisView::set_state (node);
541 if ((prop = node.property ("shown_editor")) != 0) {
542 if (prop->value() == "no") {
543 _marked_for_display = false;
545 _marked_for_display = true;
548 _marked_for_display = true;
551 XMLNodeList nlist = node.children();
552 XMLNodeConstIterator niter;
556 show_gain_automation = false;
557 show_pan_automation = false;
559 for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
562 if (child_node->name() == "gain") {
563 XMLProperty *prop=child_node->property ("shown");
566 if (prop->value() == "yes") {
567 show_gain_automation = true;
573 if (child_node->name() == "pan") {
574 XMLProperty *prop=child_node->property ("shown");
577 if (prop->value() == "yes") {
578 show_pan_automation = true;
587 AudioTimeAxisView::set_height (TrackHeight h)
589 bool height_changed = (h != (TrackHeight)height);
591 TimeAxisView::set_height (h);
595 view->set_height ((double) height);
599 xml_node->add_property ("track_height", "largest");
600 controls_table.show_all ();
604 xml_node->add_property ("track_height", "large");
605 controls_table.show_all ();
609 xml_node->add_property ("track_height", "larger");
610 controls_table.show_all ();
614 xml_node->add_property ("track_height", "normal");
615 controls_table.show_all ();
619 xml_node->add_property ("track_height", "smaller");
620 controls_table.show_all ();
622 edit_group_button.hide ();
624 visual_button.hide ();
626 automation_button.hide ();
627 playlist_button.hide ();
630 xml_node->add_property ("track_height", "small");
631 controls_table.hide_all ();
632 controls_table.show ();
633 name_label.set_text (_route.name());
639 if (height_changed) {
640 /* only emit the signal if the height really changed */
641 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
646 AudioTimeAxisView::select_track_color ()
648 if (RouteUI::choose_color ()) {
651 view->apply_color (_color, StreamView::RegionColor);
657 AudioTimeAxisView::reset_redirect_automation_curves ()
659 for (vector<RedirectAutomationLine*>::iterator i = redirect_automation_curves.begin(); i != redirect_automation_curves.end(); ++i) {
665 AudioTimeAxisView::reset_samples_per_unit ()
667 set_samples_per_unit (editor.get_current_zoom());
671 AudioTimeAxisView::set_samples_per_unit (double spu)
675 if (get_diskstream() != 0) {
676 speed = get_diskstream()->speed();
680 view->set_samples_per_unit (spu * speed);
683 TimeAxisView::set_samples_per_unit (spu * speed);
687 AudioTimeAxisView::build_display_menu ()
689 using namespace Menu_Helpers;
691 /* get the size menu ready */
697 TimeAxisView::build_display_menu ();
699 /* now fill it with our stuff */
701 MenuList& items = display_menu->items();
702 display_menu->set_name ("ArdourContextMenu");
704 items.push_back (MenuElem (_("Height"), *size_menu));
705 items.push_back (MenuElem (_("Color"), mem_fun(*this, &AudioTimeAxisView::select_track_color)));
708 items.push_back (SeparatorElem());
709 items.push_back (MenuElem (_("Hide all crossfades"), mem_fun(*this, &AudioTimeAxisView::hide_all_xfades)));
710 items.push_back (MenuElem (_("Show all crossfades"), mem_fun(*this, &AudioTimeAxisView::show_all_xfades)));
711 items.push_back (SeparatorElem());
714 automation_action_menu = manage (new Menu);
715 MenuList& automation_items = automation_action_menu->items();
716 automation_action_menu->set_name ("ArdourContextMenu");
718 automation_items.push_back (MenuElem (_("show all automation"),
719 mem_fun(*this, &AudioTimeAxisView::show_all_automation)));
721 automation_items.push_back (MenuElem (_("show existing automation"),
722 mem_fun(*this, &AudioTimeAxisView::show_existing_automation)));
724 automation_items.push_back (MenuElem (_("hide all automation"),
725 mem_fun(*this, &AudioTimeAxisView::hide_all_automation)));
727 automation_items.push_back (SeparatorElem());
729 automation_items.push_back (CheckMenuElem (_("gain"),
730 mem_fun(*this, &AudioTimeAxisView::toggle_gain_track)));
731 gain_automation_item = static_cast<CheckMenuItem*> (&automation_items.back());
732 gain_automation_item->set_active(show_gain_automation);
734 automation_items.push_back (CheckMenuElem (_("pan"),
735 mem_fun(*this, &AudioTimeAxisView::toggle_pan_track)));
736 pan_automation_item = static_cast<CheckMenuItem*> (&automation_items.back());
737 pan_automation_item->set_active(show_pan_automation);
739 automation_items.push_back (MenuElem (_("Plugins"), subplugin_menu));
741 items.push_back (MenuElem (_("Automation"), *automation_action_menu));
743 Menu *waveform_menu = manage(new Menu);
744 MenuList& waveform_items = waveform_menu->items();
745 waveform_menu->set_name ("ArdourContextMenu");
747 waveform_items.push_back (CheckMenuElem (_("Show waveforms"), mem_fun(*this, &AudioTimeAxisView::toggle_waveforms)));
748 waveform_item = static_cast<CheckMenuItem *> (&waveform_items.back());
749 ignore_toggle = true;
750 waveform_item->set_active (editor.show_waveforms());
751 ignore_toggle = false;
753 RadioMenuItem::Group group;
755 waveform_items.push_back (RadioMenuElem (group, _("Traditional"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_shape), Traditional)));
756 traditional_item = static_cast<RadioMenuItem *> (&waveform_items.back());
758 waveform_items.push_back (RadioMenuElem (group, _("Rectified"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_shape), Rectified)));
759 rectified_item = static_cast<RadioMenuItem *> (&waveform_items.back());
761 items.push_back (MenuElem (_("Waveform"), *waveform_menu));
763 if (is_audio_track()) {
765 Menu* alignment_menu = manage (new Menu);
766 MenuList& alignment_items = alignment_menu->items();
767 alignment_menu->set_name ("ArdourContextMenu");
769 RadioMenuItem::Group align_group;
771 alignment_items.push_back (RadioMenuElem (align_group, _("align with existing material"), bind (mem_fun(*this, &AudioTimeAxisView::set_align_style), ExistingMaterial)));
772 align_existing_item = dynamic_cast<RadioMenuItem*>(&alignment_items.back());
773 if (get_diskstream()->alignment_style() == ExistingMaterial) {
774 align_existing_item->set_active();
776 alignment_items.push_back (RadioMenuElem (align_group, _("align with capture time"), bind (mem_fun(*this, &AudioTimeAxisView::set_align_style), CaptureTime)));
777 align_capture_item = dynamic_cast<RadioMenuItem*>(&alignment_items.back());
778 if (get_diskstream()->alignment_style() == CaptureTime) {
779 align_capture_item->set_active();
782 items.push_back (MenuElem (_("Alignment"), *alignment_menu));
784 get_diskstream()->AlignmentStyleChanged.connect (mem_fun(*this, &AudioTimeAxisView::align_style_changed));
787 items.push_back (SeparatorElem());
788 items.push_back (CheckMenuElem (_("Active"), mem_fun(*this, &RouteUI::toggle_route_active)));
789 route_active_menu_item = dynamic_cast<CheckMenuItem *> (&items.back());
790 route_active_menu_item->set_active (_route.active());
792 items.push_back (SeparatorElem());
793 items.push_back (MenuElem (_("Remove"), mem_fun(*this, &RouteUI::remove_this_route)));
798 AudioTimeAxisView::align_style_changed ()
800 switch (get_diskstream()->alignment_style()) {
801 case ExistingMaterial:
802 if (!align_existing_item->get_active()) {
803 align_existing_item->set_active();
807 if (!align_capture_item->get_active()) {
808 align_capture_item->set_active();
815 AudioTimeAxisView::set_align_style (AlignStyle style)
817 get_diskstream()->set_align_style (style);
821 AudioTimeAxisView::rename_current_playlist ()
823 ArdourPrompter prompter (true);
829 if (((ds = get_diskstream()) == 0) ||((pl = ds->playlist()) == 0)) {
833 prompter.set_prompt (_("Name for playlist"));
834 prompter.set_initial_text (pl->name());
836 switch (prompter.run ()) {
837 case GTK_RESPONSE_ACCEPT:
838 prompter.get_result (name);
848 AudioTimeAxisView::playlist_selected (AudioPlaylist *pl)
852 if ((ds = get_diskstream()) != 0) {
853 ds->use_playlist (pl);
858 AudioTimeAxisView::use_copy_playlist ()
864 if (((ds = get_diskstream()) == 0) || ((pl = ds->playlist()) == 0)) {
868 ArdourPrompter prompter (true);
869 string new_name = Playlist::bump_name (pl->name(), _session);
871 prompter.set_prompt (_("Name for playlist"));
872 prompter.set_initial_text (new_name);
873 prompter.show_all ();
875 switch (prompter.run ()) {
876 case GTK_RESPONSE_ACCEPT:
877 prompter.get_result (name);
878 ds->use_copy_playlist ();
889 AudioTimeAxisView::use_new_playlist ()
895 if (((ds = get_diskstream()) == 0) || ((pl = ds->playlist()) == 0)) {
899 ArdourPrompter prompter (true);
900 string new_name = Playlist::bump_name (pl->name(), _session);
902 prompter.set_prompt (_("Name for playlist"));
903 prompter.set_initial_text (new_name);
905 switch (prompter.run ()) {
906 case GTK_RESPONSE_ACCEPT:
907 prompter.get_result (name);
908 ds->use_new_playlist ();
919 AudioTimeAxisView::clear_playlist ()
924 if ((ds = get_diskstream()) != 0) {
925 if ((pl = ds->playlist()) != 0) {
926 editor.clear_playlist (*pl);
932 AudioTimeAxisView::toggle_waveforms ()
934 if (view && waveform_item && !ignore_toggle) {
935 view->set_show_waveforms (waveform_item->get_active());
940 AudioTimeAxisView::set_show_waveforms (bool yn)
943 waveform_item->set_active (yn);
945 view->set_show_waveforms (yn);
950 AudioTimeAxisView::set_show_waveforms_recording (bool yn)
953 view->set_show_waveforms_recording (yn);
958 AudioTimeAxisView::set_waveform_shape (WaveformShape shape)
961 view->set_waveform_shape (shape);
966 AudioTimeAxisView::speed_changed ()
968 Gtkmm2ext::UI::instance()->call_slot (mem_fun(*this, &AudioTimeAxisView::reset_samples_per_unit));
972 AudioTimeAxisView::diskstream_changed (void *src)
974 Gtkmm2ext::UI::instance()->call_slot (mem_fun(*this, &AudioTimeAxisView::update_diskstream_display));
978 AudioTimeAxisView::update_diskstream_display ()
982 if ((ds = get_diskstream()) != 0) {
983 set_playlist (ds->playlist ());
990 AudioTimeAxisView::selection_click (GdkEventButton* ev)
992 PublicEditor::TrackViewList* tracks = editor.get_valid_views (this, _route.edit_group());
994 if (Keyboard::modifier_state_contains (ev->state, Keyboard::Shift)) {
995 if (editor.get_selection().selected (this)) {
996 editor.get_selection().remove (*tracks);
998 editor.get_selection().add (*tracks);
1001 editor.get_selection().set (*tracks);
1008 AudioTimeAxisView::set_selected_regionviews (AudioRegionSelection& regions)
1011 view->set_selected_regionviews (regions);
1016 AudioTimeAxisView::set_selected_points (PointSelection& points)
1018 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1019 (*i)->set_selected_points (points);
1024 AudioTimeAxisView::get_selectables (jack_nframes_t start, jack_nframes_t end, double top, double bot, list<Selectable*>& results)
1028 if (get_diskstream() != 0) {
1029 speed = get_diskstream()->speed();
1032 jack_nframes_t start_adjusted = session_frame_to_track_frame(start, speed);
1033 jack_nframes_t end_adjusted = session_frame_to_track_frame(end, speed);
1035 if (view && touched (top, bot)) {
1036 view->get_selectables (start_adjusted, end_adjusted, results);
1039 /* pick up visible automation tracks */
1041 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1042 if (!(*i)->hidden()) {
1043 (*i)->get_selectables (start_adjusted, end_adjusted, top, bot, results);
1049 AudioTimeAxisView::get_inverted_selectables (Selection& sel, list<Selectable*>& results)
1052 view->get_inverted_selectables (sel, results);
1055 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1056 if (!(*i)->hidden()) {
1057 (*i)->get_inverted_selectables (sel, results);
1065 AudioTimeAxisView::edit_group() const
1067 return _route.edit_group();
1071 AudioTimeAxisView::name() const
1073 return _route.name();
1077 AudioTimeAxisView::playlist () const
1081 if ((ds = get_diskstream()) != 0) {
1082 return ds->playlist();
1089 AudioTimeAxisView::name_entry_changed ()
1093 x = name_entry.get_text ();
1095 if (x == _route.name()) {
1099 if (x.length() == 0) {
1100 name_entry.set_text (_route.name());
1104 strip_whitespace_edges(x);
1106 if (_session.route_name_unique (x)) {
1107 _route.set_name (x, this);
1109 ARDOUR_UI::instance()->popup_error (_("a track already exists with that name"));
1110 name_entry.set_text (_route.name());
1115 AudioTimeAxisView::visual_click ()
1117 popup_display_menu (0);
1121 AudioTimeAxisView::hide_click ()
1123 editor.hide_track_in_display (*this);
1127 AudioTimeAxisView::find_next_region (jack_nframes_t pos, RegionPoint point, int32_t dir)
1130 AudioPlaylist *playlist;
1132 if ((stream = get_diskstream()) != 0 && (playlist = stream->playlist()) != 0) {
1133 return playlist->find_next_region (pos, point, dir);
1140 AudioTimeAxisView::add_gain_automation_child ()
1143 AutomationLine* line;
1145 gain_track = new GainAutomationTimeAxisView (_session,
1151 _route.gain_automation_curve());
1153 line = new AutomationGainLine ("automation gain",
1156 *gain_track->canvas_display,
1157 _route.gain_automation_curve());
1159 line->set_line_color (color_map[cAutomationLine]);
1162 gain_track->add_line (*line);
1164 add_child (gain_track);
1166 gain_track->Hiding.connect (mem_fun(*this, &AudioTimeAxisView::gain_hidden));
1172 if ((node = gain_track->get_state_node()) != 0) {
1173 if ((prop = node->property ("shown")) != 0) {
1174 if (prop->value() == "yes") {
1181 gain_track->hide ();
1186 AudioTimeAxisView::add_pan_automation_child ()
1190 pan_track = new PanAutomationTimeAxisView (_session, _route, editor, *this, parent_canvas, _("pan"));
1194 add_child (pan_track);
1196 pan_track->Hiding.connect (mem_fun(*this, &AudioTimeAxisView::pan_hidden));
1203 if ((node = pan_track->get_state_node()) != 0) {
1204 if ((prop = node->property ("shown")) != 0) {
1205 if (prop->value() == "yes") {
1217 AudioTimeAxisView::update_pans ()
1221 pan_track->clear_lines ();
1223 /* we don't draw lines for "greater than stereo" panning.
1226 if (_route.n_outputs() > 2) {
1230 for (p = _route.panner().begin(); p != _route.panner().end(); ++p) {
1232 AutomationLine* line;
1234 line = new AutomationPanLine ("automation pan", _session, *pan_track,
1235 *pan_track->canvas_display,
1236 (*p)->automation());
1238 if (p == _route.panner().begin()) {
1239 /* first line is a nice orange */
1240 line->set_line_color (color_map[cLeftPanAutomationLine]);
1242 /* second line is a nice blue */
1243 line->set_line_color (color_map[cRightPanAutomationLine]);
1246 pan_track->add_line (*line);
1251 AudioTimeAxisView::toggle_gain_track ()
1254 bool showit = gain_automation_item->get_active();
1256 if (showit != gain_track->marked_for_display()) {
1258 gain_track->set_marked_for_display (true);
1259 gain_track->canvas_display->show();
1260 gain_track->get_state_node()->add_property ("shown", X_("yes"));
1262 gain_track->set_marked_for_display (false);
1263 gain_track->hide ();
1264 gain_track->get_state_node()->add_property ("shown", X_("no"));
1267 /* now trigger a redisplay */
1270 _route.gui_changed (X_("track_height"), (void *) 0); /* EMIT_SIGNAL */
1276 AudioTimeAxisView::gain_hidden ()
1278 gain_track->get_state_node()->add_property (X_("shown"), X_("no"));
1280 if (gain_automation_item && !_hidden) {
1281 gain_automation_item->set_active (false);
1284 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1288 AudioTimeAxisView::toggle_pan_track ()
1290 bool showit = pan_automation_item->get_active();
1292 if (showit != pan_track->marked_for_display()) {
1294 pan_track->set_marked_for_display (true);
1295 pan_track->canvas_display->show();
1296 pan_track->get_state_node()->add_property ("shown", X_("yes"));
1298 pan_track->set_marked_for_display (false);
1300 pan_track->get_state_node()->add_property ("shown", X_("no"));
1303 /* now trigger a redisplay */
1306 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1312 AudioTimeAxisView::pan_hidden ()
1314 pan_track->get_state_node()->add_property ("shown", "no");
1316 if (pan_automation_item && !_hidden) {
1317 pan_automation_item->set_active (false);
1320 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1323 AudioTimeAxisView::RedirectAutomationInfo::~RedirectAutomationInfo ()
1325 for (vector<RedirectAutomationNode*>::iterator i = lines.begin(); i != lines.end(); ++i) {
1331 AudioTimeAxisView::RedirectAutomationNode::~RedirectAutomationNode ()
1333 parent.remove_ran (this);
1341 AudioTimeAxisView::remove_ran (RedirectAutomationNode* ran)
1344 remove_child (ran->view);
1348 AudioTimeAxisView::RedirectAutomationNode*
1349 AudioTimeAxisView::find_redirect_automation_node (Redirect *redirect, uint32_t what)
1351 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1353 if ((*i)->redirect == redirect) {
1355 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1356 if ((*ii)->what == what) {
1367 legalize_for_xml_node (string str)
1369 string::size_type pos;
1370 string legal_chars = "abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_+=:";
1376 while ((pos = legal.find_first_not_of (legal_chars, pos)) != string::npos) {
1377 legal.replace (pos, 1, "_");
1386 AudioTimeAxisView::add_redirect_automation_curve (Redirect *redirect, uint32_t what)
1388 RedirectAutomationLine* ral;
1390 RedirectAutomationNode* ran;
1392 if ((ran = find_redirect_automation_node (redirect, what)) == 0) {
1393 fatal << _("programming error: ")
1394 << string_compose (X_("redirect automation curve for %1:%2 not registered with audio track!"),
1395 redirect->name(), what)
1405 name = redirect->describe_parameter (what);
1407 /* create a string that is a legal XML node name that can be used to refer to this redirect+port combination */
1409 char state_name[256];
1410 snprintf (state_name, sizeof (state_name), "Redirect-%s-%" PRIu32, legalize_for_xml_node (redirect->name()).c_str(), what);
1412 ran->view = new RedirectAutomationTimeAxisView (_session, _route, editor, *this, parent_canvas, name, what, *redirect, state_name);
1414 ral = new RedirectAutomationLine (name,
1415 *redirect, what, _session, *ran->view,
1416 *ran->view->canvas_display, redirect->automation_list (what));
1418 ral->set_line_color (color_map[cRedirectAutomationLine]);
1419 ral->queue_reset ();
1421 ran->view->add_line (*ral);
1423 ran->view->Hiding.connect (bind (mem_fun(*this, &AudioTimeAxisView::redirect_automation_track_hidden), ran, redirect));
1425 if (!ran->view->marked_for_display()) {
1428 ran->menu_item->set_active (true);
1431 add_child (ran->view);
1433 view->foreach_regionview (bind (mem_fun(*this, &AudioTimeAxisView::add_ghost_to_redirect), ran->view));
1435 redirect->mark_automation_visible (what, true);
1439 AudioTimeAxisView::redirect_automation_track_hidden (AudioTimeAxisView::RedirectAutomationNode* ran, Redirect* r)
1442 ran->menu_item->set_active (false);
1445 r->mark_automation_visible (ran->what, false);
1447 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1451 AudioTimeAxisView::add_existing_redirect_automation_curves (Redirect *redirect)
1454 RedirectAutomationLine *ral;
1456 redirect->what_has_visible_automation (s);
1458 for (set<uint32_t>::iterator i = s.begin(); i != s.end(); ++i) {
1460 if ((ral = find_redirect_automation_curve (redirect, *i)) != 0) {
1461 ral->queue_reset ();
1463 add_redirect_automation_curve (redirect, (*i));
1469 AudioTimeAxisView::add_redirect_to_subplugin_menu (Redirect* r)
1471 using namespace Menu_Helpers;
1472 RedirectAutomationInfo *rai;
1473 list<RedirectAutomationInfo*>::iterator x;
1475 const std::set<uint32_t>& automatable = r->what_can_be_automated ();
1476 std::set<uint32_t> has_visible_automation;
1478 r->what_has_visible_automation(has_visible_automation);
1480 if (automatable.empty()) {
1484 for (x = redirect_automation.begin(); x != redirect_automation.end(); ++x) {
1485 if ((*x)->redirect == r) {
1490 if (x == redirect_automation.end()) {
1492 rai = new RedirectAutomationInfo (r);
1493 redirect_automation.push_back (rai);
1501 /* any older menu was deleted at the top of redirects_changed()
1502 when we cleared the subplugin menu.
1505 rai->menu = manage (new Menu);
1506 MenuList& items = rai->menu->items();
1507 rai->menu->set_name ("ArdourContextMenu");
1511 for (std::set<uint32_t>::const_iterator i = automatable.begin(); i != automatable.end(); ++i) {
1513 RedirectAutomationNode* ran;
1514 CheckMenuItem* mitem;
1516 string name = r->describe_parameter (*i);
1518 items.push_back (CheckMenuElem (name));
1519 mitem = dynamic_cast<CheckMenuItem*> (&items.back());
1521 if (has_visible_automation.find((*i)) != has_visible_automation.end()) {
1522 mitem->set_active(true);
1525 if ((ran = find_redirect_automation_node (r, *i)) == 0) {
1529 ran = new RedirectAutomationNode (*i, mitem, *this);
1531 rai->lines.push_back (ran);
1535 ran->menu_item = mitem;
1539 mitem->signal_toggled().connect (bind (mem_fun(*this, &AudioTimeAxisView::redirect_menu_item_toggled), rai, ran));
1542 /* add the menu for this redirect, because the subplugin
1543 menu is always cleared at the top of redirects_changed().
1544 this is the result of some poor design in gtkmm and/or
1548 subplugin_menu.items().push_back (MenuElem (r->name(), *rai->menu));
1553 AudioTimeAxisView::redirect_menu_item_toggled (AudioTimeAxisView::RedirectAutomationInfo* rai,
1554 AudioTimeAxisView::RedirectAutomationNode* ran)
1556 bool showit = ran->menu_item->get_active();
1557 bool redraw = false;
1559 if (ran->view == 0 && showit) {
1560 add_redirect_automation_curve (rai->redirect, ran->what);
1564 if (showit != ran->view->marked_for_display()) {
1567 ran->view->set_marked_for_display (true);
1568 ran->view->canvas_display->show();
1570 rai->redirect->mark_automation_visible (ran->what, true);
1571 ran->view->set_marked_for_display (false);
1579 if (redraw && !no_redraw) {
1581 /* now trigger a redisplay */
1583 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1589 AudioTimeAxisView::redirects_changed (void *src)
1591 using namespace Menu_Helpers;
1593 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1594 (*i)->valid = false;
1597 subplugin_menu.items().clear ();
1599 _route.foreach_redirect (this, &AudioTimeAxisView::add_redirect_to_subplugin_menu);
1600 _route.foreach_redirect (this, &AudioTimeAxisView::add_existing_redirect_automation_curves);
1602 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ) {
1604 list<RedirectAutomationInfo*>::iterator tmp;
1612 redirect_automation.erase (i);
1619 /* change in visibility was possible */
1621 _route.gui_changed ("track_height", this);
1624 RedirectAutomationLine *
1625 AudioTimeAxisView::find_redirect_automation_curve (Redirect *redirect, uint32_t what)
1627 RedirectAutomationNode* ran;
1629 if ((ran = find_redirect_automation_node (redirect, what)) != 0) {
1631 return dynamic_cast<RedirectAutomationLine*> (ran->view->lines.front());
1639 AudioTimeAxisView::show_all_automation ()
1643 pan_automation_item->set_active (true);
1644 gain_automation_item->set_active (true);
1646 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1647 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1648 if ((*ii)->view == 0) {
1649 add_redirect_automation_curve ((*i)->redirect, (*ii)->what);
1652 (*ii)->menu_item->set_active (true);
1658 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1662 AudioTimeAxisView::show_existing_automation ()
1666 pan_automation_item->set_active (true);
1667 gain_automation_item->set_active (true);
1669 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1670 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1671 if ((*ii)->view != 0) {
1672 (*ii)->menu_item->set_active (true);
1679 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1683 AudioTimeAxisView::hide_all_automation ()
1687 pan_automation_item->set_active (false);
1688 gain_automation_item->set_active (false);
1690 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1691 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1692 (*ii)->menu_item->set_active (false);
1697 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1701 AudioTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op)
1703 Playlist* what_we_got;
1704 DiskStream* ds = get_diskstream();
1709 /* route is a bus, not a track */
1713 playlist = ds->playlist();
1716 TimeSelection time (selection.time);
1717 float speed = ds->speed();
1718 if (speed != 1.0f) {
1719 for (TimeSelection::iterator i = time.begin(); i != time.end(); ++i) {
1720 (*i).start = session_frame_to_track_frame((*i).start, speed);
1721 (*i).end = session_frame_to_track_frame((*i).end, speed);
1727 _session.add_undo (playlist->get_memento());
1728 if ((what_we_got = playlist->cut (time)) != 0) {
1729 editor.get_cut_buffer().add (what_we_got);
1730 _session.add_redo_no_execute (playlist->get_memento());
1735 if ((what_we_got = playlist->copy (time)) != 0) {
1736 editor.get_cut_buffer().add (what_we_got);
1741 _session.add_undo (playlist->get_memento());
1742 if ((what_we_got = playlist->cut (time)) != 0) {
1743 _session.add_redo_no_execute (playlist->get_memento());
1744 what_we_got->unref ();
1754 AudioTimeAxisView::paste (jack_nframes_t pos, float times, Selection& selection, size_t nth)
1756 if (!is_audio_track()) {
1760 Playlist* playlist = get_diskstream()->playlist();
1761 PlaylistSelection::iterator p;
1763 for (p = selection.playlists.begin(); p != selection.playlists.end() && nth; ++p, --nth);
1765 if (p == selection.playlists.end()) {
1769 if (get_diskstream()->speed() != 1.0f)
1770 pos = session_frame_to_track_frame(pos, get_diskstream()->speed() );
1772 _session.add_undo (playlist->get_memento());
1773 playlist->paste (**p, pos, times);
1774 _session.add_redo_no_execute (playlist->get_memento());
1780 AudioTimeAxisView::region_view_added (AudioRegionView* arv)
1782 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1783 AutomationTimeAxisView* atv;
1785 if ((atv = dynamic_cast<AutomationTimeAxisView*> (*i)) != 0) {
1786 arv->add_ghost (*atv);
1792 AudioTimeAxisView::add_ghost_to_redirect (AudioRegionView* arv, AutomationTimeAxisView* atv)
1794 arv->add_ghost (*atv);
1798 AudioTimeAxisView::get_child_list()
1801 list<TimeAxisView*>redirect_children;
1803 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1804 if (!(*i)->hidden()) {
1805 redirect_children.push_back(*i);
1808 return redirect_children;
1813 AudioTimeAxisView::build_playlist_menu (Gtk::Menu * menu)
1815 using namespace Menu_Helpers;
1817 if (!menu || !is_audio_track()) {
1821 MenuList& playlist_items = menu->items();
1822 menu->set_name ("ArdourContextMenu");
1823 playlist_items.clear();
1825 if (playlist_menu) {
1826 delete playlist_menu;
1828 playlist_menu = new Menu;
1829 playlist_menu->set_name ("ArdourContextMenu");
1831 playlist_items.push_back (MenuElem (string_compose (_("Current: %1"), get_diskstream()->playlist()->name())));
1832 playlist_items.push_back (SeparatorElem());
1834 playlist_items.push_back (MenuElem (_("Rename"), mem_fun(*this, &AudioTimeAxisView::rename_current_playlist)));
1835 playlist_items.push_back (SeparatorElem());
1837 playlist_items.push_back (MenuElem (_("New"), mem_fun(*this, &AudioTimeAxisView::use_new_playlist)));
1838 playlist_items.push_back (MenuElem (_("New Copy"), mem_fun(*this, &AudioTimeAxisView::use_copy_playlist)));
1839 playlist_items.push_back (SeparatorElem());
1840 playlist_items.push_back (MenuElem (_("Clear Current"), mem_fun(*this, &AudioTimeAxisView::clear_playlist)));
1841 playlist_items.push_back (SeparatorElem());
1842 playlist_items.push_back (MenuElem(_("Select"), mem_fun(*this, &AudioTimeAxisView::show_playlist_selector)));
1847 AudioTimeAxisView::show_playlist_selector ()
1849 editor.playlist_selector().show_for (this);
1854 AudioTimeAxisView::map_frozen ()
1856 if (!is_audio_track()) {
1860 ENSURE_GUI_THREAD (mem_fun(*this, &AudioTimeAxisView::map_frozen));
1863 switch (audio_track()->freeze_state()) {
1864 case AudioTrack::Frozen:
1865 playlist_button.set_sensitive (false);
1866 rec_enable_button->set_sensitive (false);
1869 playlist_button.set_sensitive (true);
1870 rec_enable_button->set_sensitive (true);
1876 AudioTimeAxisView::show_all_xfades ()
1879 view->show_all_xfades ();
1884 AudioTimeAxisView::hide_all_xfades ()
1887 view->hide_all_xfades ();
1892 AudioTimeAxisView::hide_dependent_views (TimeAxisViewItem& tavi)
1894 AudioRegionView* rv;
1896 if (view && (rv = dynamic_cast<AudioRegionView*>(&tavi)) != 0) {
1897 view->hide_xfades_involving (*rv);
1902 AudioTimeAxisView::reveal_dependent_views (TimeAxisViewItem& tavi)
1904 AudioRegionView* rv;
1906 if (view && (rv = dynamic_cast<AudioRegionView*>(&tavi)) != 0) {
1907 view->reveal_xfades_involving (*rv);
1912 AudioTimeAxisView::route_active_changed ()
1914 RouteUI::route_active_changed ();
1916 if (is_audio_track()) {
1917 if (_route.active()) {
1918 controls_ebox.set_name ("AudioTrackControlsBaseUnselected");
1919 controls_base_selected_name = "AudioTrackControlsBaseSelected";
1920 controls_base_unselected_name = "AudioTrackControlsBaseUnselected";
1922 controls_ebox.set_name ("AudioTrackControlsBaseInactiveUnselected");
1923 controls_base_selected_name = "AudioTrackControlsBaseInactiveSelected";
1924 controls_base_unselected_name = "AudioTrackControlsBaseInactiveUnselected";
1927 if (_route.active()) {
1928 controls_ebox.set_name ("BusControlsBaseUnselected");
1929 controls_base_selected_name = "BusControlsBaseSelected";
1930 controls_base_unselected_name = "BusControlsBaseUnselected";
1932 controls_ebox.set_name ("BusControlsBaseInactiveUnselected");
1933 controls_base_selected_name = "BusControlsBaseInactiveSelected";
1934 controls_base_unselected_name = "BusControlsBaseInactiveUnselected";
1940 AudioTimeAxisView::get_child_xml_node (const string & childname)
1942 return RouteUI::get_child_xml_node (childname);