#endif
using namespace std;
-using namespace sigc;
using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
_active.set_active (_processor->active ());
_active.signal_toggled().connect (sigc::mem_fun (*this, &ProcessorEntry::active_toggled));
- _processor->ActiveChanged.connect (sigc::mem_fun (*this, &ProcessorEntry::processor_active_changed));
- _processor->NameChanged.connect (sigc::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
_vbox.pack_start (_fader);
_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &SendProcessorEntry::gain_adjusted));
- _send->amp()->gain_control()->Changed.connect (sigc::mem_fun (*this, &SendProcessorEntry::show_gain));
+ _send->amp()->gain_control()->Changed.connect (send_gain_connection, boost::bind (&SendProcessorEntry::show_gain, this), gui_context());
show_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;
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 (sigc::mem_fun (*this, &ProcessorBox::route_processors_changed)));
- connections.push_back (_route->GoingAway.connect (
- sigc::mem_fun (*this, &ProcessorBox::route_going_away)));
- connections.push_back (_route->NameChanged.connect (
- sigc::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 ();
}
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;
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);
}
{
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 */
is closed.
*/
- IOSelectorWindow *ios = new IOSelectorWindow (&_session, send->output(), true);
+ IOSelectorWindow *ios = new IOSelectorWindow (_session, send->output(), true);
ios->show_all ();
/* keep a reference to the send so it doesn't get deleted while
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
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;
PortInsertWindow *io_selector;
if (port_insert->get_gui() == 0) {
- io_selector = new PortInsertWindow (&_session, port_insert);
+ io_selector = new PortInsertWindow (_session, port_insert);
port_insert->set_gui (io_selector);
} else {
}
void
-ProcessorBox::route_name_changed ()
+ProcessorBox::route_property_changed (const PropertyChange& what_changed)
{
- ENSURE_GUI_THREAD (*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;