2005-09-25 14:42:24 -04:00
|
|
|
/*
|
2006-08-03 22:18:45 -04:00
|
|
|
Copyright (C) 2000-2006 Paul Davis
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
$Id$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <cstdlib>
|
|
|
|
#include <cmath>
|
2006-08-03 22:18:45 -04:00
|
|
|
#include <cassert>
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
#include <algorithm>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include <sigc++/bind.h>
|
|
|
|
|
|
|
|
#include <pbd/error.h>
|
|
|
|
#include <pbd/stl_delete.h>
|
2006-07-28 23:17:11 -04:00
|
|
|
#include <pbd/memento_command.h>
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-09-25 16:33:00 -04:00
|
|
|
#include <gtkmm2ext/gtk_ui.h>
|
2006-01-13 14:48:55 -05:00
|
|
|
#include <gtkmm2ext/selector.h>
|
2005-09-25 16:33:00 -04:00
|
|
|
#include <gtkmm2ext/stop_signal.h>
|
2006-08-03 22:18:45 -04:00
|
|
|
#include <gtkmm2ext/bindable_button.h>
|
2006-01-13 14:48:55 -05:00
|
|
|
#include <gtkmm2ext/utils.h>
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
#include <ardour/audioplaylist.h>
|
2006-06-22 19:40:55 -04:00
|
|
|
#include <ardour/audio_diskstream.h>
|
2005-09-25 14:42:24 -04:00
|
|
|
#include <ardour/insert.h>
|
|
|
|
#include <ardour/location.h>
|
|
|
|
#include <ardour/panner.h>
|
2006-01-13 14:48:55 -05:00
|
|
|
#include <ardour/playlist.h>
|
|
|
|
#include <ardour/session.h>
|
|
|
|
#include <ardour/session_playlist.h>
|
|
|
|
#include <ardour/utils.h>
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
#include "ardour_ui.h"
|
|
|
|
#include "audio_time_axis.h"
|
|
|
|
#include "automation_gain_line.h"
|
|
|
|
#include "automation_pan_line.h"
|
2006-01-13 14:48:55 -05:00
|
|
|
#include "canvas_impl.h"
|
|
|
|
#include "crossfade_view.h"
|
|
|
|
#include "enums.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
#include "gain_automation_time_axis.h"
|
2006-01-13 14:48:55 -05:00
|
|
|
#include "keyboard.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
#include "pan_automation_time_axis.h"
|
2006-01-13 14:48:55 -05:00
|
|
|
#include "playlist_selector.h"
|
|
|
|
#include "prompter.h"
|
|
|
|
#include "public_editor.h"
|
2006-08-03 22:18:45 -04:00
|
|
|
#include "audio_region_view.h"
|
2006-01-13 14:48:55 -05:00
|
|
|
#include "simplerect.h"
|
2006-08-03 22:18:45 -04:00
|
|
|
#include "audio_streamview.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
#include "utils.h"
|
|
|
|
|
|
|
|
#include <ardour/audio_track.h>
|
|
|
|
|
|
|
|
#include "i18n.h"
|
|
|
|
|
|
|
|
using namespace ARDOUR;
|
2006-06-22 19:40:55 -04:00
|
|
|
using namespace PBD;
|
2005-09-25 14:42:24 -04:00
|
|
|
using namespace Gtk;
|
|
|
|
using namespace Editing;
|
|
|
|
|
|
|
|
|
2006-08-03 22:18:45 -04:00
|
|
|
AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, boost::shared_ptr<Route> rt, Canvas& canvas)
|
|
|
|
: AxisView(sess)
|
|
|
|
, RouteTimeAxisView(ed, sess, rt, canvas)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2006-08-03 22:18:45 -04:00
|
|
|
// Make sure things are sane...
|
|
|
|
assert(!is_track() || is_audio_track());
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
subplugin_menu.set_name ("ArdourContextMenu");
|
|
|
|
gain_track = 0;
|
|
|
|
pan_track = 0;
|
|
|
|
waveform_item = 0;
|
|
|
|
pan_automation_item = 0;
|
|
|
|
gain_automation_item = 0;
|
|
|
|
|
2006-08-03 22:18:45 -04:00
|
|
|
_view = new AudioStreamView (*this);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
add_gain_automation_child ();
|
|
|
|
add_pan_automation_child ();
|
|
|
|
|
|
|
|
ignore_toggle = false;
|
|
|
|
|
2006-08-03 22:18:45 -04:00
|
|
|
if (is_audio_track())
|
|
|
|
controls_ebox.set_name ("AudioTimeAxisViewControlsBaseUnselected");
|
|
|
|
else // bus
|
|
|
|
controls_ebox.set_name ("AudioBusControlsBaseUnselected");
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
ensure_xml_node ();
|
|
|
|
|
|
|
|
set_state (*xml_node);
|
|
|
|
|
2006-08-03 22:18:45 -04:00
|
|
|
_route->panner().Changed.connect (mem_fun(*this, &AudioTimeAxisView::update_pans));
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
if (is_audio_track()) {
|
|
|
|
|
|
|
|
controls_ebox.set_name ("AudioTrackControlsBaseUnselected");
|
|
|
|
controls_base_selected_name = "AudioTrackControlsBaseSelected";
|
|
|
|
controls_base_unselected_name = "AudioTrackControlsBaseUnselected";
|
|
|
|
|
|
|
|
/* ask for notifications of any new RegionViews */
|
2006-08-03 22:18:45 -04:00
|
|
|
_view->RegionViewAdded.connect (mem_fun(*this, &AudioTimeAxisView::region_view_added));
|
|
|
|
_view->attach ();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-08-03 22:18:45 -04:00
|
|
|
} else { /* bus */
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-08-03 22:18:45 -04:00
|
|
|
controls_ebox.set_name ("AudioBusControlsBaseUnselected");
|
|
|
|
controls_base_selected_name = "AudioBusControlsBaseSelected";
|
|
|
|
controls_base_unselected_name = "AudioBusControlsBaseUnselected";
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2006-12-14 11:21:43 -05:00
|
|
|
|
|
|
|
post_construct ();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
AudioTimeAxisView::~AudioTimeAxisView ()
|
|
|
|
{
|
2006-08-03 22:18:45 -04:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-08-03 22:18:45 -04:00
|
|
|
AudioStreamView*
|
|
|
|
AudioTimeAxisView::audio_view()
|
|
|
|
{
|
|
|
|
return dynamic_cast<AudioStreamView*>(_view);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
guint32
|
|
|
|
AudioTimeAxisView::show_at (double y, int& nth, Gtk::VBox *parent)
|
|
|
|
{
|
|
|
|
ensure_xml_node ();
|
|
|
|
xml_node->add_property ("shown_editor", "yes");
|
|
|
|
|
|
|
|
return TimeAxisView::show_at (y, nth, parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioTimeAxisView::hide ()
|
|
|
|
{
|
|
|
|
ensure_xml_node ();
|
|
|
|
xml_node->add_property ("shown_editor", "no");
|
|
|
|
|
|
|
|
TimeAxisView::hide ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioTimeAxisView::set_state (const XMLNode& node)
|
|
|
|
{
|
|
|
|
const XMLProperty *prop;
|
|
|
|
|
|
|
|
TimeAxisView::set_state (node);
|
|
|
|
|
|
|
|
if ((prop = node.property ("shown_editor")) != 0) {
|
|
|
|
if (prop->value() == "no") {
|
|
|
|
_marked_for_display = false;
|
|
|
|
} else {
|
|
|
|
_marked_for_display = true;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
_marked_for_display = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
XMLNodeList nlist = node.children();
|
|
|
|
XMLNodeConstIterator niter;
|
|
|
|
XMLNode *child_node;
|
|
|
|
|
|
|
|
|
|
|
|
show_gain_automation = false;
|
|
|
|
show_pan_automation = false;
|
|
|
|
|
|
|
|
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
|
|
|
|
child_node = *niter;
|
|
|
|
|
|
|
|
if (child_node->name() == "gain") {
|
|
|
|
XMLProperty *prop=child_node->property ("shown");
|
|
|
|
|
|
|
|
if (prop != 0) {
|
|
|
|
if (prop->value() == "yes") {
|
|
|
|
show_gain_automation = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (child_node->name() == "pan") {
|
|
|
|
XMLProperty *prop=child_node->property ("shown");
|
|
|
|
|
|
|
|
if (prop != 0) {
|
|
|
|
if (prop->value() == "yes") {
|
|
|
|
show_pan_automation = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-08-03 22:18:45 -04:00
|
|
|
AudioTimeAxisView::build_automation_action_menu ()
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
|
|
|
using namespace Menu_Helpers;
|
|
|
|
|
2006-08-03 22:18:45 -04:00
|
|
|
RouteTimeAxisView::build_automation_action_menu ();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
MenuList& automation_items = automation_action_menu->items();
|
|
|
|
|
|
|
|
automation_items.push_back (SeparatorElem());
|
|
|
|
|
2006-05-17 08:07:16 -04:00
|
|
|
automation_items.push_back (CheckMenuElem (_("Fader"),
|
2005-09-25 17:19:23 -04:00
|
|
|
mem_fun(*this, &AudioTimeAxisView::toggle_gain_track)));
|
2005-10-09 01:03:29 -04:00
|
|
|
gain_automation_item = static_cast<CheckMenuItem*> (&automation_items.back());
|
2005-09-25 14:42:24 -04:00
|
|
|
gain_automation_item->set_active(show_gain_automation);
|
|
|
|
|
2006-05-17 08:07:16 -04:00
|
|
|
automation_items.push_back (CheckMenuElem (_("Pan"),
|
2005-09-25 17:19:23 -04:00
|
|
|
mem_fun(*this, &AudioTimeAxisView::toggle_pan_track)));
|
2005-10-09 01:03:29 -04:00
|
|
|
pan_automation_item = static_cast<CheckMenuItem*> (&automation_items.back());
|
2005-09-25 14:42:24 -04:00
|
|
|
pan_automation_item->set_active(show_pan_automation);
|
2006-08-03 22:18:45 -04:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioTimeAxisView::append_extra_display_menu_items ()
|
|
|
|
{
|
|
|
|
using namespace Menu_Helpers;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-08-03 22:18:45 -04:00
|
|
|
MenuList& items = display_menu->items();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-08-03 22:18:45 -04:00
|
|
|
// crossfade stuff
|
|
|
|
items.push_back (MenuElem (_("Hide all crossfades"), mem_fun(*this, &AudioTimeAxisView::hide_all_xfades)));
|
|
|
|
items.push_back (MenuElem (_("Show all crossfades"), mem_fun(*this, &AudioTimeAxisView::show_all_xfades)));
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-08-03 22:18:45 -04:00
|
|
|
// waveform menu
|
2005-09-25 14:42:24 -04:00
|
|
|
Menu *waveform_menu = manage(new Menu);
|
|
|
|
MenuList& waveform_items = waveform_menu->items();
|
|
|
|
waveform_menu->set_name ("ArdourContextMenu");
|
|
|
|
|
2005-09-25 17:19:23 -04:00
|
|
|
waveform_items.push_back (CheckMenuElem (_("Show waveforms"), mem_fun(*this, &AudioTimeAxisView::toggle_waveforms)));
|
2005-10-09 01:03:29 -04:00
|
|
|
waveform_item = static_cast<CheckMenuItem *> (&waveform_items.back());
|
2005-09-25 14:42:24 -04:00
|
|
|
ignore_toggle = true;
|
|
|
|
waveform_item->set_active (editor.show_waveforms());
|
|
|
|
ignore_toggle = false;
|
|
|
|
|
2006-12-16 00:14:34 -05:00
|
|
|
waveform_items.push_back (SeparatorElem());
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
RadioMenuItem::Group group;
|
2006-12-16 00:14:34 -05:00
|
|
|
|
2005-09-25 17:19:23 -04:00
|
|
|
waveform_items.push_back (RadioMenuElem (group, _("Traditional"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_shape), Traditional)));
|
2005-10-09 01:03:29 -04:00
|
|
|
traditional_item = static_cast<RadioMenuItem *> (&waveform_items.back());
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-09-25 17:19:23 -04:00
|
|
|
waveform_items.push_back (RadioMenuElem (group, _("Rectified"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_shape), Rectified)));
|
2005-10-09 01:03:29 -04:00
|
|
|
rectified_item = static_cast<RadioMenuItem *> (&waveform_items.back());
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-12-16 00:14:34 -05:00
|
|
|
waveform_items.push_back (SeparatorElem());
|
|
|
|
|
|
|
|
RadioMenuItem::Group group2;
|
|
|
|
|
|
|
|
waveform_items.push_back (RadioMenuElem (group2, _("Linear"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_scale), LinearWaveform)));
|
|
|
|
linearscale_item = static_cast<RadioMenuItem *> (&waveform_items.back());
|
|
|
|
|
|
|
|
waveform_items.push_back (RadioMenuElem (group2, _("Logarithmic"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_scale), LogWaveform)));
|
|
|
|
logscale_item = static_cast<RadioMenuItem *> (&waveform_items.back());
|
|
|
|
|
|
|
|
// setting initial item state
|
|
|
|
AudioStreamView* asv = audio_view();
|
|
|
|
if (asv) {
|
|
|
|
ignore_toggle = true;
|
|
|
|
if (asv->get_waveform_shape() == Rectified)
|
|
|
|
rectified_item->set_active(true);
|
|
|
|
else traditional_item->set_active(true);
|
|
|
|
|
|
|
|
if (asv->get_waveform_scale() == LogWaveform)
|
|
|
|
logscale_item->set_active(true);
|
|
|
|
else linearscale_item->set_active(true);
|
|
|
|
ignore_toggle = false;
|
|
|
|
}
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
items.push_back (MenuElem (_("Waveform"), *waveform_menu));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioTimeAxisView::toggle_waveforms ()
|
|
|
|
{
|
2006-08-03 22:18:45 -04:00
|
|
|
AudioStreamView* asv = audio_view();
|
|
|
|
assert(asv);
|
|
|
|
|
|
|
|
if (asv && waveform_item && !ignore_toggle) {
|
|
|
|
asv->set_show_waveforms (waveform_item->get_active());
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioTimeAxisView::set_show_waveforms (bool yn)
|
|
|
|
{
|
2006-08-03 22:18:45 -04:00
|
|
|
AudioStreamView* asv = audio_view();
|
|
|
|
assert(asv);
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
if (waveform_item) {
|
|
|
|
waveform_item->set_active (yn);
|
|
|
|
} else {
|
2006-08-03 22:18:45 -04:00
|
|
|
asv->set_show_waveforms (yn);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioTimeAxisView::set_show_waveforms_recording (bool yn)
|
|
|
|
{
|
2006-08-03 22:18:45 -04:00
|
|
|
AudioStreamView* asv = audio_view();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-08-03 22:18:45 -04:00
|
|
|
if (asv) {
|
|
|
|
asv->set_show_waveforms_recording (yn);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-08-03 22:18:45 -04:00
|
|
|
AudioTimeAxisView::set_waveform_shape (WaveformShape shape)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2006-08-03 22:18:45 -04:00
|
|
|
AudioStreamView* asv = audio_view();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-12-16 00:14:34 -05:00
|
|
|
if (asv && !ignore_toggle) {
|
2006-08-03 22:18:45 -04:00
|
|
|
asv->set_waveform_shape (shape);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2006-08-03 22:18:45 -04:00
|
|
|
map_frozen ();
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-12-16 00:14:34 -05:00
|
|
|
void
|
|
|
|
AudioTimeAxisView::set_waveform_scale (WaveformScale scale)
|
|
|
|
{
|
|
|
|
AudioStreamView* asv = audio_view();
|
|
|
|
|
|
|
|
if (asv && !ignore_toggle) {
|
|
|
|
asv->set_waveform_scale (scale);
|
|
|
|
}
|
|
|
|
|
|
|
|
map_frozen ();
|
|
|
|
}
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void
|
|
|
|
AudioTimeAxisView::add_gain_automation_child ()
|
|
|
|
{
|
|
|
|
XMLProperty* prop;
|
|
|
|
AutomationLine* line;
|
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
gain_track = new GainAutomationTimeAxisView (_session,
|
|
|
|
_route,
|
|
|
|
editor,
|
|
|
|
*this,
|
2005-11-15 21:57:22 -05:00
|
|
|
parent_canvas,
|
2005-11-14 03:38:16 -05:00
|
|
|
_("gain"),
|
2006-08-03 22:18:45 -04:00
|
|
|
_route->gain_automation_curve());
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
line = new AutomationGainLine ("automation gain",
|
|
|
|
_session,
|
|
|
|
*gain_track,
|
2005-11-12 22:53:51 -05:00
|
|
|
*gain_track->canvas_display,
|
2006-08-03 22:18:45 -04:00
|
|
|
_route->gain_automation_curve());
|
2005-11-13 13:13:50 -05:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
line->set_line_color (color_map[cAutomationLine]);
|
|
|
|
|
|
|
|
|
|
|
|
gain_track->add_line (*line);
|
|
|
|
|
|
|
|
add_child (gain_track);
|
|
|
|
|
2005-09-25 17:19:23 -04:00
|
|
|
gain_track->Hiding.connect (mem_fun(*this, &AudioTimeAxisView::gain_hidden));
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
bool hideit = true;
|
|
|
|
|
|
|
|
XMLNode* node;
|
|
|
|
|
|
|
|
if ((node = gain_track->get_state_node()) != 0) {
|
|
|
|
if ((prop = node->property ("shown")) != 0) {
|
|
|
|
if (prop->value() == "yes") {
|
|
|
|
hideit = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (hideit) {
|
|
|
|
gain_track->hide ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioTimeAxisView::add_pan_automation_child ()
|
|
|
|
{
|
|
|
|
XMLProperty* prop;
|
|
|
|
|
2005-11-15 21:57:22 -05:00
|
|
|
pan_track = new PanAutomationTimeAxisView (_session, _route, editor, *this, parent_canvas, _("pan"));
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
update_pans ();
|
|
|
|
|
|
|
|
add_child (pan_track);
|
|
|
|
|
2005-09-25 17:19:23 -04:00
|
|
|
pan_track->Hiding.connect (mem_fun(*this, &AudioTimeAxisView::pan_hidden));
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
ensure_xml_node ();
|
|
|
|
bool hideit = true;
|
|
|
|
|
|
|
|
XMLNode* node;
|
|
|
|
|
|
|
|
if ((node = pan_track->get_state_node()) != 0) {
|
|
|
|
if ((prop = node->property ("shown")) != 0) {
|
|
|
|
if (prop->value() == "yes") {
|
|
|
|
hideit = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (hideit) {
|
|
|
|
pan_track->hide ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioTimeAxisView::update_pans ()
|
|
|
|
{
|
|
|
|
Panner::iterator p;
|
|
|
|
|
|
|
|
pan_track->clear_lines ();
|
|
|
|
|
|
|
|
/* we don't draw lines for "greater than stereo" panning.
|
|
|
|
*/
|
|
|
|
|
2006-08-03 22:18:45 -04:00
|
|
|
if (_route->n_outputs() > 2) {
|
2005-09-25 14:42:24 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2006-08-03 22:18:45 -04:00
|
|
|
for (p = _route->panner().begin(); p != _route->panner().end(); ++p) {
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
AutomationLine* line;
|
|
|
|
|
|
|
|
line = new AutomationPanLine ("automation pan", _session, *pan_track,
|
2005-11-12 22:53:51 -05:00
|
|
|
*pan_track->canvas_display,
|
2005-11-15 21:57:22 -05:00
|
|
|
(*p)->automation());
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-08-03 22:18:45 -04:00
|
|
|
if (p == _route->panner().begin()) {
|
2005-09-25 14:42:24 -04:00
|
|
|
/* first line is a nice orange */
|
|
|
|
line->set_line_color (color_map[cLeftPanAutomationLine]);
|
|
|
|
} else {
|
|
|
|
/* second line is a nice blue */
|
|
|
|
line->set_line_color (color_map[cRightPanAutomationLine]);
|
|
|
|
}
|
|
|
|
|
|
|
|
pan_track->add_line (*line);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioTimeAxisView::toggle_gain_track ()
|
|
|
|
{
|
|
|
|
|
|
|
|
bool showit = gain_automation_item->get_active();
|
|
|
|
|
|
|
|
if (showit != gain_track->marked_for_display()) {
|
|
|
|
if (showit) {
|
|
|
|
gain_track->set_marked_for_display (true);
|
2005-11-12 22:53:51 -05:00
|
|
|
gain_track->canvas_display->show();
|
2005-09-25 14:42:24 -04:00
|
|
|
gain_track->get_state_node()->add_property ("shown", X_("yes"));
|
|
|
|
} else {
|
|
|
|
gain_track->set_marked_for_display (false);
|
|
|
|
gain_track->hide ();
|
|
|
|
gain_track->get_state_node()->add_property ("shown", X_("no"));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* now trigger a redisplay */
|
|
|
|
|
|
|
|
if (!no_redraw) {
|
2006-08-03 22:18:45 -04:00
|
|
|
_route->gui_changed (X_("track_height"), (void *) 0); /* EMIT_SIGNAL */
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioTimeAxisView::gain_hidden ()
|
|
|
|
{
|
|
|
|
gain_track->get_state_node()->add_property (X_("shown"), X_("no"));
|
|
|
|
|
|
|
|
if (gain_automation_item && !_hidden) {
|
|
|
|
gain_automation_item->set_active (false);
|
|
|
|
}
|
|
|
|
|
2006-08-03 22:18:45 -04:00
|
|
|
_route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioTimeAxisView::toggle_pan_track ()
|
|
|
|
{
|
|
|
|
bool showit = pan_automation_item->get_active();
|
|
|
|
|
|
|
|
if (showit != pan_track->marked_for_display()) {
|
|
|
|
if (showit) {
|
|
|
|
pan_track->set_marked_for_display (true);
|
2005-11-12 22:53:51 -05:00
|
|
|
pan_track->canvas_display->show();
|
2005-09-25 14:42:24 -04:00
|
|
|
pan_track->get_state_node()->add_property ("shown", X_("yes"));
|
|
|
|
} else {
|
|
|
|
pan_track->set_marked_for_display (false);
|
|
|
|
pan_track->hide ();
|
|
|
|
pan_track->get_state_node()->add_property ("shown", X_("no"));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* now trigger a redisplay */
|
|
|
|
|
|
|
|
if (!no_redraw) {
|
2006-08-03 22:18:45 -04:00
|
|
|
_route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioTimeAxisView::pan_hidden ()
|
|
|
|
{
|
|
|
|
pan_track->get_state_node()->add_property ("shown", "no");
|
|
|
|
|
|
|
|
if (pan_automation_item && !_hidden) {
|
|
|
|
pan_automation_item->set_active (false);
|
|
|
|
}
|
|
|
|
|
2006-08-03 22:18:45 -04:00
|
|
|
_route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioTimeAxisView::show_all_automation ()
|
|
|
|
{
|
|
|
|
no_redraw = true;
|
|
|
|
|
|
|
|
pan_automation_item->set_active (true);
|
|
|
|
gain_automation_item->set_active (true);
|
|
|
|
|
2006-08-03 22:18:45 -04:00
|
|
|
RouteTimeAxisView::show_all_automation ();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
no_redraw = false;
|
|
|
|
|
2006-08-03 22:18:45 -04:00
|
|
|
_route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioTimeAxisView::show_existing_automation ()
|
|
|
|
{
|
|
|
|
no_redraw = true;
|
|
|
|
|
|
|
|
pan_automation_item->set_active (true);
|
|
|
|
gain_automation_item->set_active (true);
|
|
|
|
|
2006-08-03 22:18:45 -04:00
|
|
|
RouteTimeAxisView::show_existing_automation ();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
no_redraw = false;
|
|
|
|
|
2006-08-03 22:18:45 -04:00
|
|
|
_route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioTimeAxisView::hide_all_automation ()
|
|
|
|
{
|
|
|
|
no_redraw = true;
|
|
|
|
|
|
|
|
pan_automation_item->set_active (false);
|
|
|
|
gain_automation_item->set_active (false);
|
|
|
|
|
2006-08-03 22:18:45 -04:00
|
|
|
RouteTimeAxisView::hide_all_automation();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
no_redraw = false;
|
2006-08-03 22:18:45 -04:00
|
|
|
_route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioTimeAxisView::show_all_xfades ()
|
|
|
|
{
|
2006-08-03 22:18:45 -04:00
|
|
|
AudioStreamView* asv = audio_view();
|
|
|
|
|
|
|
|
if (asv) {
|
|
|
|
asv->show_all_xfades ();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioTimeAxisView::hide_all_xfades ()
|
|
|
|
{
|
2006-08-03 22:18:45 -04:00
|
|
|
AudioStreamView* asv = audio_view();
|
|
|
|
|
|
|
|
if (asv) {
|
|
|
|
asv->hide_all_xfades ();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioTimeAxisView::hide_dependent_views (TimeAxisViewItem& tavi)
|
|
|
|
{
|
2006-08-03 22:18:45 -04:00
|
|
|
AudioStreamView* asv = audio_view();
|
2005-09-25 14:42:24 -04:00
|
|
|
AudioRegionView* rv;
|
|
|
|
|
2006-08-03 22:18:45 -04:00
|
|
|
if (asv && (rv = dynamic_cast<AudioRegionView*>(&tavi)) != 0) {
|
|
|
|
asv->hide_xfades_involving (*rv);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioTimeAxisView::reveal_dependent_views (TimeAxisViewItem& tavi)
|
|
|
|
{
|
2006-08-03 22:18:45 -04:00
|
|
|
AudioStreamView* asv = audio_view();
|
2005-09-25 14:42:24 -04:00
|
|
|
AudioRegionView* rv;
|
|
|
|
|
2006-08-03 22:18:45 -04:00
|
|
|
if (asv && (rv = dynamic_cast<AudioRegionView*>(&tavi)) != 0) {
|
|
|
|
asv->reveal_xfades_involving (*rv);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioTimeAxisView::route_active_changed ()
|
|
|
|
{
|
2006-08-03 22:18:45 -04:00
|
|
|
RouteTimeAxisView::route_active_changed ();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
if (is_audio_track()) {
|
2006-08-03 22:18:45 -04:00
|
|
|
if (_route->active()) {
|
2005-09-25 14:42:24 -04:00
|
|
|
controls_ebox.set_name ("AudioTrackControlsBaseUnselected");
|
|
|
|
controls_base_selected_name = "AudioTrackControlsBaseSelected";
|
|
|
|
controls_base_unselected_name = "AudioTrackControlsBaseUnselected";
|
|
|
|
} else {
|
|
|
|
controls_ebox.set_name ("AudioTrackControlsBaseInactiveUnselected");
|
|
|
|
controls_base_selected_name = "AudioTrackControlsBaseInactiveSelected";
|
|
|
|
controls_base_unselected_name = "AudioTrackControlsBaseInactiveUnselected";
|
|
|
|
}
|
|
|
|
} else {
|
2006-08-03 22:18:45 -04:00
|
|
|
if (_route->active()) {
|
2005-09-25 14:42:24 -04:00
|
|
|
controls_ebox.set_name ("BusControlsBaseUnselected");
|
|
|
|
controls_base_selected_name = "BusControlsBaseSelected";
|
|
|
|
controls_base_unselected_name = "BusControlsBaseUnselected";
|
|
|
|
} else {
|
|
|
|
controls_ebox.set_name ("BusControlsBaseInactiveUnselected");
|
|
|
|
controls_base_selected_name = "BusControlsBaseInactiveSelected";
|
|
|
|
controls_base_unselected_name = "BusControlsBaseInactiveUnselected";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
XMLNode*
|
2005-12-22 07:23:54 -05:00
|
|
|
AudioTimeAxisView::get_child_xml_node (const string & childname)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
|
|
|
return RouteUI::get_child_xml_node (childname);
|
|
|
|
}
|
2006-02-14 12:19:58 -05:00
|
|
|
|