#include "ardour/buffer_set.h"
#include "ardour/io_processor.h"
#include "ardour/panner.h"
+#include "ardour/meter.h"
#include "ardour/playlist_factory.h"
#include "ardour/plugin_insert.h"
#include "ardour/processor.h"
diskstream->deprecated_io_node = 0;
- set_input_minimum (ChanCount::ZERO);
- set_input_maximum (ChanCount::INFINITE);
- set_output_minimum (ChanCount::ZERO);
- set_output_maximum (ChanCount::INFINITE);
-
if ((prop = node.property ("gain")) != 0) {
- set_gain (atof (prop->value().c_str()), this);
- _gain = _gain_control->user_float();
+ _amp->set_gain (atof (prop->value().c_str()), this);
}
if ((prop = node.property ("input-connection")) != 0) {
}
}
- connect_input_ports_to_bundle (c, this);
+ _input->connect_ports_to_bundle (c, this);
} else if ((prop = node.property ("inputs")) != 0) {
- if (set_inputs (prop->value())) {
+ if (_input->set_ports (prop->value())) {
error << string_compose(_("improper input channel list in XML node (%1)"), prop->value()) << endmsg;
return -1;
}
}
int
-AudioTrack::set_diskstream (boost::shared_ptr<AudioDiskstream> ds, void *src)
+AudioTrack::set_diskstream (boost::shared_ptr<AudioDiskstream> ds, void * /*src*/)
{
_diskstream = ds;
- _diskstream->set_io (*this);
+ _diskstream->set_route (*this);
_diskstream->set_destructive (_mode == Destructive);
_diskstream->set_non_layered (_mode == NonLayered);
if (audio_diskstream()->deprecated_io_node) {
- if (!connecting_legal) {
- ConnectingLegal.connect (mem_fun (*this, &AudioTrack::deprecated_use_diskstream_connections));
+ if (!IO::connecting_legal) {
+ IO::ConnectingLegal.connect (mem_fun (*this, &AudioTrack::deprecated_use_diskstream_connections));
} else {
deprecated_use_diskstream_connections ();
}
_diskstream->monitor_input (false);
ic_connection.disconnect();
- ic_connection = input_changed.connect (mem_fun (*_diskstream, &Diskstream::handle_input_change));
+ ic_connection = _input->changed.connect (mem_fun (*_diskstream, &Diskstream::handle_input_change));
DiskstreamChanged (); /* EMIT SIGNAL */
transport_frame = _session.transport_frame();
- prepare_inputs (nframes);
-
if ((nframes = check_initial_delay (nframes, transport_frame)) == 0) {
/* need to do this so that the diskstream sets its
/* special condition applies */
if (_meter_point == MeterInput) {
- just_meter_input (start_frame, end_frame, nframes);
+ _input->process_input (_meter, start_frame, end_frame, nframes);
}
if (diskstream->record_enabled() && !can_record && !_session.config.get_auto_input()) {
limit = blimit;
} else {
- for (i = 0, n = 1; i < blimit; ++i, ++n) {
+ for (i = 0, n = 1; i < limit; ++i, ++n) {
memcpy (bufs.get_audio (i).data(), b, sizeof (Sample) * nframes);
if (n < diskstream->n_channels().n_audio()) {
tmpb = diskstream->playback_buffer(n);
}
}
}
+
+ /* try to leave any MIDI buffers alone */
+
+ ChanCount chn;
+ chn.set_audio (limit);
+ chn.set_midi (_input->n_ports().n_midi());
+ bufs.set_count (chn);
}
/* don't waste time with automation if we're recording or we've just stopped (yes it can happen) */
if (!diskstream->record_enabled() && _session.transport_rolling()) {
+#ifdef XXX_MOVE_THIS_TO_AMP
Glib::Mutex::Lock am (data().control_lock(), Glib::TRY_LOCK);
if (am.locked() && gain_control()->automation_playback()) {
gain_control()->list()->curve().rt_safe_get_vector (
start_frame, end_frame, _session.gain_automation_buffer(), nframes));
}
+#endif
}
process_output_buffers (bufs, start_frame, end_frame, nframes, (!_session.get_record_enabled() || !Config->get_do_not_record_plugins()), declick);
for (i = _processors.begin(); i != _processors.end(); ++i) {
boost::shared_ptr<Processor> processor;
if ((processor = boost::dynamic_pointer_cast<Processor>(*i)) != 0) {
- processor->run_in_place (buffers, start, start+nframes, nframes);
+ processor->run (buffers, start, start+nframes, nframes);
}
}
new_playlist = PlaylistFactory::create (DataType::AUDIO, _session, new_playlist_name, false);
- _freeze_record.gain = _gain;
- _freeze_record.gain_automation_state = _gain_control->automation_state();
- _freeze_record.pan_automation_state = _panner->automation_state();
+ _freeze_record.gain = _amp->gain();
+ _freeze_record.gain_automation_state = _amp->gain_control()->automation_state();
+ /* XXX need main outs automation state _freeze_record.pan_automation_state = _mainpanner->automation_state(); */
region_name = new_playlist_name;
/* reset stuff that has already been accounted for in the freeze process */
set_gain (1.0, this);
- _gain_control->set_automation_state (Off);
- _panner->set_automation_state (Off);
+ _amp->gain_control()->set_automation_state (Off);
+ /* XXX need to use _main_outs _panner->set_automation_state (Off); */
_freeze_record.state = Frozen;
FreezeChange(); /* EMIT SIGNAL */
_freeze_record.playlist.reset ();
set_gain (_freeze_record.gain, this);
- _gain_control->set_automation_state (_freeze_record.gain_automation_state);
- _panner->set_automation_state (_freeze_record.pan_automation_state);
+ _amp->gain_control()->set_automation_state (_freeze_record.gain_automation_state);
+ /* XXX need to use _main_outs _panner->set_automation_state (_freeze_record.pan_automation_state); */
}
_freeze_record.state = UnFrozen;