- selector_button_box.set_spacing (5);
- selector_button_box.set_border_width (5);
-
- selector_box.set_spacing (5);
- selector_box.set_border_width (5);
- selector_box.pack_start (notebook);
- selector_box.pack_start (selector_button_box, false, false);
-
- selector_frame.add (selector_box);
-
- port_box.set_spacing (5);
- port_box.set_border_width (5);
-
- port_display_scroller.set_name ("IOSelectorNotebook");
- port_display_scroller.set_border_width (0);
- port_display_scroller.set_size_request (-1, 170);
- port_display_scroller.add (port_box);
- port_display_scroller.set_policy (POLICY_NEVER,
- POLICY_AUTOMATIC);
-
- port_button_box.set_spacing (5);
- port_button_box.set_border_width (5);
-
- port_button_box.pack_start (add_port_button, false, false);
-
- if (for_input) {
- if (io.input_maximum() < 0 || io.input_maximum() > (int) io.n_inputs()) {
- add_port_button.set_sensitive (true);
- } else {
- add_port_button.set_sensitive (false);
- }
-
- } else {
- if (io.output_maximum() < 0 || io.output_maximum() > (int) io.n_outputs()) {
- add_port_button.set_sensitive (true);
- } else {
- add_port_button.set_sensitive (false);
- }
-
- }
-
- port_button_box.pack_start (remove_port_button, false, false);
-
- if (for_input) {
- if (io.input_minimum() < 0 || io.input_minimum() < (int) io.n_inputs()) {
- remove_port_button.set_sensitive (true);
- } else {
- remove_port_button.set_sensitive (false);
- }
-
- } else {
- if (io.output_minimum() < 0 || io.output_minimum() < (int) io.n_outputs()) {
- remove_port_button.set_sensitive (true);
- } else {
- remove_port_button.set_sensitive (false);
- }
- }
-
- port_button_box.pack_start (clear_connections_button, false, false);
-
- port_and_button_box.set_border_width (5);
- port_and_button_box.pack_start (port_button_box, false, false);
- port_and_button_box.pack_start (port_display_scroller);
-
- port_frame.add (port_and_button_box);
-
- port_and_selector_box.set_spacing (5);
- port_and_selector_box.pack_start (port_frame);
- port_and_selector_box.pack_start (selector_frame);
-
- set_spacing (5);
- set_border_width (5);
- pack_start (port_and_selector_box);
-
- rescan();
- display_ports ();
-
- clear_connections_button.signal_clicked().connect (mem_fun(*this, &IOSelector::clear_connections));
-
- add_port_button.signal_clicked().connect (mem_fun(*this, &IOSelector::add_port));
- remove_port_button.signal_clicked().connect (mem_fun(*this, &IOSelector::remove_port));
-
- if (for_input) {
- io.input_changed.connect (mem_fun(*this, &IOSelector::ports_changed));
- } else {
- io.output_changed.connect (mem_fun(*this, &IOSelector::ports_changed));
- }
-
- io.name_changed.connect (mem_fun(*this, &IOSelector::name_changed));
-}
-
-IOSelector::~IOSelector ()
-{
-}
-
-void
-IOSelector::name_changed (void* src)
-{
- ENSURE_GUI_THREAD(bind (mem_fun(*this, &IOSelector::name_changed), src));
-
- display_ports ();
-}
-
-void
-IOSelector::clear_connections ()
-{
- if (for_input) {
- io.disconnect_inputs (this);
- } else {
- io.disconnect_outputs (this);
- }