#include "ardour/audio_diskstream.h"
#include "ardour/audio_track.h"
#include "ardour/audioplaylist.h"
#include "ardour/audio_diskstream.h"
#include "ardour/audio_track.h"
#include "ardour/audioplaylist.h"
#include "ardour/buffer_set.h"
#include "ardour/delivery.h"
#include "ardour/meter.h"
#include "ardour/buffer_set.h"
#include "ardour/delivery.h"
#include "ardour/meter.h"
if ((prop = node.property (X_("mode"))) != 0) {
_mode = TrackMode (string_2_enum (prop->value(), _mode));
if ((prop = node.property (X_("mode"))) != 0) {
_mode = TrackMode (string_2_enum (prop->value(), _mode));
/* This is called after all session state has been restored but before
have been made ports and connections are established.
/* This is called after all session state has been restored but before
have been made ports and connections are established.
boost::shared_ptr<Playlist> pl = _session.playlists->by_name (prop->value());
if (pl) {
_freeze_record.playlist = boost::dynamic_pointer_cast<AudioPlaylist> (pl);
boost::shared_ptr<Playlist> pl = _session.playlists->by_name (prop->value());
if (pl) {
_freeze_record.playlist = boost::dynamic_pointer_cast<AudioPlaylist> (pl);
if (!lm.locked()) {
boost::shared_ptr<AudioDiskstream> diskstream = audio_diskstream();
framecnt_t playback_distance = diskstream->calculate_playback_distance(nframes);
if (!lm.locked()) {
boost::shared_ptr<AudioDiskstream> diskstream = audio_diskstream();
framecnt_t playback_distance = diskstream->calculate_playback_distance(nframes);
if ((nframes = check_initial_delay (nframes, transport_frame)) == 0) {
/* need to do this so that the diskstream sets its
if ((nframes = check_initial_delay (nframes, transport_frame)) == 0) {
/* need to do this so that the diskstream sets its
bool valid = false;
const float mute = _mute_control->list()->rt_safe_eval(transport_frame, valid);
if (mute >= 0.5 && !muted()) {
bool valid = false;
const float mute = _mute_control->list()->rt_safe_eval(transport_frame, valid);
if (mute >= 0.5 && !muted()) {
BufferSet& bufs = _session.get_route_buffers (n_process_buffers ());
fill_buffers_with_input (bufs, _input, nframes);
BufferSet& bufs = _session.get_route_buffers (n_process_buffers ());
fill_buffers_with_input (bufs, _input, nframes);
if (_meter_point == MeterInput && (_monitoring & MonitorInput || _diskstream->record_enabled())) {
_meter->run (bufs, start_frame, end_frame, nframes, true);
}
if (_meter_point == MeterInput && (_monitoring & MonitorInput || _diskstream->record_enabled())) {
_meter->run (bufs, start_frame, end_frame, nframes, true);
}
diskstream->use_playlist (boost::dynamic_pointer_cast<AudioPlaylist>(new_playlist));
diskstream->set_record_enabled (false);
diskstream->use_playlist (boost::dynamic_pointer_cast<AudioPlaylist>(new_playlist));
diskstream->set_record_enabled (false);
_amp->gain_control()->set_automation_state (Off);
/* XXX need to use _main_outs _panner->set_automation_state (Off); */
_amp->gain_control()->set_automation_state (Off);
/* XXX need to use _main_outs _panner->set_automation_state (Off); */