diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-02-14 21:49:43 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-02-14 21:49:43 +0000 |
commit | 7a5b6a5031d4c573c90d2455276aa174a665239b (patch) | |
tree | 5fe53c6eb77432eeb78d4a8b46dba9112e483885 /gtk2_ardour/editor_regions.h | |
parent | 7ac5d03cb870acb429b7fb0c315dd5774d4e0b8c (diff) |
patches from lincoln to speed up the regionlist and provide region removal (causes dangling shared ptrs to regions, fix to come
git-svn-id: svn://localhost/ardour2/branches/3.0@8845 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_regions.h')
-rw-r--r-- | gtk2_ardour/editor_regions.h | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/gtk2_ardour/editor_regions.h b/gtk2_ardour/editor_regions.h index 0643befbdf..c9d2f8714e 100644 --- a/gtk2_ardour/editor_regions.h +++ b/gtk2_ardour/editor_regions.h @@ -20,6 +20,7 @@ #define __gtk_ardour_editor_regions_h__ #include "editor_component.h" +#include <boost/unordered_map.hpp> class EditorRegions : public EditorComponent, public ARDOUR::SessionHandlePtr { @@ -66,6 +67,8 @@ public: void unselect_all () { _display.get_selection()->unselect_all (); } + + void delete_unused_regions(); XMLNode& get_state () const; void set_state (const XMLNode &); @@ -115,12 +118,13 @@ private: Gtk::TreeModel::RowReference last_row; + void freeze_tree_model (); + void thaw_tree_model (); void region_changed (boost::shared_ptr<ARDOUR::Region>, PBD::PropertyChange const &); void selection_changed (); sigc::connection _change_connection; - - bool set_selected_in_subrow (boost::shared_ptr<ARDOUR::Region>, Gtk::TreeModel::Row const &, int); + bool selection_filter (const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::Path& path, bool yn); Gtk::Widget* old_focus; @@ -135,10 +139,12 @@ private: bool key_press (GdkEventKey *); bool button_press (GdkEventButton *); + bool focus_in (GdkEventFocus*); bool focus_out (GdkEventFocus*); bool enter_notify (GdkEventCrossing*); bool leave_notify (GdkEventCrossing*); + void show_context_menu (int button, int time); int sorter (Gtk::TreeModel::iterator, Gtk::TreeModel::iterator); @@ -146,7 +152,7 @@ private: void format_position (ARDOUR::framepos_t pos, char* buf, size_t bufsize); void add_region (boost::shared_ptr<ARDOUR::Region>); - void add_regions (std::vector<boost::shared_ptr<ARDOUR::Region> > & ); + void populate_row (boost::shared_ptr<ARDOUR::Region>, Gtk::TreeModel::Row const &); void populate_row_used (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row, uint32_t used); void populate_row_position (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row, uint32_t used); @@ -162,10 +168,9 @@ private: void populate_row_name (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row); void populate_row_source (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row); - void update_row (boost::shared_ptr<ARDOUR::Region>); - bool update_subrows (boost::shared_ptr<ARDOUR::Region>, Gtk::TreeModel::Row const &, int); + void update_row (boost::shared_ptr<ARDOUR::Region>); void update_all_rows (); - void update_all_subrows (Gtk::TreeModel::Row const &, int); + void insert_into_tmp_regionlist (boost::shared_ptr<ARDOUR::Region>); void drag_data_received ( @@ -177,22 +182,39 @@ private: Glib::RefPtr<Gtk::Action> hide_action () const; Glib::RefPtr<Gtk::Action> show_action () const; + Glib::RefPtr<Gtk::Action> delete_unused_regions_action() const; Glib::RefPtr<Gtk::ToggleAction> toggle_full_action () const; Glib::RefPtr<Gtk::ToggleAction> toggle_show_auto_regions_action () const; Gtk::Menu* _menu; Gtk::ScrolledWindow _scroller; Gtk::Frame _frame; + Gtkmm2ext::DnDTreeView<boost::shared_ptr<ARDOUR::Region> > _display; + Glib::RefPtr<Gtk::TreeStore> _model; + bool _show_automatic_regions; - Editing::RegionListSortType _sort_type; + bool ignore_region_list_selection_change; + bool ignore_selected_region_change; bool _no_redisplay; + + Editing::RegionListSortType _sort_type; + std::list<boost::shared_ptr<ARDOUR::Region> > tmp_region_list; + + typedef boost::unordered_map<boost::shared_ptr<ARDOUR::Region>, Gtk::TreeModel::RowReference> RegionRowMap; + typedef boost::unordered_map<std::string, Gtk::TreeModel::RowReference > RegionSourceMap; + + RegionRowMap region_row_map; + RegionSourceMap parent_regions_sources_map; + PBD::ScopedConnection region_property_connection; PBD::ScopedConnection check_new_region_connection; - bool ignore_region_list_selection_change; - bool ignore_selected_region_change; + + PBD::ScopedConnection editor_freeze_connection; + PBD::ScopedConnection editor_thaw_connection; + bool expanded; }; |