diff options
author | Carl Hetherington <carl@carlh.net> | 2009-01-23 21:24:11 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2009-01-23 21:24:11 +0000 |
commit | f6652f07ae2bfa9d7984c5b6feffd6479faec034 (patch) | |
tree | 8f02ca41d0f56eb20be3f684eefdf29e218c3a1e /gtk2_ardour/port_group.h | |
parent | 9245b7f95947ae196b8bb734ecb9767a362cccfe (diff) |
Add global port matrix dialogs.
git-svn-id: svn://localhost/ardour2/branches/3.0@4434 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/port_group.h')
-rw-r--r-- | gtk2_ardour/port_group.h | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/gtk2_ardour/port_group.h b/gtk2_ardour/port_group.h index 0641d231ef..d2136d6f5e 100644 --- a/gtk2_ardour/port_group.h +++ b/gtk2_ardour/port_group.h @@ -38,15 +38,15 @@ class PortMatrix; * type e.g. busses, tracks, system. Each group has 0 or more bundles * and 0 or more ports, where the ports are not in the bundles. */ -class PortGroup +class PortGroup : public sigc::trackable { - public: +public: /** PortGroup constructor. * @param n Name. * @param v true if group should be visible in the UI, otherwise false. */ PortGroup (std::string const & n, bool v) - : name (n), visible (v) {} + : name (n), _visible (v) {} void add_bundle (boost::shared_ptr<ARDOUR::Bundle>); void add_port (std::string const &); @@ -55,7 +55,19 @@ class PortGroup std::string name; ///< name for the group std::vector<boost::shared_ptr<ARDOUR::Bundle> > bundles; std::vector<std::string> ports; - bool visible; ///< true if the group is visible in the UI + bool visible () const { + return _visible; + } + + void set_visible (bool v) { + _visible = v; + VisibilityChanged (); + } + + sigc::signal<void> VisibilityChanged; + +private: + bool _visible; ///< true if the group is visible in the UI }; /// The UI for a PortGroup @@ -78,7 +90,7 @@ class PortGroupUI }; /// A list of PortGroups -class PortGroupList : public std::list<PortGroup*> +class PortGroupList : public std::list<PortGroup*>, public sigc::trackable { public: enum Mask { @@ -93,9 +105,15 @@ class PortGroupList : public std::list<PortGroup*> void refresh (); void set_type (ARDOUR::DataType); void set_offer_inputs (bool); + std::vector<boost::shared_ptr<ARDOUR::Bundle> > bundles (); + void take_visibility_from (PortGroupList const &); + + sigc::signal<void> VisibilityChanged; private: void maybe_add_session_bundle (boost::shared_ptr<ARDOUR::Bundle>); + std::string common_prefix (std::vector<std::string> const &) const; + void visibility_changed (); ARDOUR::Session& _session; ARDOUR::DataType _type; |