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), false);
145 solo_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::solo_release), false);
146 mute_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::mute_press), false);
147 mute_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::mute_release), false);
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());
704 build_remote_control_menu ();
705 items.push_back (MenuElem (_("Remote Control ID"), *remote_control_menu));
707 automation_action_menu = manage (new Menu);
708 MenuList& automation_items = automation_action_menu->items();
709 automation_action_menu->set_name ("ArdourContextMenu");
711 automation_items.push_back (MenuElem (_("show all automation"),
712 mem_fun(*this, &AudioTimeAxisView::show_all_automation)));
714 automation_items.push_back (MenuElem (_("show existing automation"),
715 mem_fun(*this, &AudioTimeAxisView::show_existing_automation)));
717 automation_items.push_back (MenuElem (_("hide all automation"),
718 mem_fun(*this, &AudioTimeAxisView::hide_all_automation)));
720 automation_items.push_back (SeparatorElem());
722 automation_items.push_back (CheckMenuElem (_("gain"),
723 mem_fun(*this, &AudioTimeAxisView::toggle_gain_track)));
724 gain_automation_item = static_cast<CheckMenuItem*> (&automation_items.back());
725 gain_automation_item->set_active(show_gain_automation);
727 automation_items.push_back (CheckMenuElem (_("pan"),
728 mem_fun(*this, &AudioTimeAxisView::toggle_pan_track)));
729 pan_automation_item = static_cast<CheckMenuItem*> (&automation_items.back());
730 pan_automation_item->set_active(show_pan_automation);
732 automation_items.push_back (MenuElem (_("Plugins"), subplugin_menu));
734 items.push_back (MenuElem (_("Automation"), *automation_action_menu));
736 Menu *waveform_menu = manage(new Menu);
737 MenuList& waveform_items = waveform_menu->items();
738 waveform_menu->set_name ("ArdourContextMenu");
740 waveform_items.push_back (CheckMenuElem (_("Show waveforms"), mem_fun(*this, &AudioTimeAxisView::toggle_waveforms)));
741 waveform_item = static_cast<CheckMenuItem *> (&waveform_items.back());
742 ignore_toggle = true;
743 waveform_item->set_active (editor.show_waveforms());
744 ignore_toggle = false;
746 RadioMenuItem::Group group;
748 waveform_items.push_back (RadioMenuElem (group, _("Traditional"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_shape), Traditional)));
749 traditional_item = static_cast<RadioMenuItem *> (&waveform_items.back());
751 waveform_items.push_back (RadioMenuElem (group, _("Rectified"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_shape), Rectified)));
752 rectified_item = static_cast<RadioMenuItem *> (&waveform_items.back());
754 items.push_back (MenuElem (_("Waveform"), *waveform_menu));
756 if (is_audio_track()) {
758 Menu* alignment_menu = manage (new Menu);
759 MenuList& alignment_items = alignment_menu->items();
760 alignment_menu->set_name ("ArdourContextMenu");
762 RadioMenuItem::Group align_group;
764 alignment_items.push_back (RadioMenuElem (align_group, _("align with existing material"), bind (mem_fun(*this, &AudioTimeAxisView::set_align_style), ExistingMaterial)));
765 align_existing_item = dynamic_cast<RadioMenuItem*>(&alignment_items.back());
766 if (get_diskstream()->alignment_style() == ExistingMaterial) {
767 align_existing_item->set_active();
769 alignment_items.push_back (RadioMenuElem (align_group, _("align with capture time"), bind (mem_fun(*this, &AudioTimeAxisView::set_align_style), CaptureTime)));
770 align_capture_item = dynamic_cast<RadioMenuItem*>(&alignment_items.back());
771 if (get_diskstream()->alignment_style() == CaptureTime) {
772 align_capture_item->set_active();
775 items.push_back (MenuElem (_("Alignment"), *alignment_menu));
777 get_diskstream()->AlignmentStyleChanged.connect (mem_fun(*this, &AudioTimeAxisView::align_style_changed));
780 items.push_back (SeparatorElem());
781 items.push_back (CheckMenuElem (_("Active"), mem_fun(*this, &RouteUI::toggle_route_active)));
782 route_active_menu_item = dynamic_cast<CheckMenuItem *> (&items.back());
783 route_active_menu_item->set_active (_route.active());
785 items.push_back (SeparatorElem());
786 items.push_back (MenuElem (_("Remove"), mem_fun(*this, &RouteUI::remove_this_route)));
791 AudioTimeAxisView::align_style_changed ()
793 switch (get_diskstream()->alignment_style()) {
794 case ExistingMaterial:
795 if (!align_existing_item->get_active()) {
796 align_existing_item->set_active();
800 if (!align_capture_item->get_active()) {
801 align_capture_item->set_active();
808 AudioTimeAxisView::set_align_style (AlignStyle style)
810 get_diskstream()->set_align_style (style);
814 AudioTimeAxisView::rename_current_playlist ()
816 ArdourPrompter prompter (true);
822 if (((ds = get_diskstream()) == 0) || ds->destructive() || ((pl = ds->playlist()) == 0)) {
826 prompter.set_prompt (_("Name for playlist"));
827 prompter.set_initial_text (pl->name());
829 switch (prompter.run ()) {
830 case Gtk::RESPONSE_ACCEPT:
831 prompter.get_result (name);
843 AudioTimeAxisView::use_copy_playlist (bool prompt)
849 if (((ds = get_diskstream()) == 0) || ds->destructive() || ((pl = ds->playlist()) == 0)) {
853 name = Playlist::bump_name (pl->name(), _session);
857 ArdourPrompter prompter (true);
859 prompter.set_prompt (_("Name for playlist"));
860 prompter.set_initial_text (name);
861 prompter.show_all ();
863 switch (prompter.run ()) {
864 case Gtk::RESPONSE_ACCEPT:
865 prompter.get_result (name);
874 ds->use_copy_playlist ();
881 AudioTimeAxisView::use_new_playlist (bool prompt)
887 if (((ds = get_diskstream()) == 0) || ds->destructive() || ((pl = ds->playlist()) == 0)) {
891 name = Playlist::bump_name (pl->name(), _session);
895 ArdourPrompter prompter (true);
897 prompter.set_prompt (_("Name for playlist"));
898 prompter.set_initial_text (name);
900 switch (prompter.run ()) {
901 case Gtk::RESPONSE_ACCEPT:
902 prompter.get_result (name);
911 ds->use_new_playlist ();
918 AudioTimeAxisView::clear_playlist ()
923 if ((ds = get_diskstream()) != 0) {
924 if ((pl = ds->playlist()) != 0) {
925 editor.clear_playlist (*pl);
931 AudioTimeAxisView::toggle_waveforms ()
933 if (view && waveform_item && !ignore_toggle) {
934 view->set_show_waveforms (waveform_item->get_active());
939 AudioTimeAxisView::set_show_waveforms (bool yn)
942 waveform_item->set_active (yn);
944 view->set_show_waveforms (yn);
949 AudioTimeAxisView::set_show_waveforms_recording (bool yn)
952 view->set_show_waveforms_recording (yn);
957 AudioTimeAxisView::set_waveform_shape (WaveformShape shape)
960 view->set_waveform_shape (shape);
965 AudioTimeAxisView::speed_changed ()
967 Gtkmm2ext::UI::instance()->call_slot (mem_fun(*this, &AudioTimeAxisView::reset_samples_per_unit));
971 AudioTimeAxisView::diskstream_changed (void *src)
973 Gtkmm2ext::UI::instance()->call_slot (mem_fun(*this, &AudioTimeAxisView::update_diskstream_display));
977 AudioTimeAxisView::update_diskstream_display ()
981 if ((ds = get_diskstream()) != 0) {
982 set_playlist (ds->playlist ());
989 AudioTimeAxisView::selection_click (GdkEventButton* ev)
991 PublicEditor::TrackViewList* tracks = editor.get_valid_views (this, _route.edit_group());
993 switch (Keyboard::selection_type (ev->state)) {
994 case Selection::Toggle:
995 /* XXX this is not right */
996 editor.get_selection().add (*tracks);
1000 editor.get_selection().set (*tracks);
1003 case Selection::Extend:
1004 /* not defined yet */
1012 AudioTimeAxisView::set_selected_regionviews (AudioRegionSelection& regions)
1015 view->set_selected_regionviews (regions);
1020 AudioTimeAxisView::set_selected_points (PointSelection& points)
1022 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1023 (*i)->set_selected_points (points);
1028 AudioTimeAxisView::get_selectables (jack_nframes_t start, jack_nframes_t end, double top, double bot, list<Selectable*>& results)
1032 if (get_diskstream() != 0) {
1033 speed = get_diskstream()->speed();
1036 jack_nframes_t start_adjusted = session_frame_to_track_frame(start, speed);
1037 jack_nframes_t end_adjusted = session_frame_to_track_frame(end, speed);
1039 if (view && touched (top, bot)) {
1040 view->get_selectables (start_adjusted, end_adjusted, results);
1043 /* pick up visible automation tracks */
1045 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1046 if (!(*i)->hidden()) {
1047 (*i)->get_selectables (start_adjusted, end_adjusted, top, bot, results);
1053 AudioTimeAxisView::get_inverted_selectables (Selection& sel, list<Selectable*>& results)
1056 view->get_inverted_selectables (sel, results);
1059 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1060 if (!(*i)->hidden()) {
1061 (*i)->get_inverted_selectables (sel, results);
1069 AudioTimeAxisView::edit_group() const
1071 return _route.edit_group();
1075 AudioTimeAxisView::name() const
1077 return _route.name();
1081 AudioTimeAxisView::playlist () const
1085 if ((ds = get_diskstream()) != 0) {
1086 return ds->playlist();
1093 AudioTimeAxisView::name_entry_changed ()
1097 x = name_entry.get_text ();
1099 if (x == _route.name()) {
1103 if (x.length() == 0) {
1104 name_entry.set_text (_route.name());
1108 strip_whitespace_edges(x);
1110 if (_session.route_name_unique (x)) {
1111 _route.set_name (x, this);
1113 ARDOUR_UI::instance()->popup_error (_("a track already exists with that name"));
1114 name_entry.set_text (_route.name());
1119 AudioTimeAxisView::visual_click ()
1121 popup_display_menu (0);
1125 AudioTimeAxisView::hide_click ()
1127 editor.hide_track_in_display (*this);
1131 AudioTimeAxisView::find_next_region (jack_nframes_t pos, RegionPoint point, int32_t dir)
1134 AudioPlaylist *playlist;
1136 if ((stream = get_diskstream()) != 0 && (playlist = stream->playlist()) != 0) {
1137 return playlist->find_next_region (pos, point, dir);
1144 AudioTimeAxisView::add_gain_automation_child ()
1147 AutomationLine* line;
1149 gain_track = new GainAutomationTimeAxisView (_session,
1155 _route.gain_automation_curve());
1157 line = new AutomationGainLine ("automation gain",
1160 *gain_track->canvas_display,
1161 _route.gain_automation_curve());
1163 line->set_line_color (color_map[cAutomationLine]);
1166 gain_track->add_line (*line);
1168 add_child (gain_track);
1170 gain_track->Hiding.connect (mem_fun(*this, &AudioTimeAxisView::gain_hidden));
1176 if ((node = gain_track->get_state_node()) != 0) {
1177 if ((prop = node->property ("shown")) != 0) {
1178 if (prop->value() == "yes") {
1185 gain_track->hide ();
1190 AudioTimeAxisView::add_pan_automation_child ()
1194 pan_track = new PanAutomationTimeAxisView (_session, _route, editor, *this, parent_canvas, _("pan"));
1198 add_child (pan_track);
1200 pan_track->Hiding.connect (mem_fun(*this, &AudioTimeAxisView::pan_hidden));
1207 if ((node = pan_track->get_state_node()) != 0) {
1208 if ((prop = node->property ("shown")) != 0) {
1209 if (prop->value() == "yes") {
1221 AudioTimeAxisView::update_pans ()
1225 pan_track->clear_lines ();
1227 /* we don't draw lines for "greater than stereo" panning.
1230 if (_route.n_outputs() > 2) {
1234 for (p = _route.panner().begin(); p != _route.panner().end(); ++p) {
1236 AutomationLine* line;
1238 line = new AutomationPanLine ("automation pan", _session, *pan_track,
1239 *pan_track->canvas_display,
1240 (*p)->automation());
1242 if (p == _route.panner().begin()) {
1243 /* first line is a nice orange */
1244 line->set_line_color (color_map[cLeftPanAutomationLine]);
1246 /* second line is a nice blue */
1247 line->set_line_color (color_map[cRightPanAutomationLine]);
1250 pan_track->add_line (*line);
1255 AudioTimeAxisView::toggle_gain_track ()
1258 bool showit = gain_automation_item->get_active();
1260 if (showit != gain_track->marked_for_display()) {
1262 gain_track->set_marked_for_display (true);
1263 gain_track->canvas_display->show();
1264 gain_track->get_state_node()->add_property ("shown", X_("yes"));
1266 gain_track->set_marked_for_display (false);
1267 gain_track->hide ();
1268 gain_track->get_state_node()->add_property ("shown", X_("no"));
1271 /* now trigger a redisplay */
1274 _route.gui_changed (X_("track_height"), (void *) 0); /* EMIT_SIGNAL */
1280 AudioTimeAxisView::gain_hidden ()
1282 gain_track->get_state_node()->add_property (X_("shown"), X_("no"));
1284 if (gain_automation_item && !_hidden) {
1285 gain_automation_item->set_active (false);
1288 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1292 AudioTimeAxisView::toggle_pan_track ()
1294 bool showit = pan_automation_item->get_active();
1296 if (showit != pan_track->marked_for_display()) {
1298 pan_track->set_marked_for_display (true);
1299 pan_track->canvas_display->show();
1300 pan_track->get_state_node()->add_property ("shown", X_("yes"));
1302 pan_track->set_marked_for_display (false);
1304 pan_track->get_state_node()->add_property ("shown", X_("no"));
1307 /* now trigger a redisplay */
1310 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1316 AudioTimeAxisView::pan_hidden ()
1318 pan_track->get_state_node()->add_property ("shown", "no");
1320 if (pan_automation_item && !_hidden) {
1321 pan_automation_item->set_active (false);
1324 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1327 AudioTimeAxisView::RedirectAutomationInfo::~RedirectAutomationInfo ()
1329 for (vector<RedirectAutomationNode*>::iterator i = lines.begin(); i != lines.end(); ++i) {
1335 AudioTimeAxisView::RedirectAutomationNode::~RedirectAutomationNode ()
1337 parent.remove_ran (this);
1345 AudioTimeAxisView::remove_ran (RedirectAutomationNode* ran)
1348 remove_child (ran->view);
1352 AudioTimeAxisView::RedirectAutomationNode*
1353 AudioTimeAxisView::find_redirect_automation_node (Redirect *redirect, uint32_t what)
1355 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1357 if ((*i)->redirect == redirect) {
1359 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1360 if ((*ii)->what == what) {
1371 legalize_for_xml_node (string str)
1373 string::size_type pos;
1374 string legal_chars = "abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_+=:";
1380 while ((pos = legal.find_first_not_of (legal_chars, pos)) != string::npos) {
1381 legal.replace (pos, 1, "_");
1390 AudioTimeAxisView::add_redirect_automation_curve (Redirect *redirect, uint32_t what)
1392 RedirectAutomationLine* ral;
1394 RedirectAutomationNode* ran;
1396 if ((ran = find_redirect_automation_node (redirect, what)) == 0) {
1397 fatal << _("programming error: ")
1398 << string_compose (X_("redirect automation curve for %1:%2 not registered with audio track!"),
1399 redirect->name(), what)
1409 name = redirect->describe_parameter (what);
1411 /* create a string that is a legal XML node name that can be used to refer to this redirect+port combination */
1413 char state_name[256];
1414 snprintf (state_name, sizeof (state_name), "Redirect-%s-%" PRIu32, legalize_for_xml_node (redirect->name()).c_str(), what);
1416 ran->view = new RedirectAutomationTimeAxisView (_session, _route, editor, *this, parent_canvas, name, what, *redirect, state_name);
1418 ral = new RedirectAutomationLine (name,
1419 *redirect, what, _session, *ran->view,
1420 *ran->view->canvas_display, redirect->automation_list (what));
1422 ral->set_line_color (color_map[cRedirectAutomationLine]);
1423 ral->queue_reset ();
1425 ran->view->add_line (*ral);
1427 ran->view->Hiding.connect (bind (mem_fun(*this, &AudioTimeAxisView::redirect_automation_track_hidden), ran, redirect));
1429 if (!ran->view->marked_for_display()) {
1432 ran->menu_item->set_active (true);
1435 add_child (ran->view);
1437 view->foreach_regionview (bind (mem_fun(*this, &AudioTimeAxisView::add_ghost_to_redirect), ran->view));
1439 redirect->mark_automation_visible (what, true);
1443 AudioTimeAxisView::redirect_automation_track_hidden (AudioTimeAxisView::RedirectAutomationNode* ran, Redirect* r)
1446 ran->menu_item->set_active (false);
1449 r->mark_automation_visible (ran->what, false);
1451 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1455 AudioTimeAxisView::add_existing_redirect_automation_curves (Redirect *redirect)
1458 RedirectAutomationLine *ral;
1460 redirect->what_has_visible_automation (s);
1462 for (set<uint32_t>::iterator i = s.begin(); i != s.end(); ++i) {
1464 if ((ral = find_redirect_automation_curve (redirect, *i)) != 0) {
1465 ral->queue_reset ();
1467 add_redirect_automation_curve (redirect, (*i));
1473 AudioTimeAxisView::add_redirect_to_subplugin_menu (Redirect* r)
1475 using namespace Menu_Helpers;
1476 RedirectAutomationInfo *rai;
1477 list<RedirectAutomationInfo*>::iterator x;
1479 const std::set<uint32_t>& automatable = r->what_can_be_automated ();
1480 std::set<uint32_t> has_visible_automation;
1482 r->what_has_visible_automation(has_visible_automation);
1484 if (automatable.empty()) {
1488 for (x = redirect_automation.begin(); x != redirect_automation.end(); ++x) {
1489 if ((*x)->redirect == r) {
1494 if (x == redirect_automation.end()) {
1496 rai = new RedirectAutomationInfo (r);
1497 redirect_automation.push_back (rai);
1505 /* any older menu was deleted at the top of redirects_changed()
1506 when we cleared the subplugin menu.
1509 rai->menu = manage (new Menu);
1510 MenuList& items = rai->menu->items();
1511 rai->menu->set_name ("ArdourContextMenu");
1515 for (std::set<uint32_t>::const_iterator i = automatable.begin(); i != automatable.end(); ++i) {
1517 RedirectAutomationNode* ran;
1518 CheckMenuItem* mitem;
1520 string name = r->describe_parameter (*i);
1522 items.push_back (CheckMenuElem (name));
1523 mitem = dynamic_cast<CheckMenuItem*> (&items.back());
1525 if (has_visible_automation.find((*i)) != has_visible_automation.end()) {
1526 mitem->set_active(true);
1529 if ((ran = find_redirect_automation_node (r, *i)) == 0) {
1533 ran = new RedirectAutomationNode (*i, mitem, *this);
1535 rai->lines.push_back (ran);
1539 ran->menu_item = mitem;
1543 mitem->signal_toggled().connect (bind (mem_fun(*this, &AudioTimeAxisView::redirect_menu_item_toggled), rai, ran));
1546 /* add the menu for this redirect, because the subplugin
1547 menu is always cleared at the top of redirects_changed().
1548 this is the result of some poor design in gtkmm and/or
1552 subplugin_menu.items().push_back (MenuElem (r->name(), *rai->menu));
1557 AudioTimeAxisView::redirect_menu_item_toggled (AudioTimeAxisView::RedirectAutomationInfo* rai,
1558 AudioTimeAxisView::RedirectAutomationNode* ran)
1560 bool showit = ran->menu_item->get_active();
1561 bool redraw = false;
1563 if (ran->view == 0 && showit) {
1564 add_redirect_automation_curve (rai->redirect, ran->what);
1568 if (showit != ran->view->marked_for_display()) {
1571 ran->view->set_marked_for_display (true);
1572 ran->view->canvas_display->show();
1574 rai->redirect->mark_automation_visible (ran->what, true);
1575 ran->view->set_marked_for_display (false);
1583 if (redraw && !no_redraw) {
1585 /* now trigger a redisplay */
1587 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1593 AudioTimeAxisView::redirects_changed (void *src)
1595 using namespace Menu_Helpers;
1597 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1598 (*i)->valid = false;
1601 subplugin_menu.items().clear ();
1603 _route.foreach_redirect (this, &AudioTimeAxisView::add_redirect_to_subplugin_menu);
1604 _route.foreach_redirect (this, &AudioTimeAxisView::add_existing_redirect_automation_curves);
1606 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ) {
1608 list<RedirectAutomationInfo*>::iterator tmp;
1616 redirect_automation.erase (i);
1623 /* change in visibility was possible */
1625 _route.gui_changed ("track_height", this);
1628 RedirectAutomationLine *
1629 AudioTimeAxisView::find_redirect_automation_curve (Redirect *redirect, uint32_t what)
1631 RedirectAutomationNode* ran;
1633 if ((ran = find_redirect_automation_node (redirect, what)) != 0) {
1635 return dynamic_cast<RedirectAutomationLine*> (ran->view->lines.front());
1643 AudioTimeAxisView::show_all_automation ()
1647 pan_automation_item->set_active (true);
1648 gain_automation_item->set_active (true);
1650 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1651 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1652 if ((*ii)->view == 0) {
1653 add_redirect_automation_curve ((*i)->redirect, (*ii)->what);
1656 (*ii)->menu_item->set_active (true);
1662 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1666 AudioTimeAxisView::show_existing_automation ()
1670 pan_automation_item->set_active (true);
1671 gain_automation_item->set_active (true);
1673 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1674 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1675 if ((*ii)->view != 0) {
1676 (*ii)->menu_item->set_active (true);
1683 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1687 AudioTimeAxisView::hide_all_automation ()
1691 pan_automation_item->set_active (false);
1692 gain_automation_item->set_active (false);
1694 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1695 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1696 (*ii)->menu_item->set_active (false);
1701 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1705 AudioTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op)
1707 Playlist* what_we_got;
1708 DiskStream* ds = get_diskstream();
1713 /* route is a bus, not a track */
1717 playlist = ds->playlist();
1720 TimeSelection time (selection.time);
1721 float speed = ds->speed();
1722 if (speed != 1.0f) {
1723 for (TimeSelection::iterator i = time.begin(); i != time.end(); ++i) {
1724 (*i).start = session_frame_to_track_frame((*i).start, speed);
1725 (*i).end = session_frame_to_track_frame((*i).end, speed);
1731 _session.add_undo (playlist->get_memento());
1732 if ((what_we_got = playlist->cut (time)) != 0) {
1733 editor.get_cut_buffer().add (what_we_got);
1734 _session.add_redo_no_execute (playlist->get_memento());
1739 if ((what_we_got = playlist->copy (time)) != 0) {
1740 editor.get_cut_buffer().add (what_we_got);
1745 _session.add_undo (playlist->get_memento());
1746 if ((what_we_got = playlist->cut (time)) != 0) {
1747 _session.add_redo_no_execute (playlist->get_memento());
1748 what_we_got->unref ();
1758 AudioTimeAxisView::paste (jack_nframes_t pos, float times, Selection& selection, size_t nth)
1760 if (!is_audio_track()) {
1764 Playlist* playlist = get_diskstream()->playlist();
1765 PlaylistSelection::iterator p;
1767 for (p = selection.playlists.begin(); p != selection.playlists.end() && nth; ++p, --nth);
1769 if (p == selection.playlists.end()) {
1773 if (get_diskstream()->speed() != 1.0f)
1774 pos = session_frame_to_track_frame(pos, get_diskstream()->speed() );
1776 _session.add_undo (playlist->get_memento());
1777 playlist->paste (**p, pos, times);
1778 _session.add_redo_no_execute (playlist->get_memento());
1784 AudioTimeAxisView::region_view_added (AudioRegionView* arv)
1786 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1787 AutomationTimeAxisView* atv;
1789 if ((atv = dynamic_cast<AutomationTimeAxisView*> (*i)) != 0) {
1790 arv->add_ghost (*atv);
1796 AudioTimeAxisView::add_ghost_to_redirect (AudioRegionView* arv, AutomationTimeAxisView* atv)
1798 arv->add_ghost (*atv);
1802 AudioTimeAxisView::get_child_list()
1805 list<TimeAxisView*>redirect_children;
1807 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1808 if (!(*i)->hidden()) {
1809 redirect_children.push_back(*i);
1812 return redirect_children;
1817 AudioTimeAxisView::build_playlist_menu (Gtk::Menu * menu)
1819 using namespace Menu_Helpers;
1821 if (!menu || !is_audio_track()) {
1825 MenuList& playlist_items = menu->items();
1826 menu->set_name ("ArdourContextMenu");
1827 playlist_items.clear();
1829 if (playlist_menu) {
1830 delete playlist_menu;
1832 playlist_menu = new Menu;
1833 playlist_menu->set_name ("ArdourContextMenu");
1835 playlist_items.push_back (MenuElem (string_compose (_("Current: %1"), get_diskstream()->playlist()->name())));
1836 playlist_items.push_back (SeparatorElem());
1838 playlist_items.push_back (MenuElem (_("Rename"), mem_fun(*this, &AudioTimeAxisView::rename_current_playlist)));
1839 playlist_items.push_back (SeparatorElem());
1841 playlist_items.push_back (MenuElem (_("New"), mem_fun(editor, &PublicEditor::new_playlists)));
1842 playlist_items.push_back (MenuElem (_("New Copy"), mem_fun(editor, &PublicEditor::copy_playlists)));
1843 playlist_items.push_back (SeparatorElem());
1844 playlist_items.push_back (MenuElem (_("Clear Current"), mem_fun(editor, &PublicEditor::clear_playlists)));
1845 playlist_items.push_back (SeparatorElem());
1846 playlist_items.push_back (MenuElem(_("Select"), mem_fun(*this, &AudioTimeAxisView::show_playlist_selector)));
1851 AudioTimeAxisView::show_playlist_selector ()
1853 editor.playlist_selector().show_for (this);
1858 AudioTimeAxisView::map_frozen ()
1860 if (!is_audio_track()) {
1864 ENSURE_GUI_THREAD (mem_fun(*this, &AudioTimeAxisView::map_frozen));
1867 switch (audio_track()->freeze_state()) {
1868 case AudioTrack::Frozen:
1869 playlist_button.set_sensitive (false);
1870 rec_enable_button->set_sensitive (false);
1873 playlist_button.set_sensitive (true);
1874 rec_enable_button->set_sensitive (true);
1880 AudioTimeAxisView::show_all_xfades ()
1883 view->show_all_xfades ();
1888 AudioTimeAxisView::hide_all_xfades ()
1891 view->hide_all_xfades ();
1896 AudioTimeAxisView::hide_dependent_views (TimeAxisViewItem& tavi)
1898 AudioRegionView* rv;
1900 if (view && (rv = dynamic_cast<AudioRegionView*>(&tavi)) != 0) {
1901 view->hide_xfades_involving (*rv);
1906 AudioTimeAxisView::reveal_dependent_views (TimeAxisViewItem& tavi)
1908 AudioRegionView* rv;
1910 if (view && (rv = dynamic_cast<AudioRegionView*>(&tavi)) != 0) {
1911 view->reveal_xfades_involving (*rv);
1916 AudioTimeAxisView::route_active_changed ()
1918 RouteUI::route_active_changed ();
1920 if (is_audio_track()) {
1921 if (_route.active()) {
1922 controls_ebox.set_name ("AudioTrackControlsBaseUnselected");
1923 controls_base_selected_name = "AudioTrackControlsBaseSelected";
1924 controls_base_unselected_name = "AudioTrackControlsBaseUnselected";
1926 controls_ebox.set_name ("AudioTrackControlsBaseInactiveUnselected");
1927 controls_base_selected_name = "AudioTrackControlsBaseInactiveSelected";
1928 controls_base_unselected_name = "AudioTrackControlsBaseInactiveUnselected";
1931 if (_route.active()) {
1932 controls_ebox.set_name ("BusControlsBaseUnselected");
1933 controls_base_selected_name = "BusControlsBaseSelected";
1934 controls_base_unselected_name = "BusControlsBaseUnselected";
1936 controls_ebox.set_name ("BusControlsBaseInactiveUnselected");
1937 controls_base_selected_name = "BusControlsBaseInactiveSelected";
1938 controls_base_unselected_name = "BusControlsBaseInactiveUnselected";
1944 AudioTimeAxisView::get_child_xml_node (const string & childname)
1946 return RouteUI::get_child_xml_node (childname);
1950 AudioTimeAxisView::color_handler (ColorID id, uint32_t val)
1953 case cTimeStretchOutline:
1954 timestretch_rect->property_outline_color_rgba() = val;
1956 case cTimeStretchFill:
1957 timestretch_rect->property_fill_color_rgba() = val;