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;
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, 5, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
174 controls_table.attach (*mute_button, 6, 7, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
175 controls_table.attach (*solo_button, 7, 8, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::FILL|Gtk::EXPAND, 0, 0);
177 controls_table.attach (edit_group_button, 6, 7, 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, 5, 6, 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 != height_style);
591 TimeAxisView::set_height (h);
595 view->set_height ((double) height);
597 switch (height_style) {
599 xml_node->add_property ("track_height", "largest");
602 controls_table.show_all();
605 xml_node->add_property ("track_height", "large");
608 controls_table.show_all();
611 xml_node->add_property ("track_height", "larger");
614 controls_table.show_all();
617 xml_node->add_property ("track_height", "normal");
620 controls_table.show_all();
623 xml_node->add_property ("track_height", "smaller");
624 controls_table.show_all ();
627 edit_group_button.hide ();
629 visual_button.hide ();
631 automation_button.hide ();
632 playlist_button.hide ();
635 xml_node->add_property ("track_height", "small");
636 controls_table.hide_all ();
637 controls_table.show ();
640 name_label.set_text (_route.name());
644 if (height_changed) {
645 /* only emit the signal if the height really changed */
646 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
651 AudioTimeAxisView::select_track_color ()
653 if (RouteUI::choose_color ()) {
656 view->apply_color (_color, StreamView::RegionColor);
662 AudioTimeAxisView::reset_redirect_automation_curves ()
664 for (vector<RedirectAutomationLine*>::iterator i = redirect_automation_curves.begin(); i != redirect_automation_curves.end(); ++i) {
670 AudioTimeAxisView::reset_samples_per_unit ()
672 set_samples_per_unit (editor.get_current_zoom());
676 AudioTimeAxisView::set_samples_per_unit (double spu)
680 if (get_diskstream() != 0) {
681 speed = get_diskstream()->speed();
685 view->set_samples_per_unit (spu * speed);
688 TimeAxisView::set_samples_per_unit (spu * speed);
692 AudioTimeAxisView::build_display_menu ()
694 using namespace Menu_Helpers;
696 /* get the size menu ready */
702 TimeAxisView::build_display_menu ();
704 /* now fill it with our stuff */
706 MenuList& items = display_menu->items();
707 display_menu->set_name ("ArdourContextMenu");
709 items.push_back (MenuElem (_("Height"), *size_menu));
710 items.push_back (MenuElem (_("Color"), mem_fun(*this, &AudioTimeAxisView::select_track_color)));
713 items.push_back (SeparatorElem());
714 items.push_back (MenuElem (_("Hide all crossfades"), mem_fun(*this, &AudioTimeAxisView::hide_all_xfades)));
715 items.push_back (MenuElem (_("Show all crossfades"), mem_fun(*this, &AudioTimeAxisView::show_all_xfades)));
716 items.push_back (SeparatorElem());
719 automation_action_menu = manage (new Menu);
720 MenuList& automation_items = automation_action_menu->items();
721 automation_action_menu->set_name ("ArdourContextMenu");
723 automation_items.push_back (MenuElem (_("show all automation"),
724 mem_fun(*this, &AudioTimeAxisView::show_all_automation)));
726 automation_items.push_back (MenuElem (_("show existing automation"),
727 mem_fun(*this, &AudioTimeAxisView::show_existing_automation)));
729 automation_items.push_back (MenuElem (_("hide all automation"),
730 mem_fun(*this, &AudioTimeAxisView::hide_all_automation)));
732 automation_items.push_back (SeparatorElem());
734 automation_items.push_back (CheckMenuElem (_("gain"),
735 mem_fun(*this, &AudioTimeAxisView::toggle_gain_track)));
736 gain_automation_item = static_cast<CheckMenuItem*> (&automation_items.back());
737 gain_automation_item->set_active(show_gain_automation);
739 automation_items.push_back (CheckMenuElem (_("pan"),
740 mem_fun(*this, &AudioTimeAxisView::toggle_pan_track)));
741 pan_automation_item = static_cast<CheckMenuItem*> (&automation_items.back());
742 pan_automation_item->set_active(show_pan_automation);
744 automation_items.push_back (MenuElem (_("Plugins"), subplugin_menu));
746 items.push_back (MenuElem (_("Automation"), *automation_action_menu));
748 Menu *waveform_menu = manage(new Menu);
749 MenuList& waveform_items = waveform_menu->items();
750 waveform_menu->set_name ("ArdourContextMenu");
752 waveform_items.push_back (CheckMenuElem (_("Show waveforms"), mem_fun(*this, &AudioTimeAxisView::toggle_waveforms)));
753 waveform_item = static_cast<CheckMenuItem *> (&waveform_items.back());
754 ignore_toggle = true;
755 waveform_item->set_active (editor.show_waveforms());
756 ignore_toggle = false;
758 RadioMenuItem::Group group;
760 waveform_items.push_back (RadioMenuElem (group, _("Traditional"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_shape), Traditional)));
761 traditional_item = static_cast<RadioMenuItem *> (&waveform_items.back());
763 waveform_items.push_back (RadioMenuElem (group, _("Rectified"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_shape), Rectified)));
764 rectified_item = static_cast<RadioMenuItem *> (&waveform_items.back());
766 items.push_back (MenuElem (_("Waveform"), *waveform_menu));
768 if (is_audio_track()) {
770 Menu* alignment_menu = manage (new Menu);
771 MenuList& alignment_items = alignment_menu->items();
772 alignment_menu->set_name ("ArdourContextMenu");
774 RadioMenuItem::Group align_group;
776 alignment_items.push_back (RadioMenuElem (align_group, _("align with existing material"), bind (mem_fun(*this, &AudioTimeAxisView::set_align_style), ExistingMaterial)));
777 align_existing_item = dynamic_cast<RadioMenuItem*>(&alignment_items.back());
778 if (get_diskstream()->alignment_style() == ExistingMaterial) {
779 align_existing_item->set_active();
781 alignment_items.push_back (RadioMenuElem (align_group, _("align with capture time"), bind (mem_fun(*this, &AudioTimeAxisView::set_align_style), CaptureTime)));
782 align_capture_item = dynamic_cast<RadioMenuItem*>(&alignment_items.back());
783 if (get_diskstream()->alignment_style() == CaptureTime) {
784 align_capture_item->set_active();
787 items.push_back (MenuElem (_("Alignment"), *alignment_menu));
789 get_diskstream()->AlignmentStyleChanged.connect (mem_fun(*this, &AudioTimeAxisView::align_style_changed));
792 items.push_back (SeparatorElem());
793 items.push_back (CheckMenuElem (_("Active"), mem_fun(*this, &RouteUI::toggle_route_active)));
794 route_active_menu_item = dynamic_cast<CheckMenuItem *> (&items.back());
795 route_active_menu_item->set_active (_route.active());
797 items.push_back (SeparatorElem());
798 items.push_back (MenuElem (_("Remove"), mem_fun(*this, &RouteUI::remove_this_route)));
803 AudioTimeAxisView::align_style_changed ()
805 switch (get_diskstream()->alignment_style()) {
806 case ExistingMaterial:
807 if (!align_existing_item->get_active()) {
808 align_existing_item->set_active();
812 if (!align_capture_item->get_active()) {
813 align_capture_item->set_active();
820 AudioTimeAxisView::set_align_style (AlignStyle style)
822 get_diskstream()->set_align_style (style);
826 AudioTimeAxisView::rename_current_playlist ()
828 ArdourPrompter prompter (true);
834 if (((ds = get_diskstream()) == 0) ||((pl = ds->playlist()) == 0)) {
838 prompter.set_prompt (_("Name for playlist"));
839 prompter.set_initial_text (pl->name());
841 switch (prompter.run ()) {
842 case Gtk::RESPONSE_ACCEPT:
843 prompter.get_result (name);
855 AudioTimeAxisView::playlist_selected (AudioPlaylist *pl)
859 if ((ds = get_diskstream()) != 0) {
860 ds->use_playlist (pl);
865 AudioTimeAxisView::use_copy_playlist ()
871 if (((ds = get_diskstream()) == 0) || ((pl = ds->playlist()) == 0)) {
875 ArdourPrompter prompter (true);
876 string new_name = Playlist::bump_name (pl->name(), _session);
878 prompter.set_prompt (_("Name for playlist"));
879 prompter.set_initial_text (new_name);
880 prompter.show_all ();
882 switch (prompter.run ()) {
883 case Gtk::RESPONSE_ACCEPT:
884 prompter.get_result (name);
886 ds->use_copy_playlist ();
898 AudioTimeAxisView::use_new_playlist ()
904 if (((ds = get_diskstream()) == 0) || ((pl = ds->playlist()) == 0)) {
908 ArdourPrompter prompter (true);
909 string new_name = Playlist::bump_name (pl->name(), _session);
911 prompter.set_prompt (_("Name for playlist"));
912 prompter.set_initial_text (new_name);
914 switch (prompter.run ()) {
915 case Gtk::RESPONSE_ACCEPT:
916 prompter.get_result (name);
918 ds->use_new_playlist ();
930 AudioTimeAxisView::clear_playlist ()
935 if ((ds = get_diskstream()) != 0) {
936 if ((pl = ds->playlist()) != 0) {
937 editor.clear_playlist (*pl);
943 AudioTimeAxisView::toggle_waveforms ()
945 if (view && waveform_item && !ignore_toggle) {
946 view->set_show_waveforms (waveform_item->get_active());
951 AudioTimeAxisView::set_show_waveforms (bool yn)
954 waveform_item->set_active (yn);
956 view->set_show_waveforms (yn);
961 AudioTimeAxisView::set_show_waveforms_recording (bool yn)
964 view->set_show_waveforms_recording (yn);
969 AudioTimeAxisView::set_waveform_shape (WaveformShape shape)
972 view->set_waveform_shape (shape);
977 AudioTimeAxisView::speed_changed ()
979 Gtkmm2ext::UI::instance()->call_slot (mem_fun(*this, &AudioTimeAxisView::reset_samples_per_unit));
983 AudioTimeAxisView::diskstream_changed (void *src)
985 Gtkmm2ext::UI::instance()->call_slot (mem_fun(*this, &AudioTimeAxisView::update_diskstream_display));
989 AudioTimeAxisView::update_diskstream_display ()
993 if ((ds = get_diskstream()) != 0) {
994 set_playlist (ds->playlist ());
1001 AudioTimeAxisView::selection_click (GdkEventButton* ev)
1003 PublicEditor::TrackViewList* tracks = editor.get_valid_views (this, _route.edit_group());
1005 if (Keyboard::modifier_state_contains (ev->state, Keyboard::Shift)) {
1006 if (editor.get_selection().selected (this)) {
1007 editor.get_selection().remove (*tracks);
1009 editor.get_selection().add (*tracks);
1012 editor.get_selection().set (*tracks);
1019 AudioTimeAxisView::set_selected_regionviews (AudioRegionSelection& regions)
1022 view->set_selected_regionviews (regions);
1027 AudioTimeAxisView::set_selected_points (PointSelection& points)
1029 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1030 (*i)->set_selected_points (points);
1035 AudioTimeAxisView::get_selectables (jack_nframes_t start, jack_nframes_t end, double top, double bot, list<Selectable*>& results)
1039 if (get_diskstream() != 0) {
1040 speed = get_diskstream()->speed();
1043 jack_nframes_t start_adjusted = session_frame_to_track_frame(start, speed);
1044 jack_nframes_t end_adjusted = session_frame_to_track_frame(end, speed);
1046 if (view && touched (top, bot)) {
1047 view->get_selectables (start_adjusted, end_adjusted, results);
1050 /* pick up visible automation tracks */
1052 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1053 if (!(*i)->hidden()) {
1054 (*i)->get_selectables (start_adjusted, end_adjusted, top, bot, results);
1060 AudioTimeAxisView::get_inverted_selectables (Selection& sel, list<Selectable*>& results)
1063 view->get_inverted_selectables (sel, results);
1066 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1067 if (!(*i)->hidden()) {
1068 (*i)->get_inverted_selectables (sel, results);
1076 AudioTimeAxisView::edit_group() const
1078 return _route.edit_group();
1082 AudioTimeAxisView::name() const
1084 return _route.name();
1088 AudioTimeAxisView::playlist () const
1092 if ((ds = get_diskstream()) != 0) {
1093 return ds->playlist();
1100 AudioTimeAxisView::name_entry_changed ()
1104 x = name_entry.get_text ();
1106 if (x == _route.name()) {
1110 if (x.length() == 0) {
1111 name_entry.set_text (_route.name());
1115 strip_whitespace_edges(x);
1117 if (_session.route_name_unique (x)) {
1118 _route.set_name (x, this);
1120 ARDOUR_UI::instance()->popup_error (_("a track already exists with that name"));
1121 name_entry.set_text (_route.name());
1126 AudioTimeAxisView::visual_click ()
1128 popup_display_menu (0);
1132 AudioTimeAxisView::hide_click ()
1134 editor.hide_track_in_display (*this);
1138 AudioTimeAxisView::find_next_region (jack_nframes_t pos, RegionPoint point, int32_t dir)
1141 AudioPlaylist *playlist;
1143 if ((stream = get_diskstream()) != 0 && (playlist = stream->playlist()) != 0) {
1144 return playlist->find_next_region (pos, point, dir);
1151 AudioTimeAxisView::add_gain_automation_child ()
1154 AutomationLine* line;
1156 gain_track = new GainAutomationTimeAxisView (_session,
1162 _route.gain_automation_curve());
1164 line = new AutomationGainLine ("automation gain",
1167 *gain_track->canvas_display,
1168 _route.gain_automation_curve());
1170 line->set_line_color (color_map[cAutomationLine]);
1173 gain_track->add_line (*line);
1175 add_child (gain_track);
1177 gain_track->Hiding.connect (mem_fun(*this, &AudioTimeAxisView::gain_hidden));
1183 if ((node = gain_track->get_state_node()) != 0) {
1184 if ((prop = node->property ("shown")) != 0) {
1185 if (prop->value() == "yes") {
1192 gain_track->hide ();
1197 AudioTimeAxisView::add_pan_automation_child ()
1201 pan_track = new PanAutomationTimeAxisView (_session, _route, editor, *this, parent_canvas, _("pan"));
1205 add_child (pan_track);
1207 pan_track->Hiding.connect (mem_fun(*this, &AudioTimeAxisView::pan_hidden));
1214 if ((node = pan_track->get_state_node()) != 0) {
1215 if ((prop = node->property ("shown")) != 0) {
1216 if (prop->value() == "yes") {
1228 AudioTimeAxisView::update_pans ()
1232 pan_track->clear_lines ();
1234 /* we don't draw lines for "greater than stereo" panning.
1237 if (_route.n_outputs() > 2) {
1241 for (p = _route.panner().begin(); p != _route.panner().end(); ++p) {
1243 AutomationLine* line;
1245 line = new AutomationPanLine ("automation pan", _session, *pan_track,
1246 *pan_track->canvas_display,
1247 (*p)->automation());
1249 if (p == _route.panner().begin()) {
1250 /* first line is a nice orange */
1251 line->set_line_color (color_map[cLeftPanAutomationLine]);
1253 /* second line is a nice blue */
1254 line->set_line_color (color_map[cRightPanAutomationLine]);
1257 pan_track->add_line (*line);
1262 AudioTimeAxisView::toggle_gain_track ()
1265 bool showit = gain_automation_item->get_active();
1267 if (showit != gain_track->marked_for_display()) {
1269 gain_track->set_marked_for_display (true);
1270 gain_track->canvas_display->show();
1271 gain_track->get_state_node()->add_property ("shown", X_("yes"));
1273 gain_track->set_marked_for_display (false);
1274 gain_track->hide ();
1275 gain_track->get_state_node()->add_property ("shown", X_("no"));
1278 /* now trigger a redisplay */
1281 _route.gui_changed (X_("track_height"), (void *) 0); /* EMIT_SIGNAL */
1287 AudioTimeAxisView::gain_hidden ()
1289 gain_track->get_state_node()->add_property (X_("shown"), X_("no"));
1291 if (gain_automation_item && !_hidden) {
1292 gain_automation_item->set_active (false);
1295 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1299 AudioTimeAxisView::toggle_pan_track ()
1301 bool showit = pan_automation_item->get_active();
1303 if (showit != pan_track->marked_for_display()) {
1305 pan_track->set_marked_for_display (true);
1306 pan_track->canvas_display->show();
1307 pan_track->get_state_node()->add_property ("shown", X_("yes"));
1309 pan_track->set_marked_for_display (false);
1311 pan_track->get_state_node()->add_property ("shown", X_("no"));
1314 /* now trigger a redisplay */
1317 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1323 AudioTimeAxisView::pan_hidden ()
1325 pan_track->get_state_node()->add_property ("shown", "no");
1327 if (pan_automation_item && !_hidden) {
1328 pan_automation_item->set_active (false);
1331 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1334 AudioTimeAxisView::RedirectAutomationInfo::~RedirectAutomationInfo ()
1336 for (vector<RedirectAutomationNode*>::iterator i = lines.begin(); i != lines.end(); ++i) {
1342 AudioTimeAxisView::RedirectAutomationNode::~RedirectAutomationNode ()
1344 parent.remove_ran (this);
1352 AudioTimeAxisView::remove_ran (RedirectAutomationNode* ran)
1355 remove_child (ran->view);
1359 AudioTimeAxisView::RedirectAutomationNode*
1360 AudioTimeAxisView::find_redirect_automation_node (Redirect *redirect, uint32_t what)
1362 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1364 if ((*i)->redirect == redirect) {
1366 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1367 if ((*ii)->what == what) {
1378 legalize_for_xml_node (string str)
1380 string::size_type pos;
1381 string legal_chars = "abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_+=:";
1387 while ((pos = legal.find_first_not_of (legal_chars, pos)) != string::npos) {
1388 legal.replace (pos, 1, "_");
1397 AudioTimeAxisView::add_redirect_automation_curve (Redirect *redirect, uint32_t what)
1399 RedirectAutomationLine* ral;
1401 RedirectAutomationNode* ran;
1403 if ((ran = find_redirect_automation_node (redirect, what)) == 0) {
1404 fatal << _("programming error: ")
1405 << string_compose (X_("redirect automation curve for %1:%2 not registered with audio track!"),
1406 redirect->name(), what)
1416 name = redirect->describe_parameter (what);
1418 /* create a string that is a legal XML node name that can be used to refer to this redirect+port combination */
1420 char state_name[256];
1421 snprintf (state_name, sizeof (state_name), "Redirect-%s-%" PRIu32, legalize_for_xml_node (redirect->name()).c_str(), what);
1423 ran->view = new RedirectAutomationTimeAxisView (_session, _route, editor, *this, parent_canvas, name, what, *redirect, state_name);
1425 ral = new RedirectAutomationLine (name,
1426 *redirect, what, _session, *ran->view,
1427 *ran->view->canvas_display, redirect->automation_list (what));
1429 ral->set_line_color (color_map[cRedirectAutomationLine]);
1430 ral->queue_reset ();
1432 ran->view->add_line (*ral);
1434 ran->view->Hiding.connect (bind (mem_fun(*this, &AudioTimeAxisView::redirect_automation_track_hidden), ran, redirect));
1436 if (!ran->view->marked_for_display()) {
1439 ran->menu_item->set_active (true);
1442 add_child (ran->view);
1444 view->foreach_regionview (bind (mem_fun(*this, &AudioTimeAxisView::add_ghost_to_redirect), ran->view));
1446 redirect->mark_automation_visible (what, true);
1450 AudioTimeAxisView::redirect_automation_track_hidden (AudioTimeAxisView::RedirectAutomationNode* ran, Redirect* r)
1453 ran->menu_item->set_active (false);
1456 r->mark_automation_visible (ran->what, false);
1458 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1462 AudioTimeAxisView::add_existing_redirect_automation_curves (Redirect *redirect)
1465 RedirectAutomationLine *ral;
1467 redirect->what_has_visible_automation (s);
1469 for (set<uint32_t>::iterator i = s.begin(); i != s.end(); ++i) {
1471 if ((ral = find_redirect_automation_curve (redirect, *i)) != 0) {
1472 ral->queue_reset ();
1474 add_redirect_automation_curve (redirect, (*i));
1480 AudioTimeAxisView::add_redirect_to_subplugin_menu (Redirect* r)
1482 using namespace Menu_Helpers;
1483 RedirectAutomationInfo *rai;
1484 list<RedirectAutomationInfo*>::iterator x;
1486 const std::set<uint32_t>& automatable = r->what_can_be_automated ();
1487 std::set<uint32_t> has_visible_automation;
1489 r->what_has_visible_automation(has_visible_automation);
1491 if (automatable.empty()) {
1495 for (x = redirect_automation.begin(); x != redirect_automation.end(); ++x) {
1496 if ((*x)->redirect == r) {
1501 if (x == redirect_automation.end()) {
1503 rai = new RedirectAutomationInfo (r);
1504 redirect_automation.push_back (rai);
1512 /* any older menu was deleted at the top of redirects_changed()
1513 when we cleared the subplugin menu.
1516 rai->menu = manage (new Menu);
1517 MenuList& items = rai->menu->items();
1518 rai->menu->set_name ("ArdourContextMenu");
1522 for (std::set<uint32_t>::const_iterator i = automatable.begin(); i != automatable.end(); ++i) {
1524 RedirectAutomationNode* ran;
1525 CheckMenuItem* mitem;
1527 string name = r->describe_parameter (*i);
1529 items.push_back (CheckMenuElem (name));
1530 mitem = dynamic_cast<CheckMenuItem*> (&items.back());
1532 if (has_visible_automation.find((*i)) != has_visible_automation.end()) {
1533 mitem->set_active(true);
1536 if ((ran = find_redirect_automation_node (r, *i)) == 0) {
1540 ran = new RedirectAutomationNode (*i, mitem, *this);
1542 rai->lines.push_back (ran);
1546 ran->menu_item = mitem;
1550 mitem->signal_toggled().connect (bind (mem_fun(*this, &AudioTimeAxisView::redirect_menu_item_toggled), rai, ran));
1553 /* add the menu for this redirect, because the subplugin
1554 menu is always cleared at the top of redirects_changed().
1555 this is the result of some poor design in gtkmm and/or
1559 subplugin_menu.items().push_back (MenuElem (r->name(), *rai->menu));
1564 AudioTimeAxisView::redirect_menu_item_toggled (AudioTimeAxisView::RedirectAutomationInfo* rai,
1565 AudioTimeAxisView::RedirectAutomationNode* ran)
1567 bool showit = ran->menu_item->get_active();
1568 bool redraw = false;
1570 if (ran->view == 0 && showit) {
1571 add_redirect_automation_curve (rai->redirect, ran->what);
1575 if (showit != ran->view->marked_for_display()) {
1578 ran->view->set_marked_for_display (true);
1579 ran->view->canvas_display->show();
1581 rai->redirect->mark_automation_visible (ran->what, true);
1582 ran->view->set_marked_for_display (false);
1590 if (redraw && !no_redraw) {
1592 /* now trigger a redisplay */
1594 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1600 AudioTimeAxisView::redirects_changed (void *src)
1602 using namespace Menu_Helpers;
1604 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1605 (*i)->valid = false;
1608 subplugin_menu.items().clear ();
1610 _route.foreach_redirect (this, &AudioTimeAxisView::add_redirect_to_subplugin_menu);
1611 _route.foreach_redirect (this, &AudioTimeAxisView::add_existing_redirect_automation_curves);
1613 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ) {
1615 list<RedirectAutomationInfo*>::iterator tmp;
1623 redirect_automation.erase (i);
1630 /* change in visibility was possible */
1632 _route.gui_changed ("track_height", this);
1635 RedirectAutomationLine *
1636 AudioTimeAxisView::find_redirect_automation_curve (Redirect *redirect, uint32_t what)
1638 RedirectAutomationNode* ran;
1640 if ((ran = find_redirect_automation_node (redirect, what)) != 0) {
1642 return dynamic_cast<RedirectAutomationLine*> (ran->view->lines.front());
1650 AudioTimeAxisView::show_all_automation ()
1654 pan_automation_item->set_active (true);
1655 gain_automation_item->set_active (true);
1657 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1658 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1659 if ((*ii)->view == 0) {
1660 add_redirect_automation_curve ((*i)->redirect, (*ii)->what);
1663 (*ii)->menu_item->set_active (true);
1669 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1673 AudioTimeAxisView::show_existing_automation ()
1677 pan_automation_item->set_active (true);
1678 gain_automation_item->set_active (true);
1680 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1681 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1682 if ((*ii)->view != 0) {
1683 (*ii)->menu_item->set_active (true);
1690 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1694 AudioTimeAxisView::hide_all_automation ()
1698 pan_automation_item->set_active (false);
1699 gain_automation_item->set_active (false);
1701 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1702 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1703 (*ii)->menu_item->set_active (false);
1708 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1712 AudioTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op)
1714 Playlist* what_we_got;
1715 DiskStream* ds = get_diskstream();
1720 /* route is a bus, not a track */
1724 playlist = ds->playlist();
1727 TimeSelection time (selection.time);
1728 float speed = ds->speed();
1729 if (speed != 1.0f) {
1730 for (TimeSelection::iterator i = time.begin(); i != time.end(); ++i) {
1731 (*i).start = session_frame_to_track_frame((*i).start, speed);
1732 (*i).end = session_frame_to_track_frame((*i).end, speed);
1738 _session.add_undo (playlist->get_memento());
1739 if ((what_we_got = playlist->cut (time)) != 0) {
1740 editor.get_cut_buffer().add (what_we_got);
1741 _session.add_redo_no_execute (playlist->get_memento());
1746 if ((what_we_got = playlist->copy (time)) != 0) {
1747 editor.get_cut_buffer().add (what_we_got);
1752 _session.add_undo (playlist->get_memento());
1753 if ((what_we_got = playlist->cut (time)) != 0) {
1754 _session.add_redo_no_execute (playlist->get_memento());
1755 what_we_got->unref ();
1765 AudioTimeAxisView::paste (jack_nframes_t pos, float times, Selection& selection, size_t nth)
1767 if (!is_audio_track()) {
1771 Playlist* playlist = get_diskstream()->playlist();
1772 PlaylistSelection::iterator p;
1774 for (p = selection.playlists.begin(); p != selection.playlists.end() && nth; ++p, --nth);
1776 if (p == selection.playlists.end()) {
1780 if (get_diskstream()->speed() != 1.0f)
1781 pos = session_frame_to_track_frame(pos, get_diskstream()->speed() );
1783 _session.add_undo (playlist->get_memento());
1784 playlist->paste (**p, pos, times);
1785 _session.add_redo_no_execute (playlist->get_memento());
1791 AudioTimeAxisView::region_view_added (AudioRegionView* arv)
1793 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1794 AutomationTimeAxisView* atv;
1796 if ((atv = dynamic_cast<AutomationTimeAxisView*> (*i)) != 0) {
1797 arv->add_ghost (*atv);
1803 AudioTimeAxisView::add_ghost_to_redirect (AudioRegionView* arv, AutomationTimeAxisView* atv)
1805 arv->add_ghost (*atv);
1809 AudioTimeAxisView::get_child_list()
1812 list<TimeAxisView*>redirect_children;
1814 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1815 if (!(*i)->hidden()) {
1816 redirect_children.push_back(*i);
1819 return redirect_children;
1824 AudioTimeAxisView::build_playlist_menu (Gtk::Menu * menu)
1826 using namespace Menu_Helpers;
1828 if (!menu || !is_audio_track()) {
1832 MenuList& playlist_items = menu->items();
1833 menu->set_name ("ArdourContextMenu");
1834 playlist_items.clear();
1836 if (playlist_menu) {
1837 delete playlist_menu;
1839 playlist_menu = new Menu;
1840 playlist_menu->set_name ("ArdourContextMenu");
1842 playlist_items.push_back (MenuElem (string_compose (_("Current: %1"), get_diskstream()->playlist()->name())));
1843 playlist_items.push_back (SeparatorElem());
1845 playlist_items.push_back (MenuElem (_("Rename"), mem_fun(*this, &AudioTimeAxisView::rename_current_playlist)));
1846 playlist_items.push_back (SeparatorElem());
1848 playlist_items.push_back (MenuElem (_("New"), mem_fun(*this, &AudioTimeAxisView::use_new_playlist)));
1849 playlist_items.push_back (MenuElem (_("New Copy"), mem_fun(*this, &AudioTimeAxisView::use_copy_playlist)));
1850 playlist_items.push_back (SeparatorElem());
1851 playlist_items.push_back (MenuElem (_("Clear Current"), mem_fun(*this, &AudioTimeAxisView::clear_playlist)));
1852 playlist_items.push_back (SeparatorElem());
1853 playlist_items.push_back (MenuElem(_("Select"), mem_fun(*this, &AudioTimeAxisView::show_playlist_selector)));
1858 AudioTimeAxisView::show_playlist_selector ()
1860 editor.playlist_selector().show_for (this);
1865 AudioTimeAxisView::map_frozen ()
1867 if (!is_audio_track()) {
1871 ENSURE_GUI_THREAD (mem_fun(*this, &AudioTimeAxisView::map_frozen));
1874 switch (audio_track()->freeze_state()) {
1875 case AudioTrack::Frozen:
1876 playlist_button.set_sensitive (false);
1877 rec_enable_button->set_sensitive (false);
1880 playlist_button.set_sensitive (true);
1881 rec_enable_button->set_sensitive (true);
1887 AudioTimeAxisView::show_all_xfades ()
1890 view->show_all_xfades ();
1895 AudioTimeAxisView::hide_all_xfades ()
1898 view->hide_all_xfades ();
1903 AudioTimeAxisView::hide_dependent_views (TimeAxisViewItem& tavi)
1905 AudioRegionView* rv;
1907 if (view && (rv = dynamic_cast<AudioRegionView*>(&tavi)) != 0) {
1908 view->hide_xfades_involving (*rv);
1913 AudioTimeAxisView::reveal_dependent_views (TimeAxisViewItem& tavi)
1915 AudioRegionView* rv;
1917 if (view && (rv = dynamic_cast<AudioRegionView*>(&tavi)) != 0) {
1918 view->reveal_xfades_involving (*rv);
1923 AudioTimeAxisView::route_active_changed ()
1925 RouteUI::route_active_changed ();
1927 if (is_audio_track()) {
1928 if (_route.active()) {
1929 controls_ebox.set_name ("AudioTrackControlsBaseUnselected");
1930 controls_base_selected_name = "AudioTrackControlsBaseSelected";
1931 controls_base_unselected_name = "AudioTrackControlsBaseUnselected";
1933 controls_ebox.set_name ("AudioTrackControlsBaseInactiveUnselected");
1934 controls_base_selected_name = "AudioTrackControlsBaseInactiveSelected";
1935 controls_base_unselected_name = "AudioTrackControlsBaseInactiveUnselected";
1938 if (_route.active()) {
1939 controls_ebox.set_name ("BusControlsBaseUnselected");
1940 controls_base_selected_name = "BusControlsBaseSelected";
1941 controls_base_unselected_name = "BusControlsBaseUnselected";
1943 controls_ebox.set_name ("BusControlsBaseInactiveUnselected");
1944 controls_base_selected_name = "BusControlsBaseInactiveSelected";
1945 controls_base_unselected_name = "BusControlsBaseInactiveUnselected";
1951 AudioTimeAxisView::get_child_xml_node (const string & childname)
1953 return RouteUI::get_child_xml_node (childname);