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 ();
224 edit_group_menu_radio_group = 0;
229 set_state (*xml_node);
231 _route.mute_changed.connect (mem_fun(*this, &RouteUI::mute_changed));
232 _route.solo_changed.connect (mem_fun(*this, &RouteUI::solo_changed));
233 _route.redirects_changed.connect (mem_fun(*this, &AudioTimeAxisView::redirects_changed));
235 _route.name_changed.connect (mem_fun(*this, &AudioTimeAxisView::route_name_changed));
237 if (is_audio_track()) {
241 audio_track()->FreezeChange.connect (mem_fun(*this, &AudioTimeAxisView::map_frozen));
243 audio_track()->diskstream_changed.connect (mem_fun(*this, &AudioTimeAxisView::diskstream_changed));
244 get_diskstream()->speed_changed.connect (mem_fun(*this, &AudioTimeAxisView::speed_changed));
246 controls_ebox.set_name ("AudioTrackControlsBaseUnselected");
247 controls_base_selected_name = "AudioTrackControlsBaseSelected";
248 controls_base_unselected_name = "AudioTrackControlsBaseUnselected";
250 /* ask for notifications of any new RegionViews */
252 view->AudioRegionViewAdded.connect (mem_fun(*this, &AudioTimeAxisView::region_view_added));
256 /* pick up the correct freeze state */
264 controls_ebox.set_name ("BusControlsBaseUnselected");
265 controls_base_selected_name = "BusControlsBaseSelected";
266 controls_base_unselected_name = "BusControlsBaseUnselected";
269 editor.ZoomChanged.connect (mem_fun(*this, &AudioTimeAxisView::reset_samples_per_unit));
272 AudioTimeAxisView::~AudioTimeAxisView ()
274 GoingAway (); /* EMIT_SIGNAL */
277 delete playlist_menu;
281 if (playlist_action_menu) {
282 delete playlist_action_menu;
283 playlist_action_menu = 0;
286 vector_delete (&redirect_automation_curves);
288 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
299 AudioTimeAxisView::show_at (double y, int& nth, Gtk::VBox *parent)
302 xml_node->add_property ("shown_editor", "yes");
304 return TimeAxisView::show_at (y, nth, parent);
308 AudioTimeAxisView::hide ()
311 xml_node->add_property ("shown_editor", "no");
313 TimeAxisView::hide ();
317 AudioTimeAxisView::set_playlist (AudioPlaylist *newplaylist)
321 modified_connection.disconnect ();
322 state_changed_connection.disconnect ();
324 if ((pl = dynamic_cast<AudioPlaylist*> (playlist())) != 0) {
325 state_changed_connection = pl->StateChanged.connect (mem_fun(*this, &AudioTimeAxisView::playlist_state_changed));
326 modified_connection = pl->Modified.connect (mem_fun(*this, &AudioTimeAxisView::playlist_modified));
331 AudioTimeAxisView::playlist_modified ()
336 AudioTimeAxisView::edit_click (GdkEventButton *ev)
338 if (Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) {
339 _route.set_edit_group (0, this);
343 using namespace Menu_Helpers;
345 MenuList& items = edit_group_menu.items ();
348 items.push_back (RadioMenuElem (edit_group_menu_radio_group, _("No group"),
349 bind (mem_fun(*this, &AudioTimeAxisView::set_edit_group_from_menu), (RouteGroup *) 0)));
351 if (_route.edit_group() == 0) {
352 static_cast<RadioMenuItem*>(&items.back())->set_active ();
355 _session.foreach_edit_group (this, &AudioTimeAxisView::add_edit_group_menu_item);
356 edit_group_menu.popup (ev->button, ev->time);
362 AudioTimeAxisView::add_edit_group_menu_item (RouteGroup *eg)
364 using namespace Menu_Helpers;
366 MenuList &items = edit_group_menu.items();
367 items.push_back (RadioMenuElem (edit_group_menu_radio_group,
368 eg->name(), bind (mem_fun(*this, &AudioTimeAxisView::set_edit_group_from_menu), eg)));
369 if (_route.edit_group() == eg) {
370 static_cast<RadioMenuItem*>(&items.back())->set_active ();
375 AudioTimeAxisView::set_edit_group_from_menu (RouteGroup *eg)
378 _route.set_edit_group (eg, this);
382 AudioTimeAxisView::playlist_state_changed (Change ignored)
384 // ENSURE_GUI_THREAD (bind (mem_fun(*this, &AudioTimeAxisView::playlist_state_changed), ignored));
389 AudioTimeAxisView::playlist_changed ()
394 if (is_audio_track()) {
395 set_playlist (get_diskstream()->playlist());
400 AudioTimeAxisView::label_view ()
402 string x = _route.name();
404 if (x != name_entry.get_text()) {
405 name_entry.set_text (x);
408 ARDOUR_UI::instance()->tooltips().set_tip (name_entry, x);
412 AudioTimeAxisView::route_name_changed (void *src)
414 editor.route_name_changed (this);
419 AudioTimeAxisView::take_name_changed (void *src)
428 AudioTimeAxisView::playlist_click ()
430 // always build a new action menu
432 if (playlist_action_menu == 0) {
433 playlist_action_menu = new Menu;
434 playlist_action_menu->set_name ("ArdourContextMenu");
437 build_playlist_menu(playlist_action_menu);
439 playlist_action_menu->popup (1, 0);
443 AudioTimeAxisView::automation_click ()
445 if (automation_action_menu == 0) {
446 /* this seems odd, but the automation action
447 menu is built as part of the display menu.
449 build_display_menu ();
451 automation_action_menu->popup (1, 0);
455 AudioTimeAxisView::show_timestretch (jack_nframes_t start, jack_nframes_t end)
461 TimeAxisView::show_timestretch (start, end);
471 /* check that the time selection was made in our route, or our edit group.
472 remember that edit_group() == 0 implies the route is *not* in a edit group.
475 if (!(ts.track == this || (ts.group != 0 && ts.group == _route.edit_group()))) {
476 /* this doesn't apply to us */
480 /* ignore it if our edit group is not active */
482 if ((ts.track != this) && _route.edit_group() && !_route.edit_group()->is_active()) {
487 if (timestretch_rect == 0) {
488 timestretch_rect = gnome_canvas_item_new (GNOME_CANVAS_GROUP(canvas_display),
489 gnome_canvas_simplerect_get_type(),
494 "fill_color_rgba", color_map[cTimeStretchFill],
495 "outline_color_rgba" , color_map[cTimeStretchOutline],
499 gnome_canvas_item_show (timestretch_rect);
500 gnome_canvas_item_raise_to_top (timestretch_rect);
502 x1 = start / editor.get_current_zoom();
503 x2 = (end - 1) / editor.get_current_zoom();
506 gtk_object_set (GTK_OBJECT(timestretch_rect),
515 AudioTimeAxisView::hide_timestretch ()
517 TimeAxisView::hide_timestretch ();
519 if (timestretch_rect) {
520 gnome_canvas_item_hide (timestretch_rect);
525 AudioTimeAxisView::show_selection (TimeSelection& ts)
529 /* ignore it if our edit group is not active or if the selection was started
530 in some other track or edit group (remember that edit_group() == 0 means
531 that the track is not in an edit group).
534 if (((ts.track != this && !is_child (ts.track)) && _route.edit_group() && !_route.edit_group()->is_active()) ||
535 (!(ts.track == this || is_child (ts.track) || (ts.group != 0 && ts.group == _route.edit_group())))) {
541 TimeAxisView::show_selection (ts);
545 AudioTimeAxisView::set_state (const XMLNode& node)
547 const XMLProperty *prop;
549 TimeAxisView::set_state (node);
551 if ((prop = node.property ("shown_editor")) != 0) {
552 if (prop->value() == "no") {
553 _marked_for_display = false;
555 _marked_for_display = true;
558 _marked_for_display = true;
561 XMLNodeList nlist = node.children();
562 XMLNodeConstIterator niter;
566 show_gain_automation = false;
567 show_pan_automation = false;
569 for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
572 if (child_node->name() == "gain") {
573 XMLProperty *prop=child_node->property ("shown");
576 if (prop->value() == "yes") {
577 show_gain_automation = true;
583 if (child_node->name() == "pan") {
584 XMLProperty *prop=child_node->property ("shown");
587 if (prop->value() == "yes") {
588 show_pan_automation = true;
597 AudioTimeAxisView::set_height (TrackHeight h)
599 bool height_changed = (h != (TrackHeight)height);
601 TimeAxisView::set_height (h);
605 view->set_height ((double) height);
609 xml_node->add_property ("track_height", "largest");
610 controls_table.show_all ();
614 xml_node->add_property ("track_height", "large");
615 controls_table.show_all ();
619 xml_node->add_property ("track_height", "larger");
620 controls_table.show_all ();
624 xml_node->add_property ("track_height", "normal");
625 controls_table.show_all ();
629 xml_node->add_property ("track_height", "smaller");
630 controls_table.show_all ();
632 edit_group_button.hide ();
634 visual_button.hide ();
636 automation_button.hide ();
637 playlist_button.hide ();
640 xml_node->add_property ("track_height", "small");
641 controls_table.hide_all ();
642 controls_table.show ();
643 name_label.set_text (_route.name());
649 if (height_changed) {
650 /* only emit the signal if the height really changed */
651 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
656 AudioTimeAxisView::select_track_color ()
658 if (RouteUI::choose_color ()) {
661 view->apply_color (_color, StreamView::RegionColor);
667 AudioTimeAxisView::reset_redirect_automation_curves ()
669 for (vector<RedirectAutomationLine*>::iterator i = redirect_automation_curves.begin(); i != redirect_automation_curves.end(); ++i) {
675 AudioTimeAxisView::reset_samples_per_unit ()
677 set_samples_per_unit (editor.get_current_zoom());
681 AudioTimeAxisView::set_samples_per_unit (double spu)
685 if (get_diskstream() != 0) {
686 speed = get_diskstream()->speed();
690 view->set_samples_per_unit (spu * speed);
693 TimeAxisView::set_samples_per_unit (spu * speed);
697 AudioTimeAxisView::build_display_menu ()
699 using namespace Menu_Helpers;
701 /* get the size menu ready */
707 TimeAxisView::build_display_menu ();
709 /* now fill it with our stuff */
711 MenuList& items = display_menu->items();
712 display_menu->set_name ("ArdourContextMenu");
714 items.push_back (MenuElem (_("Height"), *size_menu));
715 items.push_back (MenuElem (_("Color"), mem_fun(*this, &AudioTimeAxisView::select_track_color)));
718 items.push_back (SeparatorElem());
719 items.push_back (MenuElem (_("Hide all crossfades"), mem_fun(*this, &AudioTimeAxisView::hide_all_xfades)));
720 items.push_back (MenuElem (_("Show all crossfades"), mem_fun(*this, &AudioTimeAxisView::show_all_xfades)));
721 items.push_back (SeparatorElem());
724 automation_action_menu = manage (new Menu);
725 MenuList& automation_items = automation_action_menu->items();
726 automation_action_menu->set_name ("ArdourContextMenu");
728 automation_items.push_back (MenuElem (_("show all automation"),
729 mem_fun(*this, &AudioTimeAxisView::show_all_automation)));
731 automation_items.push_back (MenuElem (_("show existing automation"),
732 mem_fun(*this, &AudioTimeAxisView::show_existing_automation)));
734 automation_items.push_back (MenuElem (_("hide all automation"),
735 mem_fun(*this, &AudioTimeAxisView::hide_all_automation)));
737 automation_items.push_back (SeparatorElem());
739 automation_items.push_back (CheckMenuElem (_("gain"),
740 mem_fun(*this, &AudioTimeAxisView::toggle_gain_track)));
741 gain_automation_item = static_cast<CheckMenuItem*> (&automation_items.back());
742 gain_automation_item->set_active(show_gain_automation);
744 automation_items.push_back (CheckMenuElem (_("pan"),
745 mem_fun(*this, &AudioTimeAxisView::toggle_pan_track)));
746 pan_automation_item = static_cast<CheckMenuItem*> (&automation_items.back());
747 pan_automation_item->set_active(show_pan_automation);
749 automation_items.push_back (MenuElem (_("Plugins"), subplugin_menu));
751 items.push_back (MenuElem (_("Automation"), *automation_action_menu));
753 Menu *waveform_menu = manage(new Menu);
754 MenuList& waveform_items = waveform_menu->items();
755 waveform_menu->set_name ("ArdourContextMenu");
757 waveform_items.push_back (CheckMenuElem (_("Show waveforms"), mem_fun(*this, &AudioTimeAxisView::toggle_waveforms)));
758 waveform_item = static_cast<CheckMenuItem *> (&waveform_items.back());
759 ignore_toggle = true;
760 waveform_item->set_active (editor.show_waveforms());
761 ignore_toggle = false;
763 RadioMenuItem::Group group;
765 waveform_items.push_back (RadioMenuElem (group, _("Traditional"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_shape), Traditional)));
766 traditional_item = static_cast<RadioMenuItem *> (&waveform_items.back());
768 waveform_items.push_back (RadioMenuElem (group, _("Rectified"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_shape), Rectified)));
769 rectified_item = static_cast<RadioMenuItem *> (&waveform_items.back());
771 items.push_back (MenuElem (_("Waveform"), *waveform_menu));
773 if (is_audio_track()) {
775 Menu* alignment_menu = manage (new Menu);
776 MenuList& alignment_items = alignment_menu->items();
777 alignment_menu->set_name ("ArdourContextMenu");
779 RadioMenuItem::Group align_group;
781 alignment_items.push_back (RadioMenuElem (align_group, _("align with existing material"), bind (mem_fun(*this, &AudioTimeAxisView::set_align_style), ExistingMaterial)));
782 align_existing_item = dynamic_cast<RadioMenuItem*>(&alignment_items.back());
783 if (get_diskstream()->alignment_style() == ExistingMaterial) {
784 align_existing_item->set_active();
786 alignment_items.push_back (RadioMenuElem (align_group, _("align with capture time"), bind (mem_fun(*this, &AudioTimeAxisView::set_align_style), CaptureTime)));
787 align_capture_item = dynamic_cast<RadioMenuItem*>(&alignment_items.back());
788 if (get_diskstream()->alignment_style() == CaptureTime) {
789 align_capture_item->set_active();
792 items.push_back (MenuElem (_("Alignment"), *alignment_menu));
794 get_diskstream()->AlignmentStyleChanged.connect (mem_fun(*this, &AudioTimeAxisView::align_style_changed));
797 items.push_back (SeparatorElem());
798 items.push_back (CheckMenuElem (_("Active"), mem_fun(*this, &RouteUI::toggle_route_active)));
799 route_active_menu_item = dynamic_cast<CheckMenuItem *> (&items.back());
800 route_active_menu_item->set_active (_route.active());
802 items.push_back (SeparatorElem());
803 items.push_back (MenuElem (_("Remove"), mem_fun(*this, &RouteUI::remove_this_route)));
808 AudioTimeAxisView::align_style_changed ()
810 switch (get_diskstream()->alignment_style()) {
811 case ExistingMaterial:
812 if (!align_existing_item->get_active()) {
813 align_existing_item->set_active();
817 if (!align_capture_item->get_active()) {
818 align_capture_item->set_active();
825 AudioTimeAxisView::set_align_style (AlignStyle style)
827 get_diskstream()->set_align_style (style);
831 AudioTimeAxisView::rename_current_playlist ()
833 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());
844 prompter.done.connect (Main::quit.slot());
845 prompter.show_all ();
849 if (prompter.status == Gtkmm2ext::Prompter::entered) {
851 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 ()
872 if (((ds = get_diskstream()) == 0) || ((pl = ds->playlist()) == 0)) {
876 ArdourPrompter prompter (true);
877 string new_name = Playlist::bump_name (pl->name(), _session);
879 prompter.set_prompt (_("Name for playlist"));
880 prompter.set_initial_text (new_name);
881 prompter.done.connect (Main::quit.slot());
882 prompter.show_all ();
886 if (prompter.status == Gtkmm2ext::Prompter::entered) {
888 prompter.get_result (name);
890 ds->use_copy_playlist ();
898 AudioTimeAxisView::use_new_playlist ()
903 if (((ds = get_diskstream()) == 0) || ((pl = ds->playlist()) == 0)) {
907 ArdourPrompter prompter (true);
908 string new_name = Playlist::bump_name (pl->name(), _session);
910 prompter.set_prompt (_("Name for playlist"));
911 prompter.set_initial_text (new_name);
912 prompter.done.connect (Main::quit.slot());
913 prompter.show_all ();
917 if (prompter.status == Gtkmm2ext::Prompter::entered) {
919 prompter.get_result (name);
921 ds->use_new_playlist ();
929 AudioTimeAxisView::clear_playlist ()
934 if ((ds = get_diskstream()) != 0) {
935 if ((pl = ds->playlist()) != 0) {
936 editor.clear_playlist (*pl);
942 AudioTimeAxisView::toggle_waveforms ()
944 if (view && waveform_item && !ignore_toggle) {
945 view->set_show_waveforms (waveform_item->is_active());
950 AudioTimeAxisView::set_show_waveforms (bool yn)
953 waveform_item->set_active (yn);
955 view->set_show_waveforms (yn);
960 AudioTimeAxisView::set_show_waveforms_recording (bool yn)
963 view->set_show_waveforms_recording (yn);
968 AudioTimeAxisView::set_waveform_shape (WaveformShape shape)
971 view->set_waveform_shape (shape);
976 AudioTimeAxisView::speed_changed ()
978 Gtkmm2ext::UI::instance()->call_slot (mem_fun(*this, &AudioTimeAxisView::reset_samples_per_unit));
982 AudioTimeAxisView::diskstream_changed (void *src)
984 Gtkmm2ext::UI::instance()->call_slot (mem_fun(*this, &AudioTimeAxisView::update_diskstream_display));
988 AudioTimeAxisView::update_diskstream_display ()
992 if ((ds = get_diskstream()) != 0) {
993 set_playlist (ds->playlist ());
1000 AudioTimeAxisView::selection_click (GdkEventButton* ev)
1002 PublicEditor::TrackViewList* tracks = editor.get_valid_views (this, _route.edit_group());
1004 if (Keyboard::modifier_state_contains (ev->state, Keyboard::Shift)) {
1005 if (editor.get_selection().selected (this)) {
1006 editor.get_selection().remove (*tracks);
1008 editor.get_selection().add (*tracks);
1011 editor.get_selection().set (*tracks);
1018 AudioTimeAxisView::set_selected_regionviews (AudioRegionSelection& regions)
1021 view->set_selected_regionviews (regions);
1026 AudioTimeAxisView::set_selected_points (PointSelection& points)
1028 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1029 (*i)->set_selected_points (points);
1034 AudioTimeAxisView::get_selectables (jack_nframes_t start, jack_nframes_t end, double top, double bot, list<Selectable*>& results)
1038 if (get_diskstream() != 0) {
1039 speed = get_diskstream()->speed();
1042 jack_nframes_t start_adjusted = (jack_nframes_t) (start * speed);
1043 jack_nframes_t end_adjusted = (jack_nframes_t) (end * speed);
1045 if (view && touched (top, bot)) {
1046 view->get_selectables (start_adjusted, end_adjusted, results);
1049 /* pick up visible automation tracks */
1051 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1052 if (!(*i)->hidden()) {
1053 (*i)->get_selectables (start_adjusted, end_adjusted, top, bot, results);
1059 AudioTimeAxisView::get_inverted_selectables (Selection& sel, list<Selectable*>& results)
1062 view->get_inverted_selectables (sel, results);
1065 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1066 if (!(*i)->hidden()) {
1067 (*i)->get_inverted_selectables (sel, results);
1075 AudioTimeAxisView::edit_group() const
1077 return _route.edit_group();
1081 AudioTimeAxisView::name() const
1083 return _route.name();
1087 AudioTimeAxisView::playlist () const
1091 if ((ds = get_diskstream()) != 0) {
1092 return ds->playlist();
1099 AudioTimeAxisView::name_entry_button_press_handler (GdkEventButton *ev)
1101 if (ev->button == 3) {
1102 return stop_signal (name_entry, "button_press_event");
1108 AudioTimeAxisView::name_entry_button_release_handler (GdkEventButton *ev)
1114 AudioTimeAxisView::name_entry_focus_out_handler (GdkEventFocus* ev)
1116 name_entry_changed ();
1121 AudioTimeAxisView::name_entry_key_release_handler (GdkEventKey* ev)
1123 switch (ev->keyval) {
1127 name_entry_changed ();
1136 AudioTimeAxisView::name_entry_activated ()
1138 /* this should drop focus from the entry,
1139 and cause a call to name_entry_changed()
1141 controls_ebox.grab_focus();
1145 AudioTimeAxisView::name_entry_changed ()
1149 ARDOUR_UI::generic_focus_out_event (0);
1151 x = name_entry.get_text ();
1153 if (x == _route.name()) {
1157 if (x.length() == 0) {
1158 name_entry.set_text (_route.name());
1162 strip_whitespace_edges(x);
1164 if (_session.route_name_unique (x)) {
1165 _route.set_name (x, this);
1167 ARDOUR_UI::instance()->popup_error (_("a track already exists with that name"));
1168 name_entry.set_text (_route.name());
1173 AudioTimeAxisView::visual_click ()
1175 popup_display_menu (0);
1179 AudioTimeAxisView::hide_click ()
1181 editor.unselect_strip_in_display (*this);
1185 AudioTimeAxisView::find_next_region (jack_nframes_t pos, RegionPoint point, int32_t dir)
1188 AudioPlaylist *playlist;
1190 if ((stream = get_diskstream()) != 0 && (playlist = stream->playlist()) != 0) {
1191 return playlist->find_next_region (pos, point, dir);
1198 AudioTimeAxisView::add_gain_automation_child ()
1201 AutomationLine* line;
1203 gain_track = new GainAutomationTimeAxisView (_session, _route, editor, *this, parent_canvas, _("gain"),
1204 _route.gain_automation_curve());
1207 line = new AutomationGainLine ("automation gain", _session, *gain_track,
1208 gain_track->canvas_display,
1209 _route.gain_automation_curve(),
1210 PublicEditor::canvas_control_point_event,
1211 PublicEditor::canvas_line_event);
1212 line->set_line_color (color_map[cAutomationLine]);
1215 gain_track->add_line (*line);
1217 add_child (gain_track);
1219 gain_track->Hiding.connect (mem_fun(*this, &AudioTimeAxisView::gain_hidden));
1225 if ((node = gain_track->get_state_node()) != 0) {
1226 if ((prop = node->property ("shown")) != 0) {
1227 if (prop->value() == "yes") {
1234 gain_track->hide ();
1239 AudioTimeAxisView::add_pan_automation_child ()
1243 pan_track = new PanAutomationTimeAxisView (_session, _route, editor, *this, parent_canvas, _("pan"));
1247 add_child (pan_track);
1249 pan_track->Hiding.connect (mem_fun(*this, &AudioTimeAxisView::pan_hidden));
1256 if ((node = pan_track->get_state_node()) != 0) {
1257 if ((prop = node->property ("shown")) != 0) {
1258 if (prop->value() == "yes") {
1270 AudioTimeAxisView::update_pans ()
1274 pan_track->clear_lines ();
1276 /* we don't draw lines for "greater than stereo" panning.
1279 if (_route.n_outputs() > 2) {
1283 for (p = _route.panner().begin(); p != _route.panner().end(); ++p) {
1285 AutomationLine* line;
1287 line = new AutomationPanLine ("automation pan", _session, *pan_track,
1288 pan_track->canvas_display,
1290 PublicEditor::canvas_control_point_event,
1291 PublicEditor::canvas_line_event);
1293 if (p == _route.panner().begin()) {
1294 /* first line is a nice orange */
1295 line->set_line_color (color_map[cLeftPanAutomationLine]);
1297 /* second line is a nice blue */
1298 line->set_line_color (color_map[cRightPanAutomationLine]);
1301 pan_track->add_line (*line);
1306 AudioTimeAxisView::toggle_gain_track ()
1309 bool showit = gain_automation_item->get_active();
1311 if (showit != gain_track->marked_for_display()) {
1313 gain_track->set_marked_for_display (true);
1314 gnome_canvas_item_show (gain_track->canvas_display);
1315 gain_track->get_state_node()->add_property ("shown", X_("yes"));
1317 gain_track->set_marked_for_display (false);
1318 gain_track->hide ();
1319 gain_track->get_state_node()->add_property ("shown", X_("no"));
1322 /* now trigger a redisplay */
1325 _route.gui_changed (X_("track_height"), (void *) 0); /* EMIT_SIGNAL */
1331 AudioTimeAxisView::gain_hidden ()
1333 gain_track->get_state_node()->add_property (X_("shown"), X_("no"));
1335 if (gain_automation_item && !_hidden) {
1336 gain_automation_item->set_active (false);
1339 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1343 AudioTimeAxisView::toggle_pan_track ()
1345 bool showit = pan_automation_item->get_active();
1347 if (showit != pan_track->marked_for_display()) {
1349 pan_track->set_marked_for_display (true);
1350 gnome_canvas_item_show (pan_track->canvas_display);
1351 pan_track->get_state_node()->add_property ("shown", X_("yes"));
1353 pan_track->set_marked_for_display (false);
1355 pan_track->get_state_node()->add_property ("shown", X_("no"));
1358 /* now trigger a redisplay */
1361 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1367 AudioTimeAxisView::pan_hidden ()
1369 pan_track->get_state_node()->add_property ("shown", "no");
1371 if (pan_automation_item && !_hidden) {
1372 pan_automation_item->set_active (false);
1375 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1378 AudioTimeAxisView::RedirectAutomationInfo::~RedirectAutomationInfo ()
1380 for (vector<RedirectAutomationNode*>::iterator i = lines.begin(); i != lines.end(); ++i) {
1386 AudioTimeAxisView::RedirectAutomationNode::~RedirectAutomationNode ()
1388 parent.remove_ran (this);
1396 AudioTimeAxisView::remove_ran (RedirectAutomationNode* ran)
1399 remove_child (ran->view);
1403 AudioTimeAxisView::RedirectAutomationNode*
1404 AudioTimeAxisView::find_redirect_automation_node (Redirect *redirect, uint32_t what)
1406 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1408 if ((*i)->redirect == redirect) {
1410 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1411 if ((*ii)->what == what) {
1422 legalize_for_xml_node (string str)
1424 string::size_type pos;
1425 string legal_chars = "abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_+=:";
1431 while ((pos = legal.find_first_not_of (legal_chars, pos)) != string::npos) {
1432 legal.replace (pos, 1, "_");
1441 AudioTimeAxisView::add_redirect_automation_curve (Redirect *redirect, uint32_t what)
1443 RedirectAutomationLine* ral;
1445 RedirectAutomationNode* ran;
1447 if ((ran = find_redirect_automation_node (redirect, what)) == 0) {
1448 fatal << _("programming error: ")
1449 << string_compose (X_("redirect automation curve for %1:%2 not registered with audio track!"),
1450 redirect->name(), what)
1460 name = redirect->describe_parameter (what);
1462 /* create a string that is a legal XML node name that can be used to refer to this redirect+port combination */
1464 char state_name[256];
1465 snprintf (state_name, sizeof (state_name), "Redirect-%s-%" PRIu32, legalize_for_xml_node (redirect->name()).c_str(), what);
1467 ran->view = new RedirectAutomationTimeAxisView (_session, _route, editor, *this, parent_canvas, name, what, *redirect, state_name);
1469 ral = new RedirectAutomationLine (name,
1470 *redirect, what, _session, *ran->view,
1471 ran->view->canvas_display, redirect->automation_list (what),
1472 PublicEditor::canvas_control_point_event,
1473 PublicEditor::canvas_line_event);
1475 ral->set_line_color (color_map[cRedirectAutomationLine]);
1476 ral->queue_reset ();
1478 ran->view->add_line (*ral);
1480 ran->view->Hiding.connect (bind (mem_fun(*this, &AudioTimeAxisView::redirect_automation_track_hidden), ran, redirect));
1482 if (!ran->view->marked_for_display()) {
1485 ran->menu_item->set_active (true);
1488 add_child (ran->view);
1490 view->foreach_regionview (bind (mem_fun(*this, &AudioTimeAxisView::add_ghost_to_redirect), ran->view));
1492 redirect->mark_automation_visible (what, true);
1496 AudioTimeAxisView::redirect_automation_track_hidden (AudioTimeAxisView::RedirectAutomationNode* ran, Redirect* r)
1499 ran->menu_item->set_active (false);
1502 r->mark_automation_visible (ran->what, false);
1504 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1508 AudioTimeAxisView::add_existing_redirect_automation_curves (Redirect *redirect)
1511 RedirectAutomationLine *ral;
1513 redirect->what_has_visible_automation (s);
1515 for (set<uint32_t>::iterator i = s.begin(); i != s.end(); ++i) {
1517 if ((ral = find_redirect_automation_curve (redirect, *i)) != 0) {
1518 ral->queue_reset ();
1520 add_redirect_automation_curve (redirect, (*i));
1526 AudioTimeAxisView::add_redirect_to_subplugin_menu (Redirect* r)
1528 using namespace Menu_Helpers;
1529 RedirectAutomationInfo *rai;
1530 list<RedirectAutomationInfo*>::iterator x;
1532 const std::set<uint32_t>& automatable = r->what_can_be_automated ();
1533 std::set<uint32_t> has_visible_automation;
1535 r->what_has_visible_automation(has_visible_automation);
1537 if (automatable.empty()) {
1541 for (x = redirect_automation.begin(); x != redirect_automation.end(); ++x) {
1542 if ((*x)->redirect == r) {
1547 if (x == redirect_automation.end()) {
1549 rai = new RedirectAutomationInfo (r);
1550 redirect_automation.push_back (rai);
1558 /* any older menu was deleted at the top of redirects_changed()
1559 when we cleared the subplugin menu.
1562 rai->menu = manage (new Menu);
1563 MenuList& items = rai->menu->items();
1564 rai->menu->set_name ("ArdourContextMenu");
1568 for (std::set<uint32_t>::const_iterator i = automatable.begin(); i != automatable.end(); ++i) {
1570 RedirectAutomationNode* ran;
1571 CheckMenuItem* mitem;
1573 string name = r->describe_parameter (*i);
1575 items.push_back (CheckMenuElem (name));
1576 mitem = dynamic_cast<CheckMenuItem*> (&items.back());
1578 if (has_visible_automation.find((*i)) != has_visible_automation.end()) {
1579 mitem->set_active(true);
1582 if ((ran = find_redirect_automation_node (r, *i)) == 0) {
1586 ran = new RedirectAutomationNode (*i, mitem, *this);
1588 rai->lines.push_back (ran);
1592 ran->menu_item = mitem;
1596 mitem->signal_toggled().connect (bind (mem_fun(*this, &AudioTimeAxisView::redirect_menu_item_toggled), rai, ran));
1599 /* add the menu for this redirect, because the subplugin
1600 menu is always cleared at the top of redirects_changed().
1601 this is the result of some poor design in gtkmm and/or
1605 subplugin_menu.items().push_back (MenuElem (r->name(), *rai->menu));
1610 AudioTimeAxisView::redirect_menu_item_toggled (AudioTimeAxisView::RedirectAutomationInfo* rai,
1611 AudioTimeAxisView::RedirectAutomationNode* ran)
1613 bool showit = ran->menu_item->get_active();
1614 bool redraw = false;
1616 if (ran->view == 0 && showit) {
1617 add_redirect_automation_curve (rai->redirect, ran->what);
1621 if (showit != ran->view->marked_for_display()) {
1624 ran->view->set_marked_for_display (true);
1625 gnome_canvas_item_show (ran->view->canvas_display);
1627 rai->redirect->mark_automation_visible (ran->what, true);
1628 ran->view->set_marked_for_display (false);
1636 if (redraw && !no_redraw) {
1638 /* now trigger a redisplay */
1640 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1646 AudioTimeAxisView::redirects_changed (void *src)
1648 using namespace Menu_Helpers;
1650 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1651 (*i)->valid = false;
1654 subplugin_menu.items().clear ();
1656 _route.foreach_redirect (this, &AudioTimeAxisView::add_redirect_to_subplugin_menu);
1657 _route.foreach_redirect (this, &AudioTimeAxisView::add_existing_redirect_automation_curves);
1659 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ) {
1661 list<RedirectAutomationInfo*>::iterator tmp;
1669 redirect_automation.erase (i);
1676 /* change in visibility was possible */
1678 _route.gui_changed ("track_height", this);
1681 RedirectAutomationLine *
1682 AudioTimeAxisView::find_redirect_automation_curve (Redirect *redirect, uint32_t what)
1684 RedirectAutomationNode* ran;
1686 if ((ran = find_redirect_automation_node (redirect, what)) != 0) {
1688 return dynamic_cast<RedirectAutomationLine*> (ran->view->lines.front());
1696 AudioTimeAxisView::show_all_automation ()
1700 pan_automation_item->set_active (true);
1701 gain_automation_item->set_active (true);
1703 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1704 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1705 if ((*ii)->view == 0) {
1706 add_redirect_automation_curve ((*i)->redirect, (*ii)->what);
1709 (*ii)->menu_item->set_active (true);
1715 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1719 AudioTimeAxisView::show_existing_automation ()
1723 pan_automation_item->set_active (true);
1724 gain_automation_item->set_active (true);
1726 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1727 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1728 if ((*ii)->view != 0) {
1729 (*ii)->menu_item->set_active (true);
1736 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1740 AudioTimeAxisView::hide_all_automation ()
1744 pan_automation_item->set_active (false);
1745 gain_automation_item->set_active (false);
1747 for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
1748 for (vector<RedirectAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
1749 (*ii)->menu_item->set_active (false);
1754 _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
1758 AudioTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op)
1760 Playlist* what_we_got;
1761 DiskStream* ds = get_diskstream();
1766 /* route is a bus, not a track */
1770 playlist = ds->playlist();
1773 TimeSelection time (selection.time);
1774 float speed = ds->speed();
1775 if (speed != 1.0f) {
1776 for (TimeSelection::iterator i = time.begin(); i != time.end(); ++i) {
1777 (*i).start = (jack_nframes_t)floor( (float) (*i).start * speed);
1778 (*i).end = (jack_nframes_t)floor( (float) (*i).end * speed);
1784 _session.add_undo (playlist->get_memento());
1785 if ((what_we_got = playlist->cut (time)) != 0) {
1786 editor.get_cut_buffer().add (what_we_got);
1787 _session.add_redo_no_execute (playlist->get_memento());
1792 if ((what_we_got = playlist->copy (time)) != 0) {
1793 editor.get_cut_buffer().add (what_we_got);
1798 _session.add_undo (playlist->get_memento());
1799 if ((what_we_got = playlist->cut (time)) != 0) {
1800 _session.add_redo_no_execute (playlist->get_memento());
1801 what_we_got->unref ();
1811 AudioTimeAxisView::paste (jack_nframes_t pos, float times, Selection& selection, size_t nth)
1813 if (!is_audio_track()) {
1817 Playlist* playlist = get_diskstream()->playlist();
1818 PlaylistSelection::iterator p;
1820 for (p = selection.playlists.begin(); p != selection.playlists.end() && nth; ++p, --nth);
1822 if (p == selection.playlists.end()) {
1826 if (get_diskstream()->speed() != 1.0f)
1827 pos = (jack_nframes_t) floor( (float) pos * get_diskstream()->speed() );
1829 _session.add_undo (playlist->get_memento());
1830 playlist->paste (**p, pos, times);
1831 _session.add_redo_no_execute (playlist->get_memento());
1837 AudioTimeAxisView::region_view_added (AudioRegionView* arv)
1839 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1840 AutomationTimeAxisView* atv;
1842 if ((atv = dynamic_cast<AutomationTimeAxisView*> (*i)) != 0) {
1843 arv->add_ghost (*atv);
1849 AudioTimeAxisView::add_ghost_to_redirect (AudioRegionView* arv, AutomationTimeAxisView* atv)
1851 arv->add_ghost (*atv);
1855 AudioTimeAxisView::get_child_list()
1858 list<TimeAxisView*>redirect_children;
1860 for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
1861 if (!(*i)->hidden()) {
1862 redirect_children.push_back(*i);
1865 return redirect_children;
1870 AudioTimeAxisView::build_playlist_menu (Gtk::Menu * menu)
1872 using namespace Menu_Helpers;
1874 if (!menu || !is_audio_track()) {
1878 MenuList& playlist_items = menu->items();
1879 menu->set_name ("ArdourContextMenu");
1880 playlist_items.clear();
1882 if (playlist_menu) {
1883 delete playlist_menu;
1885 playlist_menu = new Menu;
1886 playlist_menu->set_name ("ArdourContextMenu");
1888 playlist_items.push_back (MenuElem (string_compose (_("Current: %1"), get_diskstream()->playlist()->name())));
1889 playlist_items.push_back (SeparatorElem());
1891 playlist_items.push_back (MenuElem (_("Rename"), mem_fun(*this, &AudioTimeAxisView::rename_current_playlist)));
1892 playlist_items.push_back (SeparatorElem());
1894 playlist_items.push_back (MenuElem (_("New"), mem_fun(*this, &AudioTimeAxisView::use_new_playlist)));
1895 playlist_items.push_back (MenuElem (_("New Copy"), mem_fun(*this, &AudioTimeAxisView::use_copy_playlist)));
1896 playlist_items.push_back (SeparatorElem());
1897 playlist_items.push_back (MenuElem (_("Clear Current"), mem_fun(*this, &AudioTimeAxisView::clear_playlist)));
1898 playlist_items.push_back (SeparatorElem());
1899 playlist_items.push_back (MenuElem(_("Select"), mem_fun(*this, &AudioTimeAxisView::show_playlist_selector)));
1904 AudioTimeAxisView::show_playlist_selector ()
1906 editor.playlist_selector().show_for (this);
1911 AudioTimeAxisView::map_frozen ()
1913 if (!is_audio_track()) {
1917 ENSURE_GUI_THREAD (mem_fun(*this, &AudioTimeAxisView::map_frozen));
1920 switch (audio_track()->freeze_state()) {
1921 case AudioTrack::Frozen:
1922 playlist_button.set_sensitive (false);
1923 rec_enable_button->set_sensitive (false);
1926 playlist_button.set_sensitive (true);
1927 rec_enable_button->set_sensitive (true);
1933 AudioTimeAxisView::show_all_xfades ()
1936 view->show_all_xfades ();
1941 AudioTimeAxisView::hide_all_xfades ()
1944 view->hide_all_xfades ();
1949 AudioTimeAxisView::hide_dependent_views (TimeAxisViewItem& tavi)
1951 AudioRegionView* rv;
1953 if (view && (rv = dynamic_cast<AudioRegionView*>(&tavi)) != 0) {
1954 view->hide_xfades_involving (*rv);
1959 AudioTimeAxisView::reveal_dependent_views (TimeAxisViewItem& tavi)
1961 AudioRegionView* rv;
1963 if (view && (rv = dynamic_cast<AudioRegionView*>(&tavi)) != 0) {
1964 view->reveal_xfades_involving (*rv);
1969 AudioTimeAxisView::route_active_changed ()
1971 RouteUI::route_active_changed ();
1973 if (is_audio_track()) {
1974 if (_route.active()) {
1975 controls_ebox.set_name ("AudioTrackControlsBaseUnselected");
1976 controls_base_selected_name = "AudioTrackControlsBaseSelected";
1977 controls_base_unselected_name = "AudioTrackControlsBaseUnselected";
1979 controls_ebox.set_name ("AudioTrackControlsBaseInactiveUnselected");
1980 controls_base_selected_name = "AudioTrackControlsBaseInactiveSelected";
1981 controls_base_unselected_name = "AudioTrackControlsBaseInactiveUnselected";
1984 if (_route.active()) {
1985 controls_ebox.set_name ("BusControlsBaseUnselected");
1986 controls_base_selected_name = "BusControlsBaseSelected";
1987 controls_base_unselected_name = "BusControlsBaseUnselected";
1989 controls_ebox.set_name ("BusControlsBaseInactiveUnselected");
1990 controls_base_selected_name = "BusControlsBaseInactiveSelected";
1991 controls_base_unselected_name = "BusControlsBaseInactiveUnselected";
1997 AudioTimeAxisView::get_child_xml_node (std::string childname)
1999 return RouteUI::get_child_xml_node (childname);