summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2007-05-08 14:58:45 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2007-05-08 14:58:45 +0000
commit061bf0f35817eef693bbefed45eefecde1987b4c (patch)
treee6e98702532f72b7499362a2a1e4c347b163ef93 /libs/ardour
parent176385ea999e71e7d04158f78128f862a68ca0cc (diff)
fix numlock-effect on redirect clicks; fix control outs (finally?)
git-svn-id: svn://localhost/ardour2/branches/2.0.1@1794 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/io.cc14
-rw-r--r--libs/ardour/route.cc27
-rw-r--r--libs/ardour/session.cc56
3 files changed, 60 insertions, 37 deletions
diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc
index 0bda946d11..4e09061845 100644
--- a/libs/ardour/io.cc
+++ b/libs/ardour/io.cc
@@ -484,13 +484,6 @@ IO::deliver_output_no_pan (vector<Sample *>& bufs, uint32_t nbufs, nframes_t nfr
vector<Sample*> outs;
gain_t actual_gain;
- if (dg != _gain) {
- /* unlikely condition */
- for (o = _outputs.begin(), i = 0; o != _outputs.end(); ++o, ++i) {
- outs.push_back ((*o)->get_buffer (nframes) + offset);
- }
- }
-
/* reduce nbufs to the index of the last input buffer */
nbufs--;
@@ -506,6 +499,11 @@ IO::deliver_output_no_pan (vector<Sample *>& bufs, uint32_t nbufs, nframes_t nfr
dst = (*o)->get_buffer (nframes) + offset;
src = bufs[min(nbufs,i)];
+ if (dg != _gain) {
+ /* unlikely condition */
+ outs.push_back (dst);
+ }
+
if (dg != _gain || actual_gain == 1.0f) {
memcpy (dst, src, sizeof (Sample) * nframes);
} else if (actual_gain == 0.0f) {
@@ -520,7 +518,7 @@ IO::deliver_output_no_pan (vector<Sample *>& bufs, uint32_t nbufs, nframes_t nfr
}
if (dg != _gain) {
- apply_declick (outs, outs.size(), nframes, _gain, dg, false);
+ apply_declick (outs, i, nframes, _gain, dg, false);
_gain = dg;
}
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index 091ff549ad..79894bdd33 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -421,7 +421,7 @@ Route::process_output_buffers (vector<Sample*>& bufs, uint32_t nbufs,
} else {
- co->deliver_output (bufs, nbufs, nframes, offset);
+ co->deliver_output_no_pan (bufs, nbufs, nframes, offset);
}
}
@@ -585,7 +585,7 @@ Route::process_output_buffers (vector<Sample*>& bufs, uint32_t nbufs,
(no_monitor && record_enabled() && (!Config->get_auto_input() || _session.actively_recording()))
) {
-
+
co->silence (nframes, offset);
} else {
@@ -642,7 +642,7 @@ Route::process_output_buffers (vector<Sample*>& bufs, uint32_t nbufs,
if (_meter_point == MeterPostFader) {
reset_peak_meters ();
}
-
+
IO::silence (nframes, offset);
} else {
@@ -1806,11 +1806,17 @@ Route::set_control_outs (const vector<string>& ports)
{
Glib::Mutex::Lock lm (control_outs_lock);
vector<string>::const_iterator i;
+ uint32_t limit;
if (_control_outs) {
delete _control_outs;
_control_outs = 0;
}
+
+ if (control() || master()) {
+ /* no control outs for these two special busses */
+ return 0;
+ }
if (ports.empty()) {
return 0;
@@ -1825,7 +1831,20 @@ Route::set_control_outs (const vector<string>& ports)
have outputs. we track the changes in ::output_change_handler().
*/
- _control_outs->ensure_io (0, n_outputs(), true, this);
+ limit = n_outputs ();
+
+ if (_control_outs->ensure_io (0, limit, true, this)) {
+ return -1;
+ }
+
+ /* now connect to the named ports */
+
+ for (uint32_t n = 0; n < limit; ++n) {
+ if (_control_outs->connect_output (_control_outs->output (n), ports[n], this)) {
+ error << string_compose (_("could not connect %1 to %2"), _control_outs->output(n)->name(), ports[n]) << endmsg;
+ return -1;
+ }
+ }
return 0;
}
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index 7c77023c67..77a3f175c5 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -915,6 +915,7 @@ Session::hookup_io ()
if (_control_out) {
uint32_t n;
+ vector<string> cports;
while ((int) _control_out->n_inputs() < _control_out->input_maximum()) {
if (_control_out->add_input_port ("", this)) {
@@ -932,7 +933,20 @@ Session::hookup_io ()
}
n++;
}
- }
+
+
+ uint32_t ni = _control_out->n_inputs();
+
+ for (n = 0; n < ni; ++n) {
+ cports.push_back (_control_out->input(n)->name());
+ }
+
+ boost::shared_ptr<RouteList> r = routes.reader ();
+
+ for (RouteList::iterator x = r->begin(); x != r->end(); ++x) {
+ (*x)->set_control_outs (cports);
+ }
+ }
/* Tell all IO objects to connect themselves together */
@@ -1745,19 +1759,6 @@ Session::new_audio_track (int input_channels, int output_channels, TrackMode mod
channels_used += track->n_inputs ();
- if (_control_out) {
- vector<string> cports;
- uint32_t ni = _control_out->n_inputs();
-
- for (n = 0; n < ni; ++n) {
- cports.push_back (_control_out->input(n)->name());
- }
-
- track->set_control_outs (cports);
- }
-
- // assert (current_thread != RT_thread)
-
track->audio_diskstream()->non_realtime_input_change();
track->DiskstreamChanged.connect (mem_fun (this, &Session::resort_routes));
@@ -1920,16 +1921,6 @@ Session::new_audio_route (int input_channels, int output_channels, uint32_t how_
}
}
- if (_control_out) {
- vector<string> cports;
- uint32_t ni = _control_out->n_inputs();
-
- for (uint32_t n = 0; n < ni; ++n) {
- cports.push_back (_control_out->input(n)->name());
- }
- bus->set_control_outs (cports);
- }
-
bus->set_remote_control_id (control_id);
++control_id;
@@ -1986,9 +1977,24 @@ Session::add_routes (RouteList& new_routes, bool save)
if ((*x)->control()) {
_control_out = (*x);
- }
+ }
}
+ if (_control_out && IO::connecting_legal) {
+
+ vector<string> cports;
+ uint32_t ni = _control_out->n_inputs();
+ uint32_t n;
+
+ for (n = 0; n < ni; ++n) {
+ cports.push_back (_control_out->input(n)->name());
+ }
+
+ for (RouteList::iterator x = new_routes.begin(); x != new_routes.end(); ++x) {
+ (*x)->set_control_outs (cports);
+ }
+ }
+
set_dirty();
if (save) {