#include <ardour/track.h>
#include <ardour/diskstream.h>
#include <ardour/session.h>
-#include <ardour/redirect.h>
+#include <ardour/io_processor.h>
#include <ardour/audioregion.h>
#include <ardour/audiosource.h>
#include <ardour/route_group_specialized.h>
-#include <ardour/insert.h>
+#include <ardour/processor.h>
#include <ardour/audioplaylist.h>
#include <ardour/panner.h>
#include <ardour/utils.h>
-#include <ardour/connection.h>
#include "i18n.h"
Track::Track (Session& sess, string name, Route::Flag flag, TrackMode mode, DataType default_type)
: Route (sess, name, 1, -1, -1, -1, flag, default_type)
- , _rec_enable_control (*this)
+ , _rec_enable_control (new RecEnableControllable(*this))
{
_declickable = true;
_freeze_record.state = NoFreeze;
}
Track::Track (Session& sess, const XMLNode& node, DataType default_type)
- : Route (sess, node),
- _rec_enable_control (*this)
+ : Route (sess, node)
+ , _rec_enable_control (new RecEnableControllable(*this))
{
_freeze_record.state = NoFreeze;
_declickable = true;
void
Track::toggle_monitor_input ()
{
- for (vector<Port*>::iterator i = _inputs.begin(); i != _inputs.end(); ++i) {
- (*i)->ensure_monitor_input(!(*i)->monitoring_input());
+ for (PortSet::iterator i = _inputs.begin(); i != _inputs.end(); ++i) {
+ i->ensure_monitor_input(!i->monitoring_input());
}
}
-nframes_t
+ARDOUR::nframes_t
Track::update_total_latency ()
{
- _own_latency = 0;
+ nframes_t old = _own_latency;
- for (RedirectList::iterator i = _redirects.begin(); i != _redirects.end(); ++i) {
- if ((*i)->active ()) {
- _own_latency += (*i)->latency ();
+ if (_user_latency) {
+ _own_latency = _user_latency;
+ } else {
+ _own_latency = 0;
+
+ for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
+ if ((*i)->active ()) {
+ _own_latency += (*i)->signal_latency ();
+ }
}
}
set_port_latency (_own_latency);
+ if (old != _own_latency) {
+ signal_latency_changed (); /* EMIT SIGNAL */
+ }
+
return _own_latency;
}
-
Track::FreezeRecord::~FreezeRecord ()
{
- for (vector<FreezeRecordInsertInfo*>::iterator i = insert_info.begin(); i != insert_info.end(); ++i) {
+ for (vector<FreezeRecordProcessorInfo*>::iterator i = processor_info.begin(); i != processor_info.end(); ++i) {
delete *i;
}
}
Track::can_record()
{
bool will_record = true;
- for (size_t i = 0; i < _inputs.size() && will_record; i++) {
- if (!_inputs[i]->connected())
+ for (PortSet::iterator i = _inputs.begin(); i != _inputs.end() && will_record; ++i) {
+ if (!i->connected())
will_record = false;
}
set_meter_point (_saved_meter_point, this);
}
- _rec_enable_control.Changed ();
+ _rec_enable_control->Changed ();
}
-int
-Track::set_name (string str, void *src)
+
+bool
+Track::set_name (const string& str)
{
- int ret;
+ bool ret;
if (record_enabled() && _session.actively_recording()) {
/* this messes things up if done while recording */
- return -1;
+ return false;
}
if (_diskstream->set_name (str)) {
- return -1;
+ return false;
}
/* save state so that the statefile fully reflects any filename changes */
- if ((ret = IO::set_name (str, src)) == 0) {
+ if ((ret = IO::set_name (str)) == 0) {
_session.save_state ("");
}
+
return ret;
}