From ee42a6dd97045253d1a9bb32fc2e571d235f9967 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 9 Feb 2009 03:18:10 +0000 Subject: Fixes to bundle manager to make it vaguely usable. Rework signal handling for bundles so that all changes should now be noticed by port matrices. git-svn-id: svn://localhost/ardour2/branches/3.0@4501 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/port_group.h | 58 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 17 deletions(-) (limited to 'gtk2_ardour/port_group.h') diff --git a/gtk2_ardour/port_group.h b/gtk2_ardour/port_group.h index c2961c4925..c2daae341a 100644 --- a/gtk2_ardour/port_group.h +++ b/gtk2_ardour/port_group.h @@ -42,20 +42,15 @@ class PortMatrix; class PortGroup : public sigc::trackable { public: - /** PortGroup constructor. - * @param n Name. - */ - PortGroup (std::string const & n) - : name (n), _visible (true) {} + PortGroup (std::string const & n); void add_bundle (boost::shared_ptr); + void remove_bundle (boost::shared_ptr); boost::shared_ptr only_bundle (); - void add_port (std::string const &); void clear (); - uint32_t total_ports () const; + uint32_t total_channels () const; std::string name; ///< name for the group - std::vector ports; ARDOUR::BundleList const & bundles () const { return _bundles; @@ -73,14 +68,21 @@ public: bool has_port (std::string const &) const; sigc::signal Modified; + sigc::signal BundleChanged; -private: +private: + void bundle_changed (ARDOUR::Bundle::Change); + ARDOUR::BundleList _bundles; + + typedef std::map, sigc::connection> ConnectionList; + ConnectionList _bundle_changed_connections; + bool _visible; ///< true if the group is visible in the UI }; /// A list of PortGroups -class PortGroupList +class PortGroupList : public sigc::trackable { public: PortGroupList (); @@ -90,14 +92,17 @@ class PortGroupList void add_group (boost::shared_ptr); void set_type (ARDOUR::DataType); void gather (ARDOUR::Session &, bool); - void set_offer_inputs (bool); ARDOUR::BundleList const & bundles () const; void clear (); - uint32_t total_visible_ports () const; + void remove_bundle (boost::shared_ptr); + uint32_t total_visible_channels () const; uint32_t size () const { return _groups.size(); } + void suspend_signals (); + void resume_signals (); + List::const_iterator begin () const { return _groups.begin(); } @@ -105,18 +110,37 @@ class PortGroupList List::const_iterator end () const { return _groups.end(); } - + + sigc::signal Changed; + private: bool port_has_prefix (std::string const &, std::string const &) const; std::string common_prefix (std::vector const &) const; - void update_bundles () const; - void group_modified (); + std::string common_prefix_before (std::vector const &, std::string const &) const; + void emit_changed (); + boost::shared_ptr make_bundle_from_ports (std::vector const &, bool) const; ARDOUR::DataType _type; - bool _offer_inputs; mutable ARDOUR::BundleList _bundles; - mutable bool _bundles_dirty; List _groups; + std::vector _bundle_changed_connections; + bool _signals_suspended; + bool _pending_change; +}; + + +class RouteBundle : public ARDOUR::Bundle +{ +public: + RouteBundle (boost::shared_ptr); + + void add_processor_bundle (boost::shared_ptr); + +private: + void reread_component_bundles (); + + boost::shared_ptr _route; + std::vector > _processor; }; #endif /* __gtk_ardour_port_group_h__ */ -- cgit v1.2.3