13
0

Make it possible to consolidate/bounce ranges without applying processing

git-svn-id: svn://localhost/ardour2/branches/3.0@4743 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Sampo Savolainen 2009-03-06 19:28:39 +00:00
parent 0697aed059
commit bb20bcc7b6
10 changed files with 24 additions and 16 deletions

View File

@ -2173,8 +2173,10 @@ Editor::add_selection_context_items (Menu_Helpers::MenuList& edit_items)
edit_items.push_back (MenuElem (_("Duplicate range"), bind (mem_fun(*this, &Editor::duplicate_dialog), false)));
edit_items.push_back (MenuElem (_("Create chunk from range"), mem_fun(*this, &Editor::create_named_selection)));
edit_items.push_back (SeparatorElem());
edit_items.push_back (MenuElem (_("Consolidate range"), bind (mem_fun(*this, &Editor::bounce_range_selection), true)));
edit_items.push_back (MenuElem (_("Bounce range to region list"), bind (mem_fun(*this, &Editor::bounce_range_selection), false)));
edit_items.push_back (MenuElem (_("Consolidate range"), bind (mem_fun(*this, &Editor::bounce_range_selection), true, false)));
edit_items.push_back (MenuElem (_("Consolidate range with processing"), bind (mem_fun(*this, &Editor::bounce_range_selection), true, true)));
edit_items.push_back (MenuElem (_("Bounce range to region list"), bind (mem_fun(*this, &Editor::bounce_range_selection), false, false)));
edit_items.push_back (MenuElem (_("Bounce range to region list with processing"), bind (mem_fun(*this, &Editor::bounce_range_selection), false, true)));
edit_items.push_back (MenuElem (_("Export range"), mem_fun(*this, &Editor::export_range)));
}

View File

@ -2067,7 +2067,7 @@ public:
int write_region_selection(RegionSelection&);
bool write_region (string path, boost::shared_ptr<ARDOUR::AudioRegion>);
void bounce_region_selection ();
void bounce_range_selection (bool replace);
void bounce_range_selection (bool replace, bool enable_processing);
void external_edit_region ();
int write_audio_selection (TimeSelection&);

View File

@ -3688,7 +3688,7 @@ Editor::freeze_route ()
}
void
Editor::bounce_range_selection (bool replace)
Editor::bounce_range_selection (bool replace, bool enable_processing)
{
if (selection->time.empty()) {
return;
@ -3723,7 +3723,7 @@ Editor::bounce_range_selection (bool replace)
itt.progress = false;
XMLNode &before = playlist->get_state();
boost::shared_ptr<Region> r = rtv->track()->bounce_range (start, start+cnt, itt);
boost::shared_ptr<Region> r = rtv->track()->bounce_range (start, start+cnt, itt, enable_processing);
if (replace) {
list<AudioRange> ranges;

View File

@ -53,13 +53,13 @@ class AudioTrack : public Track
int use_diskstream (string name);
int use_diskstream (const PBD::ID& id);
int export_stuff (BufferSet& bufs, nframes_t nframes, nframes_t end_frame);
int export_stuff (BufferSet& bufs, 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);

View File

@ -66,7 +66,8 @@ public:
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);

View File

@ -725,7 +725,8 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
/* flattening stuff */
boost::shared_ptr<Region> write_one_track (AudioTrack&, nframes_t start, nframes_t end,
bool overwrite, vector<boost::shared_ptr<Source> >&, InterThreadInfo& wot);
bool overwrite, vector<boost::shared_ptr<Source> >&, InterThreadInfo& wot,
bool enable_processing = true);
int freeze (InterThreadInfo&);
/* session-wide solo/mute/rec-enable */

View File

@ -78,7 +78,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();

View File

@ -722,7 +722,7 @@ AudioTrack::silent_roll (nframes_t nframes, nframes_t start_frame, nframes_t end
}
int
AudioTrack::export_stuff (BufferSet& buffers, nframes_t start, nframes_t nframes)
AudioTrack::export_stuff (BufferSet& buffers, nframes_t start, nframes_t nframes, bool enable_processing)
{
gain_t gain_automation[nframes];
gain_t gain_buffer[nframes];
@ -761,6 +761,9 @@ AudioTrack::export_stuff (BufferSet& buffers, nframes_t start, nframes_t nframes
}
}
// If no processing is required, there's no need to go any further.
if (!enable_processing)
return 0;
/* note: only run processors during export. other layers in the machinery
will already have checked that there are no external port processors.
@ -830,10 +833,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<Source> > srcs;
return _session.write_one_track (*this, start, end, false, srcs, itt);
return _session.write_one_track (*this, start, end, false, srcs, itt, enable_processing);
}
void

View File

@ -635,7 +635,7 @@ MidiTrack::bounce (InterThreadInfo& itt)
boost::shared_ptr<Region>
MidiTrack::bounce_range (nframes_t start, nframes_t end, InterThreadInfo& itt)
MidiTrack::bounce_range (nframes_t start, nframes_t end, InterThreadInfo& itt, bool enable_processing)
{
throw;
//vector<MidiSource*> srcs;

View File

@ -4055,7 +4055,8 @@ Session::freeze (InterThreadInfo& itt)
boost::shared_ptr<Region>
Session::write_one_track (AudioTrack& track, nframes_t start, nframes_t end,
bool overwrite, vector<boost::shared_ptr<Source> >& srcs, InterThreadInfo& itt)
bool overwrite, vector<boost::shared_ptr<Source> >& srcs,
InterThreadInfo& itt, bool enable_processing)
{
boost::shared_ptr<Region> result;
boost::shared_ptr<Playlist> playlist;
@ -4140,7 +4141,7 @@ Session::write_one_track (AudioTrack& track, nframes_t start, nframes_t end,
this_chunk = min (to_do, chunk_size);
if (track.export_stuff (buffers, start, this_chunk)) {
if (track.export_stuff (buffers, start, this_chunk, enable_processing)) {
goto out;
}