2005-09-25 14:42:24 -04:00
|
|
|
/*
|
2009-10-14 12:10:01 -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.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <cstdlib>
|
|
|
|
#include <cmath>
|
2006-07-23 08:03:19 -04:00
|
|
|
#include <cassert>
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
#include <algorithm>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include <sigc++/bind.h>
|
|
|
|
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "pbd/error.h"
|
|
|
|
#include "pbd/stl_delete.h"
|
|
|
|
#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-07-13 23:43:32 -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
|
|
|
|
2009-06-09 16:21:19 -04:00
|
|
|
#include "ardour/amp.h"
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "ardour/audioplaylist.h"
|
|
|
|
#include "ardour/event_type_map.h"
|
|
|
|
#include "ardour/location.h"
|
|
|
|
#include "ardour/panner.h"
|
|
|
|
#include "ardour/playlist.h"
|
|
|
|
#include "ardour/processor.h"
|
|
|
|
#include "ardour/profile.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"
|
2007-06-30 14:41:50 -04:00
|
|
|
#include "automation_line.h"
|
2006-01-13 14:48:55 -05:00
|
|
|
#include "canvas_impl.h"
|
|
|
|
#include "crossfade_view.h"
|
|
|
|
#include "enums.h"
|
2009-12-21 13:23:07 -05:00
|
|
|
#include "gui_thread.h"
|
2007-06-30 14:41:50 -04:00
|
|
|
#include "automation_time_axis.h"
|
2006-01-13 14:48:55 -05:00
|
|
|
#include "keyboard.h"
|
|
|
|
#include "playlist_selector.h"
|
|
|
|
#include "prompter.h"
|
|
|
|
#include "public_editor.h"
|
2006-08-01 13:19:38 -04:00
|
|
|
#include "audio_region_view.h"
|
2006-01-13 14:48:55 -05:00
|
|
|
#include "simplerect.h"
|
2006-07-23 08:03:19 -04:00
|
|
|
#include "audio_streamview.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
#include "utils.h"
|
|
|
|
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "ardour/audio_track.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
#include "i18n.h"
|
|
|
|
|
2009-05-12 13:03:42 -04:00
|
|
|
using namespace std;
|
2005-09-25 14:42:24 -04:00
|
|
|
using namespace ARDOUR;
|
Large nasty commit in the form of a 5000 line patch chock-full of completely
unecessary changes. (Sorry, doing a "sprint" based thing, this is the end of the first one)
Achieved MIDI track and bus creation, associated Jack port and diskstream creation, and minimal GUI stuff for creating them. Should be set to start work on actually recording and playing midi to/from disk now.
Relevant (significant) changes:
- Creation of a Buffer class. Base class is type agnostic so things can point to a buffer but not care what kind it is (otherwise it'd be a template). Derived into AudioBuffer and MidiBuffer, with a type tag because checking type is necessary in parts of the code where dynamic_cast wouldn't be wise. Originally I considered this a hack, but passing around a type proved to be a very good solution to all the other problems (below). There is a 1:1 mapping between jack port data types and ardour Buffer types (with a conversion function), but that's easily removed if it ever becomes necessary. Having the type scoped in the Buffer class is maybe not the best spot for it, but whatever (this is proof of concept kinda stuff right now...)
- IO now has a "default" port type (passed to the constructor and stored as a member), used by ensure_io (and similar) to create n ports. IO::register_***_port has a type argument that defaults to the default type if not passed. Rationale: previous IO API is identical, no changes needed to existing code, but path is paved for multiple port types in one IO, which we will need for eg synth plugin inserts, among other things. This is not quite ideal (best would be to only have the two port register functions and have them take a type), but the alternative is a lot of work (namely destroying the 'ensure' functions and everything that uses them) for very little gain. (I am convinced after quite a few tries at the whiteboard that subclassing IO in any way is not a feasible option, look at it's inheritance diagram in Doxygen and you can see why)
- AudioEngine::register_audio_input_port is now register_input_port and takes a type argument. Ditto for output.
- (Most significant change) AudioDiskstream abstracted into Distream, and sibling MidiDiskstream created. Very much still a work in progress, but Diskstream is there to switch references over to (most already are), which is the important part. It is still unclear what the MIDI diskstream's relation to channels is, but I'm pretty sure they will be single channel only (so SMF Type 0) since noone can come up with a reason otherwise.
- MidiTrack creation. Same thing as AudioTrack but with a different default type basically. No big deal here.
- Random cleanups and variable renamings etc. because I have OCD and can't help myself. :)
Known broken: Loading of sessions containing MIDI tracks.
git-svn-id: svn://localhost/ardour2/branches/midi@641 d708f5d6-7413-0410-9779-e7cbd77b26cf
2006-06-26 12:01:34 -04:00
|
|
|
using namespace PBD;
|
2005-09-25 14:42:24 -04:00
|
|
|
using namespace Gtk;
|
|
|
|
using namespace Editing;
|
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session* sess, boost::shared_ptr<Route> rt, Canvas& canvas)
|
2006-07-29 23:25:38 -04:00
|
|
|
: AxisView(sess)
|
|
|
|
, RouteTimeAxisView(ed, sess, rt, canvas)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2006-07-29 23:25:38 -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");
|
|
|
|
|
2009-07-09 13:58:13 -04:00
|
|
|
_view = new AudioStreamView (*this);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
ignore_toggle = false;
|
|
|
|
|
|
|
|
mute_button->set_active (false);
|
|
|
|
solo_button->set_active (false);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-09-12 05:01:52 -04:00
|
|
|
if (is_audio_track()) {
|
|
|
|
controls_ebox.set_name ("AudioTrackControlsBaseUnselected");
|
|
|
|
} else { // bus
|
2006-07-23 08:03:19 -04:00
|
|
|
controls_ebox.set_name ("AudioBusControlsBaseUnselected");
|
2008-09-12 05:01:52 -04:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
ensure_xml_node ();
|
|
|
|
|
2009-10-15 14:56:11 -04:00
|
|
|
set_state (*xml_node, Stateful::loading_state_version);
|
2008-12-19 13:08:35 -05:00
|
|
|
|
|
|
|
/* if set_state above didn't create a gain automation child, we need to make one */
|
2010-05-25 10:50:45 -04:00
|
|
|
if (automation_child (GainAutomation) == 0) {
|
2008-12-19 13:08:35 -05:00
|
|
|
create_automation_child (GainAutomation, false);
|
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
The great audio processing overhaul.
The vast majority of Route signal processing is now simply in the list of
processors. There are definitely regressions here, but there's also
a lot of things fixed. It's far too much work to let diverge anymore
regardless, so here it is.
The basic model is: A route has a fixed set of input channels (matching
its JACK input ports and diskstream). The first processor takes this
as input. The next processor is configured using the first processor's
output as input, and is allowed to choose whatever output it wants
given that input... and so on, and so on. Finally, the last processor's
requested output is used to set up the panner and create whatever Jack
ports are needed to output the data.
All 'special' internal processors (meter, fader, amp, insert, send) are
currently transparent: they read any input, and return the same set
of channels back (unmodified, except for amp).
User visible changes:
* LV2 Instrument support (tracks with both MIDI and audio channels)
* MIDI in/out plugin support
* Generic plugin replication (for MIDI plugins, MIDI/audio plugins)
* Movable meter point
Known Bugs:
* Things seem to get weird on loaded sessions
* Output delivery is sketchy
* 2.0 session loading was probably already broken...
but it's definitely broken now :)
Please test this and file bugs if you have any time...
git-svn-id: svn://localhost/ardour2/branches/3.0@5055 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-05-07 02:30:50 -04:00
|
|
|
if (_route->panner()) {
|
2010-03-30 11:18:43 -04:00
|
|
|
_route->panner()->Changed.connect (*this, invalidator (*this),
|
|
|
|
boost::bind (&AudioTimeAxisView::ensure_pan_views, this, false), gui_context());
|
The great audio processing overhaul.
The vast majority of Route signal processing is now simply in the list of
processors. There are definitely regressions here, but there's also
a lot of things fixed. It's far too much work to let diverge anymore
regardless, so here it is.
The basic model is: A route has a fixed set of input channels (matching
its JACK input ports and diskstream). The first processor takes this
as input. The next processor is configured using the first processor's
output as input, and is allowed to choose whatever output it wants
given that input... and so on, and so on. Finally, the last processor's
requested output is used to set up the panner and create whatever Jack
ports are needed to output the data.
All 'special' internal processors (meter, fader, amp, insert, send) are
currently transparent: they read any input, and return the same set
of channels back (unmodified, except for amp).
User visible changes:
* LV2 Instrument support (tracks with both MIDI and audio channels)
* MIDI in/out plugin support
* Generic plugin replication (for MIDI plugins, MIDI/audio plugins)
* Movable meter point
Known Bugs:
* Things seem to get weird on loaded sessions
* Output delivery is sketchy
* 2.0 session loading was probably already broken...
but it's definitely broken now :)
Please test this and file bugs if you have any time...
git-svn-id: svn://localhost/ardour2/branches/3.0@5055 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-05-07 02:30:50 -04:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2008-09-12 05:01:52 -04:00
|
|
|
/* map current state of the route */
|
|
|
|
|
2009-11-30 18:16:28 -05:00
|
|
|
processors_changed (RouteProcessorChange ());
|
2008-09-12 05:01:52 -04:00
|
|
|
reset_processor_automation_curves ();
|
2008-12-19 13:08:35 -05:00
|
|
|
ensure_pan_views (false);
|
2007-03-18 02:07:08 -04:00
|
|
|
update_control_names ();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2007-03-18 02:07:08 -04:00
|
|
|
if (is_audio_track()) {
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
/* ask for notifications of any new RegionViews */
|
2009-12-11 18:29:48 -05:00
|
|
|
_view->RegionViewAdded.connect (sigc::mem_fun(*this, &AudioTimeAxisView::region_view_added));
|
2007-01-09 18:24:54 -05:00
|
|
|
|
2009-01-01 19:17:55 -05:00
|
|
|
if (!_editor.have_idled()) {
|
2008-03-17 16:54:03 -04:00
|
|
|
/* first idle will do what we need */
|
|
|
|
} else {
|
|
|
|
first_idle ();
|
2009-06-10 17:58:25 -04:00
|
|
|
}
|
2008-03-17 16:54:03 -04:00
|
|
|
|
|
|
|
} else {
|
|
|
|
post_construct ();
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
AudioTimeAxisView::~AudioTimeAxisView ()
|
|
|
|
{
|
2006-07-23 08:03:19 -04:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2008-03-17 16:54:03 -04:00
|
|
|
void
|
|
|
|
AudioTimeAxisView::first_idle ()
|
|
|
|
{
|
|
|
|
_view->attach ();
|
|
|
|
post_construct ();
|
|
|
|
}
|
|
|
|
|
2006-07-23 08:03:19 -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 ();
|
2008-10-05 19:14:48 -04:00
|
|
|
xml_node->add_property ("shown-editor", "yes");
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
return TimeAxisView::show_at (y, nth, parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioTimeAxisView::hide ()
|
|
|
|
{
|
|
|
|
ensure_xml_node ();
|
2008-10-05 19:14:48 -04:00
|
|
|
xml_node->add_property ("shown-editor", "no");
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
TimeAxisView::hide ();
|
|
|
|
}
|
|
|
|
|
2008-09-12 05:01:52 -04:00
|
|
|
|
2006-07-29 23:25:38 -04:00
|
|
|
void
|
|
|
|
AudioTimeAxisView::append_extra_display_menu_items ()
|
|
|
|
{
|
|
|
|
using namespace Menu_Helpers;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-07-29 23:25:38 -04:00
|
|
|
MenuList& items = display_menu->items();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-07-29 23:25:38 -04:00
|
|
|
// crossfade stuff
|
2008-01-10 16:20:59 -05:00
|
|
|
if (!Profile->get_sae()) {
|
2010-03-23 09:11:14 -04:00
|
|
|
items.push_back (MenuElem (_("Hide All Crossfades"), sigc::mem_fun(*this, &AudioTimeAxisView::hide_all_xfades)));
|
|
|
|
items.push_back (MenuElem (_("Show All Crossfades"), sigc::mem_fun(*this, &AudioTimeAxisView::show_all_xfades)));
|
2008-01-10 16:20:59 -05:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void
|
2008-09-29 18:47:40 -04:00
|
|
|
AudioTimeAxisView::create_automation_child (const Evoral::Parameter& param, bool show)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2007-06-27 11:51:50 -04:00
|
|
|
if (param.type() == GainAutomation) {
|
2007-06-29 00:02:58 -04:00
|
|
|
|
|
|
|
boost::shared_ptr<AutomationControl> c = _route->gain_control();
|
|
|
|
if (!c) {
|
|
|
|
error << "Route has no gain automation, unable to add automation track view." << endmsg;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2010-05-26 19:16:53 -04:00
|
|
|
gain_track.reset (new AutomationTimeAxisView (_session,
|
|
|
|
_route, _route->amp(), c,
|
|
|
|
_editor,
|
|
|
|
*this,
|
|
|
|
false,
|
|
|
|
parent_canvas,
|
|
|
|
_route->amp()->describe_parameter(param)));
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2008-09-29 18:47:40 -04:00
|
|
|
add_automation_child(Evoral::Parameter(GainAutomation), gain_track, show);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2007-06-27 11:51:50 -04:00
|
|
|
} else if (param.type() == PanAutomation) {
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2007-06-27 11:51:50 -04:00
|
|
|
ensure_xml_node ();
|
2008-12-19 13:08:35 -05:00
|
|
|
ensure_pan_views (show);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2007-06-27 11:51:50 -04:00
|
|
|
} else {
|
2008-09-29 18:47:40 -04:00
|
|
|
error << "AudioTimeAxisView: unknown automation child " << EventTypeMap::instance().to_symbol(param) << endmsg;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-12-19 13:08:35 -05:00
|
|
|
/** Ensure that we have the appropriate AutomationTimeAxisViews for the
|
|
|
|
* panners that we have.
|
|
|
|
*
|
|
|
|
* @param show true to show any new views that we create, otherwise false.
|
|
|
|
*/
|
2005-09-25 14:42:24 -04:00
|
|
|
void
|
2008-12-19 13:08:35 -05:00
|
|
|
AudioTimeAxisView::ensure_pan_views (bool show)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
The great audio processing overhaul.
The vast majority of Route signal processing is now simply in the list of
processors. There are definitely regressions here, but there's also
a lot of things fixed. It's far too much work to let diverge anymore
regardless, so here it is.
The basic model is: A route has a fixed set of input channels (matching
its JACK input ports and diskstream). The first processor takes this
as input. The next processor is configured using the first processor's
output as input, and is allowed to choose whatever output it wants
given that input... and so on, and so on. Finally, the last processor's
requested output is used to set up the panner and create whatever Jack
ports are needed to output the data.
All 'special' internal processors (meter, fader, amp, insert, send) are
currently transparent: they read any input, and return the same set
of channels back (unmodified, except for amp).
User visible changes:
* LV2 Instrument support (tracks with both MIDI and audio channels)
* MIDI in/out plugin support
* Generic plugin replication (for MIDI plugins, MIDI/audio plugins)
* Movable meter point
Known Bugs:
* Things seem to get weird on loaded sessions
* Output delivery is sketchy
* 2.0 session loading was probably already broken...
but it's definitely broken now :)
Please test this and file bugs if you have any time...
git-svn-id: svn://localhost/ardour2/branches/3.0@5055 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-05-07 02:30:50 -04:00
|
|
|
if (!_route->panner()) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
const set<Evoral::Parameter>& params = _route->panner()->what_can_be_automated();
|
2008-10-02 23:16:19 -04:00
|
|
|
set<Evoral::Parameter>::iterator p;
|
2007-06-27 11:51:50 -04:00
|
|
|
|
2008-10-02 23:16:19 -04:00
|
|
|
for (p = params.begin(); p != params.end(); ++p) {
|
|
|
|
boost::shared_ptr<ARDOUR::AutomationControl> pan_control
|
|
|
|
= boost::dynamic_pointer_cast<ARDOUR::AutomationControl>(
|
2010-02-05 15:03:57 -05:00
|
|
|
_route->panner()->control(*p));
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2007-07-03 20:39:00 -04:00
|
|
|
if (pan_control->parameter().type() == NullAutomation) {
|
2007-07-02 22:37:24 -04:00
|
|
|
error << "Pan control has NULL automation type!" << endmsg;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2008-12-19 13:08:35 -05:00
|
|
|
if (automation_child (pan_control->parameter ()).get () == 0) {
|
|
|
|
|
|
|
|
/* we don't already have an AutomationTimeAxisView for this parameter */
|
|
|
|
|
2009-06-09 16:21:19 -04:00
|
|
|
std::string const name = _route->panner()->describe_parameter (pan_control->parameter ());
|
2008-12-19 13:08:35 -05:00
|
|
|
|
2010-05-26 19:16:53 -04:00
|
|
|
boost::shared_ptr<AutomationTimeAxisView> t (
|
2009-07-09 13:58:13 -04:00
|
|
|
new AutomationTimeAxisView (_session,
|
2009-10-14 12:10:01 -04:00
|
|
|
_route, _route->panner(), pan_control,
|
2009-07-09 13:58:13 -04:00
|
|
|
_editor,
|
|
|
|
*this,
|
|
|
|
false,
|
|
|
|
parent_canvas,
|
2010-05-26 19:16:53 -04:00
|
|
|
name)
|
|
|
|
);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2010-05-26 19:16:53 -04:00
|
|
|
pan_tracks.push_back (t);
|
|
|
|
add_automation_child (*p, t, show);
|
2008-12-19 13:08:35 -05:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
2010-05-26 19:16:53 -04:00
|
|
|
|
2008-12-12 09:43:24 -05:00
|
|
|
void
|
2010-05-26 19:16:53 -04:00
|
|
|
AudioTimeAxisView::update_gain_track_visibility ()
|
2008-12-12 09:43:24 -05:00
|
|
|
{
|
2010-05-26 19:16:53 -04:00
|
|
|
bool const showit = gain_automation_item->get_active();
|
2008-12-12 09:43:24 -05:00
|
|
|
|
|
|
|
if (showit != gain_track->marked_for_display()) {
|
|
|
|
if (showit) {
|
|
|
|
gain_track->set_marked_for_display (true);
|
2010-05-26 19:16:53 -04:00
|
|
|
gain_track->canvas_display()->show();
|
|
|
|
gain_track->canvas_background()->show();
|
2008-12-12 09:43:24 -05: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 */
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-12-12 09:43:24 -05:00
|
|
|
if (!no_redraw) {
|
|
|
|
_route->gui_changed (X_("visible_tracks"), (void *) 0); /* EMIT_SIGNAL */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2010-05-26 19:16:53 -04:00
|
|
|
AudioTimeAxisView::update_pan_track_visibility ()
|
2008-12-12 09:43:24 -05:00
|
|
|
{
|
2010-05-26 19:16:53 -04:00
|
|
|
bool const showit = pan_automation_item->get_active();
|
|
|
|
|
|
|
|
for (list<boost::shared_ptr<AutomationTimeAxisView> >::iterator i = pan_tracks.begin(); i != pan_tracks.end(); ++i) {
|
|
|
|
|
|
|
|
if (showit != (*i)->marked_for_display()) {
|
|
|
|
if (showit) {
|
|
|
|
(*i)->set_marked_for_display (true);
|
|
|
|
(*i)->canvas_display()->show();
|
|
|
|
(*i)->canvas_background()->show();
|
|
|
|
(*i)->get_state_node()->add_property ("shown", X_("yes"));
|
|
|
|
} else {
|
|
|
|
(*i)->set_marked_for_display (false);
|
|
|
|
(*i)->hide ();
|
|
|
|
(*i)->get_state_node()->add_property ("shown", X_("no"));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* now trigger a redisplay */
|
|
|
|
if (!no_redraw) {
|
|
|
|
_route->gui_changed (X_("visible_tracks"), (void *) 0); /* EMIT_SIGNAL */
|
|
|
|
}
|
2008-12-12 09:43:24 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void
|
|
|
|
AudioTimeAxisView::show_all_automation ()
|
|
|
|
{
|
|
|
|
no_redraw = true;
|
|
|
|
|
2006-07-29 23:25:38 -04:00
|
|
|
RouteTimeAxisView::show_all_automation ();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
no_redraw = false;
|
|
|
|
|
2010-05-26 19:16:53 -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;
|
|
|
|
|
2006-07-29 23:25:38 -04:00
|
|
|
RouteTimeAxisView::show_existing_automation ();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
no_redraw = false;
|
|
|
|
|
2010-05-26 19:16:53 -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;
|
|
|
|
|
2006-07-29 23:25:38 -04:00
|
|
|
RouteTimeAxisView::hide_all_automation();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
no_redraw = false;
|
2010-05-26 19:16:53 -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-07-23 08:03:19 -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-07-23 08:03:19 -04:00
|
|
|
AudioStreamView* asv = audio_view();
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2006-07-23 08:03:19 -04:00
|
|
|
if (asv) {
|
|
|
|
asv->hide_all_xfades ();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioTimeAxisView::hide_dependent_views (TimeAxisViewItem& tavi)
|
|
|
|
{
|
2006-07-23 08:03:19 -04:00
|
|
|
AudioStreamView* asv = audio_view();
|
2005-09-25 14:42:24 -04:00
|
|
|
AudioRegionView* rv;
|
|
|
|
|
2006-07-23 08:03:19 -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-07-23 08:03:19 -04:00
|
|
|
AudioStreamView* asv = audio_view();
|
2005-09-25 14:42:24 -04:00
|
|
|
AudioRegionView* rv;
|
|
|
|
|
2006-07-23 08:03:19 -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-07-29 23:25:38 -04:00
|
|
|
RouteTimeAxisView::route_active_changed ();
|
2007-03-18 02:07:08 -04:00
|
|
|
update_control_names ();
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2007-03-18 02:07:08 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set up the names of the controls so that they are coloured
|
|
|
|
* correctly depending on whether this route is inactive or
|
|
|
|
* selected.
|
|
|
|
*/
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioTimeAxisView::update_control_names ()
|
|
|
|
{
|
2005-09-25 14:42:24 -04:00
|
|
|
if (is_audio_track()) {
|
2006-07-27 21:08:57 -04:00
|
|
|
if (_route->active()) {
|
2005-09-25 14:42:24 -04:00
|
|
|
controls_base_selected_name = "AudioTrackControlsBaseSelected";
|
|
|
|
controls_base_unselected_name = "AudioTrackControlsBaseUnselected";
|
|
|
|
} else {
|
|
|
|
controls_base_selected_name = "AudioTrackControlsBaseInactiveSelected";
|
|
|
|
controls_base_unselected_name = "AudioTrackControlsBaseInactiveUnselected";
|
|
|
|
}
|
|
|
|
} else {
|
2006-07-27 21:08:57 -04:00
|
|
|
if (_route->active()) {
|
2005-09-25 14:42:24 -04:00
|
|
|
controls_base_selected_name = "BusControlsBaseSelected";
|
|
|
|
controls_base_unselected_name = "BusControlsBaseUnselected";
|
|
|
|
} else {
|
|
|
|
controls_base_selected_name = "BusControlsBaseInactiveSelected";
|
|
|
|
controls_base_unselected_name = "BusControlsBaseInactiveUnselected";
|
|
|
|
}
|
|
|
|
}
|
2008-03-17 16:54:03 -04:00
|
|
|
|
|
|
|
if (get_selected()) {
|
|
|
|
controls_ebox.set_name (controls_base_selected_name);
|
|
|
|
} else {
|
|
|
|
controls_ebox.set_name (controls_base_unselected_name);
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2010-05-26 19:16:53 -04:00
|
|
|
|
|
|
|
void
|
|
|
|
AudioTimeAxisView::build_automation_action_menu ()
|
|
|
|
{
|
|
|
|
using namespace Menu_Helpers;
|
|
|
|
|
|
|
|
RouteTimeAxisView::build_automation_action_menu ();
|
|
|
|
|
|
|
|
MenuList& automation_items = automation_action_menu->items ();
|
|
|
|
|
|
|
|
automation_items.push_back (CheckMenuElem (_("Fader"), sigc::mem_fun (*this, &AudioTimeAxisView::update_gain_track_visibility)));
|
|
|
|
gain_automation_item = dynamic_cast<CheckMenuItem*> (&automation_items.back ());
|
|
|
|
gain_automation_item->set_active (gain_track->marked_for_display ());
|
|
|
|
|
|
|
|
automation_items.push_back (CheckMenuElem (_("Pan"), sigc::mem_fun (*this, &AudioTimeAxisView::update_pan_track_visibility)));
|
|
|
|
pan_automation_item = dynamic_cast<CheckMenuItem*> (&automation_items.back ());
|
|
|
|
pan_automation_item->set_active (pan_tracks.front()->marked_for_display ());
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioTimeAxisView::add_processor_to_subplugin_menu (boost::weak_ptr<Processor> wp)
|
|
|
|
{
|
|
|
|
/* we use this override to veto the Amp processor from the plugin menu,
|
|
|
|
as its automation lane can be accessed using the special "Fader" menu
|
|
|
|
option
|
|
|
|
*/
|
|
|
|
|
|
|
|
boost::shared_ptr<Processor> p = wp.lock ();
|
|
|
|
if (!p) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (boost::dynamic_pointer_cast<Amp> (p) == 0) {
|
|
|
|
RouteTimeAxisView::add_processor_to_subplugin_menu (wp);
|
|
|
|
}
|
|
|
|
}
|