#endif
using namespace std;
-using namespace sigc;
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
_name.set_padding (2, 2);
_active.set_active (_processor->active ());
- _active.signal_toggled().connect (mem_fun (*this, &ProcessorEntry::active_toggled));
+ _active.signal_toggled().connect (sigc::mem_fun (*this, &ProcessorEntry::active_toggled));
- _processor->ActiveChanged.connect (mem_fun (*this, &ProcessorEntry::processor_active_changed));
- _processor->NameChanged.connect (mem_fun (*this, &ProcessorEntry::processor_name_changed));
+ _processor->ActiveChanged.connect (active_connection, boost::bind (&ProcessorEntry::processor_active_changed, this), gui_context());
+ _processor->PropertyChanged.connect (name_connection, ui_bind (&ProcessorEntry::processor_property_changed, this, _1), gui_context());
}
EventBox&
}
void
-ProcessorEntry::processor_name_changed ()
+ProcessorEntry::processor_property_changed (const PropertyChange& what_changed)
{
- _name.set_text (name ());
+ if (what_changed.contains (ARDOUR::Properties::name)) {
+ _name.set_text (name ());
+ }
}
string
_fader.set_controllable (_send->amp()->gain_control ());
_vbox.pack_start (_fader);
- _adjustment.signal_value_changed().connect (mem_fun (*this, &SendProcessorEntry::gain_adjusted));
- _send->amp()->gain_control()->Changed.connect (mem_fun (*this, &SendProcessorEntry::show_gain));
+ _adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &SendProcessorEntry::gain_adjusted));
+ _send->amp()->gain_control()->Changed.connect (send_gain_connection, boost::bind (&SendProcessorEntry::show_gain, this), gui_context());
show_gain ();
}
void
SendProcessorEntry::show_gain ()
{
- ENSURE_GUI_THREAD (mem_fun (*this, &SendProcessorEntry::show_gain));
+ ENSURE_GUI_THREAD (*this, &SendProcessorEntry::show_gain)
float const value = gain_to_slider_position (_send->amp()->gain ());
_fader.set_fader_length (p);
}
-ProcessorBox::ProcessorBox (ARDOUR::Session& sess, sigc::slot<PluginSelector*> get_plugin_selector,
- RouteRedirectSelection& rsel, MixerStrip* parent, bool owner_is_mixer)
- : _session(sess)
- , _parent_strip (parent)
+ProcessorBox::ProcessorBox (ARDOUR::Session* sess, boost::function<PluginSelector*()> get_plugin_selector,
+ RouteRedirectSelection& rsel, MixerStrip* parent, bool owner_is_mixer)
+ : _parent_strip (parent)
, _owner_is_mixer (owner_is_mixer)
, ab_direction (true)
, _get_plugin_selector (get_plugin_selector)
, _placement(PreFader)
, _rr_selection(rsel)
{
+ set_session (sess);
+
_width = Wide;
processor_menu = 0;
send_action_menu = 0;
processor_display.set_size_request (48, -1);
processor_display.set_data ("processorbox", this);
- processor_display.signal_enter_notify_event().connect (mem_fun(*this, &ProcessorBox::enter_notify), false);
- processor_display.signal_leave_notify_event().connect (mem_fun(*this, &ProcessorBox::leave_notify), false);
+ processor_display.signal_enter_notify_event().connect (sigc::mem_fun(*this, &ProcessorBox::enter_notify), false);
+ processor_display.signal_leave_notify_event().connect (sigc::mem_fun(*this, &ProcessorBox::leave_notify), false);
- processor_display.signal_key_press_event().connect (mem_fun(*this, &ProcessorBox::processor_key_press_event));
- processor_display.signal_key_release_event().connect (mem_fun(*this, &ProcessorBox::processor_key_release_event));
+ processor_display.signal_key_press_event().connect (sigc::mem_fun(*this, &ProcessorBox::processor_key_press_event));
+ processor_display.signal_key_release_event().connect (sigc::mem_fun(*this, &ProcessorBox::processor_key_release_event));
- processor_display.ButtonPress.connect (mem_fun (*this, &ProcessorBox::processor_button_press_event));
- processor_display.ButtonRelease.connect (mem_fun (*this, &ProcessorBox::processor_button_release_event));
+ processor_display.ButtonPress.connect (sigc::mem_fun (*this, &ProcessorBox::processor_button_press_event));
+ processor_display.ButtonRelease.connect (sigc::mem_fun (*this, &ProcessorBox::processor_button_release_event));
- processor_display.Reordered.connect (mem_fun (*this, &ProcessorBox::reordered));
- processor_display.DropFromAnotherBox.connect (mem_fun (*this, &ProcessorBox::object_drop));
- processor_display.SelectionChanged.connect (mem_fun (*this, &ProcessorBox::selection_changed));
+ processor_display.Reordered.connect (sigc::mem_fun (*this, &ProcessorBox::reordered));
+ processor_display.DropFromAnotherBox.connect (sigc::mem_fun (*this, &ProcessorBox::object_drop));
+ processor_display.SelectionChanged.connect (sigc::mem_fun (*this, &ProcessorBox::selection_changed));
}
ProcessorBox::~ProcessorBox ()
return;
}
- connections.clear ();
+ connections.drop_connections();
/* new route: any existing block on processor redisplay must be meaningless */
no_processor_redisplay = false;
_route = r;
- connections.push_back (_route->processors_changed.connect (mem_fun (*this, &ProcessorBox::route_processors_changed)));
- connections.push_back (_route->GoingAway.connect (
- mem_fun (*this, &ProcessorBox::route_going_away)));
- connections.push_back (_route->NameChanged.connect (
- mem_fun(*this, &ProcessorBox::route_name_changed)));
+ _route->processors_changed.connect (connections, ui_bind (&ProcessorBox::route_processors_changed, this, _1), gui_context());
+ _route->DropReferences.connect (connections, boost::bind (&ProcessorBox::route_going_away, this), gui_context());
+ _route->PropertyChanged.connect (connections, ui_bind (&ProcessorBox::route_property_changed, this, _1), gui_context());
redisplay_processors ();
}
send_action_menu->set_name ("ArdourContextMenu");
MenuList& items = send_action_menu->items();
- items.push_back (MenuElem (_("New send"), mem_fun(*this, &ProcessorBox::new_send)));
- items.push_back (MenuElem (_("Show send controls"), mem_fun(*this, &ProcessorBox::show_send_controls)));
+ items.push_back (MenuElem (_("New send"), sigc::mem_fun(*this, &ProcessorBox::new_send)));
+ items.push_back (MenuElem (_("Show send controls"), sigc::mem_fun(*this, &ProcessorBox::show_send_controls)));
}
Gtk::Menu*
ProcessorBox::build_possible_aux_menu ()
{
- boost::shared_ptr<RouteList> rl = _session.get_routes_with_internal_returns();
+ boost::shared_ptr<RouteList> rl = _session->get_routes_with_internal_returns();
if (rl->empty()) {
return 0;
for (RouteList::iterator r = rl->begin(); r != rl->end(); ++r) {
if (!_route->internal_send_for (*r) && *r != _route) {
- items.push_back (MenuElem ((*r)->name(), bind (sigc::ptr_fun (ProcessorBox::rb_choose_aux), boost::weak_ptr<Route>(*r))));
+ items.push_back (MenuElem ((*r)->name(), sigc::bind (sigc::ptr_fun (ProcessorBox::rb_choose_aux), boost::weak_ptr<Route>(*r))));
}
}
if (processor && (Keyboard::is_edit_event (ev) || (ev->button == 1 && ev->type == GDK_2BUTTON_PRESS))) {
- if (_session.engine().connected()) {
+ if (_session->engine().connected()) {
/* XXX giving an error message here is hard, because we may be in the midst of a button press */
edit_processor (processor);
}
if (processor && Keyboard::is_delete_event (ev)) {
- Glib::signal_idle().connect (bind (
- mem_fun(*this, &ProcessorBox::idle_delete_processor),
+ Glib::signal_idle().connect (sigc::bind (
+ sigc::mem_fun(*this, &ProcessorBox::idle_delete_processor),
boost::weak_ptr<Processor>(processor)));
ret = true;
{
for (SelectedPlugins::const_iterator p = plugins.begin(); p != plugins.end(); ++p) {
- boost::shared_ptr<Processor> processor (new PluginInsert (_session, *p));
+ boost::shared_ptr<Processor> processor (new PluginInsert (*_session, *p));
Route::ProcessorStreams err_streams;
void
ProcessorBox::choose_insert ()
{
- boost::shared_ptr<Processor> processor (new PortInsert (_session, _route->mute_master()));
+ boost::shared_ptr<Processor> processor (new PortInsert (*_session, _route->mute_master()));
_route->add_processor (processor, _placement);
}
void
ProcessorBox::choose_send ()
{
- boost::shared_ptr<Send> send (new Send (_session, _route->mute_master()));
+ boost::shared_ptr<Send> send (new Send (*_session, _route->mute_master()));
/* make an educated guess at the initial number of outputs for the send */
- ChanCount outs = (_session.master_out())
- ? _session.master_out()->n_outputs()
+ ChanCount outs = (_session->master_out())
+ ? _session->master_out()->n_outputs()
: _route->n_outputs();
/* XXX need processor lock on route */
*/
_processor_being_created = send;
- ios->selector().Finished.connect (bind (
- mem_fun(*this, &ProcessorBox::send_io_finished),
+ ios->selector().Finished.connect (sigc::bind (
+ sigc::mem_fun(*this, &ProcessorBox::send_io_finished),
boost::weak_ptr<Processor>(send), ios));
}
boost::shared_ptr<RouteList> rlist (new RouteList);
rlist->push_back (_route);
- _session.add_internal_sends (target, PreFader, rlist);
+ _session->add_internal_sends (target, PreFader, rlist);
}
void
void
ProcessorBox::redisplay_processors ()
{
- ENSURE_GUI_THREAD (mem_fun(*this, &ProcessorBox::redisplay_processors));
+ ENSURE_GUI_THREAD (*this, &ProcessorBox::redisplay_processors)
if (no_processor_redisplay) {
return;
processor_display.clear ();
- _route->foreach_processor (mem_fun (*this, &ProcessorBox::add_processor_to_display));
+ _route->foreach_processor (sigc::mem_fun (*this, &ProcessorBox::add_processor_to_display));
build_processor_tooltip (processor_eventbox, _("Inserts, sends & plugins:"));
}
tip += (*i)->processor()->name();
}
- ARDOUR_UI::instance()->tooltips().set_tip (box, tip);
+ ARDOUR_UI::instance()->set_tip (box, tip);
}
void
Label label;
label.set_text (_("\
-You cannot reorder this set of processors\n\
+You cannot reorder these plugins/sends/inserts\n\
in that way because the inputs and\n\
-outputs do not work correctly."));
+outputs will not work correctly."));
+ dialog.get_vbox()->set_border_width (12);
dialog.get_vbox()->pack_start (label);
dialog.add_button (Stock::OK, RESPONSE_ACCEPT);
case Gtk::RESPONSE_ACCEPT:
name_prompter.get_result (result);
if (result.length()) {
- if (_session.route_by_name (result)) {
+ if (_session->route_by_name (result)) {
ARDOUR_UI::instance()->popup_error (_("A track already exists with that name."));
return;
}
} else if (type->value() == "send") {
XMLNode n (**niter);
- Send::make_unique (n, _session);
- p.reset (new Send (_session, _route->mute_master(), n));
+ Send::make_unique (n, *_session);
+ p.reset (new Send (*_session, _route->mute_master(), n));
} else if (type->value() == "return") {
XMLNode n (**niter);
- Return::make_unique (n, _session);
- p.reset (new Return (_session, **niter));
+ Return::make_unique (n, *_session);
+ p.reset (new Return (*_session, **niter));
} else {
/* XXX its a bit limiting to assume that everything else
is a plugin.
*/
- p.reset (new PluginInsert (_session, **niter));
+ p.reset (new PluginInsert (*_session, **niter));
}
copies.push_back (p);
choices.push_back (_("Cancel"));
choices.push_back (_("Yes, remove them all"));
- Gtkmm2ext::Choice prompter (prompt, choices);
+ Gtkmm2ext::Choice prompter (_("Remove processors"), prompt, choices);
if (prompter.run () == 1) {
_route->clear_processors (PreFader);
choices.push_back (_("Cancel"));
choices.push_back (_("Yes, remove them all"));
- Gtkmm2ext::Choice prompter (prompt, choices);
+ Gtkmm2ext::Choice prompter (_("Remove processors"), prompt, choices);
if (prompter.run () == 1) {
_route->clear_processors (p);
if ((send = boost::dynamic_pointer_cast<Send> (processor)) != 0) {
- if (!_session.engine().connected()) {
+ if (!_session->engine().connected()) {
return;
}
} else if ((retrn = boost::dynamic_pointer_cast<Return> (processor)) != 0) {
- if (!_session.engine().connected()) {
+ if (!_session->engine().connected()) {
return;
}
} else if ((port_insert = boost::dynamic_pointer_cast<PortInsert> (processor)) != 0) {
- if (!_session.engine().connected()) {
+ if (!_session->engine().connected()) {
MessageDialog msg ( _("Not connected to JACK - no I/O changes are possible"));
msg.run ();
return;
}
void
-ProcessorBox::route_name_changed ()
+ProcessorBox::route_property_changed (const PropertyChange& what_changed)
{
- ENSURE_GUI_THREAD (mem_fun (*this, &ProcessorBox::route_name_changed));
+ if (!what_changed.contains (ARDOUR::Properties::name)) {
+ return;
+ }
+
+ ENSURE_GUI_THREAD (*this, &ProcessorBox::route_property_changed, what_changed);
boost::shared_ptr<Processor> processor;
boost::shared_ptr<PluginInsert> plugin_insert;