From f07ca6397f5699e4dc4ec1e360f9e263d8a0d9ad Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 15 Mar 2012 21:40:17 +0000 Subject: radically rethink export/bounce/freeze code design. probably not 100% done by freeze+unfreeze now work and behave sensibly w.r.t. processors that do routing git-svn-id: svn://localhost/ardour2/branches/3.0@11701 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor_export_audio.cc | 8 ++++- gtk2_ardour/editor_ops.cc | 63 +++++++++++++++++++++++--------------- gtk2_ardour/time_fx_dialog.h | 1 + 3 files changed, 47 insertions(+), 25 deletions(-) (limited to 'gtk2_ardour') diff --git a/gtk2_ardour/editor_export_audio.cc b/gtk2_ardour/editor_export_audio.cc index 4a0424eb87..ac0c3f67c4 100644 --- a/gtk2_ardour/editor_export_audio.cc +++ b/gtk2_ardour/editor_export_audio.cc @@ -161,7 +161,13 @@ Editor::bounce_region_selection (bool with_processing) InterThreadInfo itt; - boost::shared_ptr r = track->bounce_range (region->position(), region->position() + region->length(), itt, with_processing); + boost::shared_ptr r; + + if (with_processing) { + r = track->bounce_range (region->position(), region->position() + region->length(), itt, track->main_outs(), false); + } else { + r = track->bounce_range (region->position(), region->position() + region->length(), itt, boost::shared_ptr(), false); + } } } diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 70606e28be..5060038f0e 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -3345,14 +3345,17 @@ Editor::unfreeze_route () void* Editor::_freeze_thread (void* arg) { - SessionEvent::create_per_thread_pool ("freeze events", 64); - return static_cast(arg)->freeze_thread (); } void* Editor::freeze_thread () { + /* create event pool because we may need to talk to the session */ + SessionEvent::create_per_thread_pool ("freeze events", 64); + /* create per-thread buffers for process() tree to use */ + current_interthread_info->process_thread.init (); + clicked_routeview->audio_track()->freeze_me (*current_interthread_info); current_interthread_info->done = true; return 0; @@ -3368,22 +3371,23 @@ Editor::freeze_route () /* stop transport before we start. this is important */ _session->request_transport_speed (0.0); + + /* wait for just a little while, because the above call is asynchronous */ + + ::usleep (250000); if (clicked_routeview == 0 || !clicked_routeview->is_audio_track()) { return; } - if (!clicked_routeview->track()->bounceable()) { - RouteTimeAxisView* rtv = dynamic_cast (clicked_routeview); - if (rtv && !rtv->track()->bounceable()) { - MessageDialog d ( - _("This route cannot be frozen because it has more outputs than inputs. " - "You can fix this by increasing the number of inputs.") - ); - d.set_title (_("Cannot freeze")); - d.run (); - return; - } + if (!clicked_routeview->track()->bounceable (clicked_routeview->track()->main_outs(), true)) { + MessageDialog d ( + _("This track/bus cannot be frozen because the signal adds or loses channels before reaching the outputs.\n" + "This is typically caused by plugins that generate stereo output from mono input or vice versa.") + ); + d.set_title (_("Cannot freeze")); + d.run (); + return; } InterThreadInfo itt; @@ -3413,16 +3417,21 @@ Editor::bounce_range_selection (bool replace, bool enable_processing) TrackSelection views = selection->tracks; for (TrackViewList::iterator i = views.begin(); i != views.end(); ++i) { - RouteTimeAxisView* rtv = dynamic_cast (*i); - if (rtv && rtv->track() && replace && enable_processing && !rtv->track()->bounceable()) { - MessageDialog d ( - _("You can't perform this operation because the processing of the signal " - "will cause one or more of the tracks will end up with a region with more channels than this track has inputs.\n\n" - "You can do this without processing, which is a different operation.") - ); - d.set_title (_("Cannot bounce")); - d.run (); - return; + + if (enable_processing) { + + RouteTimeAxisView* rtv = dynamic_cast (*i); + + if (rtv && rtv->track() && replace && enable_processing && !rtv->track()->bounceable (rtv->track()->main_outs(), false)) { + MessageDialog d ( + _("You can't perform this operation because the processing of the signal " + "will cause one or more of the tracks will end up with a region with more channels than this track has inputs.\n\n" + "You can do this without processing, which is a different operation.") + ); + d.set_title (_("Cannot bounce")); + d.run (); + return; + } } } @@ -3451,7 +3460,13 @@ Editor::bounce_range_selection (bool replace, bool enable_processing) playlist->clear_changes (); playlist->clear_owned_changes (); - boost::shared_ptr r = rtv->track()->bounce_range (start, start+cnt, itt, enable_processing); + boost::shared_ptr r; + + if (enable_processing) { + r = rtv->track()->bounce_range (start, start+cnt, itt, rtv->track()->main_outs(), false); + } else { + r = rtv->track()->bounce_range (start, start+cnt, itt, boost::shared_ptr(), false); + } if (!r) { continue; diff --git a/gtk2_ardour/time_fx_dialog.h b/gtk2_ardour/time_fx_dialog.h index be7c32c1e8..d47ba4265f 100644 --- a/gtk2_ardour/time_fx_dialog.h +++ b/gtk2_ardour/time_fx_dialog.h @@ -23,6 +23,7 @@ #include #include "ardour/playlist.h" +#include "ardour/timefx_request.h" #include "ardour_dialog.h" #include "region_selection.h" -- cgit v1.2.3