From 491f3f6e448f5cde73a1af8bac22990dffe55106 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 26 May 2014 06:17:49 +0200 Subject: process effect-automation when bouncing w/processing --- libs/ardour/ardour/plugin_insert.h | 2 +- libs/ardour/ardour/session.h | 7 ++++++- libs/ardour/plugin_insert.cc | 10 +++++----- libs/ardour/session.cc | 4 ++++ 4 files changed, 16 insertions(+), 7 deletions(-) (limited to 'libs') diff --git a/libs/ardour/ardour/plugin_insert.h b/libs/ardour/ardour/plugin_insert.h index 627c847513..f1c03a79d2 100644 --- a/libs/ardour/ardour/plugin_insert.h +++ b/libs/ardour/ardour/plugin_insert.h @@ -177,7 +177,7 @@ class LIBARDOUR_API PluginInsert : public Processor /** details of the match currently being used */ Match _match; - void automation_run (BufferSet& bufs, pframes_t nframes); + void automation_run (BufferSet& bufs, framepos_t start, pframes_t nframes); void connect_and_run (BufferSet& bufs, pframes_t nframes, framecnt_t offset, bool with_auto, framepos_t now = 0); void create_automatable_parameters (); diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 40ada138a6..a2949c59cc 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -791,6 +791,10 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop return _exporting; } + bool bounce_processing() const { + return _bounce_processing_active; + } + /* this is a private enum, but setup_enum_writer() needs it, and i can't find a way to give that function friend access. sigh. @@ -928,6 +932,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop mutable gint processing_prohibited; process_function_type process_function; process_function_type last_process_function; + bool _bounce_processing_active; bool waiting_for_sync_offset; framecnt_t _base_frame_rate; framecnt_t _current_frame_rate; //this includes video pullup offset @@ -982,7 +987,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop void process_without_events (pframes_t); void process_with_events (pframes_t); void process_audition (pframes_t); - int process_export (pframes_t); + int process_export (pframes_t); int process_export_fw (pframes_t); void block_processing() { g_atomic_int_set (&processing_prohibited, 1); } diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index 6fbb5cb679..27cae70b62 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -455,13 +455,13 @@ PluginInsert::silence (framecnt_t nframes) } void -PluginInsert::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_frame*/, pframes_t nframes, bool) +PluginInsert::run (BufferSet& bufs, framepos_t start_frame, framepos_t /*end_frame*/, pframes_t nframes, bool) { if (_pending_active) { /* run as normal if we are active or moving from inactive to active */ - if (_session.transport_rolling()) { - automation_run (bufs, nframes); + if (_session.transport_rolling() || _session.bounce_processing()) { + automation_run (bufs, start_frame, nframes); } else { connect_and_run (bufs, nframes, 0, false); } @@ -538,10 +538,10 @@ PluginInsert::get_parameter (Evoral::Parameter param) } void -PluginInsert::automation_run (BufferSet& bufs, pframes_t nframes) +PluginInsert::automation_run (BufferSet& bufs, framepos_t start, pframes_t nframes) { Evoral::ControlEvent next_event (0, 0.0f); - framepos_t now = _session.transport_frame (); + framepos_t now = start; framepos_t end = now + nframes; framecnt_t offset = 0; diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 4221dceb6a..d6add56c6b 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -137,6 +137,7 @@ Session::Session (AudioEngine &eng, : playlists (new SessionPlaylists) , _engine (eng) , process_function (&Session::process_with_events) + , _bounce_processing_active (false) , waiting_for_sync_offset (false) , _base_frame_rate (0) , _current_frame_rate (0) @@ -4169,6 +4170,8 @@ Session::write_one_track (AudioTrack& track, framepos_t start, framepos_t end, Glib::Threads::Mutex::Lock lm (_engine.process_lock()); } + _bounce_processing_active = true; + _engine.main_thread()->get_buffers (); /* call tree *MUST* hold route_lock */ @@ -4334,6 +4337,7 @@ Session::write_one_track (AudioTrack& track, framepos_t start, framepos_t end, } } + _bounce_processing_active = false; if (need_block_size_reset) { track.set_block_size (get_block_size()); -- cgit v1.2.3