13
0

Allocate some thread-local buffers for the GUI thread so that the PluginEqGui impulse analysis can use them (fixes #4418).

git-svn-id: svn://localhost/ardour2/branches/3.0@10387 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2011-11-01 23:19:03 +00:00
parent 7c9c86af27
commit 337e010345
4 changed files with 32 additions and 1 deletions

View File

@ -78,6 +78,7 @@
#include "ardour/midi_track.h"
#include "ardour/filesystem_paths.h"
#include "ardour/filename_extensions.h"
#include "ardour/process_thread.h"
typedef uint64_t microseconds_t;
@ -332,6 +333,8 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
starting.connect (sigc::mem_fun(*this, &ARDOUR_UI::startup));
stopping.connect (sigc::mem_fun(*this, &ARDOUR_UI::shutdown));
_process_thread = new ProcessThread ();
_process_thread->init ();
}
/** @return true if a session was chosen and `apply' clicked, otherwise false if `cancel' was clicked */
@ -3851,3 +3854,17 @@ ARDOUR_UI::ambiguous_file (std::string file, std::string /*path*/, std::vector<s
dialog.run ();
return dialog.get_which ();
}
/** Allocate our thread-local buffers */
void
ARDOUR_UI::get_process_buffers ()
{
_process_thread->get_buffers ();
}
/** Drop our thread-local buffers */
void
ARDOUR_UI::drop_process_buffers ()
{
_process_thread->drop_buffers ();
}

View File

@ -105,6 +105,7 @@ namespace ARDOUR {
class Route;
class RouteGroup;
class Location;
class ProcessThread;
}
class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
@ -266,6 +267,9 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
void add_window_proxy (WindowProxyBase *);
void remove_window_proxy (WindowProxyBase *);
void get_process_buffers ();
void drop_process_buffers ();
protected:
friend class PublicEditor;
@ -724,6 +728,11 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
bool click_button_clicked (GdkEventButton *);
VisibilityGroup _status_bar_visibility;
/** A ProcessThread so that we have some thread-local buffers for use by
* PluginEqGui::impulse_analysis ().
*/
ARDOUR::ProcessThread* _process_thread;
};
#endif /* __ardour_gui_h__ */

View File

@ -317,6 +317,9 @@ PluginEqGui::signal_collect_callback(ARDOUR::BufferSet *in, ARDOUR::BufferSet *o
void
PluginEqGui::run_impulse_analysis()
{
/* Allocate some thread-local buffers so that Plugin::connect_and_run can use them */
ARDOUR_UI::instance()->get_process_buffers ();
uint32_t inputs = _plugin->get_info()->n_inputs.n_audio();
uint32_t outputs = _plugin->get_info()->n_outputs.n_audio();
@ -406,6 +409,8 @@ PluginEqGui::run_impulse_analysis()
// This signals calls expose_analysis_area()
_analysis_area->queue_draw();
ARDOUR_UI::instance()->drop_process_buffers ();
}
bool

View File

@ -337,7 +337,7 @@ ARDOUR::init (bool use_vst, bool try_optimization)
new PluginManager ();
ProcessThread::init ();
BufferManager::init (10); // XX should be num_processors_for_dsp
BufferManager::init (10); // XX should be num_processors_for_dsp + 1 for the GUI thread
PannerManager::instance().discover_panners();