OptionEditorComponent::add_widget_to_page (OptionEditorPage* p, Gtk::Widget* w)
{
int const n = p->table.property_n_rows();
- p->table.resize (n + 1, 3);
+ int m = n + 1;
+ if (!_note.empty ()) {
+ ++m;
+ }
+
+ p->table.resize (m, 3);
p->table.attach (*w, 1, 3, n, n + 1, FILL | EXPAND);
+
+ maybe_add_note (p, n + 1);
}
void
OptionEditorComponent::add_widgets_to_page (OptionEditorPage* p, Gtk::Widget* wa, Gtk::Widget* wb)
{
int const n = p->table.property_n_rows();
- p->table.resize (n + 1, 3);
+ int m = n + 1;
+ if (!_note.empty ()) {
+ ++m;
+ }
+
+ p->table.resize (m, 3);
p->table.attach (*wa, 1, 2, n, n + 1, FILL);
p->table.attach (*wb, 2, 3, n, n + 1, FILL | EXPAND);
+
+ maybe_add_note (p, n + 1);
+}
+
+void
+OptionEditorComponent::maybe_add_note (OptionEditorPage* p, int n)
+{
+ if (!_note.empty ()) {
+ Gtk::Label* l = manage (new Gtk::Label (string_compose (X_("<i>%1</i>"), _note)));
+ l->set_use_markup (true);
+ p->table.attach (*l, 1, 3, n, n + 1, FILL | EXPAND);
+ }
+}
+
+void
+OptionEditorComponent::set_note (string const & n)
+{
+ _note = n;
}
OptionEditorHeading::OptionEditorHeading (string const & h)
void add_widget_to_page (OptionEditorPage*, Gtk::Widget*);
void add_widgets_to_page (OptionEditorPage*, Gtk::Widget*, Gtk::Widget*);
+
+ void set_note (std::string const &);
+
+private:
+ void maybe_add_note (OptionEditorPage *, int);
+
+ std::string _note;
};
/** A component which provides a subheading within the dialog */
procs->add (i, string_compose (_("%1 processors"), i));
}
+ procs->set_note (_("This setting will only take effect when Ardour is restarted."));
+
add_option (_("Misc"), procs);
}
private:
std::list<pthread_t> _thread_list;
volatile bool _quit_threads;
- PBD::ScopedConnection processor_usage_connection;
- void parameter_changed (std::string);
void reset_thread_list ();
void drop_threads ();
reset_thread_list ();
- Config->ParameterChanged.connect_same_thread (processor_usage_connection, boost::bind (&Graph::parameter_changed, this, _1));
-
#ifdef DEBUG_RT_ALLOC
graph = this;
pbd_alloc_allowed = &::alloc_allowed;
#endif
}
-void
-Graph::parameter_changed (std::string param)
-{
- if (param == X_("processor-usage")) {
- reset_thread_list ();
- }
-}
-
/** Set up threads for running the graph */
void
Graph::reset_thread_list ()
{
uint32_t num_threads = how_many_dsp_threads ();
+ /* For now, we shouldn't be using the graph code if we only have 1 DSP thread */
+ assert (num_threads > 1);
+
/* don't bother doing anything here if we already have the right
number of threads.
*/
drop_threads ();
}
-#if 0
- /* XXX this only makes sense when we can use just the AudioEngine thread
- and still keep the graph current with the route list
- */
- if (num_threads <= 1) {
- /* no point creating 1 thread - the AudioEngine already gives us one
- */
- return;
- }
-#endif
if (AudioEngine::instance()->create_process_thread (boost::bind (&Graph::main_thread, this), &a_thread, 100000) == 0) {
_thread_list.push_back (a_thread);
}
, _post_transport_work (0)
, _send_timecode_update (false)
, _all_route_group (new RouteGroup (*this, "all"))
- , _process_graph (new Graph (*this))
, routes (new RouteList)
, _total_free_4k_blocks (0)
, _bundles (new BundleList)
{
_locations = new Locations (*this);
+ if (how_many_dsp_threads () > 1) {
+ /* For now, only create the graph if we are using >1 DSP threads, as
+ it is a bit slower than the old code with 1 thread.
+ */
+ _process_graph.reset (new Graph (*this));
+ }
+
playlists.reset (new SessionPlaylists);
_all_route_group->set_active (true, this);
/* writer goes out of scope and forces update */
}
- //_process_graph->dump(1);
-
#ifndef NDEBUG
boost::shared_ptr<RouteList> rl = routes.reader ();
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
Note: the process graph rechain does not require a
topologically-sorted list, but hey ho.
*/
- _process_graph->rechain (sorted_routes, edges);
+ if (_process_graph) {
+ _process_graph->rechain (sorted_routes, edges);
+ }
+
_current_route_graph = edges;
/* Complete the building of the routes' lists of what directly
*/
resort_routes ();
- _process_graph->clear_other_chain ();
+ if (_process_graph) {
+ _process_graph->clear_other_chain ();
+ }
/* get rid of it from the dead wood collection in the route list manager */
_click_io->silence (nframes);
}
- if (1 || _process_graph->threads_in_use() > 0) {
+ if (_process_graph) {
DEBUG_TRACE(DEBUG::ProcessThreads,"calling graph/no-roll\n");
_process_graph->routes_no_roll( nframes, _transport_frame, end_frame, non_realtime_work_pending(), declick);
} else {
const framepos_t start_frame = _transport_frame;
const framepos_t end_frame = _transport_frame + floor (nframes * _transport_speed);
- /* XXX this is hack to force use of the graph even if we are only
- using 1 thread. its needed because otherwise when we remove
- tracks, the graph never gets updated.
- */
- if (1 || _process_graph->threads_in_use() > 0) {
+ if (_process_graph) {
DEBUG_TRACE(DEBUG::ProcessThreads,"calling graph/process-routes\n");
_process_graph->process_routes (nframes, start_frame, end_frame, declick, need_butler);
} else {
const framepos_t start_frame = _transport_frame;
const framepos_t end_frame = _transport_frame + lrintf(nframes * _transport_speed);
- /* XXX this is hack to force use of the graph even if we are only
- using 1 thread. its needed because otherwise when we remove
- tracks, the graph never gets updated.
- */
- if (1 || _process_graph->threads_in_use() > 0) {
+ if (_process_graph) {
_process_graph->silent_process_routes (nframes, start_frame, end_frame, need_butler);
} else {
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {