Clear out any command line session name on closing a session so that the same session...
[ardour.git] / gtk2_ardour / port_matrix.h
index 4d103bf3698d4cbae9d55fd5cce1be0e40288004..b3d94055eb62fcede9800fcd817753cf2139fb68 100644 (file)
@@ -30,6 +30,7 @@
 #include "ardour/bundle.h"
 #include "port_group.h"
 #include "port_matrix_types.h"
+#include "i18n.h"
 
 /** The `port matrix' UI.  This is a widget which lets the user alter
  *  associations between one set of ports and another.  e.g. to connect
@@ -49,7 +50,7 @@ class PortMatrixBody;
 class PortMatrix : public Gtk::Table
 {
 public:
-       PortMatrix (ARDOUR::Session&, ARDOUR::DataType);
+       PortMatrix (Gtk::Window*, ARDOUR::Session&, ARDOUR::DataType);
        ~PortMatrix ();
 
        void set_type (ARDOUR::DataType);
@@ -110,8 +111,6 @@ public:
        void setup_all_ports ();
 
        std::pair<uint32_t, uint32_t> max_size () const;
-       void setup_max_size ();
-       sigc::signal<void> MaxSizeChanged;
 
        /** @param c Channels; where c[0] is from _ports[0] and c[1] is from _ports[1].
         *  @param s New state.
@@ -124,11 +123,16 @@ public:
        virtual PortMatrixNode::State get_state (ARDOUR::BundleChannel c[2]) const = 0;
        virtual bool list_is_global (int) const = 0;
 
-       virtual void add_channel (boost::shared_ptr<ARDOUR::Bundle>) = 0;
-       virtual bool can_remove_channels (int) const = 0;
-       virtual void remove_channel (ARDOUR::BundleChannel) = 0;
-       virtual bool can_rename_channels (int) const = 0;
+       virtual bool can_add_channel (boost::shared_ptr<ARDOUR::Bundle>) const;
+       virtual void add_channel (boost::shared_ptr<ARDOUR::Bundle>);
+       virtual bool can_remove_channels (boost::shared_ptr<ARDOUR::Bundle>) const;
+       virtual void remove_channel (ARDOUR::BundleChannel);
+       virtual bool can_rename_channels (boost::shared_ptr<ARDOUR::Bundle>) const {
+               return false;
+       }
        virtual void rename_channel (ARDOUR::BundleChannel) {}
+       virtual std::string disassociation_verb () const = 0;
+       virtual std::string channel_noun () const { return _("channel"); }
        
        enum Result {
                Cancelled,
@@ -155,6 +159,7 @@ private:
        void routes_changed ();
        void reconnect_to_routes ();
        void select_arrangement ();
+       void add_channel_proxy (boost::weak_ptr<ARDOUR::Bundle>);
        void remove_channel_proxy (boost::weak_ptr<ARDOUR::Bundle>, uint32_t);
        void rename_channel_proxy (boost::weak_ptr<ARDOUR::Bundle>, uint32_t);
        void disassociate_all_on_channel (boost::weak_ptr<ARDOUR::Bundle>, uint32_t, int);
@@ -162,6 +167,10 @@ private:
        void hide_group (boost::weak_ptr<PortGroup>);
        void show_group (boost::weak_ptr<PortGroup>);
        void toggle_show_only_bundles ();
+       bool on_scroll_event (GdkEventScroll *);
+       boost::shared_ptr<ARDOUR::IO> io_from_bundle (boost::shared_ptr<ARDOUR::Bundle>) const;
+
+       Gtk::Window* _parent;
 
        /// port type that we are working with
        ARDOUR::DataType _type;