1 #ifndef __gtk_ardour_port_group_h__
2 #define __gtk_ardour_port_group_h__
7 #include <gtkmm/widget.h>
8 #include <gtkmm/checkbutton.h>
10 #include <ardour/data_type.h>
20 /// A list of port names, grouped by some aspect of their type e.g. busses, tracks, system
24 /** PortGroup constructor.
26 * @param p Port name prefix.
27 * @param v true if group should be visible in the UI, otherwise false.
29 PortGroup (std::string const & n, std::string const & p, bool v) : name (n), prefix (p), visible (v) {}
31 void add (std::string const & p);
33 std::string name; ///< name for the group
34 std::string prefix; ///< prefix (before colon) e.g. "ardour:"
35 std::vector<std::string> ports; ///< port names
36 bool visible; ///< true if the group is visible in the UI
39 /// The UI for a PortGroup
43 PortGroupUI (PortMatrix&, PortGroup&);
45 Gtk::Widget& get_visibility_checkbutton ();
46 PortGroup& port_group () { return _port_group; }
47 void setup_visibility ();
50 void port_checkbutton_toggled (Gtk::CheckButton*, int, int);
51 bool port_checkbutton_release (GdkEventButton* ev, Gtk::CheckButton* b, int r, int c);
52 void visibility_checkbutton_toggled ();
54 PortMatrix& _port_matrix; ///< the PortMatrix that we are working for
55 PortGroup& _port_group; ///< the PortGroup that we are representing
56 bool _ignore_check_button_toggle;
57 Gtk::CheckButton _visibility_checkbutton;
60 /// A list of PortGroups
61 class PortGroupList : public std::list<PortGroup*>
71 PortGroupList (ARDOUR::Session &, ARDOUR::DataType, bool, Mask);
74 int n_visible_ports () const;
75 std::string get_port_by_index (int, bool with_prefix = true) const;
76 void set_type (ARDOUR::DataType);
77 void set_offer_inputs (bool);
80 ARDOUR::Session& _session;
81 ARDOUR::DataType _type;
90 #endif /* __gtk_ardour_port_group_h__ */