2 Copyright (C) 2000 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #include <sigc++/bind.h>
30 #include <pbd/error.h>
31 #include <pbd/stl_delete.h>
33 #include <gtkmm2ext/utils.h>
34 #include <gtkmm2ext/selector.h>
35 #include <gtkmm2ext/gtk_ui.h>
36 #include <gtkmm2ext/stop_signal.h>
37 #include <gtkmm2ext/bindable_button.h>
39 #include <ardour/session.h>
40 #include <ardour/session_playlist.h>
41 #include <ardour/audioplaylist.h>
42 #include <ardour/diskstream.h>
43 #include <ardour/utils.h>
44 #include <ardour/playlist.h>
45 #include <ardour/ladspa_plugin.h>
46 #include <ardour/insert.h>
47 #include <ardour/location.h>
48 #include <ardour/panner.h>
50 #include "ardour_ui.h"
51 #include "public_editor.h"
52 #include "audio_time_axis.h"
53 #include "streamview.h"
54 #include "simplerect.h"
55 #include "playlist_selector.h"
56 #include "plugin_selector.h"
57 #include "plugin_ui.h"
58 #include "regionview.h"
59 #include "automation_gain_line.h"
60 #include "automation_pan_line.h"
61 #include "automation_time_axis.h"
62 #include "redirect_automation_time_axis.h"
63 #include "gain_automation_time_axis.h"
64 #include "pan_automation_time_axis.h"
65 #include "redirect_automation_line.h"
66 #include "selection.h"
67 #include "point_selection.h"
71 #include "rgb_macros.h"
73 #include "crossfade_view.h"
74 #include "gui_thread.h"
75 #include "canvas_impl.h"
77 #include <ardour/audio_track.h>
81 using namespace ARDOUR;
82 //using namespace sigc;
83 using namespace LADSPA;
85 using namespace Editing;
87 static const gchar * small_x_xpm[] = {
103 AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, Route& rt, Canvas& canvas)
105 RouteUI(rt, sess, _("m"), _("s"), _("r")), // mute, solo, and record
106 TimeAxisView(sess,ed,(TimeAxisView*) 0, canvas),
107 parent_canvas (canvas),
109 edit_group_button (_("g")), // group
110 playlist_button (_("p")),
111 size_button (_("h")), // height
112 automation_button (_("a")),
113 visual_button (_("v"))
117 subplugin_menu.set_name ("ArdourContextMenu");
119 playlist_action_menu = 0;
120 automation_action_menu = 0;
124 timestretch_rect = 0;
126 pan_automation_item = 0;
127 gain_automation_item = 0;
130 view = new StreamView (*this);
132 add_gain_automation_child ();
133 add_pan_automation_child ();
135 ignore_toggle = false;
137 rec_enable_button->set_active (false);
138 mute_button->set_active (false);
139 solo_button->set_active (false);
141 rec_enable_button->set_name ("TrackRecordEnableButton");
142 mute_button->set_name ("TrackMuteButton");
143 solo_button->set_name ("SoloButton");
144 edit_group_button.set_name ("TrackGroupButton");
145 playlist_button.set_name ("TrackPlaylistButton");
146 automation_button.set_name ("TrackAutomationButton");
147 size_button.set_name ("TrackSizeButton");
148 visual_button.set_name ("TrackVisualButton");
149 hide_button.set_name ("TrackRemoveButton");
151 hide_button.add (*(manage (new Image (Gdk::Pixbuf::create_from_xpm_data(small_x_xpm)))));
153 _route.mute_changed.connect (mem_fun(*this, &RouteUI::mute_changed));
154 _route.solo_changed.connect (mem_fun(*this, &RouteUI::solo_changed));
155 _route.solo_safe_changed.connect (mem_fun(*this, &RouteUI::solo_changed));
157 _route.panner().Changed.connect (mem_fun(*this, &AudioTimeAxisView::update_pans));
159 solo_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::solo_press));
160 solo_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::solo_release));
161 mute_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::mute_press));
162 mute_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::mute_release));
163 rec_enable_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::rec_enable_press));
164 edit_group_button.signal_button_release_event().connect (mem_fun(*this, &AudioTimeAxisView::edit_click));
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));
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 name_entry.signal_activate().connect (mem_fun(*this, &AudioTimeAxisView::name_entry_activated));
172 name_entry.signal_button_press_event().connect (mem_fun(*this, &AudioTimeAxisView::name_entry_button_press_handler));
173 name_entry.signal_button_release_event().connect (mem_fun(*this, &AudioTimeAxisView::name_entry_button_release_handler));
174 name_entry.signal_key_release_event().connect (mem_fun(*this, &AudioTimeAxisView::name_entry_key_release_handler));
176 if (is_audio_track()) {
177 controls_table.attach (*rec_enable_button, 6, 7, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
179 controls_table.attach (*mute_button, 7, 8, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
180 controls_table.attach (*solo_button, 8, 9, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::FILL|Gtk::EXPAND, 0, 0);
182 controls_table.attach (edit_group_button, 7, 8, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
184 ARDOUR_UI::instance()->tooltips().set_tip(*rec_enable_button, _("Record"));
185 ARDOUR_UI::instance()->tooltips().set_tip(*solo_button,_("Solo"));
186 ARDOUR_UI::instance()->tooltips().set_tip(*mute_button,_("Mute"));
187 ARDOUR_UI::instance()->tooltips().set_tip(edit_group_button,_("Edit Group"));
188 ARDOUR_UI::instance()->tooltips().set_tip(size_button,_("Display Height"));
189 ARDOUR_UI::instance()->tooltips().set_tip(playlist_button,_("Playlist"));
190 ARDOUR_UI::instance()->tooltips().set_tip(automation_button, _("Automation"));
191 ARDOUR_UI::instance()->tooltips().set_tip(visual_button, _("Visual options"));
192 ARDOUR_UI::instance()->tooltips().set_tip(hide_button, _("Hide this track"));
196 controls_table.attach (hide_button, 0, 1, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
197 controls_table.attach (visual_button, 1, 2, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
198 controls_table.attach (size_button, 2, 3, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
199 controls_table.attach (automation_button, 3, 4, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
201 if (is_audio_track()) {
202 controls_table.attach (playlist_button, 6, 7, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
206 /* remove focus from the buttons */
208 automation_button.unset_flags (Gtk::CAN_FOCUS);
209 solo_button->unset_flags (Gtk::CAN_FOCUS);
210 mute_button->unset_flags (Gtk::CAN_FOCUS);
211 edit_group_button.unset_flags (Gtk::CAN_FOCUS);
212 size_button.unset_flags (Gtk::CAN_FOCUS);
213 playlist_button.unset_flags (Gtk::CAN_FOCUS);
214 hide_button.unset_flags (Gtk::CAN_FOCUS);
215 visual_button.unset_flags (Gtk::CAN_FOCUS);
217 /* map current state of the route */
219 update_diskstream_display ();
222 redirects_changed (0);
223 reset_redirect_automation_curves ();
228 set_state (*xml_node);
230 _route.mute_changed.connect (mem_fun(*this, &RouteUI::mute_changed));
231 _route.solo_changed.connect (mem_fun(*this, &RouteUI::solo_changed));
232 _route.redirects_changed.connect (mem_fun(*this, &AudioTimeAxisView::redirects_changed));
234 _route.name_changed.connect (mem_fun(*this, &AudioTimeAxisView::route_name_changed));
236 if (is_audio_track()) {
240 audio_track()->FreezeChange.connect (mem_fun(*this, &AudioTimeAxisView::map_frozen));
242 audio_track()->diskstream_changed.connect (mem_fun(*this, &AudioTimeAxisView::diskstream_changed));
243 get_diskstream()->speed_changed.connect (mem_fun(*this, &AudioTimeAxisView::speed_changed));
245 controls_ebox.set_name ("AudioTrackControlsBaseUnselected");
246 controls_base_selected_name = "AudioTrackControlsBaseSelected";
247 controls_base_unselected_name = "AudioTrackControlsBaseUnselected";
249 /* ask for notifications of any new RegionViews */
251 view->AudioRegionViewAdded.connect (mem_fun(*this, &AudioTimeAxisView::region_view_added));
255 /* pick up the correct freeze state */
263 controls_ebox.set_name ("BusControlsBaseUnselected");
264 controls_base_selected_name = "BusControlsBaseSelected";
265 controls_base_unselected_name = "BusControlsBaseUnselected";
268 editor.ZoomChanged.connect (mem_fun(*this, &AudioTimeAxisView::reset_samples_per_unit));
271 AudioTimeAxisView::~AudioTimeAxisView ()
273 GoingAway (); /* EMIT_SIGNAL */
276 delete playlist_menu;
280 if (playlist_action_menu) {
281 delete playlist_action_menu;
282 playlist_action_menu = 0;
285 vector_delete (&redirect_automation_curves);
287 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
298 AudioTimeAxisView::show_at (double y, int& nth, Gtk::VBox *parent)
301 xml_node->add_property ("shown_editor", "yes");
303 return TimeAxisView::show_at (y, nth, parent);
307 AudioTimeAxisView::hide ()
310 xml_node->add_property ("shown_editor", "no");
312 TimeAxisView::hide ();
316 AudioTimeAxisView::set_playlist (AudioPlaylist *newplaylist)
320 modified_connection.disconnect ();
321 state_changed_connection.disconnect ();
323 if ((pl = dynamic_cast<AudioPlaylist*> (playlist())) != 0) {
324 state_changed_connection = pl->StateChanged.connect (mem_fun(*this, &AudioTimeAxisView::playlist_state_changed));
325 modified_connection = pl->Modified.connect (mem_fun(*this, &AudioTimeAxisView::playlist_modified));
330 AudioTimeAxisView::playlist_modified ()
335 AudioTimeAxisView::edit_click (GdkEventButton *ev)
337 if (Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) {
338 _route.set_edit_group (0, this);
342 using namespace Menu_Helpers;
344 MenuList& items = edit_group_menu.items ();
347 items.push_back (RadioMenuElem (edit_group_menu_radio_group, _("No group"),
348 bind (mem_fun(*this, &AudioTimeAxisView::set_edit_group_from_menu), (RouteGroup *) 0)));
350 if (_route.edit_group() == 0) {
351 static_cast<RadioMenuItem*>(&items.back())->set_active ();
354 _session.foreach_edit_group (this, &AudioTimeAxisView::add_edit_group_menu_item);
355 edit_group_menu.popup (ev->button, ev->time);
361 AudioTimeAxisView::add_edit_group_menu_item (RouteGroup *eg)
363 using namespace Menu_Helpers;
365 MenuList &items = edit_group_menu.items();
366 items.push_back (RadioMenuElem (edit_group_menu_radio_group,
367 eg->name(), bind (mem_fun(*this, &AudioTimeAxisView::set_edit_group_from_menu), eg)));
368 if (_route.edit_group() == eg) {
369 static_cast<RadioMenuItem*>(&items.back())->set_active ();
374 AudioTimeAxisView::set_edit_group_from_menu (RouteGroup *eg)
377 _route.set_edit_group (eg, this);
381 AudioTimeAxisView::playlist_state_changed (Change ignored)
383 // ENSURE_GUI_THREAD (bind (mem_fun(*this, &AudioTimeAxisView::playlist_state_changed), ignored));
388 AudioTimeAxisView::playlist_changed ()
393 if (is_audio_track()) {
394 set_playlist (get_diskstream()->playlist());
399 AudioTimeAxisView::label_view ()
401 string x = _route.name();
403 if (x != name_entry.get_text()) {
404 name_entry.set_text (x);
407 ARDOUR_UI::instance()->tooltips().set_tip (name_entry, x);
411 AudioTimeAxisView::route_name_changed (void *src)
413 editor.route_name_changed (this);
418 AudioTimeAxisView::take_name_changed (void *src)
427 AudioTimeAxisView::playlist_click ()
429 // always build a new action menu
431 if (playlist_action_menu == 0) {
432 playlist_action_menu = new Menu;
433 playlist_action_menu->set_name ("ArdourContextMenu");
436 build_playlist_menu(playlist_action_menu);
438 playlist_action_menu->popup (1, 0);
442 AudioTimeAxisView::automation_click ()
444 if (automation_action_menu == 0) {
445 /* this seems odd, but the automation action
446 menu is built as part of the display menu.
448 build_display_menu ();
450 automation_action_menu->popup (1, 0);
454 AudioTimeAxisView::show_timestretch (jack_nframes_t start, jack_nframes_t end)
460 TimeAxisView::show_timestretch (start, end);
470 /* check that the time selection was made in our route, or our edit group.
471 remember that edit_group() == 0 implies the route is *not* in a edit group.
474 if (!(ts.track == this || (ts.group != 0 && ts.group == _route.edit_group()))) {
475 /* this doesn't apply to us */
479 /* ignore it if our edit group is not active */
481 if ((ts.track != this) && _route.edit_group() && !_route.edit_group()->is_active()) {
486 if (timestretch_rect == 0) {
487 timestretch_rect = new SimpleRect (*canvas_display);
488 timestretch_rect->property_x1() = 0.0;
489 timestretch_rect->property_y1() = 0.0;
490 timestretch_rect->property_x2() = 0.0;
491 timestretch_rect->property_y2() = 0.0;
492 timestretch_rect->property_fill_color_rgba() = color_map[cTimeStretchFill];
493 timestretch_rect->property_outline_color_rgba() = color_map[cTimeStretchOutline];
496 timestretch_rect->show ();
497 timestretch_rect->raise_to_top ();
499 x1 = start / editor.get_current_zoom();
500 x2 = (end - 1) / editor.get_current_zoom();
503 timestretch_rect->property_x1() = x1;
504 timestretch_rect->property_y1() = 1.0;
505 timestretch_rect->property_x2() = x2;
506 timestretch_rect->property_y2() = y2;
510 AudioTimeAxisView::hide_timestretch ()
512 TimeAxisView::hide_timestretch ();
514 if (timestretch_rect) {
515 timestretch_rect->hide ();
520 AudioTimeAxisView::show_selection (TimeSelection& ts)
524 /* ignore it if our edit group is not active or if the selection was started
525 in some other track or edit group (remember that edit_group() == 0 means
526 that the track is not in an edit group).
529 if (((ts.track != this && !is_child (ts.track)) && _route.edit_group() && !_route.edit_group()->is_active()) ||
530 (!(ts.track == this || is_child (ts.track) || (ts.group != 0 && ts.group == _route.edit_group())))) {
536 TimeAxisView::show_selection (ts);
540 AudioTimeAxisView::set_state (const XMLNode& node)
542 const XMLProperty *prop;
544 TimeAxisView::set_state (node);
546 if ((prop = node.property ("shown_editor")) != 0) {
547 if (prop->value() == "no") {
548 _marked_for_display = false;
550 _marked_for_display = true;
553 _marked_for_display = true;
556 XMLNodeList nlist = node.children();
557 XMLNodeConstIterator niter;
561 show_gain_automation = false;
562 show_pan_automation = false;
564 for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
567 if (child_node->name() == "gain") {
568 XMLProperty *prop=child_node->property ("shown");
571 if (prop->value() == "yes") {
572 show_gain_automation = true;
578 if (child_node->name() == "pan") {
579 XMLProperty *prop=child_node->property ("shown");
582 if (prop->value() == "yes") {
583 show_pan_automation = true;
592 AudioTimeAxisView::set_height (TrackHeight h)
594 bool height_changed = (h != (TrackHeight)height);
596 TimeAxisView::set_height (h);
600 view->set_height ((double) height);
604 xml_node->add_property ("track_height", "largest");
605 controls_table.show_all ();
609 xml_node->add_property ("track_height", "large");
610 controls_table.show_all ();
614 xml_node->add_property ("track_height", "larger");
615 controls_table.show_all ();
619 xml_node->add_property ("track_height", "normal");
620 controls_table.show_all ();
624 xml_node->add_property ("track_height", "smaller");
625 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 ();
638 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);
853 AudioTimeAxisView::playlist_selected (AudioPlaylist *pl)
857 if ((ds = get_diskstream()) != 0) {
858 ds->use_playlist (pl);
863 AudioTimeAxisView::use_copy_playlist ()
869 if (((ds = get_diskstream()) == 0) || ((pl = ds->playlist()) == 0)) {
873 ArdourPrompter prompter (true);
874 string new_name = Playlist::bump_name (pl->name(), _session);
876 prompter.set_prompt (_("Name for playlist"));
877 prompter.set_initial_text (new_name);
878 prompter.show_all ();
880 switch (prompter.run ()) {
881 case GTK_RESPONSE_ACCEPT:
882 prompter.get_result (name);
883 ds->use_copy_playlist ();
894 AudioTimeAxisView::use_new_playlist ()
900 if (((ds = get_diskstream()) == 0) || ((pl = ds->playlist()) == 0)) {
904 ArdourPrompter prompter (true);
905 string new_name = Playlist::bump_name (pl->name(), _session);
907 prompter.set_prompt (_("Name for playlist"));
908 prompter.set_initial_text (new_name);
910 switch (prompter.run ()) {
911 case GTK_RESPONSE_ACCEPT:
912 prompter.get_result (name);
913 ds->use_new_playlist ();
924 AudioTimeAxisView::clear_playlist ()
929 if ((ds = get_diskstream()) != 0) {
930 if ((pl = ds->playlist()) != 0) {
931 editor.clear_playlist (*pl);
937 AudioTimeAxisView::toggle_waveforms ()
939 if (view && waveform_item && !ignore_toggle) {
940 view->set_show_waveforms (waveform_item->get_active());
945 AudioTimeAxisView::set_show_waveforms (bool yn)
948 waveform_item->set_active (yn);
950 view->set_show_waveforms (yn);
955 AudioTimeAxisView::set_show_waveforms_recording (bool yn)
958 view->set_show_waveforms_recording (yn);
963 AudioTimeAxisView::set_waveform_shape (WaveformShape shape)
966 view->set_waveform_shape (shape);
971 AudioTimeAxisView::speed_changed ()
973 Gtkmm2ext::UI::instance()->call_slot (mem_fun(*this, &AudioTimeAxisView::reset_samples_per_unit));
977 AudioTimeAxisView::diskstream_changed (void *src)
979 Gtkmm2ext::UI::instance()->call_slot (mem_fun(*this, &AudioTimeAxisView::update_diskstream_display));
983 AudioTimeAxisView::update_diskstream_display ()
987 if ((ds = get_diskstream()) != 0) {
988 set_playlist (ds->playlist ());
995 AudioTimeAxisView::selection_click (GdkEventButton* ev)
997 PublicEditor::TrackViewList* tracks = editor.get_valid_views (this, _route.edit_group());
999 if (Keyboard::modifier_state_contains (ev->state, Keyboard::Shift)) {
1000 if (editor.get_selection().selected (this)) {
1001 editor.get_selection().remove (*tracks);
1003 editor.get_selection().add (*tracks);
1006 editor.get_selection().set (*tracks);
1013 AudioTimeAxisView::set_selected_regionviews (AudioRegionSelection& regions)
1016 view->set_selected_regionviews (regions);
1021 AudioTimeAxisView::set_selected_points (PointSelection& points)
1023 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1024 (*i)->set_selected_points (points);
1029 AudioTimeAxisView::get_selectables (jack_nframes_t start, jack_nframes_t end, double top, double bot, list<Selectable*>& results)
1033 if (get_diskstream() != 0) {
1034 speed = get_diskstream()->speed();
1037 jack_nframes_t start_adjusted = session_frame_to_track_frame(start, speed);
1038 jack_nframes_t end_adjusted = session_frame_to_track_frame(end, speed);
1040 if (view && touched (top, bot)) {
1041 view->get_selectables (start_adjusted, end_adjusted, results);
1044 /* pick up visible automation tracks */
1046 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1047 if (!(*i)->hidden()) {
1048 (*i)->get_selectables (start_adjusted, end_adjusted, top, bot, results);
1054 AudioTimeAxisView::get_inverted_selectables (Selection& sel, list<Selectable*>& results)
1057 view->get_inverted_selectables (sel, results);
1060 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1061 if (!(*i)->hidden()) {
1062 (*i)->get_inverted_selectables (sel, results);
1070 AudioTimeAxisView::edit_group() const
1072 return _route.edit_group();
1076 AudioTimeAxisView::name() const
1078 return _route.name();
1082 AudioTimeAxisView::playlist () const
1086 if ((ds = get_diskstream()) != 0) {
1087 return ds->playlist();
1094 AudioTimeAxisView::name_entry_button_press_handler (GdkEventButton *ev)
1096 if (ev->button == 3) {
1097 return stop_signal (name_entry, "button_press_event");
1103 AudioTimeAxisView::name_entry_button_release_handler (GdkEventButton *ev)
1109 AudioTimeAxisView::name_entry_key_release_handler (GdkEventKey* ev)
1111 switch (ev->keyval) {
1115 name_entry_changed ();
1124 AudioTimeAxisView::name_entry_activated ()
1126 /* this should drop focus from the entry,
1127 and cause a call to name_entry_changed()
1129 controls_ebox.grab_focus();
1133 AudioTimeAxisView::name_entry_changed ()
1137 x = name_entry.get_text ();
1139 if (x == _route.name()) {
1143 if (x.length() == 0) {
1144 name_entry.set_text (_route.name());
1148 strip_whitespace_edges(x);
1150 if (_session.route_name_unique (x)) {
1151 _route.set_name (x, this);
1153 ARDOUR_UI::instance()->popup_error (_("a track already exists with that name"));
1154 name_entry.set_text (_route.name());
1159 AudioTimeAxisView::visual_click ()
1161 popup_display_menu (0);
1165 AudioTimeAxisView::hide_click ()
1167 editor.unselect_strip_in_display (*this);
1171 AudioTimeAxisView::find_next_region (jack_nframes_t pos, RegionPoint point, int32_t dir)
1174 AudioPlaylist *playlist;
1176 if ((stream = get_diskstream()) != 0 && (playlist = stream->playlist()) != 0) {
1177 return playlist->find_next_region (pos, point, dir);
1184 AudioTimeAxisView::add_gain_automation_child ()
1187 AutomationLine* line;
1189 gain_track = new GainAutomationTimeAxisView (_session,
1195 _route.gain_automation_curve());
1197 line = new AutomationGainLine ("automation gain",
1200 *gain_track->canvas_display,
1201 _route.gain_automation_curve());
1203 line->set_line_color (color_map[cAutomationLine]);
1206 gain_track->add_line (*line);
1208 add_child (gain_track);
1210 gain_track->Hiding.connect (mem_fun(*this, &AudioTimeAxisView::gain_hidden));
1216 if ((node = gain_track->get_state_node()) != 0) {
1217 if ((prop = node->property ("shown")) != 0) {
1218 if (prop->value() == "yes") {
1225 gain_track->hide ();
1230 AudioTimeAxisView::add_pan_automation_child ()
1234 pan_track = new PanAutomationTimeAxisView (_session, _route, editor, *this, parent_canvas, _("pan"));
1238 add_child (pan_track);
1240 pan_track->Hiding.connect (mem_fun(*this, &AudioTimeAxisView::pan_hidden));
1247 if ((node = pan_track->get_state_node()) != 0) {
1248 if ((prop = node->property ("shown")) != 0) {
1249 if (prop->value() == "yes") {
1261 AudioTimeAxisView::update_pans ()
1265 pan_track->clear_lines ();
1267 /* we don't draw lines for "greater than stereo" panning.
1270 if (_route.n_outputs() > 2) {
1274 for (p = _route.panner().begin(); p != _route.panner().end(); ++p) {
1276 AutomationLine* line;
1278 line = new AutomationPanLine ("automation pan", _session, *pan_track,
1279 *pan_track->canvas_display,
1280 (*p)->automation());
1282 if (p == _route.panner().begin()) {
1283 /* first line is a nice orange */
1284 line->set_line_color (color_map[cLeftPanAutomationLine]);
1286 /* second line is a nice blue */
1287 line->set_line_color (color_map[cRightPanAutomationLine]);
1290 pan_track->add_line (*line);
1295 AudioTimeAxisView::toggle_gain_track ()
1298 bool showit = gain_automation_item->get_active();
1300 if (showit != gain_track->marked_for_display()) {
1302 gain_track->set_marked_for_display (true);
1303 gain_track->canvas_display->show();
1304 gain_track->get_state_node()->add_property ("shown", X_("yes"));
1306 gain_track->set_marked_for_display (false);
1307 gain_track->hide ();
1308 gain_track->get_state_node()->add_property ("shown", X_("no"));
1311 /* now trigger a redisplay */
1314 _route.gui_changed (X_("track_height"), (void *) 0); /* EMIT_SIGNAL */
1320 AudioTimeAxisView::gain_hidden ()
1322 gain_track->get_state_node()->add_property (X_("shown"), X_("no"));
1324 if (gain_automation_item && !_hidden) {
1325 gain_automation_item->set_active (false);
1328 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1332 AudioTimeAxisView::toggle_pan_track ()
1334 bool showit = pan_automation_item->get_active();
1336 if (showit != pan_track->marked_for_display()) {
1338 pan_track->set_marked_for_display (true);
1339 pan_track->canvas_display->show();
1340 pan_track->get_state_node()->add_property ("shown", X_("yes"));
1342 pan_track->set_marked_for_display (false);
1344 pan_track->get_state_node()->add_property ("shown", X_("no"));
1347 /* now trigger a redisplay */
1350 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1356 AudioTimeAxisView::pan_hidden ()
1358 pan_track->get_state_node()->add_property ("shown", "no");
1360 if (pan_automation_item && !_hidden) {
1361 pan_automation_item->set_active (false);
1364 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1367 AudioTimeAxisView::RedirectAutomationInfo::~RedirectAutomationInfo ()
1369 for (vector<RedirectAutomationNode*>::iterator i = lines.begin(); i != lines.end(); ++i) {
1375 AudioTimeAxisView::RedirectAutomationNode::~RedirectAutomationNode ()
1377 parent.remove_ran (this);
1385 AudioTimeAxisView::remove_ran (RedirectAutomationNode* ran)
1388 remove_child (ran->view);
1392 AudioTimeAxisView::RedirectAutomationNode*
1393 AudioTimeAxisView::find_redirect_automation_node (Redirect *redirect, uint32_t what)
1395 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1397 if ((*i)->redirect == redirect) {
1399 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1400 if ((*ii)->what == what) {
1411 legalize_for_xml_node (string str)
1413 string::size_type pos;
1414 string legal_chars = "abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_+=:";
1420 while ((pos = legal.find_first_not_of (legal_chars, pos)) != string::npos) {
1421 legal.replace (pos, 1, "_");
1430 AudioTimeAxisView::add_redirect_automation_curve (Redirect *redirect, uint32_t what)
1432 RedirectAutomationLine* ral;
1434 RedirectAutomationNode* ran;
1436 if ((ran = find_redirect_automation_node (redirect, what)) == 0) {
1437 fatal << _("programming error: ")
1438 << string_compose (X_("redirect automation curve for %1:%2 not registered with audio track!"),
1439 redirect->name(), what)
1449 name = redirect->describe_parameter (what);
1451 /* create a string that is a legal XML node name that can be used to refer to this redirect+port combination */
1453 char state_name[256];
1454 snprintf (state_name, sizeof (state_name), "Redirect-%s-%" PRIu32, legalize_for_xml_node (redirect->name()).c_str(), what);
1456 ran->view = new RedirectAutomationTimeAxisView (_session, _route, editor, *this, parent_canvas, name, what, *redirect, state_name);
1458 ral = new RedirectAutomationLine (name,
1459 *redirect, what, _session, *ran->view,
1460 *ran->view->canvas_display, redirect->automation_list (what));
1462 ral->set_line_color (color_map[cRedirectAutomationLine]);
1463 ral->queue_reset ();
1465 ran->view->add_line (*ral);
1467 ran->view->Hiding.connect (bind (mem_fun(*this, &AudioTimeAxisView::redirect_automation_track_hidden), ran, redirect));
1469 if (!ran->view->marked_for_display()) {
1472 ran->menu_item->set_active (true);
1475 add_child (ran->view);
1477 view->foreach_regionview (bind (mem_fun(*this, &AudioTimeAxisView::add_ghost_to_redirect), ran->view));
1479 redirect->mark_automation_visible (what, true);
1483 AudioTimeAxisView::redirect_automation_track_hidden (AudioTimeAxisView::RedirectAutomationNode* ran, Redirect* r)
1486 ran->menu_item->set_active (false);
1489 r->mark_automation_visible (ran->what, false);
1491 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1495 AudioTimeAxisView::add_existing_redirect_automation_curves (Redirect *redirect)
1498 RedirectAutomationLine *ral;
1500 redirect->what_has_visible_automation (s);
1502 for (set<uint32_t>::iterator i = s.begin(); i != s.end(); ++i) {
1504 if ((ral = find_redirect_automation_curve (redirect, *i)) != 0) {
1505 ral->queue_reset ();
1507 add_redirect_automation_curve (redirect, (*i));
1513 AudioTimeAxisView::add_redirect_to_subplugin_menu (Redirect* r)
1515 using namespace Menu_Helpers;
1516 RedirectAutomationInfo *rai;
1517 list<RedirectAutomationInfo*>::iterator x;
1519 const std::set<uint32_t>& automatable = r->what_can_be_automated ();
1520 std::set<uint32_t> has_visible_automation;
1522 r->what_has_visible_automation(has_visible_automation);
1524 if (automatable.empty()) {
1528 for (x = redirect_automation.begin(); x != redirect_automation.end(); ++x) {
1529 if ((*x)->redirect == r) {
1534 if (x == redirect_automation.end()) {
1536 rai = new RedirectAutomationInfo (r);
1537 redirect_automation.push_back (rai);
1545 /* any older menu was deleted at the top of redirects_changed()
1546 when we cleared the subplugin menu.
1549 rai->menu = manage (new Menu);
1550 MenuList& items = rai->menu->items();
1551 rai->menu->set_name ("ArdourContextMenu");
1555 for (std::set<uint32_t>::const_iterator i = automatable.begin(); i != automatable.end(); ++i) {
1557 RedirectAutomationNode* ran;
1558 CheckMenuItem* mitem;
1560 string name = r->describe_parameter (*i);
1562 items.push_back (CheckMenuElem (name));
1563 mitem = dynamic_cast<CheckMenuItem*> (&items.back());
1565 if (has_visible_automation.find((*i)) != has_visible_automation.end()) {
1566 mitem->set_active(true);
1569 if ((ran = find_redirect_automation_node (r, *i)) == 0) {
1573 ran = new RedirectAutomationNode (*i, mitem, *this);
1575 rai->lines.push_back (ran);
1579 ran->menu_item = mitem;
1583 mitem->signal_toggled().connect (bind (mem_fun(*this, &AudioTimeAxisView::redirect_menu_item_toggled), rai, ran));
1586 /* add the menu for this redirect, because the subplugin
1587 menu is always cleared at the top of redirects_changed().
1588 this is the result of some poor design in gtkmm and/or
1592 subplugin_menu.items().push_back (MenuElem (r->name(), *rai->menu));
1597 AudioTimeAxisView::redirect_menu_item_toggled (AudioTimeAxisView::RedirectAutomationInfo* rai,
1598 AudioTimeAxisView::RedirectAutomationNode* ran)
1600 bool showit = ran->menu_item->get_active();
1601 bool redraw = false;
1603 if (ran->view == 0 && showit) {
1604 add_redirect_automation_curve (rai->redirect, ran->what);
1608 if (showit != ran->view->marked_for_display()) {
1611 ran->view->set_marked_for_display (true);
1612 ran->view->canvas_display->show();
1614 rai->redirect->mark_automation_visible (ran->what, true);
1615 ran->view->set_marked_for_display (false);
1623 if (redraw && !no_redraw) {
1625 /* now trigger a redisplay */
1627 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1633 AudioTimeAxisView::redirects_changed (void *src)
1635 using namespace Menu_Helpers;
1637 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1638 (*i)->valid = false;
1641 subplugin_menu.items().clear ();
1643 _route.foreach_redirect (this, &AudioTimeAxisView::add_redirect_to_subplugin_menu);
1644 _route.foreach_redirect (this, &AudioTimeAxisView::add_existing_redirect_automation_curves);
1646 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ) {
1648 list<RedirectAutomationInfo*>::iterator tmp;
1656 redirect_automation.erase (i);
1663 /* change in visibility was possible */
1665 _route.gui_changed ("track_height", this);
1668 RedirectAutomationLine *
1669 AudioTimeAxisView::find_redirect_automation_curve (Redirect *redirect, uint32_t what)
1671 RedirectAutomationNode* ran;
1673 if ((ran = find_redirect_automation_node (redirect, what)) != 0) {
1675 return dynamic_cast<RedirectAutomationLine*> (ran->view->lines.front());
1683 AudioTimeAxisView::show_all_automation ()
1687 pan_automation_item->set_active (true);
1688 gain_automation_item->set_active (true);
1690 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1691 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1692 if ((*ii)->view == 0) {
1693 add_redirect_automation_curve ((*i)->redirect, (*ii)->what);
1696 (*ii)->menu_item->set_active (true);
1702 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1706 AudioTimeAxisView::show_existing_automation ()
1710 pan_automation_item->set_active (true);
1711 gain_automation_item->set_active (true);
1713 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1714 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1715 if ((*ii)->view != 0) {
1716 (*ii)->menu_item->set_active (true);
1723 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1727 AudioTimeAxisView::hide_all_automation ()
1731 pan_automation_item->set_active (false);
1732 gain_automation_item->set_active (false);
1734 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1735 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1736 (*ii)->menu_item->set_active (false);
1741 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1745 AudioTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op)
1747 Playlist* what_we_got;
1748 DiskStream* ds = get_diskstream();
1753 /* route is a bus, not a track */
1757 playlist = ds->playlist();
1760 TimeSelection time (selection.time);
1761 float speed = ds->speed();
1762 if (speed != 1.0f) {
1763 for (TimeSelection::iterator i = time.begin(); i != time.end(); ++i) {
1764 (*i).start = session_frame_to_track_frame((*i).start, speed);
1765 (*i).end = session_frame_to_track_frame((*i).end, speed);
1771 _session.add_undo (playlist->get_memento());
1772 if ((what_we_got = playlist->cut (time)) != 0) {
1773 editor.get_cut_buffer().add (what_we_got);
1774 _session.add_redo_no_execute (playlist->get_memento());
1779 if ((what_we_got = playlist->copy (time)) != 0) {
1780 editor.get_cut_buffer().add (what_we_got);
1785 _session.add_undo (playlist->get_memento());
1786 if ((what_we_got = playlist->cut (time)) != 0) {
1787 _session.add_redo_no_execute (playlist->get_memento());
1788 what_we_got->unref ();
1798 AudioTimeAxisView::paste (jack_nframes_t pos, float times, Selection& selection, size_t nth)
1800 if (!is_audio_track()) {
1804 Playlist* playlist = get_diskstream()->playlist();
1805 PlaylistSelection::iterator p;
1807 for (p = selection.playlists.begin(); p != selection.playlists.end() && nth; ++p, --nth);
1809 if (p == selection.playlists.end()) {
1813 if (get_diskstream()->speed() != 1.0f)
1814 pos = session_frame_to_track_frame(pos, get_diskstream()->speed() );
1816 _session.add_undo (playlist->get_memento());
1817 playlist->paste (**p, pos, times);
1818 _session.add_redo_no_execute (playlist->get_memento());
1824 AudioTimeAxisView::region_view_added (AudioRegionView* arv)
1826 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1827 AutomationTimeAxisView* atv;
1829 if ((atv = dynamic_cast<AutomationTimeAxisView*> (*i)) != 0) {
1830 arv->add_ghost (*atv);
1836 AudioTimeAxisView::add_ghost_to_redirect (AudioRegionView* arv, AutomationTimeAxisView* atv)
1838 arv->add_ghost (*atv);
1842 AudioTimeAxisView::get_child_list()
1845 list<TimeAxisView*>redirect_children;
1847 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1848 if (!(*i)->hidden()) {
1849 redirect_children.push_back(*i);
1852 return redirect_children;
1857 AudioTimeAxisView::build_playlist_menu (Gtk::Menu * menu)
1859 using namespace Menu_Helpers;
1861 if (!menu || !is_audio_track()) {
1865 MenuList& playlist_items = menu->items();
1866 menu->set_name ("ArdourContextMenu");
1867 playlist_items.clear();
1869 if (playlist_menu) {
1870 delete playlist_menu;
1872 playlist_menu = new Menu;
1873 playlist_menu->set_name ("ArdourContextMenu");
1875 playlist_items.push_back (MenuElem (string_compose (_("Current: %1"), get_diskstream()->playlist()->name())));
1876 playlist_items.push_back (SeparatorElem());
1878 playlist_items.push_back (MenuElem (_("Rename"), mem_fun(*this, &AudioTimeAxisView::rename_current_playlist)));
1879 playlist_items.push_back (SeparatorElem());
1881 playlist_items.push_back (MenuElem (_("New"), mem_fun(*this, &AudioTimeAxisView::use_new_playlist)));
1882 playlist_items.push_back (MenuElem (_("New Copy"), mem_fun(*this, &AudioTimeAxisView::use_copy_playlist)));
1883 playlist_items.push_back (SeparatorElem());
1884 playlist_items.push_back (MenuElem (_("Clear Current"), mem_fun(*this, &AudioTimeAxisView::clear_playlist)));
1885 playlist_items.push_back (SeparatorElem());
1886 playlist_items.push_back (MenuElem(_("Select"), mem_fun(*this, &AudioTimeAxisView::show_playlist_selector)));
1891 AudioTimeAxisView::show_playlist_selector ()
1893 editor.playlist_selector().show_for (this);
1898 AudioTimeAxisView::map_frozen ()
1900 if (!is_audio_track()) {
1904 ENSURE_GUI_THREAD (mem_fun(*this, &AudioTimeAxisView::map_frozen));
1907 switch (audio_track()->freeze_state()) {
1908 case AudioTrack::Frozen:
1909 playlist_button.set_sensitive (false);
1910 rec_enable_button->set_sensitive (false);
1913 playlist_button.set_sensitive (true);
1914 rec_enable_button->set_sensitive (true);
1920 AudioTimeAxisView::show_all_xfades ()
1923 view->show_all_xfades ();
1928 AudioTimeAxisView::hide_all_xfades ()
1931 view->hide_all_xfades ();
1936 AudioTimeAxisView::hide_dependent_views (TimeAxisViewItem& tavi)
1938 AudioRegionView* rv;
1940 if (view && (rv = dynamic_cast<AudioRegionView*>(&tavi)) != 0) {
1941 view->hide_xfades_involving (*rv);
1946 AudioTimeAxisView::reveal_dependent_views (TimeAxisViewItem& tavi)
1948 AudioRegionView* rv;
1950 if (view && (rv = dynamic_cast<AudioRegionView*>(&tavi)) != 0) {
1951 view->reveal_xfades_involving (*rv);
1956 AudioTimeAxisView::route_active_changed ()
1958 RouteUI::route_active_changed ();
1960 if (is_audio_track()) {
1961 if (_route.active()) {
1962 controls_ebox.set_name ("AudioTrackControlsBaseUnselected");
1963 controls_base_selected_name = "AudioTrackControlsBaseSelected";
1964 controls_base_unselected_name = "AudioTrackControlsBaseUnselected";
1966 controls_ebox.set_name ("AudioTrackControlsBaseInactiveUnselected");
1967 controls_base_selected_name = "AudioTrackControlsBaseInactiveSelected";
1968 controls_base_unselected_name = "AudioTrackControlsBaseInactiveUnselected";
1971 if (_route.active()) {
1972 controls_ebox.set_name ("BusControlsBaseUnselected");
1973 controls_base_selected_name = "BusControlsBaseSelected";
1974 controls_base_unselected_name = "BusControlsBaseUnselected";
1976 controls_ebox.set_name ("BusControlsBaseInactiveUnselected");
1977 controls_base_selected_name = "BusControlsBaseInactiveSelected";
1978 controls_base_unselected_name = "BusControlsBaseInactiveUnselected";
1984 AudioTimeAxisView::get_child_xml_node (std::string childname)
1986 return RouteUI::get_child_xml_node (childname);