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>
32 #include <pbd/whitespace.h>
34 #include <gtkmm2ext/bindable_button.h>
35 #include <gtkmm2ext/gtk_ui.h>
36 #include <gtkmm2ext/selector.h>
37 #include <gtkmm2ext/stop_signal.h>
38 #include <gtkmm2ext/utils.h>
40 #include <ardour/audioplaylist.h>
41 #include <ardour/diskstream.h>
42 #include <ardour/insert.h>
43 #include <ardour/ladspa_plugin.h>
44 #include <ardour/location.h>
45 #include <ardour/panner.h>
46 #include <ardour/playlist.h>
47 #include <ardour/session.h>
48 #include <ardour/session_playlist.h>
49 #include <ardour/utils.h>
51 #include "ardour_ui.h"
52 #include "audio_time_axis.h"
53 #include "automation_gain_line.h"
54 #include "automation_pan_line.h"
55 #include "automation_time_axis.h"
56 #include "canvas_impl.h"
57 #include "crossfade_view.h"
59 #include "gain_automation_time_axis.h"
60 #include "gui_thread.h"
62 #include "pan_automation_time_axis.h"
63 #include "playlist_selector.h"
64 #include "plugin_selector.h"
65 #include "plugin_ui.h"
66 #include "point_selection.h"
68 #include "public_editor.h"
69 #include "redirect_automation_line.h"
70 #include "redirect_automation_time_axis.h"
71 #include "regionview.h"
72 #include "rgb_macros.h"
73 #include "selection.h"
74 #include "simplerect.h"
75 #include "streamview.h"
78 #include <ardour/audio_track.h>
82 using namespace ARDOUR;
83 using namespace LADSPA;
85 using namespace Editing;
88 AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, Route& rt, Canvas& canvas)
90 RouteUI(rt, sess, _("m"), _("s"), _("r")), // mute, solo, and record
91 TimeAxisView(sess,ed,(TimeAxisView*) 0, canvas),
92 parent_canvas (canvas),
94 edit_group_button (_("g")), // group
95 playlist_button (_("p")),
96 size_button (_("h")), // height
97 automation_button (_("a")),
98 visual_button (_("v"))
102 subplugin_menu.set_name ("ArdourContextMenu");
104 playlist_action_menu = 0;
105 automation_action_menu = 0;
109 timestretch_rect = 0;
111 pan_automation_item = 0;
112 gain_automation_item = 0;
115 view = new StreamView (*this);
117 add_gain_automation_child ();
118 add_pan_automation_child ();
120 ignore_toggle = false;
122 rec_enable_button->set_active (false);
123 mute_button->set_active (false);
124 solo_button->set_active (false);
126 rec_enable_button->set_name ("TrackRecordEnableButton");
127 mute_button->set_name ("TrackMuteButton");
128 solo_button->set_name ("SoloButton");
129 edit_group_button.set_name ("TrackGroupButton");
130 playlist_button.set_name ("TrackPlaylistButton");
131 automation_button.set_name ("TrackAutomationButton");
132 size_button.set_name ("TrackSizeButton");
133 visual_button.set_name ("TrackVisualButton");
134 hide_button.set_name ("TrackRemoveButton");
136 hide_button.add (*(manage (new Image (get_xpm("small_x.xpm")))));
138 _route.mute_changed.connect (mem_fun(*this, &RouteUI::mute_changed));
139 _route.solo_changed.connect (mem_fun(*this, &RouteUI::solo_changed));
140 _route.solo_safe_changed.connect (mem_fun(*this, &RouteUI::solo_changed));
142 _route.panner().Changed.connect (mem_fun(*this, &AudioTimeAxisView::update_pans));
144 solo_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::solo_press));
145 solo_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::solo_release));
146 mute_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::mute_press));
147 mute_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::mute_release));
148 rec_enable_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::rec_enable_press));
149 edit_group_button.signal_button_release_event().connect (mem_fun(*this, &AudioTimeAxisView::edit_click), false);
150 playlist_button.signal_clicked().connect (mem_fun(*this, &AudioTimeAxisView::playlist_click));
151 automation_button.signal_clicked().connect (mem_fun(*this, &AudioTimeAxisView::automation_click));
152 size_button.signal_button_release_event().connect (mem_fun(*this, &AudioTimeAxisView::size_click), false);
153 visual_button.signal_clicked().connect (mem_fun(*this, &AudioTimeAxisView::visual_click));
154 hide_button.signal_clicked().connect (mem_fun(*this, &AudioTimeAxisView::hide_click));
156 if (is_audio_track()) {
157 controls_table.attach (*rec_enable_button, 5, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
159 controls_table.attach (*mute_button, 6, 7, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
160 controls_table.attach (*solo_button, 7, 8, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::FILL|Gtk::EXPAND, 0, 0);
162 controls_table.attach (edit_group_button, 6, 7, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
164 ARDOUR_UI::instance()->tooltips().set_tip(*rec_enable_button, _("Record"));
165 ARDOUR_UI::instance()->tooltips().set_tip(*solo_button,_("Solo"));
166 ARDOUR_UI::instance()->tooltips().set_tip(*mute_button,_("Mute"));
167 ARDOUR_UI::instance()->tooltips().set_tip(edit_group_button,_("Edit Group"));
168 ARDOUR_UI::instance()->tooltips().set_tip(size_button,_("Display Height"));
169 ARDOUR_UI::instance()->tooltips().set_tip(playlist_button,_("Playlist"));
170 ARDOUR_UI::instance()->tooltips().set_tip(automation_button, _("Automation"));
171 ARDOUR_UI::instance()->tooltips().set_tip(visual_button, _("Visual options"));
172 ARDOUR_UI::instance()->tooltips().set_tip(hide_button, _("Hide this track"));
176 controls_table.attach (hide_button, 0, 1, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
177 controls_table.attach (visual_button, 1, 2, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
178 controls_table.attach (size_button, 2, 3, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
179 controls_table.attach (automation_button, 3, 4, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
181 if (is_audio_track() && audio_track()->mode() == ARDOUR::Normal) {
182 controls_table.attach (playlist_button, 5, 6, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
185 /* remove focus from the buttons */
187 automation_button.unset_flags (Gtk::CAN_FOCUS);
188 solo_button->unset_flags (Gtk::CAN_FOCUS);
189 mute_button->unset_flags (Gtk::CAN_FOCUS);
190 edit_group_button.unset_flags (Gtk::CAN_FOCUS);
191 size_button.unset_flags (Gtk::CAN_FOCUS);
192 playlist_button.unset_flags (Gtk::CAN_FOCUS);
193 hide_button.unset_flags (Gtk::CAN_FOCUS);
194 visual_button.unset_flags (Gtk::CAN_FOCUS);
196 /* map current state of the route */
198 update_diskstream_display ();
201 redirects_changed (0);
202 reset_redirect_automation_curves ();
207 set_state (*xml_node);
209 _route.mute_changed.connect (mem_fun(*this, &RouteUI::mute_changed));
210 _route.solo_changed.connect (mem_fun(*this, &RouteUI::solo_changed));
211 _route.redirects_changed.connect (mem_fun(*this, &AudioTimeAxisView::redirects_changed));
213 _route.name_changed.connect (mem_fun(*this, &AudioTimeAxisView::route_name_changed));
215 if (is_audio_track()) {
219 audio_track()->FreezeChange.connect (mem_fun(*this, &AudioTimeAxisView::map_frozen));
221 audio_track()->diskstream_changed.connect (mem_fun(*this, &AudioTimeAxisView::diskstream_changed));
222 get_diskstream()->speed_changed.connect (mem_fun(*this, &AudioTimeAxisView::speed_changed));
224 controls_ebox.set_name ("AudioTrackControlsBaseUnselected");
225 controls_base_selected_name = "AudioTrackControlsBaseSelected";
226 controls_base_unselected_name = "AudioTrackControlsBaseUnselected";
228 /* ask for notifications of any new RegionViews */
230 view->AudioRegionViewAdded.connect (mem_fun(*this, &AudioTimeAxisView::region_view_added));
234 /* pick up the correct freeze state */
242 controls_ebox.set_name ("BusControlsBaseUnselected");
243 controls_base_selected_name = "BusControlsBaseSelected";
244 controls_base_unselected_name = "BusControlsBaseUnselected";
247 editor.ZoomChanged.connect (mem_fun(*this, &AudioTimeAxisView::reset_samples_per_unit));
248 ColorChanged.connect (mem_fun (*this, &AudioTimeAxisView::color_handler));
251 AudioTimeAxisView::~AudioTimeAxisView ()
253 GoingAway (); /* EMIT_SIGNAL */
256 delete playlist_menu;
260 if (playlist_action_menu) {
261 delete playlist_action_menu;
262 playlist_action_menu = 0;
265 vector_delete (&redirect_automation_curves);
267 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
278 AudioTimeAxisView::show_at (double y, int& nth, Gtk::VBox *parent)
281 xml_node->add_property ("shown_editor", "yes");
283 return TimeAxisView::show_at (y, nth, parent);
287 AudioTimeAxisView::hide ()
290 xml_node->add_property ("shown_editor", "no");
292 TimeAxisView::hide ();
296 AudioTimeAxisView::set_playlist (AudioPlaylist *newplaylist)
300 modified_connection.disconnect ();
301 state_changed_connection.disconnect ();
303 if ((pl = dynamic_cast<AudioPlaylist*> (playlist())) != 0) {
304 state_changed_connection = pl->StateChanged.connect (mem_fun(*this, &AudioTimeAxisView::playlist_state_changed));
305 modified_connection = pl->Modified.connect (mem_fun(*this, &AudioTimeAxisView::playlist_modified));
310 AudioTimeAxisView::playlist_modified ()
315 AudioTimeAxisView::edit_click (GdkEventButton *ev)
317 if (Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) {
318 _route.set_edit_group (0, this);
322 using namespace Menu_Helpers;
324 MenuList& items = edit_group_menu.items ();
325 RadioMenuItem::Group group;
328 items.push_back (RadioMenuElem (group, _("No group"),
329 bind (mem_fun(*this, &AudioTimeAxisView::set_edit_group_from_menu), (RouteGroup *) 0)));
331 if (_route.edit_group() == 0) {
332 static_cast<RadioMenuItem*>(&items.back())->set_active ();
335 _session.foreach_edit_group (bind (mem_fun (*this, &AudioTimeAxisView::add_edit_group_menu_item), &group));
336 edit_group_menu.popup (ev->button, ev->time);
342 AudioTimeAxisView::add_edit_group_menu_item (RouteGroup *eg, RadioMenuItem::Group* group)
344 using namespace Menu_Helpers;
346 MenuList &items = edit_group_menu.items();
348 items.push_back (RadioMenuElem (*group, eg->name(), bind (mem_fun(*this, &AudioTimeAxisView::set_edit_group_from_menu), eg)));
349 if (_route.edit_group() == eg) {
350 static_cast<RadioMenuItem*>(&items.back())->set_active ();
355 AudioTimeAxisView::set_edit_group_from_menu (RouteGroup *eg)
358 _route.set_edit_group (eg, this);
362 AudioTimeAxisView::playlist_state_changed (Change ignored)
364 // ENSURE_GUI_THREAD (bind (mem_fun(*this, &AudioTimeAxisView::playlist_state_changed), ignored));
369 AudioTimeAxisView::playlist_changed ()
374 if (is_audio_track()) {
375 set_playlist (get_diskstream()->playlist());
380 AudioTimeAxisView::label_view ()
382 string x = _route.name();
384 if (x != name_entry.get_text()) {
385 name_entry.set_text (x);
388 ARDOUR_UI::instance()->tooltips().set_tip (name_entry, x);
392 AudioTimeAxisView::route_name_changed (void *src)
394 editor.route_name_changed (this);
399 AudioTimeAxisView::take_name_changed (void *src)
408 AudioTimeAxisView::playlist_click ()
410 // always build a new action menu
412 if (playlist_action_menu == 0) {
413 playlist_action_menu = new Menu;
414 playlist_action_menu->set_name ("ArdourContextMenu");
417 build_playlist_menu(playlist_action_menu);
419 playlist_action_menu->popup (1, 0);
423 AudioTimeAxisView::automation_click ()
425 if (automation_action_menu == 0) {
426 /* this seems odd, but the automation action
427 menu is built as part of the display menu.
429 build_display_menu ();
431 automation_action_menu->popup (1, 0);
435 AudioTimeAxisView::show_timestretch (jack_nframes_t start, jack_nframes_t end)
441 TimeAxisView::show_timestretch (start, end);
451 /* check that the time selection was made in our route, or our edit group.
452 remember that edit_group() == 0 implies the route is *not* in a edit group.
455 if (!(ts.track == this || (ts.group != 0 && ts.group == _route.edit_group()))) {
456 /* this doesn't apply to us */
460 /* ignore it if our edit group is not active */
462 if ((ts.track != this) && _route.edit_group() && !_route.edit_group()->is_active()) {
467 if (timestretch_rect == 0) {
468 timestretch_rect = new SimpleRect (*canvas_display);
469 timestretch_rect->property_x1() = 0.0;
470 timestretch_rect->property_y1() = 0.0;
471 timestretch_rect->property_x2() = 0.0;
472 timestretch_rect->property_y2() = 0.0;
473 timestretch_rect->property_fill_color_rgba() = color_map[cTimeStretchFill];
474 timestretch_rect->property_outline_color_rgba() = color_map[cTimeStretchOutline];
477 timestretch_rect->show ();
478 timestretch_rect->raise_to_top ();
480 x1 = start / editor.get_current_zoom();
481 x2 = (end - 1) / editor.get_current_zoom();
484 timestretch_rect->property_x1() = x1;
485 timestretch_rect->property_y1() = 1.0;
486 timestretch_rect->property_x2() = x2;
487 timestretch_rect->property_y2() = y2;
491 AudioTimeAxisView::hide_timestretch ()
493 TimeAxisView::hide_timestretch ();
495 if (timestretch_rect) {
496 timestretch_rect->hide ();
501 AudioTimeAxisView::show_selection (TimeSelection& ts)
505 /* ignore it if our edit group is not active or if the selection was started
506 in some other track or edit group (remember that edit_group() == 0 means
507 that the track is not in an edit group).
510 if (((ts.track != this && !is_child (ts.track)) && _route.edit_group() && !_route.edit_group()->is_active()) ||
511 (!(ts.track == this || is_child (ts.track) || (ts.group != 0 && ts.group == _route.edit_group())))) {
517 TimeAxisView::show_selection (ts);
521 AudioTimeAxisView::set_state (const XMLNode& node)
523 const XMLProperty *prop;
525 TimeAxisView::set_state (node);
527 if ((prop = node.property ("shown_editor")) != 0) {
528 if (prop->value() == "no") {
529 _marked_for_display = false;
531 _marked_for_display = true;
534 _marked_for_display = true;
537 XMLNodeList nlist = node.children();
538 XMLNodeConstIterator niter;
542 show_gain_automation = false;
543 show_pan_automation = false;
545 for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
548 if (child_node->name() == "gain") {
549 XMLProperty *prop=child_node->property ("shown");
552 if (prop->value() == "yes") {
553 show_gain_automation = true;
559 if (child_node->name() == "pan") {
560 XMLProperty *prop=child_node->property ("shown");
563 if (prop->value() == "yes") {
564 show_pan_automation = true;
573 AudioTimeAxisView::set_height (TrackHeight h)
575 bool height_changed = (h != height_style);
577 TimeAxisView::set_height (h);
581 view->set_height ((double) height);
583 switch (height_style) {
585 xml_node->add_property ("track_height", "largest");
588 controls_table.show_all();
591 xml_node->add_property ("track_height", "large");
594 controls_table.show_all();
597 xml_node->add_property ("track_height", "larger");
600 controls_table.show_all();
603 xml_node->add_property ("track_height", "normal");
606 controls_table.show_all();
609 xml_node->add_property ("track_height", "smaller");
610 controls_table.show_all ();
613 edit_group_button.hide ();
615 visual_button.hide ();
617 automation_button.hide ();
618 playlist_button.hide ();
621 xml_node->add_property ("track_height", "small");
622 controls_table.hide_all ();
623 controls_table.show ();
626 name_label.set_text (_route.name());
630 if (height_changed) {
631 /* only emit the signal if the height really changed */
632 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
637 AudioTimeAxisView::select_track_color ()
639 if (RouteUI::choose_color ()) {
642 view->apply_color (_color, StreamView::RegionColor);
648 AudioTimeAxisView::reset_redirect_automation_curves ()
650 for (vector<RedirectAutomationLine*>::iterator i = redirect_automation_curves.begin(); i != redirect_automation_curves.end(); ++i) {
656 AudioTimeAxisView::reset_samples_per_unit ()
658 set_samples_per_unit (editor.get_current_zoom());
662 AudioTimeAxisView::set_samples_per_unit (double spu)
666 if (get_diskstream() != 0) {
667 speed = get_diskstream()->speed();
671 view->set_samples_per_unit (spu * speed);
674 TimeAxisView::set_samples_per_unit (spu * speed);
678 AudioTimeAxisView::build_display_menu ()
680 using namespace Menu_Helpers;
682 /* get the size menu ready */
688 TimeAxisView::build_display_menu ();
690 /* now fill it with our stuff */
692 MenuList& items = display_menu->items();
693 display_menu->set_name ("ArdourContextMenu");
695 items.push_back (MenuElem (_("Height"), *size_menu));
696 items.push_back (MenuElem (_("Color"), mem_fun(*this, &AudioTimeAxisView::select_track_color)));
699 items.push_back (SeparatorElem());
700 items.push_back (MenuElem (_("Hide all crossfades"), mem_fun(*this, &AudioTimeAxisView::hide_all_xfades)));
701 items.push_back (MenuElem (_("Show all crossfades"), mem_fun(*this, &AudioTimeAxisView::show_all_xfades)));
702 items.push_back (SeparatorElem());
705 automation_action_menu = manage (new Menu);
706 MenuList& automation_items = automation_action_menu->items();
707 automation_action_menu->set_name ("ArdourContextMenu");
709 automation_items.push_back (MenuElem (_("show all automation"),
710 mem_fun(*this, &AudioTimeAxisView::show_all_automation)));
712 automation_items.push_back (MenuElem (_("show existing automation"),
713 mem_fun(*this, &AudioTimeAxisView::show_existing_automation)));
715 automation_items.push_back (MenuElem (_("hide all automation"),
716 mem_fun(*this, &AudioTimeAxisView::hide_all_automation)));
718 automation_items.push_back (SeparatorElem());
720 automation_items.push_back (CheckMenuElem (_("gain"),
721 mem_fun(*this, &AudioTimeAxisView::toggle_gain_track)));
722 gain_automation_item = static_cast<CheckMenuItem*> (&automation_items.back());
723 gain_automation_item->set_active(show_gain_automation);
725 automation_items.push_back (CheckMenuElem (_("pan"),
726 mem_fun(*this, &AudioTimeAxisView::toggle_pan_track)));
727 pan_automation_item = static_cast<CheckMenuItem*> (&automation_items.back());
728 pan_automation_item->set_active(show_pan_automation);
730 automation_items.push_back (MenuElem (_("Plugins"), subplugin_menu));
732 items.push_back (MenuElem (_("Automation"), *automation_action_menu));
734 Menu *waveform_menu = manage(new Menu);
735 MenuList& waveform_items = waveform_menu->items();
736 waveform_menu->set_name ("ArdourContextMenu");
738 waveform_items.push_back (CheckMenuElem (_("Show waveforms"), mem_fun(*this, &AudioTimeAxisView::toggle_waveforms)));
739 waveform_item = static_cast<CheckMenuItem *> (&waveform_items.back());
740 ignore_toggle = true;
741 waveform_item->set_active (editor.show_waveforms());
742 ignore_toggle = false;
744 RadioMenuItem::Group group;
746 waveform_items.push_back (RadioMenuElem (group, _("Traditional"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_shape), Traditional)));
747 traditional_item = static_cast<RadioMenuItem *> (&waveform_items.back());
749 waveform_items.push_back (RadioMenuElem (group, _("Rectified"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_shape), Rectified)));
750 rectified_item = static_cast<RadioMenuItem *> (&waveform_items.back());
752 items.push_back (MenuElem (_("Waveform"), *waveform_menu));
754 if (is_audio_track()) {
756 Menu* alignment_menu = manage (new Menu);
757 MenuList& alignment_items = alignment_menu->items();
758 alignment_menu->set_name ("ArdourContextMenu");
760 RadioMenuItem::Group align_group;
762 alignment_items.push_back (RadioMenuElem (align_group, _("align with existing material"), bind (mem_fun(*this, &AudioTimeAxisView::set_align_style), ExistingMaterial)));
763 align_existing_item = dynamic_cast<RadioMenuItem*>(&alignment_items.back());
764 if (get_diskstream()->alignment_style() == ExistingMaterial) {
765 align_existing_item->set_active();
767 alignment_items.push_back (RadioMenuElem (align_group, _("align with capture time"), bind (mem_fun(*this, &AudioTimeAxisView::set_align_style), CaptureTime)));
768 align_capture_item = dynamic_cast<RadioMenuItem*>(&alignment_items.back());
769 if (get_diskstream()->alignment_style() == CaptureTime) {
770 align_capture_item->set_active();
773 items.push_back (MenuElem (_("Alignment"), *alignment_menu));
775 get_diskstream()->AlignmentStyleChanged.connect (mem_fun(*this, &AudioTimeAxisView::align_style_changed));
778 items.push_back (SeparatorElem());
779 items.push_back (CheckMenuElem (_("Active"), mem_fun(*this, &RouteUI::toggle_route_active)));
780 route_active_menu_item = dynamic_cast<CheckMenuItem *> (&items.back());
781 route_active_menu_item->set_active (_route.active());
783 items.push_back (SeparatorElem());
784 items.push_back (MenuElem (_("Remove"), mem_fun(*this, &RouteUI::remove_this_route)));
789 AudioTimeAxisView::align_style_changed ()
791 switch (get_diskstream()->alignment_style()) {
792 case ExistingMaterial:
793 if (!align_existing_item->get_active()) {
794 align_existing_item->set_active();
798 if (!align_capture_item->get_active()) {
799 align_capture_item->set_active();
806 AudioTimeAxisView::set_align_style (AlignStyle style)
808 get_diskstream()->set_align_style (style);
812 AudioTimeAxisView::rename_current_playlist ()
814 ArdourPrompter prompter (true);
820 if (((ds = get_diskstream()) == 0) || ds->destructive() || ((pl = ds->playlist()) == 0)) {
824 prompter.set_prompt (_("Name for playlist"));
825 prompter.set_initial_text (pl->name());
827 switch (prompter.run ()) {
828 case Gtk::RESPONSE_ACCEPT:
829 prompter.get_result (name);
841 AudioTimeAxisView::use_copy_playlist (bool prompt)
847 if (((ds = get_diskstream()) == 0) || ds->destructive() || ((pl = ds->playlist()) == 0)) {
851 name = Playlist::bump_name (pl->name(), _session);
855 ArdourPrompter prompter (true);
857 prompter.set_prompt (_("Name for playlist"));
858 prompter.set_initial_text (name);
859 prompter.show_all ();
861 switch (prompter.run ()) {
862 case Gtk::RESPONSE_ACCEPT:
863 prompter.get_result (name);
872 ds->use_copy_playlist ();
879 AudioTimeAxisView::use_new_playlist (bool prompt)
885 if (((ds = get_diskstream()) == 0) || ds->destructive() || ((pl = ds->playlist()) == 0)) {
889 name = Playlist::bump_name (pl->name(), _session);
893 ArdourPrompter prompter (true);
895 prompter.set_prompt (_("Name for playlist"));
896 prompter.set_initial_text (name);
898 switch (prompter.run ()) {
899 case Gtk::RESPONSE_ACCEPT:
900 prompter.get_result (name);
909 ds->use_new_playlist ();
916 AudioTimeAxisView::clear_playlist ()
921 if ((ds = get_diskstream()) != 0) {
922 if ((pl = ds->playlist()) != 0) {
923 editor.clear_playlist (*pl);
929 AudioTimeAxisView::toggle_waveforms ()
931 if (view && waveform_item && !ignore_toggle) {
932 view->set_show_waveforms (waveform_item->get_active());
937 AudioTimeAxisView::set_show_waveforms (bool yn)
940 waveform_item->set_active (yn);
942 view->set_show_waveforms (yn);
947 AudioTimeAxisView::set_show_waveforms_recording (bool yn)
950 view->set_show_waveforms_recording (yn);
955 AudioTimeAxisView::set_waveform_shape (WaveformShape shape)
958 view->set_waveform_shape (shape);
963 AudioTimeAxisView::speed_changed ()
965 Gtkmm2ext::UI::instance()->call_slot (mem_fun(*this, &AudioTimeAxisView::reset_samples_per_unit));
969 AudioTimeAxisView::diskstream_changed (void *src)
971 Gtkmm2ext::UI::instance()->call_slot (mem_fun(*this, &AudioTimeAxisView::update_diskstream_display));
975 AudioTimeAxisView::update_diskstream_display ()
979 if ((ds = get_diskstream()) != 0) {
980 set_playlist (ds->playlist ());
987 AudioTimeAxisView::selection_click (GdkEventButton* ev)
989 PublicEditor::TrackViewList* tracks = editor.get_valid_views (this, _route.edit_group());
991 switch (Keyboard::selection_type (ev->state)) {
992 case Selection::Toggle:
993 /* XXX this is not right */
994 editor.get_selection().add (*tracks);
998 editor.get_selection().set (*tracks);
1001 case Selection::Extend:
1002 /* not defined yet */
1010 AudioTimeAxisView::set_selected_regionviews (AudioRegionSelection& regions)
1013 view->set_selected_regionviews (regions);
1018 AudioTimeAxisView::set_selected_points (PointSelection& points)
1020 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1021 (*i)->set_selected_points (points);
1026 AudioTimeAxisView::get_selectables (jack_nframes_t start, jack_nframes_t end, double top, double bot, list<Selectable*>& results)
1030 if (get_diskstream() != 0) {
1031 speed = get_diskstream()->speed();
1034 jack_nframes_t start_adjusted = session_frame_to_track_frame(start, speed);
1035 jack_nframes_t end_adjusted = session_frame_to_track_frame(end, speed);
1037 if (view && touched (top, bot)) {
1038 view->get_selectables (start_adjusted, end_adjusted, results);
1041 /* pick up visible automation tracks */
1043 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1044 if (!(*i)->hidden()) {
1045 (*i)->get_selectables (start_adjusted, end_adjusted, top, bot, results);
1051 AudioTimeAxisView::get_inverted_selectables (Selection& sel, list<Selectable*>& results)
1054 view->get_inverted_selectables (sel, results);
1057 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1058 if (!(*i)->hidden()) {
1059 (*i)->get_inverted_selectables (sel, results);
1067 AudioTimeAxisView::edit_group() const
1069 return _route.edit_group();
1073 AudioTimeAxisView::name() const
1075 return _route.name();
1079 AudioTimeAxisView::playlist () const
1083 if ((ds = get_diskstream()) != 0) {
1084 return ds->playlist();
1091 AudioTimeAxisView::name_entry_changed ()
1095 x = name_entry.get_text ();
1097 if (x == _route.name()) {
1101 if (x.length() == 0) {
1102 name_entry.set_text (_route.name());
1106 strip_whitespace_edges(x);
1108 if (_session.route_name_unique (x)) {
1109 _route.set_name (x, this);
1111 ARDOUR_UI::instance()->popup_error (_("a track already exists with that name"));
1112 name_entry.set_text (_route.name());
1117 AudioTimeAxisView::visual_click ()
1119 popup_display_menu (0);
1123 AudioTimeAxisView::hide_click ()
1125 editor.hide_track_in_display (*this);
1129 AudioTimeAxisView::find_next_region (jack_nframes_t pos, RegionPoint point, int32_t dir)
1132 AudioPlaylist *playlist;
1134 if ((stream = get_diskstream()) != 0 && (playlist = stream->playlist()) != 0) {
1135 return playlist->find_next_region (pos, point, dir);
1142 AudioTimeAxisView::add_gain_automation_child ()
1145 AutomationLine* line;
1147 gain_track = new GainAutomationTimeAxisView (_session,
1153 _route.gain_automation_curve());
1155 line = new AutomationGainLine ("automation gain",
1158 *gain_track->canvas_display,
1159 _route.gain_automation_curve());
1161 line->set_line_color (color_map[cAutomationLine]);
1164 gain_track->add_line (*line);
1166 add_child (gain_track);
1168 gain_track->Hiding.connect (mem_fun(*this, &AudioTimeAxisView::gain_hidden));
1174 if ((node = gain_track->get_state_node()) != 0) {
1175 if ((prop = node->property ("shown")) != 0) {
1176 if (prop->value() == "yes") {
1183 gain_track->hide ();
1188 AudioTimeAxisView::add_pan_automation_child ()
1192 pan_track = new PanAutomationTimeAxisView (_session, _route, editor, *this, parent_canvas, _("pan"));
1196 add_child (pan_track);
1198 pan_track->Hiding.connect (mem_fun(*this, &AudioTimeAxisView::pan_hidden));
1205 if ((node = pan_track->get_state_node()) != 0) {
1206 if ((prop = node->property ("shown")) != 0) {
1207 if (prop->value() == "yes") {
1219 AudioTimeAxisView::update_pans ()
1223 pan_track->clear_lines ();
1225 /* we don't draw lines for "greater than stereo" panning.
1228 if (_route.n_outputs() > 2) {
1232 for (p = _route.panner().begin(); p != _route.panner().end(); ++p) {
1234 AutomationLine* line;
1236 line = new AutomationPanLine ("automation pan", _session, *pan_track,
1237 *pan_track->canvas_display,
1238 (*p)->automation());
1240 if (p == _route.panner().begin()) {
1241 /* first line is a nice orange */
1242 line->set_line_color (color_map[cLeftPanAutomationLine]);
1244 /* second line is a nice blue */
1245 line->set_line_color (color_map[cRightPanAutomationLine]);
1248 pan_track->add_line (*line);
1253 AudioTimeAxisView::toggle_gain_track ()
1256 bool showit = gain_automation_item->get_active();
1258 if (showit != gain_track->marked_for_display()) {
1260 gain_track->set_marked_for_display (true);
1261 gain_track->canvas_display->show();
1262 gain_track->get_state_node()->add_property ("shown", X_("yes"));
1264 gain_track->set_marked_for_display (false);
1265 gain_track->hide ();
1266 gain_track->get_state_node()->add_property ("shown", X_("no"));
1269 /* now trigger a redisplay */
1272 _route.gui_changed (X_("track_height"), (void *) 0); /* EMIT_SIGNAL */
1278 AudioTimeAxisView::gain_hidden ()
1280 gain_track->get_state_node()->add_property (X_("shown"), X_("no"));
1282 if (gain_automation_item && !_hidden) {
1283 gain_automation_item->set_active (false);
1286 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1290 AudioTimeAxisView::toggle_pan_track ()
1292 bool showit = pan_automation_item->get_active();
1294 if (showit != pan_track->marked_for_display()) {
1296 pan_track->set_marked_for_display (true);
1297 pan_track->canvas_display->show();
1298 pan_track->get_state_node()->add_property ("shown", X_("yes"));
1300 pan_track->set_marked_for_display (false);
1302 pan_track->get_state_node()->add_property ("shown", X_("no"));
1305 /* now trigger a redisplay */
1308 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1314 AudioTimeAxisView::pan_hidden ()
1316 pan_track->get_state_node()->add_property ("shown", "no");
1318 if (pan_automation_item && !_hidden) {
1319 pan_automation_item->set_active (false);
1322 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1325 AudioTimeAxisView::RedirectAutomationInfo::~RedirectAutomationInfo ()
1327 for (vector<RedirectAutomationNode*>::iterator i = lines.begin(); i != lines.end(); ++i) {
1333 AudioTimeAxisView::RedirectAutomationNode::~RedirectAutomationNode ()
1335 parent.remove_ran (this);
1343 AudioTimeAxisView::remove_ran (RedirectAutomationNode* ran)
1346 remove_child (ran->view);
1350 AudioTimeAxisView::RedirectAutomationNode*
1351 AudioTimeAxisView::find_redirect_automation_node (Redirect *redirect, uint32_t what)
1353 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1355 if ((*i)->redirect == redirect) {
1357 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1358 if ((*ii)->what == what) {
1369 legalize_for_xml_node (string str)
1371 string::size_type pos;
1372 string legal_chars = "abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_+=:";
1378 while ((pos = legal.find_first_not_of (legal_chars, pos)) != string::npos) {
1379 legal.replace (pos, 1, "_");
1388 AudioTimeAxisView::add_redirect_automation_curve (Redirect *redirect, uint32_t what)
1390 RedirectAutomationLine* ral;
1392 RedirectAutomationNode* ran;
1394 if ((ran = find_redirect_automation_node (redirect, what)) == 0) {
1395 fatal << _("programming error: ")
1396 << string_compose (X_("redirect automation curve for %1:%2 not registered with audio track!"),
1397 redirect->name(), what)
1407 name = redirect->describe_parameter (what);
1409 /* create a string that is a legal XML node name that can be used to refer to this redirect+port combination */
1411 char state_name[256];
1412 snprintf (state_name, sizeof (state_name), "Redirect-%s-%" PRIu32, legalize_for_xml_node (redirect->name()).c_str(), what);
1414 ran->view = new RedirectAutomationTimeAxisView (_session, _route, editor, *this, parent_canvas, name, what, *redirect, state_name);
1416 ral = new RedirectAutomationLine (name,
1417 *redirect, what, _session, *ran->view,
1418 *ran->view->canvas_display, redirect->automation_list (what));
1420 ral->set_line_color (color_map[cRedirectAutomationLine]);
1421 ral->queue_reset ();
1423 ran->view->add_line (*ral);
1425 ran->view->Hiding.connect (bind (mem_fun(*this, &AudioTimeAxisView::redirect_automation_track_hidden), ran, redirect));
1427 if (!ran->view->marked_for_display()) {
1430 ran->menu_item->set_active (true);
1433 add_child (ran->view);
1435 view->foreach_regionview (bind (mem_fun(*this, &AudioTimeAxisView::add_ghost_to_redirect), ran->view));
1437 redirect->mark_automation_visible (what, true);
1441 AudioTimeAxisView::redirect_automation_track_hidden (AudioTimeAxisView::RedirectAutomationNode* ran, Redirect* r)
1444 ran->menu_item->set_active (false);
1447 r->mark_automation_visible (ran->what, false);
1449 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1453 AudioTimeAxisView::add_existing_redirect_automation_curves (Redirect *redirect)
1456 RedirectAutomationLine *ral;
1458 redirect->what_has_visible_automation (s);
1460 for (set<uint32_t>::iterator i = s.begin(); i != s.end(); ++i) {
1462 if ((ral = find_redirect_automation_curve (redirect, *i)) != 0) {
1463 ral->queue_reset ();
1465 add_redirect_automation_curve (redirect, (*i));
1471 AudioTimeAxisView::add_redirect_to_subplugin_menu (Redirect* r)
1473 using namespace Menu_Helpers;
1474 RedirectAutomationInfo *rai;
1475 list<RedirectAutomationInfo*>::iterator x;
1477 const std::set<uint32_t>& automatable = r->what_can_be_automated ();
1478 std::set<uint32_t> has_visible_automation;
1480 r->what_has_visible_automation(has_visible_automation);
1482 if (automatable.empty()) {
1486 for (x = redirect_automation.begin(); x != redirect_automation.end(); ++x) {
1487 if ((*x)->redirect == r) {
1492 if (x == redirect_automation.end()) {
1494 rai = new RedirectAutomationInfo (r);
1495 redirect_automation.push_back (rai);
1503 /* any older menu was deleted at the top of redirects_changed()
1504 when we cleared the subplugin menu.
1507 rai->menu = manage (new Menu);
1508 MenuList& items = rai->menu->items();
1509 rai->menu->set_name ("ArdourContextMenu");
1513 for (std::set<uint32_t>::const_iterator i = automatable.begin(); i != automatable.end(); ++i) {
1515 RedirectAutomationNode* ran;
1516 CheckMenuItem* mitem;
1518 string name = r->describe_parameter (*i);
1520 items.push_back (CheckMenuElem (name));
1521 mitem = dynamic_cast<CheckMenuItem*> (&items.back());
1523 if (has_visible_automation.find((*i)) != has_visible_automation.end()) {
1524 mitem->set_active(true);
1527 if ((ran = find_redirect_automation_node (r, *i)) == 0) {
1531 ran = new RedirectAutomationNode (*i, mitem, *this);
1533 rai->lines.push_back (ran);
1537 ran->menu_item = mitem;
1541 mitem->signal_toggled().connect (bind (mem_fun(*this, &AudioTimeAxisView::redirect_menu_item_toggled), rai, ran));
1544 /* add the menu for this redirect, because the subplugin
1545 menu is always cleared at the top of redirects_changed().
1546 this is the result of some poor design in gtkmm and/or
1550 subplugin_menu.items().push_back (MenuElem (r->name(), *rai->menu));
1555 AudioTimeAxisView::redirect_menu_item_toggled (AudioTimeAxisView::RedirectAutomationInfo* rai,
1556 AudioTimeAxisView::RedirectAutomationNode* ran)
1558 bool showit = ran->menu_item->get_active();
1559 bool redraw = false;
1561 if (ran->view == 0 && showit) {
1562 add_redirect_automation_curve (rai->redirect, ran->what);
1566 if (showit != ran->view->marked_for_display()) {
1569 ran->view->set_marked_for_display (true);
1570 ran->view->canvas_display->show();
1572 rai->redirect->mark_automation_visible (ran->what, true);
1573 ran->view->set_marked_for_display (false);
1581 if (redraw && !no_redraw) {
1583 /* now trigger a redisplay */
1585 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1591 AudioTimeAxisView::redirects_changed (void *src)
1593 using namespace Menu_Helpers;
1595 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1596 (*i)->valid = false;
1599 subplugin_menu.items().clear ();
1601 _route.foreach_redirect (this, &AudioTimeAxisView::add_redirect_to_subplugin_menu);
1602 _route.foreach_redirect (this, &AudioTimeAxisView::add_existing_redirect_automation_curves);
1604 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ) {
1606 list<RedirectAutomationInfo*>::iterator tmp;
1614 redirect_automation.erase (i);
1621 /* change in visibility was possible */
1623 _route.gui_changed ("track_height", this);
1626 RedirectAutomationLine *
1627 AudioTimeAxisView::find_redirect_automation_curve (Redirect *redirect, uint32_t what)
1629 RedirectAutomationNode* ran;
1631 if ((ran = find_redirect_automation_node (redirect, what)) != 0) {
1633 return dynamic_cast<RedirectAutomationLine*> (ran->view->lines.front());
1641 AudioTimeAxisView::show_all_automation ()
1645 pan_automation_item->set_active (true);
1646 gain_automation_item->set_active (true);
1648 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1649 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1650 if ((*ii)->view == 0) {
1651 add_redirect_automation_curve ((*i)->redirect, (*ii)->what);
1654 (*ii)->menu_item->set_active (true);
1660 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1664 AudioTimeAxisView::show_existing_automation ()
1668 pan_automation_item->set_active (true);
1669 gain_automation_item->set_active (true);
1671 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1672 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1673 if ((*ii)->view != 0) {
1674 (*ii)->menu_item->set_active (true);
1681 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1685 AudioTimeAxisView::hide_all_automation ()
1689 pan_automation_item->set_active (false);
1690 gain_automation_item->set_active (false);
1692 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1693 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1694 (*ii)->menu_item->set_active (false);
1699 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1703 AudioTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op)
1705 Playlist* what_we_got;
1706 DiskStream* ds = get_diskstream();
1711 /* route is a bus, not a track */
1715 playlist = ds->playlist();
1718 TimeSelection time (selection.time);
1719 float speed = ds->speed();
1720 if (speed != 1.0f) {
1721 for (TimeSelection::iterator i = time.begin(); i != time.end(); ++i) {
1722 (*i).start = session_frame_to_track_frame((*i).start, speed);
1723 (*i).end = session_frame_to_track_frame((*i).end, speed);
1729 _session.add_undo (playlist->get_memento());
1730 if ((what_we_got = playlist->cut (time)) != 0) {
1731 editor.get_cut_buffer().add (what_we_got);
1732 _session.add_redo_no_execute (playlist->get_memento());
1737 if ((what_we_got = playlist->copy (time)) != 0) {
1738 editor.get_cut_buffer().add (what_we_got);
1743 _session.add_undo (playlist->get_memento());
1744 if ((what_we_got = playlist->cut (time)) != 0) {
1745 _session.add_redo_no_execute (playlist->get_memento());
1746 what_we_got->unref ();
1756 AudioTimeAxisView::paste (jack_nframes_t pos, float times, Selection& selection, size_t nth)
1758 if (!is_audio_track()) {
1762 Playlist* playlist = get_diskstream()->playlist();
1763 PlaylistSelection::iterator p;
1765 for (p = selection.playlists.begin(); p != selection.playlists.end() && nth; ++p, --nth);
1767 if (p == selection.playlists.end()) {
1771 if (get_diskstream()->speed() != 1.0f)
1772 pos = session_frame_to_track_frame(pos, get_diskstream()->speed() );
1774 _session.add_undo (playlist->get_memento());
1775 playlist->paste (**p, pos, times);
1776 _session.add_redo_no_execute (playlist->get_memento());
1782 AudioTimeAxisView::region_view_added (AudioRegionView* arv)
1784 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1785 AutomationTimeAxisView* atv;
1787 if ((atv = dynamic_cast<AutomationTimeAxisView*> (*i)) != 0) {
1788 arv->add_ghost (*atv);
1794 AudioTimeAxisView::add_ghost_to_redirect (AudioRegionView* arv, AutomationTimeAxisView* atv)
1796 arv->add_ghost (*atv);
1800 AudioTimeAxisView::get_child_list()
1803 list<TimeAxisView*>redirect_children;
1805 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1806 if (!(*i)->hidden()) {
1807 redirect_children.push_back(*i);
1810 return redirect_children;
1815 AudioTimeAxisView::build_playlist_menu (Gtk::Menu * menu)
1817 using namespace Menu_Helpers;
1819 if (!menu || !is_audio_track()) {
1823 MenuList& playlist_items = menu->items();
1824 menu->set_name ("ArdourContextMenu");
1825 playlist_items.clear();
1827 if (playlist_menu) {
1828 delete playlist_menu;
1830 playlist_menu = new Menu;
1831 playlist_menu->set_name ("ArdourContextMenu");
1833 playlist_items.push_back (MenuElem (string_compose (_("Current: %1"), get_diskstream()->playlist()->name())));
1834 playlist_items.push_back (SeparatorElem());
1836 playlist_items.push_back (MenuElem (_("Rename"), mem_fun(*this, &AudioTimeAxisView::rename_current_playlist)));
1837 playlist_items.push_back (SeparatorElem());
1839 playlist_items.push_back (MenuElem (_("New"), mem_fun(editor, &PublicEditor::new_playlists)));
1840 playlist_items.push_back (MenuElem (_("New Copy"), mem_fun(editor, &PublicEditor::copy_playlists)));
1841 playlist_items.push_back (SeparatorElem());
1842 playlist_items.push_back (MenuElem (_("Clear Current"), mem_fun(editor, &PublicEditor::clear_playlists)));
1843 playlist_items.push_back (SeparatorElem());
1844 playlist_items.push_back (MenuElem(_("Select"), mem_fun(*this, &AudioTimeAxisView::show_playlist_selector)));
1849 AudioTimeAxisView::show_playlist_selector ()
1851 editor.playlist_selector().show_for (this);
1856 AudioTimeAxisView::map_frozen ()
1858 if (!is_audio_track()) {
1862 ENSURE_GUI_THREAD (mem_fun(*this, &AudioTimeAxisView::map_frozen));
1865 switch (audio_track()->freeze_state()) {
1866 case AudioTrack::Frozen:
1867 playlist_button.set_sensitive (false);
1868 rec_enable_button->set_sensitive (false);
1871 playlist_button.set_sensitive (true);
1872 rec_enable_button->set_sensitive (true);
1878 AudioTimeAxisView::show_all_xfades ()
1881 view->show_all_xfades ();
1886 AudioTimeAxisView::hide_all_xfades ()
1889 view->hide_all_xfades ();
1894 AudioTimeAxisView::hide_dependent_views (TimeAxisViewItem& tavi)
1896 AudioRegionView* rv;
1898 if (view && (rv = dynamic_cast<AudioRegionView*>(&tavi)) != 0) {
1899 view->hide_xfades_involving (*rv);
1904 AudioTimeAxisView::reveal_dependent_views (TimeAxisViewItem& tavi)
1906 AudioRegionView* rv;
1908 if (view && (rv = dynamic_cast<AudioRegionView*>(&tavi)) != 0) {
1909 view->reveal_xfades_involving (*rv);
1914 AudioTimeAxisView::route_active_changed ()
1916 RouteUI::route_active_changed ();
1918 if (is_audio_track()) {
1919 if (_route.active()) {
1920 controls_ebox.set_name ("AudioTrackControlsBaseUnselected");
1921 controls_base_selected_name = "AudioTrackControlsBaseSelected";
1922 controls_base_unselected_name = "AudioTrackControlsBaseUnselected";
1924 controls_ebox.set_name ("AudioTrackControlsBaseInactiveUnselected");
1925 controls_base_selected_name = "AudioTrackControlsBaseInactiveSelected";
1926 controls_base_unselected_name = "AudioTrackControlsBaseInactiveUnselected";
1929 if (_route.active()) {
1930 controls_ebox.set_name ("BusControlsBaseUnselected");
1931 controls_base_selected_name = "BusControlsBaseSelected";
1932 controls_base_unselected_name = "BusControlsBaseUnselected";
1934 controls_ebox.set_name ("BusControlsBaseInactiveUnselected");
1935 controls_base_selected_name = "BusControlsBaseInactiveSelected";
1936 controls_base_unselected_name = "BusControlsBaseInactiveUnselected";
1942 AudioTimeAxisView::get_child_xml_node (const string & childname)
1944 return RouteUI::get_child_xml_node (childname);
1948 AudioTimeAxisView::color_handler (ColorID id, uint32_t val)
1951 case cTimeStretchOutline:
1952 timestretch_rect->property_outline_color_rgba() = val;
1954 case cTimeStretchFill:
1955 timestretch_rect->property_fill_color_rgba() = val;