20 #include <boost/scoped_array.hpp>
43 #include "ardour/utils.h"
52 :
Track (sess, name, flag, mode)
128 bounce_required =
false;
133 return _diskstream->can_become_destructive (bounce_required);
153 if ((prop = node.
property (
"gain")) != 0) {
157 if ((prop = node.
property (
"input-connection")) != 0) {
164 error <<
_(
"No input bundles available as a replacement")
173 _input->connect_ports_to_bundle (c,
true,
this);
175 }
else if ((prop = node.
property (
"inputs")) != 0) {
190 if ((prop = node.
property (
X_(
"mode"))) != 0) {
221 freeze_node =
new XMLNode (
X_(
"freeze-info"));
227 (*i)->id.print (buf,
sizeof (buf));
266 if ((prop = fnode->
property (
X_(
"playlist"))) != 0) {
277 if ((prop = fnode->
property (
X_(
"state"))) != 0) {
284 for (citer = clist.begin(); citer != clist.end(); ++citer) {
285 if ((*citer)->name() !=
X_(
"processor")) {
289 if ((prop = (*citer)->property (
X_(
"id"))) == 0) {
307 Glib::Threads::RWLock::ReaderLock lm (
_processor_lock, Glib::Threads::TRY_LOCK);
348 dret = diskstream->
process (bufs, transport_frame, 0, playback_distance,
false);
349 need_butler = diskstream->
commit (playback_distance);
356 if (mute >= 0.5 && !
muted()) {
358 }
else if (mute < 0.5 &&
muted()) {
364 _amp->apply_gain_automation(
false);
371 _meter->run (bufs, start_frame, end_frame, nframes,
true);
375 need_butler = diskstream->
commit (playback_distance);
389 need_butler = diskstream->
commit (playback_distance);
398 boost::scoped_array<gain_t> gain_buffer (
new gain_t[nframes]);
399 boost::scoped_array<Sample> mix_buffer (
new Sample[nframes]);
410 if (apl->
read (buffers.
get_audio(0).
data(), mix_buffer.get(), gain_buffer.get(),
start, nframes) != nframes) {
418 for ( ; bi != buffers.
audio_end(); ++bi, ++n) {
420 if (apl->
read (bi->data(), mix_buffer.get(), gain_buffer.get(),
start, nframes, n) != nframes) {
426 memcpy (bi->data(), b,
sizeof (
Sample) * nframes);
430 bounce_process (buffers, start, nframes, endpoint, include_endpoint, for_export, for_freeze);
438 if (!endpoint && !include_endpoint) {
454 if (!include_endpoint && (*r) == endpoint) {
462 if ((*r)->does_routing()) {
470 if (naudio != (*r)->input_streams().n_audio()) {
478 if ((*r) == endpoint) {
486 naudio = (*r)->output_streams().n_audio();
502 vector<boost::shared_ptr<Source> > srcs;
503 return _session.
write_one_track (*
this, start, end,
false, srcs, itt, endpoint, include_endpoint,
false,
false);
509 vector<boost::shared_ptr<Source> > srcs;
510 string new_playlist_name;
522 while (n < (UINT_MAX-1)) {
529 new_playlist_name = candidate;
537 if (n == (UINT_MAX-1)) {
547 true, srcs, itt,
main_outs(),
false,
false,
true)) == 0) {
558 if ((*r)->does_routing() && (*r)->active()) {
561 if (!boost::dynamic_pointer_cast<PeakMeter>(*r)) {
565 frii->
id = (*r)->id();
570 if (!boost::dynamic_pointer_cast<Amp>(*r)) {
583 region_name = new_playlist_name;
601 diskstream->
use_playlist (boost::dynamic_pointer_cast<AudioPlaylist>(new_playlist));
607 _amp->gain_control()->set_automation_state (
Off);
624 if ((*ii)->id == (*i)->id()) {
framecnt_t read(Sample *dst, Sample *mixdown, float *gain_buffer, framepos_t start, framecnt_t cnt, uint32_t chan_n=0)
bool transport_rolling() const
void freeze_me(InterThreadInfo &)
ARDOUR::Session & _session
boost::shared_ptr< Region > write_one_track(Track &, framepos_t start, framepos_t end, bool overwrite, std::vector< boost::shared_ptr< Source > > &, InterThreadInfo &wot, boost::shared_ptr< Processor > endpoint, bool include_endpoint, bool for_export, bool for_freeze)
PBD::Signal0< void > TrackModeChanged
FreezeRecord _freeze_record
const std::string & value() const
boost::shared_ptr< AudioDiskstream > audio_diskstream() const
PBD::Signal0< void > DiskstreamChanged
virtual int set_state(const XMLNode &, int version)
boost::shared_ptr< Amp > _amp
void flush_buffers(framecnt_t nframes)
PBD::Signal0< void > FreezeChange
shared_ptr< T > dynamic_pointer_cast(shared_ptr< U > const &r)
void set_gain(gain_t val, void *src)
LIBARDOUR_API PBD::PropertyDescriptor< std::string > name
boost::shared_ptr< Diskstream > create_diskstream()
void set_orig_track_id(const PBD::ID &did)
XMLNode * add_child_copy(const XMLNode &)
int deprecated_use_diskstream_connections()
LIBPBD_API Transmitter error
const XMLNodeList & children(const std::string &str=std::string()) const
int export_stuff(BufferSet &bufs, framepos_t start_frame, framecnt_t nframes, boost::shared_ptr< Processor > endpoint, bool include_endpoint, bool for_export, bool for_freeze)
static PBD::Signal0< int > ConnectingLegal
ProcessorList _processors
void set_state_part_two()
static bool connecting_legal
std::ostream & endmsg(std::ostream &ostr)
LIBARDOUR_API PBD::PropertyDescriptor< framepos_t > start
frameoffset_t calculate_playback_distance(pframes_t nframes)
bool bounceable(boost::shared_ptr< Processor >, bool include_endpoint) const
AudioBuffer & get_audio(size_t i)
int process(BufferSet &, framepos_t transport_frame, pframes_t nframes, framecnt_t &, bool need_disk_signal)
boost::shared_ptr< Playlist > playlist
boost::shared_ptr< PeakMeter > _meter
XMLNode & state(bool full)
std::list< XMLNode * > XMLNodeList
int use_playlist(boost::shared_ptr< Playlist >)
void set_record_enabled(bool yn)
PBD::Signal0< void > StateReady
boost::shared_ptr< AudioFileSource > write_source(uint32_t n=0)
boost::shared_ptr< MuteControllable > _mute_control
void add_region(boost::shared_ptr< Region >, framepos_t position, float times=1, bool auto_partition=false)
static int current_state_version
int roll(pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool &need_butler)
XMLProperty * property(const char *)
boost::shared_ptr< Region > bounce(InterThreadInfo &)
#define string_2_enum(str, e)
std::vector< FreezeRecordProcessorInfo * > processor_info
boost::shared_ptr< Region > bounce_range(framepos_t start, framepos_t end, InterThreadInfo &, boost::shared_ptr< Processor > endpoint, bool include_endpoint)
int internal_playback_seek(framecnt_t)
audio_iterator audio_begin()
boost::shared_ptr< Delivery > main_outs() const
StateOfTheState state_of_the_state() const
framepos_t transport_frame() const
int set_state(const XMLNode &, int version)
int set_mode(TrackMode m)
boost::shared_ptr< AudioFileSource > write_source(uint32_t n=0)
ChanCount n_outputs() const
bool record_enabled() const
LIBARDOUR_API PBD::PropertyDescriptor< bool > mute
bool can_use_mode(TrackMode m, bool &bounce_required)
MonitorChoice _monitoring
LIBARDOUR_API XMLNode * find_named_node(const XMLNode &node, std::string name)
audio_iterator audio_end()
PBD::Property< std::string > _name
ChanCount n_inputs() const
LIBPBD_API Transmitter info
XMLProperty * add_property(const char *name, const std::string &value)
BufferSet & get_route_buffers(ChanCount count=ChanCount::ZERO, bool silence=true)
boost::shared_ptr< IO > _input
MonitorState monitoring_state() const
void add_child_nocopy(XMLNode &)
int can_internal_playback_seek(framecnt_t)
framepos_t current_end_frame() const
XMLNode & state(bool full)
framepos_t current_start_frame() const
const ChanCount & count() const
framecnt_t check_initial_delay(framecnt_t nframes, framepos_t &)
boost::shared_ptr< Diskstream > diskstream_factory(XMLNode const &)
boost::shared_ptr< SessionPlaylists > playlists
virtual void process_output_buffers(BufferSet &bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, int declick, bool gain_automation_ok)
boost::shared_ptr< Bundle > bundle_by_name(std::string) const
Glib::Threads::RWLock _processor_lock
boost::shared_ptr< Diskstream > _diskstream
const Sample * data(framecnt_t offset=0) const
static boost::shared_ptr< Region > create(boost::shared_ptr< const Region > other, bool announce=false)
virtual void set_diskstream(boost::shared_ptr< Diskstream >)
XMLNodeList::const_iterator XMLNodeConstIterator
void fill_buffers_with_input(BufferSet &bufs, boost::shared_ptr< IO > io, pframes_t nframes)
boost::shared_ptr< Playlist > playlist()
static boost::shared_ptr< Playlist > create(Session &, const XMLNode &, bool hidden=false, bool unused=false)
virtual void bounce_process(BufferSet &bufs, framepos_t start_frame, framecnt_t nframes, boost::shared_ptr< Processor > endpoint, bool include_endpoint, bool for_export, bool for_freeze)
bool add(PropertyBase *prop)
LIBARDOUR_API PBD::PropertyDescriptor< bool > whole_file
ChanCount n_process_buffers()
XMLNode * deprecated_io_node
std::string string_compose(const std::string &fmt, const T1 &o1)
void set_diskstream(boost::shared_ptr< Diskstream >)
double atof(const string &s)
LIBARDOUR_API PBD::PropertyDescriptor< framecnt_t > length