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>
|
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-02-25 13:26:51 -05:00
|
|
|
#include "ardour/event_type_map.h"
|
2011-01-26 20:31:03 -05:00
|
|
|
#include "ardour/pannable.h"
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "ardour/panner.h"
|
2011-02-22 13:44:22 -05:00
|
|
|
#include "ardour/panner_shell.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2011-11-02 12:46:49 -04:00
|
|
|
#include "ardour_button.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 "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"
|
|
|
|
|
|
|
|
#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;
|
|
|
|
|
2011-07-06 20:37:13 -04:00
|
|
|
AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session* sess, Canvas& canvas)
|
2006-07-29 23:25:38 -04:00
|
|
|
: AxisView(sess)
|
2011-07-06 20:37:13 -04:00
|
|
|
, RouteTimeAxisView(ed, sess, canvas)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2011-07-06 20:37:13 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioTimeAxisView::set_route (boost::shared_ptr<Route> rt)
|
|
|
|
{
|
2011-12-26 20:42:49 -05:00
|
|
|
_route = rt;
|
|
|
|
|
|
|
|
/* RouteTimeAxisView::set_route() sets up some things in the View,
|
|
|
|
so it must be created before RouteTimeAxis::set_route() is
|
|
|
|
called.
|
|
|
|
*/
|
|
|
|
_view = new AudioStreamView (*this);
|
|
|
|
|
2011-07-06 20:37:13 -04:00
|
|
|
RouteTimeAxisView::set_route (rt);
|
|
|
|
|
2011-12-26 20:42:49 -05:00
|
|
|
_view->apply_color (color (), StreamView::RegionColor);
|
|
|
|
|
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");
|
|
|
|
|
|
|
|
ignore_toggle = false;
|
|
|
|
|
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
|
|
|
|
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
|
|
|
|
2012-09-15 08:18:41 -04:00
|
|
|
if (_route->panner_shell()) {
|
2011-06-01 13:00:29 -04:00
|
|
|
_route->panner_shell()->Changed.connect (*this, invalidator (*this),
|
2011-02-22 13:44:22 -05:00
|
|
|
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)
|
|
|
|
{
|
2011-07-11 16:31:12 -04:00
|
|
|
set_gui_property ("visible", true);
|
2005-09-25 14:42:24 -04:00
|
|
|
return TimeAxisView::show_at (y, nth, parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioTimeAxisView::hide ()
|
|
|
|
{
|
2011-07-11 16:31:12 -04:00
|
|
|
set_gui_property ("visible", false);
|
2005-09-25 14:42:24 -04:00
|
|
|
TimeAxisView::hide ();
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
{
|
2011-06-11 11:35:34 -04:00
|
|
|
if (param.type() == NullAutomation) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
AutomationTracks::iterator existing = _automation_tracks.find (param);
|
|
|
|
|
|
|
|
if (existing != _automation_tracks.end()) {
|
|
|
|
|
|
|
|
/* automation track created because we had existing data for
|
|
|
|
* the processor, but visibility may need to be controlled
|
|
|
|
* since it will have been set visible by default.
|
|
|
|
*/
|
|
|
|
|
2011-07-06 20:37:13 -04:00
|
|
|
existing->second->set_marked_for_display (show);
|
2011-06-11 11:35:34 -04:00
|
|
|
|
|
|
|
if (!no_redraw) {
|
2011-07-06 20:37:13 -04:00
|
|
|
request_redraw ();
|
2011-06-11 11:35:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-06-27 11:51:50 -04:00
|
|
|
if (param.type() == GainAutomation) {
|
2007-06-29 00:02:58 -04:00
|
|
|
|
2010-09-26 22:04:16 -04:00
|
|
|
create_gain_automation_child (param, show);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2011-01-26 20:31:03 -05:00
|
|
|
} else if (param.type() == PanWidthAutomation ||
|
|
|
|
param.type() == PanElevationAutomation ||
|
|
|
|
param.type() == PanAzimuthAutomation) {
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2008-12-19 13:08:35 -05:00
|
|
|
ensure_pan_views (show);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2010-11-25 15:37:39 -05:00
|
|
|
} else if (param.type() == PluginAutomation) {
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2010-11-25 15:37:39 -05:00
|
|
|
/* handled elsewhere */
|
2010-08-24 18:07:53 -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;
|
|
|
|
}
|
|
|
|
|
2011-01-26 20:31:03 -05:00
|
|
|
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) {
|
2011-01-26 20:31:03 -05:00
|
|
|
boost::shared_ptr<ARDOUR::AutomationControl> pan_control = _route->pannable()->automation_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,
|
2011-06-01 13:00:29 -04:00
|
|
|
_route,
|
|
|
|
_route->pannable(),
|
2011-01-26 20:31:03 -05:00
|
|
|
pan_control,
|
2011-02-17 11:18:27 -05:00
|
|
|
pan_control->parameter (),
|
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
|
|
|
|
2011-07-06 20:37:13 -04:00
|
|
|
if (showit != string_is_affirmative (gain_track->gui_property ("visible"))) {
|
|
|
|
gain_track->set_marked_for_display (showit);
|
2008-12-12 09:43:24 -05:00
|
|
|
|
|
|
|
/* 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();
|
2011-07-06 20:37:13 -04:00
|
|
|
bool changed = false;
|
2010-05-26 19:16:53 -04:00
|
|
|
|
|
|
|
for (list<boost::shared_ptr<AutomationTimeAxisView> >::iterator i = pan_tracks.begin(); i != pan_tracks.end(); ++i) {
|
2011-07-06 20:37:13 -04:00
|
|
|
if ((*i)->set_marked_for_display (showit)) {
|
|
|
|
changed = true;
|
2008-12-12 09:43:24 -05:00
|
|
|
}
|
|
|
|
}
|
2011-07-06 20:37:13 -04:00
|
|
|
|
|
|
|
if (changed) {
|
|
|
|
_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
|
2011-03-07 08:04:36 -05:00
|
|
|
AudioTimeAxisView::show_all_automation (bool apply_to_selection)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2011-03-07 08:04:36 -05:00
|
|
|
if (apply_to_selection) {
|
|
|
|
_editor.get_selection().tracks.foreach_audio_time_axis (boost::bind (&AudioTimeAxisView::show_all_automation, _1, false));
|
|
|
|
} else {
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2011-03-07 08:04:36 -05:00
|
|
|
no_redraw = true;
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2011-03-07 08:04:36 -05:00
|
|
|
RouteTimeAxisView::show_all_automation ();
|
|
|
|
|
|
|
|
no_redraw = false;
|
2011-07-06 20:37:13 -04:00
|
|
|
request_redraw ();
|
2011-03-07 08:04:36 -05:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2011-03-07 08:04:36 -05:00
|
|
|
AudioTimeAxisView::show_existing_automation (bool apply_to_selection)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2011-03-07 08:04:36 -05:00
|
|
|
if (apply_to_selection) {
|
|
|
|
_editor.get_selection().tracks.foreach_audio_time_axis (boost::bind (&AudioTimeAxisView::show_existing_automation, _1, false));
|
|
|
|
} else {
|
|
|
|
no_redraw = true;
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2011-03-07 08:04:36 -05:00
|
|
|
RouteTimeAxisView::show_existing_automation ();
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2011-03-07 08:04:36 -05:00
|
|
|
no_redraw = false;
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2011-07-06 20:37:13 -04:00
|
|
|
request_redraw ();
|
2011-03-07 08:04:36 -05:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2011-03-07 08:04:36 -05:00
|
|
|
AudioTimeAxisView::hide_all_automation (bool apply_to_selection)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2011-03-07 08:04:36 -05:00
|
|
|
if (apply_to_selection) {
|
|
|
|
_editor.get_selection().tracks.foreach_audio_time_axis (boost::bind (&AudioTimeAxisView::hide_all_automation, _1, false));
|
|
|
|
} else {
|
|
|
|
no_redraw = true;
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2011-03-07 08:04:36 -05:00
|
|
|
RouteTimeAxisView::hide_all_automation();
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2011-03-07 08:04:36 -05:00
|
|
|
no_redraw = false;
|
2011-07-06 20:37:13 -04:00
|
|
|
request_redraw ();
|
2011-03-07 08:04:36 -05:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioTimeAxisView::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
|
2011-03-07 08:04:36 -05:00
|
|
|
AudioTimeAxisView::build_automation_action_menu (bool for_selection)
|
2010-05-26 19:16:53 -04:00
|
|
|
{
|
|
|
|
using namespace Menu_Helpers;
|
|
|
|
|
2011-03-07 08:04:36 -05:00
|
|
|
RouteTimeAxisView::build_automation_action_menu (for_selection);
|
2010-05-26 19:16:53 -04:00
|
|
|
|
|
|
|
MenuList& automation_items = automation_action_menu->items ();
|
|
|
|
|
|
|
|
automation_items.push_back (CheckMenuElem (_("Fader"), sigc::mem_fun (*this, &AudioTimeAxisView::update_gain_track_visibility)));
|
2013-07-11 15:32:31 -04:00
|
|
|
gain_automation_item = dynamic_cast<Gtk::CheckMenuItem*> (&automation_items.back ());
|
2011-07-06 20:37:13 -04:00
|
|
|
gain_automation_item->set_active ((!for_selection || _editor.get_selection().tracks.size() == 1) &&
|
2011-07-11 16:31:12 -04:00
|
|
|
(gain_track && string_is_affirmative (gain_track->gui_property ("visible"))));
|
2010-05-26 19:16:53 -04:00
|
|
|
|
2010-06-08 17:48:38 -04:00
|
|
|
_main_automation_menu_map[Evoral::Parameter(GainAutomation)] = gain_automation_item;
|
2010-05-26 21:08:53 -04:00
|
|
|
|
2010-05-26 19:16:53 -04:00
|
|
|
automation_items.push_back (CheckMenuElem (_("Pan"), sigc::mem_fun (*this, &AudioTimeAxisView::update_pan_track_visibility)));
|
2013-07-11 15:32:31 -04:00
|
|
|
pan_automation_item = dynamic_cast<Gtk::CheckMenuItem*> (&automation_items.back ());
|
2011-07-06 20:37:13 -04:00
|
|
|
pan_automation_item->set_active ((!for_selection || _editor.get_selection().tracks.size() == 1) &&
|
2011-07-11 16:31:12 -04:00
|
|
|
(!pan_tracks.empty() && string_is_affirmative (pan_tracks.front()->gui_property ("visible"))));
|
2010-05-26 21:08:53 -04:00
|
|
|
|
2011-01-26 20:31:03 -05:00
|
|
|
set<Evoral::Parameter> const & params = _route->pannable()->what_can_be_automated ();
|
2010-05-26 21:08:53 -04:00
|
|
|
for (set<Evoral::Parameter>::iterator p = params.begin(); p != params.end(); ++p) {
|
2010-06-08 17:48:38 -04:00
|
|
|
_main_automation_menu_map[*p] = pan_automation_item;
|
2010-05-26 21:08:53 -04:00
|
|
|
}
|
2010-05-26 19:16:53 -04:00
|
|
|
}
|
|
|
|
|
2011-03-03 13:32:06 -05:00
|
|
|
void
|
|
|
|
AudioTimeAxisView::enter_internal_edit_mode ()
|
|
|
|
{
|
|
|
|
if (audio_view()) {
|
|
|
|
audio_view()->enter_internal_edit_mode ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioTimeAxisView::leave_internal_edit_mode ()
|
|
|
|
{
|
|
|
|
if (audio_view()) {
|
|
|
|
audio_view()->leave_internal_edit_mode ();
|
|
|
|
}
|
|
|
|
}
|