X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Faudio_track.cc;h=33a5ba8f370a7f8376f7bc338ad61623fcd11e87;hb=1fdb3560e85e3f16944568005365b4482643ac02;hp=8e14fff40225e36cc05d3ed562f7e07d756a16c1;hpb=f4b5f4c72ee60b6f509e307c5bfd164108d1f30b;p=ardour.git diff --git a/libs/ardour/audio_track.cc b/libs/ardour/audio_track.cc index 8e14fff402..33a5ba8f37 100644 --- a/libs/ardour/audio_track.cc +++ b/libs/ardour/audio_track.cc @@ -244,7 +244,7 @@ AudioTrack::set_state_part_two () { XMLNode* fnode; XMLProperty* prop; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); /* This is called after all session state has been restored but before have been made ports and connections are established. @@ -350,6 +350,16 @@ AudioTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_fram return dret; } + if (_mute_control->list() && _mute_control->automation_playback()) { + bool valid = false; + const float mute = _mute_control->list()->rt_safe_eval(transport_frame, valid); + if (mute >= 0.5 && !muted()) { + _mute_control->set_value(1.0); // mute + } else if (mute < 0.5 && muted()) { + _mute_control->set_value(0.0); // unmute + } + } + _silent = false; _amp->apply_gain_automation(false); @@ -369,6 +379,13 @@ AudioTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_fram process_output_buffers (bufs, start_frame, end_frame, nframes, declick, (!diskstream->record_enabled() && _session.transport_rolling())); + for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) { + boost::shared_ptr d = boost::dynamic_pointer_cast (*i); + if (d) { + d->flush_buffers (nframes); + } + } + need_butler = diskstream->commit (playback_distance); return 0; @@ -376,7 +393,7 @@ AudioTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_fram int AudioTrack::export_stuff (BufferSet& buffers, framepos_t start, framecnt_t nframes, - boost::shared_ptr endpoint, bool include_endpoint, bool for_export) + boost::shared_ptr endpoint, bool include_endpoint, bool for_export, bool for_freeze) { boost::scoped_array gain_buffer (new gain_t[nframes]); boost::scoped_array mix_buffer (new Sample[nframes]); @@ -410,38 +427,7 @@ AudioTrack::export_stuff (BufferSet& buffers, framepos_t start, framecnt_t nfram } } - // If no processing is required, there's no need to go any further. - - if (!endpoint && !include_endpoint) { - return 0; - } - - for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) { - - if (!include_endpoint && (*i) == endpoint) { - break; - } - - /* if we're not exporting, stop processing if we come across a routing processor. - */ - - if (!for_export && (*i)->does_routing()) { - break; - } - - /* even for export, don't run any processor that does routing. - - oh, and don't bother with the peak meter either. - */ - - if (!(*i)->does_routing() && !boost::dynamic_pointer_cast(*i)) { - (*i)->run (buffers, start, start+nframes, nframes, true); - } - - if ((*i) == endpoint) { - break; - } - } + bounce_process (buffers, start, nframes, endpoint, include_endpoint, for_export, for_freeze); return 0; } @@ -514,7 +500,7 @@ AudioTrack::bounce_range (framepos_t start, framepos_t end, InterThreadInfo& itt boost::shared_ptr endpoint, bool include_endpoint) { vector > srcs; - return _session.write_one_track (*this, start, end, false, srcs, itt, endpoint, include_endpoint, false); + return _session.write_one_track (*this, start, end, false, srcs, itt, endpoint, include_endpoint, false, false); } void @@ -557,8 +543,8 @@ AudioTrack::freeze_me (InterThreadInfo& itt) boost::shared_ptr res; - if ((res = _session.write_one_track (*this, _session.current_start_frame(), _session.current_end_frame(), true, srcs, itt, - main_outs(), false, false)) == 0) { + if ((res = _session.write_one_track (*this, _session.current_start_frame(), _session.current_end_frame(), + true, srcs, itt, main_outs(), false, false, true)) == 0) { return; } @@ -569,7 +555,10 @@ AudioTrack::freeze_me (InterThreadInfo& itt) for (ProcessorList::iterator r = _processors.begin(); r != _processors.end(); ++r) { - if (!(*r)->does_routing() && !boost::dynamic_pointer_cast(*r)) { + if ((*r)->does_routing() && (*r)->active()) { + break; + } + if (!boost::dynamic_pointer_cast(*r)) { FreezeRecordProcessorInfo* frii = new FreezeRecordProcessorInfo ((*r)->get_state(), (*r)); @@ -577,9 +566,10 @@ AudioTrack::freeze_me (InterThreadInfo& itt) _freeze_record.processor_info.push_back (frii); - /* now deactivate the processor */ - - (*r)->deactivate (); + /* now deactivate the processor, */ + if (!boost::dynamic_pointer_cast(*r)) { + (*r)->deactivate (); + } } _session.set_dirty (); @@ -613,7 +603,7 @@ AudioTrack::freeze_me (InterThreadInfo& itt) /* reset stuff that has already been accounted for in the freeze process */ - set_gain (1.0, this); + set_gain (GAIN_COEFF_UNITY, this); _amp->gain_control()->set_automation_state (Off); /* XXX need to use _main_outs _panner->set_automation_state (Off); */