#include "ardour/port.h"
#include "ardour/processor.h"
#include "ardour/record_enable_control.h"
+#include "ardour/record_safe_control.h"
#include "ardour/route_group_specialized.h"
#include "ardour/session.h"
#include "ardour/session_playlists.h"
#include "ardour/track.h"
#include "ardour/utils.h"
-#include "i18n.h"
+#include "pbd/i18n.h"
using namespace std;
using namespace ARDOUR;
_record_enable_control.reset (new RecordEnableControl (_session, X_("recenable"), *this));
add_control (_record_enable_control);
- _record_safe_control.reset (new AutomationControl (_session, RecSafeAutomation, ParameterDescriptor (RecSafeAutomation),
- boost::shared_ptr<AutomationList> (new AutomationList (Evoral::Parameter (RecSafeAutomation))),
- X_("recsafe")));
+ _record_safe_control.reset (new RecordSafeControl (_session, X_("recsafe"), *this));
add_control (_record_safe_control);
_monitoring_control.reset (new MonitorControl (_session, X_("monitoring"), *this));
Track::state (bool full)
{
XMLNode& root (Route::state (full));
+
+ root.add_child_nocopy (_monitoring_control->get_state ());
+ root.add_child_nocopy (_record_safe_control->get_state ());
+ root.add_child_nocopy (_record_enable_control->get_state ());
+
root.add_property (X_("saved-meter-point"), enum_2_string (_saved_meter_point));
root.add_child_nocopy (_diskstream->get_state ());
child = *niter;
XMLProperty const * prop;
- if (child->name() == Controllable::xml_node_name && (prop = child->property ("name")) != 0) {
- if (prop->value() == X_("recenable")) {
+
+ if (child->name() == Controllable::xml_node_name) {
+ if ((prop = child->property ("name")) == 0) {
+ continue;
+ }
+
+ if (prop->value() == _record_enable_control->name()) {
_record_enable_control->set_state (*child, version);
+ } else if (prop->value() == _record_safe_control->name()) {
+ _record_safe_control->set_state (*child, version);
+ } else if (prop->value() == _monitoring_control->name()) {
+ _monitoring_control->set_state (*child, version);
}
}
}
}
bool
-Track::record_safe () const
+Track::can_be_record_safe ()
{
- return _diskstream && _diskstream->record_safe ();
+ return !_record_enable_control->get_value() && _diskstream && _session.writable() && (_freeze_record.state != Frozen);
}
-void
-Track::set_record_safe (bool yn, Controllable::GroupControlDisposition group_override)
+bool
+Track::can_be_record_enabled ()
{
- if (!_session.writable()) {
- return;
- }
-
- if (_freeze_record.state == Frozen) {
- return;
- }
-
- if (record_enabled ()) {
- return;
- }
-
- _rec_safe_control->set_value (yn, group_override);
+ return !_record_safe_control->get_value() && _diskstream && !_diskstream->record_safe() && _session.writable() && (_freeze_record.state != Frozen);
}
void
if (no_meter) {
BufferSet& bufs (_session.get_silent_buffers (n_process_buffers()));
- _meter->run (bufs, 0, 0, nframes, true);
- _input->process_input (boost::shared_ptr<Processor>(), start_frame, end_frame, nframes);
+ _meter->run (bufs, start_frame, end_frame, 1.0, nframes, true);
+ _input->process_input (boost::shared_ptr<Processor>(), start_frame, end_frame, speed(), nframes);
} else {
- _input->process_input (_meter, start_frame, end_frame, nframes);
+ _input->process_input (_meter, start_frame, end_frame, speed(), nframes);
}
}
fill_buffers_with_input (bufs, _input, nframes);
if (_meter_point == MeterInput) {
- _meter->run (bufs, start_frame, end_frame, nframes, true);
+ _meter->run (bufs, start_frame, end_frame, 1.0 /*speed()*/, nframes, true);
}
passthru (bufs, start_frame, end_frame, nframes, false);
}
- for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
- boost::shared_ptr<Delivery> d = boost::dynamic_pointer_cast<Delivery> (*i);
- if (d) {
- d->flush_buffers (nframes);
- }
- }
+ flush_processor_buffers_locked (nframes);
return 0;
}
_amp->apply_gain_automation(false);
silence (nframes);
+ flush_processor_buffers_locked (nframes);
framecnt_t playback_distance;