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 "canvas-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"
76 #include <ardour/audio_track.h>
80 using namespace ARDOUR;
81 //using namespace sigc;
82 using namespace LADSPA;
84 using namespace Editing;
86 static const gchar * small_x_xpm[] = {
102 AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, Route& rt, Widget *canvas)
104 RouteUI(rt, sess, _("m"), _("s"), _("r")), // mute, solo, and record
105 TimeAxisView(sess,ed,(TimeAxisView*) 0, canvas),
106 parent_canvas (canvas),
108 edit_group_button (_("g")), // group
109 playlist_button (_("p")),
110 size_button (_("h")), // height
111 automation_button (_("a")),
112 visual_button (_("v"))
116 subplugin_menu.set_name ("ArdourContextMenu");
118 playlist_action_menu = 0;
119 automation_action_menu = 0;
123 timestretch_rect = 0;
125 pan_automation_item = 0;
126 gain_automation_item = 0;
129 view = new StreamView (*this);
131 add_gain_automation_child ();
132 add_pan_automation_child ();
134 ignore_toggle = false;
136 rec_enable_button->set_active (false);
137 mute_button->set_active (false);
138 solo_button->set_active (false);
140 rec_enable_button->set_name ("TrackRecordEnableButton");
141 mute_button->set_name ("TrackMuteButton");
142 solo_button->set_name ("SoloButton");
143 edit_group_button.set_name ("TrackGroupButton");
144 playlist_button.set_name ("TrackPlaylistButton");
145 automation_button.set_name ("TrackAutomationButton");
146 size_button.set_name ("TrackSizeButton");
147 visual_button.set_name ("TrackVisualButton");
148 hide_button.set_name ("TrackRemoveButton");
150 hide_button.add (*(manage (new Image (Gdk::Pixbuf::create_from_xpm_data(small_x_xpm)))));
152 _route.mute_changed.connect (mem_fun(*this, &RouteUI::mute_changed));
153 _route.solo_changed.connect (mem_fun(*this, &RouteUI::solo_changed));
154 _route.solo_safe_changed.connect (mem_fun(*this, &RouteUI::solo_changed));
156 _route.panner().Changed.connect (mem_fun(*this, &AudioTimeAxisView::update_pans));
158 solo_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::solo_press));
159 solo_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::solo_release));
160 mute_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::mute_press));
161 mute_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::mute_release));
162 rec_enable_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::rec_enable_press));
163 edit_group_button.signal_button_release_event().connect (mem_fun(*this, &AudioTimeAxisView::edit_click));
164 playlist_button.signal_clicked().connect (mem_fun(*this, &AudioTimeAxisView::playlist_click));
165 automation_button.signal_clicked().connect (mem_fun(*this, &AudioTimeAxisView::automation_click));
166 size_button.signal_button_release_event().connect (mem_fun(*this, &AudioTimeAxisView::size_click));
167 visual_button.signal_clicked().connect (mem_fun(*this, &AudioTimeAxisView::visual_click));
168 hide_button.signal_clicked().connect (mem_fun(*this, &AudioTimeAxisView::hide_click));
170 name_entry.signal_activate().connect (mem_fun(*this, &AudioTimeAxisView::name_entry_activated));
171 name_entry.signal_focus_out_event().connect (mem_fun(*this, &AudioTimeAxisView::name_entry_focus_out_handler));
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 = gnome_canvas_item_new (GNOME_CANVAS_GROUP(canvas_display),
488 gnome_canvas_simplerect_get_type(),
493 "fill_color_rgba", color_map[cTimeStretchFill],
494 "outline_color_rgba" , color_map[cTimeStretchOutline],
498 gnome_canvas_item_show (timestretch_rect);
499 gnome_canvas_item_raise_to_top (timestretch_rect);
501 x1 = start / editor.get_current_zoom();
502 x2 = (end - 1) / editor.get_current_zoom();
505 gtk_object_set (GTK_OBJECT(timestretch_rect),
514 AudioTimeAxisView::hide_timestretch ()
516 TimeAxisView::hide_timestretch ();
518 if (timestretch_rect) {
519 gnome_canvas_item_hide (timestretch_rect);
524 AudioTimeAxisView::show_selection (TimeSelection& ts)
528 /* ignore it if our edit group is not active or if the selection was started
529 in some other track or edit group (remember that edit_group() == 0 means
530 that the track is not in an edit group).
533 if (((ts.track != this && !is_child (ts.track)) && _route.edit_group() && !_route.edit_group()->is_active()) ||
534 (!(ts.track == this || is_child (ts.track) || (ts.group != 0 && ts.group == _route.edit_group())))) {
540 TimeAxisView::show_selection (ts);
544 AudioTimeAxisView::set_state (const XMLNode& node)
546 const XMLProperty *prop;
548 TimeAxisView::set_state (node);
550 if ((prop = node.property ("shown_editor")) != 0) {
551 if (prop->value() == "no") {
552 _marked_for_display = false;
554 _marked_for_display = true;
557 _marked_for_display = true;
560 XMLNodeList nlist = node.children();
561 XMLNodeConstIterator niter;
565 show_gain_automation = false;
566 show_pan_automation = false;
568 for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
571 if (child_node->name() == "gain") {
572 XMLProperty *prop=child_node->property ("shown");
575 if (prop->value() == "yes") {
576 show_gain_automation = true;
582 if (child_node->name() == "pan") {
583 XMLProperty *prop=child_node->property ("shown");
586 if (prop->value() == "yes") {
587 show_pan_automation = true;
596 AudioTimeAxisView::set_height (TrackHeight h)
598 bool height_changed = (h != (TrackHeight)height);
600 TimeAxisView::set_height (h);
604 view->set_height ((double) height);
608 xml_node->add_property ("track_height", "largest");
609 controls_table.show_all ();
613 xml_node->add_property ("track_height", "large");
614 controls_table.show_all ();
618 xml_node->add_property ("track_height", "larger");
619 controls_table.show_all ();
623 xml_node->add_property ("track_height", "normal");
624 controls_table.show_all ();
628 xml_node->add_property ("track_height", "smaller");
629 controls_table.show_all ();
631 edit_group_button.hide ();
633 visual_button.hide ();
635 automation_button.hide ();
636 playlist_button.hide ();
639 xml_node->add_property ("track_height", "small");
640 controls_table.hide_all ();
641 controls_table.show ();
642 name_label.set_text (_route.name());
648 if (height_changed) {
649 /* only emit the signal if the height really changed */
650 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
655 AudioTimeAxisView::select_track_color ()
657 if (RouteUI::choose_color ()) {
660 view->apply_color (_color, StreamView::RegionColor);
666 AudioTimeAxisView::reset_redirect_automation_curves ()
668 for (vector<RedirectAutomationLine*>::iterator i = redirect_automation_curves.begin(); i != redirect_automation_curves.end(); ++i) {
674 AudioTimeAxisView::reset_samples_per_unit ()
676 set_samples_per_unit (editor.get_current_zoom());
680 AudioTimeAxisView::set_samples_per_unit (double spu)
684 if (get_diskstream() != 0) {
685 speed = get_diskstream()->speed();
689 view->set_samples_per_unit (spu * speed);
692 TimeAxisView::set_samples_per_unit (spu * speed);
696 AudioTimeAxisView::build_display_menu ()
698 using namespace Menu_Helpers;
700 /* get the size menu ready */
706 TimeAxisView::build_display_menu ();
708 /* now fill it with our stuff */
710 MenuList& items = display_menu->items();
711 display_menu->set_name ("ArdourContextMenu");
713 items.push_back (MenuElem (_("Height"), *size_menu));
714 items.push_back (MenuElem (_("Color"), mem_fun(*this, &AudioTimeAxisView::select_track_color)));
717 items.push_back (SeparatorElem());
718 items.push_back (MenuElem (_("Hide all crossfades"), mem_fun(*this, &AudioTimeAxisView::hide_all_xfades)));
719 items.push_back (MenuElem (_("Show all crossfades"), mem_fun(*this, &AudioTimeAxisView::show_all_xfades)));
720 items.push_back (SeparatorElem());
723 automation_action_menu = manage (new Menu);
724 MenuList& automation_items = automation_action_menu->items();
725 automation_action_menu->set_name ("ArdourContextMenu");
727 automation_items.push_back (MenuElem (_("show all automation"),
728 mem_fun(*this, &AudioTimeAxisView::show_all_automation)));
730 automation_items.push_back (MenuElem (_("show existing automation"),
731 mem_fun(*this, &AudioTimeAxisView::show_existing_automation)));
733 automation_items.push_back (MenuElem (_("hide all automation"),
734 mem_fun(*this, &AudioTimeAxisView::hide_all_automation)));
736 automation_items.push_back (SeparatorElem());
738 automation_items.push_back (CheckMenuElem (_("gain"),
739 mem_fun(*this, &AudioTimeAxisView::toggle_gain_track)));
740 gain_automation_item = static_cast<CheckMenuItem*> (&automation_items.back());
741 gain_automation_item->set_active(show_gain_automation);
743 automation_items.push_back (CheckMenuElem (_("pan"),
744 mem_fun(*this, &AudioTimeAxisView::toggle_pan_track)));
745 pan_automation_item = static_cast<CheckMenuItem*> (&automation_items.back());
746 pan_automation_item->set_active(show_pan_automation);
748 automation_items.push_back (MenuElem (_("Plugins"), subplugin_menu));
750 items.push_back (MenuElem (_("Automation"), *automation_action_menu));
752 Menu *waveform_menu = manage(new Menu);
753 MenuList& waveform_items = waveform_menu->items();
754 waveform_menu->set_name ("ArdourContextMenu");
756 waveform_items.push_back (CheckMenuElem (_("Show waveforms"), mem_fun(*this, &AudioTimeAxisView::toggle_waveforms)));
757 waveform_item = static_cast<CheckMenuItem *> (&waveform_items.back());
758 ignore_toggle = true;
759 waveform_item->set_active (editor.show_waveforms());
760 ignore_toggle = false;
762 RadioMenuItem::Group group;
764 waveform_items.push_back (RadioMenuElem (group, _("Traditional"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_shape), Traditional)));
765 traditional_item = static_cast<RadioMenuItem *> (&waveform_items.back());
767 waveform_items.push_back (RadioMenuElem (group, _("Rectified"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_shape), Rectified)));
768 rectified_item = static_cast<RadioMenuItem *> (&waveform_items.back());
770 items.push_back (MenuElem (_("Waveform"), *waveform_menu));
772 if (is_audio_track()) {
774 Menu* alignment_menu = manage (new Menu);
775 MenuList& alignment_items = alignment_menu->items();
776 alignment_menu->set_name ("ArdourContextMenu");
778 RadioMenuItem::Group align_group;
780 alignment_items.push_back (RadioMenuElem (align_group, _("align with existing material"), bind (mem_fun(*this, &AudioTimeAxisView::set_align_style), ExistingMaterial)));
781 align_existing_item = dynamic_cast<RadioMenuItem*>(&alignment_items.back());
782 if (get_diskstream()->alignment_style() == ExistingMaterial) {
783 align_existing_item->set_active();
785 alignment_items.push_back (RadioMenuElem (align_group, _("align with capture time"), bind (mem_fun(*this, &AudioTimeAxisView::set_align_style), CaptureTime)));
786 align_capture_item = dynamic_cast<RadioMenuItem*>(&alignment_items.back());
787 if (get_diskstream()->alignment_style() == CaptureTime) {
788 align_capture_item->set_active();
791 items.push_back (MenuElem (_("Alignment"), *alignment_menu));
793 get_diskstream()->AlignmentStyleChanged.connect (mem_fun(*this, &AudioTimeAxisView::align_style_changed));
796 items.push_back (SeparatorElem());
797 items.push_back (CheckMenuElem (_("Active"), mem_fun(*this, &RouteUI::toggle_route_active)));
798 route_active_menu_item = dynamic_cast<CheckMenuItem *> (&items.back());
799 route_active_menu_item->set_active (_route.active());
801 items.push_back (SeparatorElem());
802 items.push_back (MenuElem (_("Remove"), mem_fun(*this, &RouteUI::remove_this_route)));
807 AudioTimeAxisView::align_style_changed ()
809 switch (get_diskstream()->alignment_style()) {
810 case ExistingMaterial:
811 if (!align_existing_item->get_active()) {
812 align_existing_item->set_active();
816 if (!align_capture_item->get_active()) {
817 align_capture_item->set_active();
824 AudioTimeAxisView::set_align_style (AlignStyle style)
826 get_diskstream()->set_align_style (style);
830 AudioTimeAxisView::rename_current_playlist ()
832 ArdourPrompter prompter (true);
838 if (((ds = get_diskstream()) == 0) ||((pl = ds->playlist()) == 0)) {
842 prompter.set_prompt (_("Name for playlist"));
843 prompter.set_initial_text (pl->name());
845 switch (prompter.run ()) {
846 case GTK_RESPONSE_ACCEPT:
847 prompter.get_result (name);
857 AudioTimeAxisView::playlist_selected (AudioPlaylist *pl)
861 if ((ds = get_diskstream()) != 0) {
862 ds->use_playlist (pl);
867 AudioTimeAxisView::use_copy_playlist ()
873 if (((ds = get_diskstream()) == 0) || ((pl = ds->playlist()) == 0)) {
877 ArdourPrompter prompter (true);
878 string new_name = Playlist::bump_name (pl->name(), _session);
880 prompter.set_prompt (_("Name for playlist"));
881 prompter.set_initial_text (new_name);
882 prompter.show_all ();
884 switch (prompter.run ()) {
885 case GTK_RESPONSE_ACCEPT:
886 prompter.get_result (name);
887 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);
917 ds->use_new_playlist ();
928 AudioTimeAxisView::clear_playlist ()
933 if ((ds = get_diskstream()) != 0) {
934 if ((pl = ds->playlist()) != 0) {
935 editor.clear_playlist (*pl);
941 AudioTimeAxisView::toggle_waveforms ()
943 if (view && waveform_item && !ignore_toggle) {
944 view->set_show_waveforms (waveform_item->get_active());
949 AudioTimeAxisView::set_show_waveforms (bool yn)
952 waveform_item->set_active (yn);
954 view->set_show_waveforms (yn);
959 AudioTimeAxisView::set_show_waveforms_recording (bool yn)
962 view->set_show_waveforms_recording (yn);
967 AudioTimeAxisView::set_waveform_shape (WaveformShape shape)
970 view->set_waveform_shape (shape);
975 AudioTimeAxisView::speed_changed ()
977 Gtkmm2ext::UI::instance()->call_slot (mem_fun(*this, &AudioTimeAxisView::reset_samples_per_unit));
981 AudioTimeAxisView::diskstream_changed (void *src)
983 Gtkmm2ext::UI::instance()->call_slot (mem_fun(*this, &AudioTimeAxisView::update_diskstream_display));
987 AudioTimeAxisView::update_diskstream_display ()
991 if ((ds = get_diskstream()) != 0) {
992 set_playlist (ds->playlist ());
999 AudioTimeAxisView::selection_click (GdkEventButton* ev)
1001 PublicEditor::TrackViewList* tracks = editor.get_valid_views (this, _route.edit_group());
1003 if (Keyboard::modifier_state_contains (ev->state, Keyboard::Shift)) {
1004 if (editor.get_selection().selected (this)) {
1005 editor.get_selection().remove (*tracks);
1007 editor.get_selection().add (*tracks);
1010 editor.get_selection().set (*tracks);
1017 AudioTimeAxisView::set_selected_regionviews (AudioRegionSelection& regions)
1020 view->set_selected_regionviews (regions);
1025 AudioTimeAxisView::set_selected_points (PointSelection& points)
1027 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1028 (*i)->set_selected_points (points);
1033 AudioTimeAxisView::get_selectables (jack_nframes_t start, jack_nframes_t end, double top, double bot, list<Selectable*>& results)
1037 if (get_diskstream() != 0) {
1038 speed = get_diskstream()->speed();
1041 jack_nframes_t start_adjusted = (jack_nframes_t) (start * speed);
1042 jack_nframes_t end_adjusted = (jack_nframes_t) (end * speed);
1044 if (view && touched (top, bot)) {
1045 view->get_selectables (start_adjusted, end_adjusted, results);
1048 /* pick up visible automation tracks */
1050 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1051 if (!(*i)->hidden()) {
1052 (*i)->get_selectables (start_adjusted, end_adjusted, top, bot, results);
1058 AudioTimeAxisView::get_inverted_selectables (Selection& sel, list<Selectable*>& results)
1061 view->get_inverted_selectables (sel, results);
1064 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1065 if (!(*i)->hidden()) {
1066 (*i)->get_inverted_selectables (sel, results);
1074 AudioTimeAxisView::edit_group() const
1076 return _route.edit_group();
1080 AudioTimeAxisView::name() const
1082 return _route.name();
1086 AudioTimeAxisView::playlist () const
1090 if ((ds = get_diskstream()) != 0) {
1091 return ds->playlist();
1098 AudioTimeAxisView::name_entry_button_press_handler (GdkEventButton *ev)
1100 if (ev->button == 3) {
1101 return stop_signal (name_entry, "button_press_event");
1107 AudioTimeAxisView::name_entry_button_release_handler (GdkEventButton *ev)
1113 AudioTimeAxisView::name_entry_focus_out_handler (GdkEventFocus* ev)
1115 name_entry_changed ();
1120 AudioTimeAxisView::name_entry_key_release_handler (GdkEventKey* ev)
1122 switch (ev->keyval) {
1126 name_entry_changed ();
1135 AudioTimeAxisView::name_entry_activated ()
1137 /* this should drop focus from the entry,
1138 and cause a call to name_entry_changed()
1140 controls_ebox.grab_focus();
1144 AudioTimeAxisView::name_entry_changed ()
1148 ARDOUR_UI::generic_focus_out_event (0);
1150 x = name_entry.get_text ();
1152 if (x == _route.name()) {
1156 if (x.length() == 0) {
1157 name_entry.set_text (_route.name());
1161 strip_whitespace_edges(x);
1163 if (_session.route_name_unique (x)) {
1164 _route.set_name (x, this);
1166 ARDOUR_UI::instance()->popup_error (_("a track already exists with that name"));
1167 name_entry.set_text (_route.name());
1172 AudioTimeAxisView::visual_click ()
1174 popup_display_menu (0);
1178 AudioTimeAxisView::hide_click ()
1180 editor.unselect_strip_in_display (*this);
1184 AudioTimeAxisView::find_next_region (jack_nframes_t pos, RegionPoint point, int32_t dir)
1187 AudioPlaylist *playlist;
1189 if ((stream = get_diskstream()) != 0 && (playlist = stream->playlist()) != 0) {
1190 return playlist->find_next_region (pos, point, dir);
1197 AudioTimeAxisView::add_gain_automation_child ()
1200 AutomationLine* line;
1202 gain_track = new GainAutomationTimeAxisView (_session, _route, editor, *this, parent_canvas, _("gain"),
1203 _route.gain_automation_curve());
1206 line = new AutomationGainLine ("automation gain", _session, *gain_track,
1207 gain_track->canvas_display,
1208 _route.gain_automation_curve(),
1209 PublicEditor::canvas_control_point_event,
1210 PublicEditor::canvas_line_event);
1211 line->set_line_color (color_map[cAutomationLine]);
1214 gain_track->add_line (*line);
1216 add_child (gain_track);
1218 gain_track->Hiding.connect (mem_fun(*this, &AudioTimeAxisView::gain_hidden));
1224 if ((node = gain_track->get_state_node()) != 0) {
1225 if ((prop = node->property ("shown")) != 0) {
1226 if (prop->value() == "yes") {
1233 gain_track->hide ();
1238 AudioTimeAxisView::add_pan_automation_child ()
1242 pan_track = new PanAutomationTimeAxisView (_session, _route, editor, *this, parent_canvas, _("pan"));
1246 add_child (pan_track);
1248 pan_track->Hiding.connect (mem_fun(*this, &AudioTimeAxisView::pan_hidden));
1255 if ((node = pan_track->get_state_node()) != 0) {
1256 if ((prop = node->property ("shown")) != 0) {
1257 if (prop->value() == "yes") {
1269 AudioTimeAxisView::update_pans ()
1273 pan_track->clear_lines ();
1275 /* we don't draw lines for "greater than stereo" panning.
1278 if (_route.n_outputs() > 2) {
1282 for (p = _route.panner().begin(); p != _route.panner().end(); ++p) {
1284 AutomationLine* line;
1286 line = new AutomationPanLine ("automation pan", _session, *pan_track,
1287 pan_track->canvas_display,
1289 PublicEditor::canvas_control_point_event,
1290 PublicEditor::canvas_line_event);
1292 if (p == _route.panner().begin()) {
1293 /* first line is a nice orange */
1294 line->set_line_color (color_map[cLeftPanAutomationLine]);
1296 /* second line is a nice blue */
1297 line->set_line_color (color_map[cRightPanAutomationLine]);
1300 pan_track->add_line (*line);
1305 AudioTimeAxisView::toggle_gain_track ()
1308 bool showit = gain_automation_item->get_active();
1310 if (showit != gain_track->marked_for_display()) {
1312 gain_track->set_marked_for_display (true);
1313 gnome_canvas_item_show (gain_track->canvas_display);
1314 gain_track->get_state_node()->add_property ("shown", X_("yes"));
1316 gain_track->set_marked_for_display (false);
1317 gain_track->hide ();
1318 gain_track->get_state_node()->add_property ("shown", X_("no"));
1321 /* now trigger a redisplay */
1324 _route.gui_changed (X_("track_height"), (void *) 0); /* EMIT_SIGNAL */
1330 AudioTimeAxisView::gain_hidden ()
1332 gain_track->get_state_node()->add_property (X_("shown"), X_("no"));
1334 if (gain_automation_item && !_hidden) {
1335 gain_automation_item->set_active (false);
1338 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1342 AudioTimeAxisView::toggle_pan_track ()
1344 bool showit = pan_automation_item->get_active();
1346 if (showit != pan_track->marked_for_display()) {
1348 pan_track->set_marked_for_display (true);
1349 gnome_canvas_item_show (pan_track->canvas_display);
1350 pan_track->get_state_node()->add_property ("shown", X_("yes"));
1352 pan_track->set_marked_for_display (false);
1354 pan_track->get_state_node()->add_property ("shown", X_("no"));
1357 /* now trigger a redisplay */
1360 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1366 AudioTimeAxisView::pan_hidden ()
1368 pan_track->get_state_node()->add_property ("shown", "no");
1370 if (pan_automation_item && !_hidden) {
1371 pan_automation_item->set_active (false);
1374 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1377 AudioTimeAxisView::RedirectAutomationInfo::~RedirectAutomationInfo ()
1379 for (vector<RedirectAutomationNode*>::iterator i = lines.begin(); i != lines.end(); ++i) {
1385 AudioTimeAxisView::RedirectAutomationNode::~RedirectAutomationNode ()
1387 parent.remove_ran (this);
1395 AudioTimeAxisView::remove_ran (RedirectAutomationNode* ran)
1398 remove_child (ran->view);
1402 AudioTimeAxisView::RedirectAutomationNode*
1403 AudioTimeAxisView::find_redirect_automation_node (Redirect *redirect, uint32_t what)
1405 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1407 if ((*i)->redirect == redirect) {
1409 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1410 if ((*ii)->what == what) {
1421 legalize_for_xml_node (string str)
1423 string::size_type pos;
1424 string legal_chars = "abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_+=:";
1430 while ((pos = legal.find_first_not_of (legal_chars, pos)) != string::npos) {
1431 legal.replace (pos, 1, "_");
1440 AudioTimeAxisView::add_redirect_automation_curve (Redirect *redirect, uint32_t what)
1442 RedirectAutomationLine* ral;
1444 RedirectAutomationNode* ran;
1446 if ((ran = find_redirect_automation_node (redirect, what)) == 0) {
1447 fatal << _("programming error: ")
1448 << string_compose (X_("redirect automation curve for %1:%2 not registered with audio track!"),
1449 redirect->name(), what)
1459 name = redirect->describe_parameter (what);
1461 /* create a string that is a legal XML node name that can be used to refer to this redirect+port combination */
1463 char state_name[256];
1464 snprintf (state_name, sizeof (state_name), "Redirect-%s-%" PRIu32, legalize_for_xml_node (redirect->name()).c_str(), what);
1466 ran->view = new RedirectAutomationTimeAxisView (_session, _route, editor, *this, parent_canvas, name, what, *redirect, state_name);
1468 ral = new RedirectAutomationLine (name,
1469 *redirect, what, _session, *ran->view,
1470 ran->view->canvas_display, redirect->automation_list (what),
1471 PublicEditor::canvas_control_point_event,
1472 PublicEditor::canvas_line_event);
1474 ral->set_line_color (color_map[cRedirectAutomationLine]);
1475 ral->queue_reset ();
1477 ran->view->add_line (*ral);
1479 ran->view->Hiding.connect (bind (mem_fun(*this, &AudioTimeAxisView::redirect_automation_track_hidden), ran, redirect));
1481 if (!ran->view->marked_for_display()) {
1484 ran->menu_item->set_active (true);
1487 add_child (ran->view);
1489 view->foreach_regionview (bind (mem_fun(*this, &AudioTimeAxisView::add_ghost_to_redirect), ran->view));
1491 redirect->mark_automation_visible (what, true);
1495 AudioTimeAxisView::redirect_automation_track_hidden (AudioTimeAxisView::RedirectAutomationNode* ran, Redirect* r)
1498 ran->menu_item->set_active (false);
1501 r->mark_automation_visible (ran->what, false);
1503 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1507 AudioTimeAxisView::add_existing_redirect_automation_curves (Redirect *redirect)
1510 RedirectAutomationLine *ral;
1512 redirect->what_has_visible_automation (s);
1514 for (set<uint32_t>::iterator i = s.begin(); i != s.end(); ++i) {
1516 if ((ral = find_redirect_automation_curve (redirect, *i)) != 0) {
1517 ral->queue_reset ();
1519 add_redirect_automation_curve (redirect, (*i));
1525 AudioTimeAxisView::add_redirect_to_subplugin_menu (Redirect* r)
1527 using namespace Menu_Helpers;
1528 RedirectAutomationInfo *rai;
1529 list<RedirectAutomationInfo*>::iterator x;
1531 const std::set<uint32_t>& automatable = r->what_can_be_automated ();
1532 std::set<uint32_t> has_visible_automation;
1534 r->what_has_visible_automation(has_visible_automation);
1536 if (automatable.empty()) {
1540 for (x = redirect_automation.begin(); x != redirect_automation.end(); ++x) {
1541 if ((*x)->redirect == r) {
1546 if (x == redirect_automation.end()) {
1548 rai = new RedirectAutomationInfo (r);
1549 redirect_automation.push_back (rai);
1557 /* any older menu was deleted at the top of redirects_changed()
1558 when we cleared the subplugin menu.
1561 rai->menu = manage (new Menu);
1562 MenuList& items = rai->menu->items();
1563 rai->menu->set_name ("ArdourContextMenu");
1567 for (std::set<uint32_t>::const_iterator i = automatable.begin(); i != automatable.end(); ++i) {
1569 RedirectAutomationNode* ran;
1570 CheckMenuItem* mitem;
1572 string name = r->describe_parameter (*i);
1574 items.push_back (CheckMenuElem (name));
1575 mitem = dynamic_cast<CheckMenuItem*> (&items.back());
1577 if (has_visible_automation.find((*i)) != has_visible_automation.end()) {
1578 mitem->set_active(true);
1581 if ((ran = find_redirect_automation_node (r, *i)) == 0) {
1585 ran = new RedirectAutomationNode (*i, mitem, *this);
1587 rai->lines.push_back (ran);
1591 ran->menu_item = mitem;
1595 mitem->signal_toggled().connect (bind (mem_fun(*this, &AudioTimeAxisView::redirect_menu_item_toggled), rai, ran));
1598 /* add the menu for this redirect, because the subplugin
1599 menu is always cleared at the top of redirects_changed().
1600 this is the result of some poor design in gtkmm and/or
1604 subplugin_menu.items().push_back (MenuElem (r->name(), *rai->menu));
1609 AudioTimeAxisView::redirect_menu_item_toggled (AudioTimeAxisView::RedirectAutomationInfo* rai,
1610 AudioTimeAxisView::RedirectAutomationNode* ran)
1612 bool showit = ran->menu_item->get_active();
1613 bool redraw = false;
1615 if (ran->view == 0 && showit) {
1616 add_redirect_automation_curve (rai->redirect, ran->what);
1620 if (showit != ran->view->marked_for_display()) {
1623 ran->view->set_marked_for_display (true);
1624 gnome_canvas_item_show (ran->view->canvas_display);
1626 rai->redirect->mark_automation_visible (ran->what, true);
1627 ran->view->set_marked_for_display (false);
1635 if (redraw && !no_redraw) {
1637 /* now trigger a redisplay */
1639 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1645 AudioTimeAxisView::redirects_changed (void *src)
1647 using namespace Menu_Helpers;
1649 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1650 (*i)->valid = false;
1653 subplugin_menu.items().clear ();
1655 _route.foreach_redirect (this, &AudioTimeAxisView::add_redirect_to_subplugin_menu);
1656 _route.foreach_redirect (this, &AudioTimeAxisView::add_existing_redirect_automation_curves);
1658 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ) {
1660 list<RedirectAutomationInfo*>::iterator tmp;
1668 redirect_automation.erase (i);
1675 /* change in visibility was possible */
1677 _route.gui_changed ("track_height", this);
1680 RedirectAutomationLine *
1681 AudioTimeAxisView::find_redirect_automation_curve (Redirect *redirect, uint32_t what)
1683 RedirectAutomationNode* ran;
1685 if ((ran = find_redirect_automation_node (redirect, what)) != 0) {
1687 return dynamic_cast<RedirectAutomationLine*> (ran->view->lines.front());
1695 AudioTimeAxisView::show_all_automation ()
1699 pan_automation_item->set_active (true);
1700 gain_automation_item->set_active (true);
1702 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1703 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1704 if ((*ii)->view == 0) {
1705 add_redirect_automation_curve ((*i)->redirect, (*ii)->what);
1708 (*ii)->menu_item->set_active (true);
1714 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1718 AudioTimeAxisView::show_existing_automation ()
1722 pan_automation_item->set_active (true);
1723 gain_automation_item->set_active (true);
1725 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1726 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1727 if ((*ii)->view != 0) {
1728 (*ii)->menu_item->set_active (true);
1735 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1739 AudioTimeAxisView::hide_all_automation ()
1743 pan_automation_item->set_active (false);
1744 gain_automation_item->set_active (false);
1746 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1747 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1748 (*ii)->menu_item->set_active (false);
1753 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1757 AudioTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op)
1759 Playlist* what_we_got;
1760 DiskStream* ds = get_diskstream();
1765 /* route is a bus, not a track */
1769 playlist = ds->playlist();
1772 TimeSelection time (selection.time);
1773 float speed = ds->speed();
1774 if (speed != 1.0f) {
1775 for (TimeSelection::iterator i = time.begin(); i != time.end(); ++i) {
1776 (*i).start = (jack_nframes_t)floor( (float) (*i).start * speed);
1777 (*i).end = (jack_nframes_t)floor( (float) (*i).end * speed);
1783 _session.add_undo (playlist->get_memento());
1784 if ((what_we_got = playlist->cut (time)) != 0) {
1785 editor.get_cut_buffer().add (what_we_got);
1786 _session.add_redo_no_execute (playlist->get_memento());
1791 if ((what_we_got = playlist->copy (time)) != 0) {
1792 editor.get_cut_buffer().add (what_we_got);
1797 _session.add_undo (playlist->get_memento());
1798 if ((what_we_got = playlist->cut (time)) != 0) {
1799 _session.add_redo_no_execute (playlist->get_memento());
1800 what_we_got->unref ();
1810 AudioTimeAxisView::paste (jack_nframes_t pos, float times, Selection& selection, size_t nth)
1812 if (!is_audio_track()) {
1816 Playlist* playlist = get_diskstream()->playlist();
1817 PlaylistSelection::iterator p;
1819 for (p = selection.playlists.begin(); p != selection.playlists.end() && nth; ++p, --nth);
1821 if (p == selection.playlists.end()) {
1825 if (get_diskstream()->speed() != 1.0f)
1826 pos = (jack_nframes_t) floor( (float) pos * get_diskstream()->speed() );
1828 _session.add_undo (playlist->get_memento());
1829 playlist->paste (**p, pos, times);
1830 _session.add_redo_no_execute (playlist->get_memento());
1836 AudioTimeAxisView::region_view_added (AudioRegionView* arv)
1838 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1839 AutomationTimeAxisView* atv;
1841 if ((atv = dynamic_cast<AutomationTimeAxisView*> (*i)) != 0) {
1842 arv->add_ghost (*atv);
1848 AudioTimeAxisView::add_ghost_to_redirect (AudioRegionView* arv, AutomationTimeAxisView* atv)
1850 arv->add_ghost (*atv);
1854 AudioTimeAxisView::get_child_list()
1857 list<TimeAxisView*>redirect_children;
1859 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1860 if (!(*i)->hidden()) {
1861 redirect_children.push_back(*i);
1864 return redirect_children;
1869 AudioTimeAxisView::build_playlist_menu (Gtk::Menu * menu)
1871 using namespace Menu_Helpers;
1873 if (!menu || !is_audio_track()) {
1877 MenuList& playlist_items = menu->items();
1878 menu->set_name ("ArdourContextMenu");
1879 playlist_items.clear();
1881 if (playlist_menu) {
1882 delete playlist_menu;
1884 playlist_menu = new Menu;
1885 playlist_menu->set_name ("ArdourContextMenu");
1887 playlist_items.push_back (MenuElem (string_compose (_("Current: %1"), get_diskstream()->playlist()->name())));
1888 playlist_items.push_back (SeparatorElem());
1890 playlist_items.push_back (MenuElem (_("Rename"), mem_fun(*this, &AudioTimeAxisView::rename_current_playlist)));
1891 playlist_items.push_back (SeparatorElem());
1893 playlist_items.push_back (MenuElem (_("New"), mem_fun(*this, &AudioTimeAxisView::use_new_playlist)));
1894 playlist_items.push_back (MenuElem (_("New Copy"), mem_fun(*this, &AudioTimeAxisView::use_copy_playlist)));
1895 playlist_items.push_back (SeparatorElem());
1896 playlist_items.push_back (MenuElem (_("Clear Current"), mem_fun(*this, &AudioTimeAxisView::clear_playlist)));
1897 playlist_items.push_back (SeparatorElem());
1898 playlist_items.push_back (MenuElem(_("Select"), mem_fun(*this, &AudioTimeAxisView::show_playlist_selector)));
1903 AudioTimeAxisView::show_playlist_selector ()
1905 editor.playlist_selector().show_for (this);
1910 AudioTimeAxisView::map_frozen ()
1912 if (!is_audio_track()) {
1916 ENSURE_GUI_THREAD (mem_fun(*this, &AudioTimeAxisView::map_frozen));
1919 switch (audio_track()->freeze_state()) {
1920 case AudioTrack::Frozen:
1921 playlist_button.set_sensitive (false);
1922 rec_enable_button->set_sensitive (false);
1925 playlist_button.set_sensitive (true);
1926 rec_enable_button->set_sensitive (true);
1932 AudioTimeAxisView::show_all_xfades ()
1935 view->show_all_xfades ();
1940 AudioTimeAxisView::hide_all_xfades ()
1943 view->hide_all_xfades ();
1948 AudioTimeAxisView::hide_dependent_views (TimeAxisViewItem& tavi)
1950 AudioRegionView* rv;
1952 if (view && (rv = dynamic_cast<AudioRegionView*>(&tavi)) != 0) {
1953 view->hide_xfades_involving (*rv);
1958 AudioTimeAxisView::reveal_dependent_views (TimeAxisViewItem& tavi)
1960 AudioRegionView* rv;
1962 if (view && (rv = dynamic_cast<AudioRegionView*>(&tavi)) != 0) {
1963 view->reveal_xfades_involving (*rv);
1968 AudioTimeAxisView::route_active_changed ()
1970 RouteUI::route_active_changed ();
1972 if (is_audio_track()) {
1973 if (_route.active()) {
1974 controls_ebox.set_name ("AudioTrackControlsBaseUnselected");
1975 controls_base_selected_name = "AudioTrackControlsBaseSelected";
1976 controls_base_unselected_name = "AudioTrackControlsBaseUnselected";
1978 controls_ebox.set_name ("AudioTrackControlsBaseInactiveUnselected");
1979 controls_base_selected_name = "AudioTrackControlsBaseInactiveSelected";
1980 controls_base_unselected_name = "AudioTrackControlsBaseInactiveUnselected";
1983 if (_route.active()) {
1984 controls_ebox.set_name ("BusControlsBaseUnselected");
1985 controls_base_selected_name = "BusControlsBaseSelected";
1986 controls_base_unselected_name = "BusControlsBaseUnselected";
1988 controls_ebox.set_name ("BusControlsBaseInactiveUnselected");
1989 controls_base_selected_name = "BusControlsBaseInactiveSelected";
1990 controls_base_unselected_name = "BusControlsBaseInactiveUnselected";
1996 AudioTimeAxisView::get_child_xml_node (std::string childname)
1998 return RouteUI::get_child_xml_node (childname);