Brought back visual indication of delete dragging.
[ardour.git] / gtk2_ardour / io_selector.cc
index 366e2c2769d708cc5ee882caca156e4bfd5c2873..0738758931193a034eb73ff0b51463d04172a2e5 100644 (file)
@@ -15,7 +15,6 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id$
 */
 
 #include <map>
@@ -31,7 +30,7 @@
 #include <ardour/route.h>
 #include <ardour/audioengine.h>
 #include <ardour/port.h>
-#include <ardour/insert.h>
+#include <ardour/port_insert.h>
 #include <ardour/session.h>
 #include <ardour/audio_diskstream.h>
 
@@ -99,6 +98,12 @@ IOSelectorWindow::IOSelectorWindow (Session& sess, boost::shared_ptr<IO> ior, bo
        set_title (title);
        set_position (WIN_POS_MOUSE);
 
+       ok_button.show();
+       cancel_button.show();
+       rescan_button.show();
+       button_box.show();
+       get_vbox()->show();
+
        signal_delete_event().connect (bind (sigc::ptr_fun (just_hide_it), reinterpret_cast<Window *> (this)));
 }
 
@@ -251,7 +256,25 @@ IOSelector::IOSelector (Session& sess, boost::shared_ptr<IO> ior, bool input)
                io->output_changed.connect (mem_fun(*this, &IOSelector::ports_changed));
        }
 
-       io->name_changed.connect (mem_fun(*this, &IOSelector::name_changed));
+       io->NameChanged.connect (mem_fun(*this, &IOSelector::name_changed));
+
+       main_box.show();
+       port_and_selector_box.show();
+       notebook.show();
+       selector_frame.show();
+       selector_box.show();
+       selector_button_box.show();
+       port_box.show();
+       port_button_box.show();
+       port_and_button_box.show();
+       port_frame.show();
+       add_port_button.show();
+       remove_port_button.show();
+       clear_connections_button.show();
+       port_display_scroller.show();
+
+       show();
+       
 }
 
 IOSelector::~IOSelector ()
@@ -299,9 +322,9 @@ IOSelector::set_button_sensitivity ()
 
 
 void
-IOSelector::name_changed (void* src)
+IOSelector::name_changed ()
 {
-       ENSURE_GUI_THREAD(bind (mem_fun(*this, &IOSelector::name_changed), src));
+       ENSURE_GUI_THREAD(mem_fun(*this, &IOSelector::name_changed));
        
        display_ports ();
 }
@@ -336,7 +359,7 @@ IOSelector::rescan ()
 
        /* get relevant current JACK ports */
 
-       ports = session.engine().get_ports ("", JACK_DEFAULT_AUDIO_TYPE, for_input ? JackPortIsOutput : JackPortIsInput);
+       ports = session.engine().get_ports ("", io->default_type().to_jack_type(), for_input ? JackPortIsOutput : JackPortIsInput);
 
        if (ports == 0) {
                return;
@@ -458,7 +481,7 @@ IOSelector::display_ports ()
                        
                        really_short_name = port->short_name();
                        really_short_name = really_short_name.substr (really_short_name.find ('/') + 1);
-                       
+
                        tview = manage (new TreeView());
                        RefPtr<ListStore> port_model = ListStore::create (port_display_columns);
                        
@@ -478,7 +501,6 @@ IOSelector::display_ports ()
                        
                        /* now fill the clist with the current connections */
                        
-                       
                        const char **connections = port->get_connections ();
                        
                        if (connections) {
@@ -487,7 +509,7 @@ IOSelector::display_ports ()
                                        row[port_display_columns.displayed_name] = connections[c];
                                        row[port_display_columns.full_name] = connections[c];
                                }
-                       }
+                       } 
                        
                        if (for_input) {
                                
@@ -767,8 +789,8 @@ IOSelector::redisplay ()
 }
 
 PortInsertUI::PortInsertUI (Session& sess, boost::shared_ptr<PortInsert> pi)
-       : input_selector (sess, pi, true),
-         output_selector (sess, pi, false)
+       : input_selector (sess, pi->io(), true),
+         output_selector (sess, pi->io(), false)
 {
        hbox.pack_start (output_selector, true, true);
        hbox.pack_start (input_selector, true, true);
@@ -830,14 +852,15 @@ PortInsertWindow::PortInsertWindow (Session& sess, boost::shared_ptr<PortInsert>
        rescan_button.signal_clicked().connect (mem_fun(*this, &PortInsertWindow::rescan));
 
        signal_delete_event().connect (bind (sigc::ptr_fun (just_hide_it), reinterpret_cast<Window *> (this))); 
-       pi->GoingAway.connect (mem_fun(*this, &PortInsertWindow::plugin_going_away));
+
+       going_away_connection = pi->GoingAway.connect (mem_fun(*this, &PortInsertWindow::plugin_going_away));
 }
 
 void
 PortInsertWindow::plugin_going_away ()
 {
        ENSURE_GUI_THREAD(mem_fun(*this, &PortInsertWindow::plugin_going_away));
-       
+       going_away_connection.disconnect ();
        delete_when_idle (this);
 }