diff options
author | Sampo Savolainen <v2@iki.fi> | 2009-03-05 19:47:39 +0000 |
---|---|---|
committer | Sampo Savolainen <v2@iki.fi> | 2009-03-05 19:47:39 +0000 |
commit | a4ecfdedec66484809e37c85213a78eb38137754 (patch) | |
tree | 9bd87748cf2569c2c20d5787e6735fca6e8cb41c /libs | |
parent | cb3aaf44cb6d8262962c016ff148fedcb0dd71ba (diff) |
Make "consolidate range" and "bounce range to region list" not apply processing to the original audio. Added variants which do apply processing. Plus changed AudioTrack::export_stuff() to use SSE mix functions for non-automated gain.
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4736 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/audio_track.h | 4 | ||||
-rw-r--r-- | libs/ardour/ardour/session.h | 3 | ||||
-rw-r--r-- | libs/ardour/ardour/track.h | 2 | ||||
-rw-r--r-- | libs/ardour/audio_track.cc | 15 | ||||
-rw-r--r-- | libs/ardour/session.cc | 4 |
5 files changed, 14 insertions, 14 deletions
diff --git a/libs/ardour/ardour/audio_track.h b/libs/ardour/ardour/audio_track.h index 63fa2945e0..b9722637f4 100644 --- a/libs/ardour/ardour/audio_track.h +++ b/libs/ardour/ardour/audio_track.h @@ -54,13 +54,13 @@ class AudioTrack : public Track int use_diskstream (const PBD::ID& id); void use_new_diskstream (); - int export_stuff (vector<Sample*>& buffers, uint32_t nbufs, nframes_t nframes, nframes_t end_frame); + int export_stuff (vector<Sample*>& buffers, uint32_t nbufs, nframes_t nframes, nframes_t end_frame, bool enable_processing = true); void freeze (InterThreadInfo&); void unfreeze (); boost::shared_ptr<Region> bounce (InterThreadInfo&); - boost::shared_ptr<Region> bounce_range (nframes_t start, nframes_t end, InterThreadInfo&); + boost::shared_ptr<Region> bounce_range (nframes_t start, nframes_t end, InterThreadInfo&, bool enable_processing); int set_state(const XMLNode& node); diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 6c97349c50..8ca3714666 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -711,8 +711,7 @@ class Session : public PBD::StatefulDestructible /* flattening stuff */ - boost::shared_ptr<Region> write_one_audio_track (AudioTrack&, nframes_t start, nframes_t end, bool overwrite, vector<boost::shared_ptr<AudioSource> >&, - InterThreadInfo& wot); + boost::shared_ptr<Region> write_one_audio_track (AudioTrack&, nframes_t start, nframes_t end, bool overwrite, vector<boost::shared_ptr<AudioSource> >&, InterThreadInfo& wot, bool enable_processing = true); int freeze (InterThreadInfo&); /* session-wide solo/mute/rec-enable */ diff --git a/libs/ardour/ardour/track.h b/libs/ardour/ardour/track.h index e756b10699..6a1a4e2e7e 100644 --- a/libs/ardour/ardour/track.h +++ b/libs/ardour/ardour/track.h @@ -77,7 +77,7 @@ class Track : public Route virtual void unfreeze () = 0; virtual boost::shared_ptr<Region> bounce (InterThreadInfo&) = 0; - virtual boost::shared_ptr<Region> bounce_range (nframes_t start, nframes_t end, InterThreadInfo&) = 0; + virtual boost::shared_ptr<Region> bounce_range (nframes_t start, nframes_t end, InterThreadInfo&, bool enable_processing = true) = 0; XMLNode& get_state(); XMLNode& get_template(); diff --git a/libs/ardour/audio_track.cc b/libs/ardour/audio_track.cc index 920367ae94..7f411be413 100644 --- a/libs/ardour/audio_track.cc +++ b/libs/ardour/audio_track.cc @@ -37,6 +37,7 @@ #include <ardour/playlist_factory.h> #include <ardour/panner.h> #include <ardour/utils.h> +#include <ardour/mix.h> #include "i18n.h" @@ -740,7 +741,7 @@ AudioTrack::silent_roll (nframes_t nframes, nframes_t start_frame, nframes_t end } int -AudioTrack::export_stuff (vector<Sample*>& buffers, uint32_t nbufs, nframes_t start, nframes_t nframes) +AudioTrack::export_stuff (vector<Sample*>& buffers, uint32_t nbufs, nframes_t start, nframes_t nframes, bool enable_processing) { gain_t gain_automation[nframes]; gain_t gain_buffer[nframes]; @@ -778,6 +779,9 @@ AudioTrack::export_stuff (vector<Sample*>& buffers, uint32_t nbufs, nframes_t st } } + // If no processing is required, there's no need to go any further. + if (!enable_processing) + return 0; /* note: only run inserts during export. other layers in the machinery will already have checked that there are no external port inserts. @@ -812,10 +816,7 @@ AudioTrack::export_stuff (vector<Sample*>& buffers, uint32_t nbufs, nframes_t st } else { for (bi = buffers.begin(); bi != buffers.end(); ++bi) { - Sample *b = *bi; - for (nframes_t n = 0; n < nframes; ++n) { - b[n] *= this_gain; - } + apply_gain_to_buffer(*bi, nframes, this_gain); } } @@ -849,10 +850,10 @@ AudioTrack::bounce (InterThreadInfo& itt) boost::shared_ptr<Region> -AudioTrack::bounce_range (nframes_t start, nframes_t end, InterThreadInfo& itt) +AudioTrack::bounce_range (nframes_t start, nframes_t end, InterThreadInfo& itt, bool enable_processing) { vector<boost::shared_ptr<AudioSource> > srcs; - return _session.write_one_audio_track (*this, start, end, false, srcs, itt); + return _session.write_one_audio_track (*this, start, end, false, srcs, itt, enable_processing); } void diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 52f799695c..7ca817147e 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -4109,7 +4109,7 @@ Session::freeze (InterThreadInfo& itt) boost::shared_ptr<Region> Session::write_one_audio_track (AudioTrack& track, nframes_t start, nframes_t end, - bool overwrite, vector<boost::shared_ptr<AudioSource> >& srcs, InterThreadInfo& itt) + bool overwrite, vector<boost::shared_ptr<AudioSource> >& srcs, InterThreadInfo& itt, bool enable_processing) { boost::shared_ptr<Region> result; boost::shared_ptr<Playlist> playlist; @@ -4202,7 +4202,7 @@ Session::write_one_audio_track (AudioTrack& track, nframes_t start, nframes_t en this_chunk = min (to_do, chunk_size); - if (track.export_stuff (buffers, nchans, start, this_chunk)) { + if (track.export_stuff (buffers, nchans, start, this_chunk, enable_processing)) { goto out; } |