- selected_port = 0;
-
- notebook.set_name ("IOSelectorNotebook");
- notebook.set_usize (-1, 125);
-
- clear_connections_button.set_name ("IOSelectorButton");
- add_port_button.set_name ("IOSelectorButton");
- remove_port_button.set_name ("IOSelectorButton");
-
- selector_frame.set_name ("IOSelectorFrame");
- port_frame.set_name ("IOSelectorFrame");
-
- selector_frame.set_label (_("Available connections"));
-
- 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_usize (-1, 170);
- port_display_scroller.add_with_viewport (port_box);
- port_display_scroller.set_policy (GTK_POLICY_NEVER,
- GTK_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.clicked.connect (slot (*this, &IOSelector::clear_connections));
-
- add_port_button.clicked.connect (slot (*this, &IOSelector::add_port));
- remove_port_button.clicked.connect (slot (*this, &IOSelector::remove_port));
-
- if (for_input) {
- io.input_changed.connect (slot (*this, &IOSelector::ports_changed));