2
Copyright (C) 2000-2004 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.
21
#include "gtk2ardour-config.h"
24
#include <boost/foreach.hpp>
26
#include "pbd/file_utils.h"
27
#include "pbd/error.h"
29
#include "ardour/filesystem_paths.h"
32
#include "mixer_actor.h"
33
#include "mixer_strip.h"
38
using namespace ARDOUR;
42
MixerActor::MixerActor ()
48
MixerActor::~MixerActor ()
53
MixerActor::register_actions ()
55
myactions.register_action ("Mixer", "solo", _("Toggle Solo on Mixer-Selected Tracks/Busses"), sigc::mem_fun (*this, &MixerActor::solo_action));
56
myactions.register_action ("Mixer", "mute", _("Toggle Mute on Mixer-Selected Tracks/Busses"), sigc::mem_fun (*this, &MixerActor::mute_action));
57
myactions.register_action ("Mixer", "recenable", _("Toggle Rec-enable on Mixer-Selected Tracks/Busses"), sigc::mem_fun (*this, &MixerActor::rec_enable_action));
58
myactions.register_action ("Mixer", "increment-gain", _("Decrease Gain on Mixer-Selected Tracks/Busses"), sigc::mem_fun (*this, &MixerActor::step_gain_up_action));
59
myactions.register_action ("Mixer", "decrement-gain", _("Increase Gain on Mixer-Selected Tracks/Busses"), sigc::mem_fun (*this, &MixerActor::step_gain_down_action));
60
myactions.register_action ("Mixer", "unity-gain", _("Set Gain to 0dB on Mixer-Selected Tracks/Busses"), sigc::mem_fun (*this, &MixerActor::unity_gain_action));
63
myactions.register_action ("Mixer", "copy-processors", _("Copy Selected Processors"), sigc::mem_fun (*this, &MixerActor::copy_processors));
64
myactions.register_action ("Mixer", "cut-processors", _("Cut Selected Processors"), sigc::mem_fun (*this, &MixerActor::cut_processors));
65
myactions.register_action ("Mixer", "paste-processors", _("Paste Selected Processors"), sigc::mem_fun (*this, &MixerActor::paste_processors));
66
myactions.register_action ("Mixer", "delete-processors", _("Delete Selected Processors"), sigc::mem_fun (*this, &MixerActor::delete_processors));
67
myactions.register_action ("Mixer", "select-all-processors", _("Select All (visible) Processors"), sigc::mem_fun (*this, &MixerActor::select_all_processors));
68
myactions.register_action ("Mixer", "toggle-processors", _("Toggle Selected Processors"), sigc::mem_fun (*this, &MixerActor::toggle_processors));
69
myactions.register_action ("Mixer", "ab-plugins", _("Toggle Selected Plugins"), sigc::mem_fun (*this, &MixerActor::ab_plugins));
72
myactions.register_action ("Mixer", "scroll-left", _("Scroll Mixer Window to the left"), sigc::mem_fun (*this, &MixerActor::scroll_left));
73
myactions.register_action ("Mixer", "scroll-right", _("Scroll Mixer Window to the left"), sigc::mem_fun (*this, &MixerActor::scroll_right));
75
myactions.register_action ("Mixer", "toggle-midi-input-active", _("Toggle MIDI Input Active for Mixer-Selected Tracks/Busses"),
76
sigc::bind (sigc::mem_fun (*this, &MixerActor::toggle_midi_input_active), false));
80
MixerActor::load_bindings ()
82
/* XXX move this to a better place */
84
bindings.set_action_map (myactions);
86
std::string binding_file;
88
if (find_file_in_search_path (ardour_config_search_path(), "mixer.bindings", binding_file)) {
89
bindings.load (binding_file);
90
info << string_compose (_("Loaded mixer bindings from %1"), binding_file) << endmsg;
92
error << string_compose (_("Could not find mixer.bindings in search path %1"), ardour_config_search_path().to_string()) << endmsg;
97
MixerActor::solo_action ()
101
ev.type = GDK_BUTTON_PRESS;
105
set_route_targets_for_operation ();
107
BOOST_FOREACH(RouteUI* r, _route_targets) {
113
MixerActor::mute_action ()
117
ev.type = GDK_BUTTON_PRESS;
121
set_route_targets_for_operation ();
123
BOOST_FOREACH(RouteUI* r, _route_targets) {
129
MixerActor::rec_enable_action ()
133
ev.type = GDK_BUTTON_PRESS;
137
set_route_targets_for_operation ();
139
BOOST_FOREACH(RouteUI* r, _route_targets) {
140
r->rec_enable_press (&ev);
145
MixerActor::step_gain_up_action ()
147
set_route_targets_for_operation ();
149
BOOST_FOREACH(RouteUI* r, _route_targets) {
150
MixerStrip* ms = dynamic_cast<MixerStrip*> (r);
158
MixerActor::step_gain_down_action ()
160
set_route_targets_for_operation ();
162
BOOST_FOREACH(RouteUI* r, _route_targets) {
163
MixerStrip* ms = dynamic_cast<MixerStrip*> (r);
165
ms->step_gain_down ();
171
MixerActor::unity_gain_action ()
173
set_route_targets_for_operation ();
175
BOOST_FOREACH(RouteUI* r, _route_targets) {
176
boost::shared_ptr<Route> rp = r->route();
178
rp->set_gain (1.0, this);
184
MixerActor::copy_processors ()
186
set_route_targets_for_operation ();
188
BOOST_FOREACH(RouteUI* r, _route_targets) {
189
MixerStrip* ms = dynamic_cast<MixerStrip*> (r);
191
ms->copy_processors ();
196
MixerActor::cut_processors ()
198
set_route_targets_for_operation ();
200
BOOST_FOREACH(RouteUI* r, _route_targets) {
201
MixerStrip* ms = dynamic_cast<MixerStrip*> (r);
203
ms->cut_processors ();
208
MixerActor::paste_processors ()
210
set_route_targets_for_operation ();
212
BOOST_FOREACH(RouteUI* r, _route_targets) {
213
MixerStrip* ms = dynamic_cast<MixerStrip*> (r);
215
ms->paste_processors ();
220
MixerActor::select_all_processors ()
222
set_route_targets_for_operation ();
224
BOOST_FOREACH(RouteUI* r, _route_targets) {
225
MixerStrip* ms = dynamic_cast<MixerStrip*> (r);
227
ms->select_all_processors ();
232
MixerActor::delete_processors ()
234
set_route_targets_for_operation ();
236
BOOST_FOREACH(RouteUI* r, _route_targets) {
237
MixerStrip* ms = dynamic_cast<MixerStrip*> (r);
239
ms->delete_processors ();
244
MixerActor::toggle_processors ()
246
set_route_targets_for_operation ();
248
BOOST_FOREACH(RouteUI* r, _route_targets) {
249
MixerStrip* ms = dynamic_cast<MixerStrip*> (r);
251
ms->toggle_processors ();
256
MixerActor::ab_plugins ()
258
set_route_targets_for_operation ();
260
BOOST_FOREACH(RouteUI* r, _route_targets) {
261
MixerStrip* ms = dynamic_cast<MixerStrip*> (r);