mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-22 06:36:29 +01:00
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
This commit is contained in:
parent
176385ea99
commit
061bf0f358
4 changed files with 61 additions and 38 deletions
|
|
@ -294,7 +294,7 @@ RedirectBox::redirect_button_press_event (GdkEventButton *ev)
|
|||
|
||||
}
|
||||
|
||||
if (redirect && (Keyboard::is_edit_event (ev) || (ev->button == 1 && ev->type == GDK_2BUTTON_PRESS && ev->state == 0))) {
|
||||
if (redirect && (Keyboard::is_edit_event (ev) || (ev->button == 1 && ev->type == GDK_2BUTTON_PRESS))) {
|
||||
|
||||
if (_session.engine().connected()) {
|
||||
/* XXX giving an error message here is hard, because we may be in the midst of a button press */
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue