bump required version of GTK, SLV2; basic fixups so that the new port-matrix io-selec...
authorPaul Davis <paul@linuxaudiosystems.com>
Sun, 14 Dec 2008 09:35:23 +0000 (09:35 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Sun, 14 Dec 2008 09:35:23 +0000 (09:35 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@4322 d708f5d6-7413-0410-9779-e7cbd77b26cf

SConstruct
gtk2_ardour/io_selector.cc
gtk2_ardour/matrix.cc
gtk2_ardour/matrix.h
gtk2_ardour/port_matrix.cc
gtk2_ardour/port_matrix.h

index 7cdd1449e7a79929ebf42e0ab1d7aed4bd424f46..8174a9171ae7c485ac0fd6085a7bbbbe44e315c7 100644 (file)
@@ -471,7 +471,7 @@ deps = \
 {
        'glib-2.0'             : '2.10.1',
        'gthread-2.0'          : '2.10.1',
-       'gtk+-2.0'             : '2.8.1',
+       'gtk+-2.0'             : '2.12.1',
        'libxml-2.0'           : '2.6.0',
        'samplerate'           : '0.1.0',
        'raptor'               : '1.4.2',
@@ -595,7 +595,7 @@ else:
 if env['LV2']:
        conf = env.Configure(custom_tests = { 'CheckPKGVersion' : CheckPKGVersion})
        
-       if conf.CheckPKGVersion('slv2', '0.6.1'):
+       if conf.CheckPKGVersion('slv2', '0.6.2'):
                libraries['slv2'] = LibraryInfo()
                libraries['slv2'].ParseConfig('pkg-config --cflags --libs slv2')
                 env.Append (CCFLAGS="-DHAVE_LV2")
index a4defec834cc64024ce92da2ef7edf3a03e1772f..954ddb6b9a712af392a5cd31eef34766d9a35459 100644 (file)
@@ -40,19 +40,36 @@ using namespace ARDOUR;
 using namespace Gtk;
 
 IOSelector::IOSelector (ARDOUR::Session& session, boost::shared_ptr<ARDOUR::IO> io, bool offer_inputs)
-       : PortMatrix (
-               session, io->default_type(), offer_inputs,
-               PortGroupList::Mask (PortGroupList::BUSS | 
-                                    PortGroupList::SYSTEM | 
-                                    PortGroupList::OTHER)),
-         _io (io)
+       : PortMatrix (session, io->default_type(), offer_inputs,
+                     PortGroupList::Mask (PortGroupList::BUSS | 
+                                          PortGroupList::SYSTEM | 
+                                          PortGroupList::OTHER))
+       , _io (io)
 {
+       list<string> our_ports;
+
        /* Listen for ports changing on the IO */
        if (_offer_inputs) {
                _io->output_changed.connect (mem_fun(*this, &IOSelector::ports_changed));
+
+               const PortSet& ps (_io->outputs());
+
+               for (PortSet::const_iterator i = ps.begin(); i != ps.end(); ++i) {
+                       our_ports.push_back ((*i).name());
+               }
+
        } else {
                _io->input_changed.connect (mem_fun(*this, &IOSelector::ports_changed));
+
+               const PortSet& ps (_io->inputs());
+
+               for (PortSet::const_iterator i = ps.begin(); i != ps.end(); ++i) {
+                       our_ports.push_back ((*i).name());
+               }
+
        }
+       
+       set_ports (our_ports);
 }
 
 void
@@ -204,16 +221,14 @@ IOSelector::row_descriptor () const
        return _("port");
 }
 
-IOSelectorWindow::IOSelectorWindow (
-       ARDOUR::Session& session, boost::shared_ptr<ARDOUR::IO> io, bool for_input, bool can_cancel
-       )
-       : ArdourDialog ("I/O selector"),
-         _selector (session, io, !for_input),
-         add_button (_("Add Port")),
-         disconnect_button (_("Disconnect All")),
-         ok_button (can_cancel ? _("OK"): _("Close")),
-         cancel_button (_("Cancel")),
-         rescan_button (_("Rescan"))
+IOSelectorWindow::IOSelectorWindow (ARDOUR::Session& session, boost::shared_ptr<ARDOUR::IO> io, bool for_input, bool can_cancel)
+       : ArdourDialog ("I/O selector")
+       , _selector (session, io, !for_input)
+       , add_button (_("Add Port"))
+       , disconnect_button (_("Disconnect All"))
+       , ok_button (can_cancel ? _("OK"): _("Close"))
+       , cancel_button (_("Cancel"))
+       , rescan_button (_("Rescan"))
 
 {
        add_events (Gdk::KEY_PRESS_MASK | Gdk::KEY_RELEASE_MASK);
index 5cb229e4ea52f60e34151112f08e82e21f50f400..c1436a1f74eac557469b144a0a44faf16eab8525 100644 (file)
@@ -50,6 +50,14 @@ Matrix::add_group (PortGroup& pg)
        reset_size ();
 }
 
+
+void
+Matrix::clear ()
+{
+       others.clear ();
+       reset_size ();
+}
+
 void
 Matrix::remove_group (PortGroup& pg)
 {
@@ -118,7 +126,20 @@ Matrix::reset_size ()
                        ++visible_others;
                }
        }
-       
+
+       if (!visible_others) {
+               cerr << "There are no visible others!\n";
+               xstep = 1;
+               ystep = 1;
+               line_width = 1;
+               line_height = 1;
+               border = 10;
+               arc_radius = 3;
+               labels_x_shift = 0;
+               labels_y_shift = 0;
+               return;
+       }
+
        border = 10;
 
        if (alloc_width > line_width) {
@@ -182,6 +203,18 @@ Matrix::reset_size ()
        labels_x_shift = (int) ceil (w);
 
        setup_nodes ();
+
+
+       cerr << "Based on ours = " << ours.size() << " others = " << others.size()
+            << " dimens = "
+            << " xstep " << xstep << endl
+            << " ystep " << ystep << endl
+            << " line_width " << line_width << endl
+            << " line_height " << line_height << endl
+            << " border " << border << endl
+            << " arc_radius " << arc_radius << endl
+            << " labels_x_shift " << labels_x_shift << endl
+            << " labels_y_shift " << labels_y_shift << endl;
 }
 
 bool
index f859a881c78a003b3a080e0970e5dbac6b00e83d..cbd34823d1c06adaab444c08d67aa167ee79f025 100644 (file)
@@ -59,6 +59,7 @@ class Matrix : public Gtk::EventBox
     void remove_group (PortGroup&);
     void hide_group (PortGroup&);
     void show_group (PortGroup&);
+    void clear ();
 
     int row_spacing () const { return xstep; }
 
index b1dd2a17ac5949e218e9a1c6cde062cca77bd791..c2bb01691b2008588e06db99bf391e70c484fce4 100644 (file)
@@ -144,6 +144,12 @@ PortMatrix::~PortMatrix ()
        clear ();
 }
 
+void 
+PortMatrix::set_ports (const std::list<std::string>& ports)
+{
+       matrix.set_ports (ports);
+}
+
 /** Clear out the things that change when the number of source or destination ports changes */
 void
 PortMatrix::clear ()
@@ -244,13 +250,17 @@ PortMatrix::setup ()
                _side_vbox.pack_start (*_side_vbox_pad, false, false);
        }
 
+       matrix.clear ();
+
        /* Checkbutton tables and visibility checkbuttons */
        for (PortGroupList::iterator i = _port_group_list.begin(); i != _port_group_list.end(); ++i) {
 
                PortGroupUI* t = new PortGroupUI (*this, **i);
                
                _port_group_ui.push_back (t);
-               
+
+               matrix.add_group (**i);
+
                _visibility_checkbutton_box.pack_start (t->get_visibility_checkbutton(), false, false);
 
                CheckButton* chk = dynamic_cast<CheckButton*>(&t->get_visibility_checkbutton());
@@ -370,6 +380,8 @@ PortGroupList::refresh ()
 
        boost::shared_ptr<ARDOUR::Session::RouteList> routes = _session.get_routes ();
 
+       cerr << "Looking for arour routes\n";
+
        for (ARDOUR::Session::RouteList::const_iterator i = routes->begin(); i != routes->end(); ++i) {
 
                PortGroup* g = 0;
@@ -408,6 +420,8 @@ PortGroupList::refresh ()
           finding all the ports that we can connect to. 
        */
 
+       cerr << "Looking for non-ardour ports\n";
+
        const char **ports = _session.engine().get_ports ("", _type.to_jack_type(), _offer_inputs ? 
                                                          JackPortIsInput : JackPortIsOutput);
        if (ports) {
@@ -415,6 +429,8 @@ PortGroupList::refresh ()
                int n = 0;
                string client_matching_string;
 
+               cerr << "Got some\n";
+
                client_matching_string = _session.engine().client_name();
                client_matching_string += ':';
 
@@ -437,6 +453,11 @@ PortGroupList::refresh ()
                free (ports);
        }
 
+       cerr << "at end of refresh, we have " << buss.ports.size () << " buss\n";
+       cerr << "at end of refresh, we have " << track.ports.size () << " track\n";
+       cerr << "at end of refresh, we have " << system.ports.size () << " system\n";
+       cerr << "at end of refresh, we have " << other.ports.size () << " other\n";
+
        push_back (&system);
        push_back (&buss);
        push_back (&track);
index b9a5f7e4c69759ec20560ede31115defcb980a58..e755d77328d751faaed7d46fbc89d74674d28dd2 100644 (file)
@@ -70,6 +70,7 @@ class PortMatrix : public Gtk::VBox {
   protected:
 
        bool _offer_inputs;
+       void set_ports (const std::list<std::string>&);
 
   private:
        PortGroupList _port_group_list;