use C++, dammit

This commit is contained in:
Paul Davis 2018-10-07 12:57:56 -04:00
parent ad4dc4460d
commit 8b1c8bb511
2 changed files with 7 additions and 9 deletions

View file

@ -213,7 +213,6 @@ TransportMastersWidget::rebuild ()
table.show_all (); table.show_all ();
// r->label_box.set_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
r->label_box.signal_button_press_event().connect (sigc::mem_fun (*r, &TransportMastersWidget::Row::name_press)); r->label_box.signal_button_press_event().connect (sigc::mem_fun (*r, &TransportMastersWidget::Row::name_press));
r->port_combo.signal_changed().connect (sigc::mem_fun (*r, &TransportMastersWidget::Row::port_choice_changed)); r->port_combo.signal_changed().connect (sigc::mem_fun (*r, &TransportMastersWidget::Row::port_choice_changed));
r->use_button.signal_toggled().connect (sigc::mem_fun (*r, &TransportMastersWidget::Row::use_button_toggled)); r->use_button.signal_toggled().connect (sigc::mem_fun (*r, &TransportMastersWidget::Row::use_button_toggled));
@ -267,13 +266,11 @@ TransportMastersWidget::Row::name_press (GdkEventButton* ev)
return false; return false;
} }
gboolean bool
TransportMastersWidget::Row::_idle_remove (gpointer arg) TransportMastersWidget::idle_remove (TransportMastersWidget::Row* row)
{ {
TransportMastersWidget::Row* row = (TransportMastersWidget::Row*) arg;
TransportMasterManager::instance().remove (row->tm->name()); TransportMasterManager::instance().remove (row->tm->name());
return false;
return FALSE; /* do not call again */
} }
void void
@ -282,7 +279,7 @@ TransportMastersWidget::Row::remove_clicked ()
/* have to do this via an idle callback, because it will destroy the /* have to do this via an idle callback, because it will destroy the
widget from which this callback was initiated. widget from which this callback was initiated.
*/ */
g_idle_add_full (G_PRIORITY_HIGH_IDLE + 10, _idle_remove, this, NULL); Glib::signal_idle().connect (sigc::bind (sigc::mem_fun (parent, &TransportMastersWidget::idle_remove), this));
} }
void void

View file

@ -126,8 +126,6 @@ class TransportMastersWidget : public Gtk::VBox, public ARDOUR::SessionHandlePtr
void prop_change (PBD::PropertyChange); void prop_change (PBD::PropertyChange);
void remove_clicked (); void remove_clicked ();
static gboolean _idle_remove (gpointer arg);
bool name_press (GdkEventButton*); bool name_press (GdkEventButton*);
void name_edited (std::string, int); void name_edited (std::string, int);
@ -149,6 +147,9 @@ class TransportMastersWidget : public Gtk::VBox, public ARDOUR::SessionHandlePtr
void rebuild (); void rebuild ();
void current_changed (boost::shared_ptr<ARDOUR::TransportMaster> old_master, boost::shared_ptr<ARDOUR::TransportMaster> new_master); void current_changed (boost::shared_ptr<ARDOUR::TransportMaster> old_master, boost::shared_ptr<ARDOUR::TransportMaster> new_master);
void add_master (); void add_master ();
public:
bool idle_remove (Row*);
}; };
class TransportMastersWindow : public ArdourWindow class TransportMastersWindow : public ArdourWindow