X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Feditor_regions.h;h=3284259ed70d1ccba56a3f1fcb70372ae36f1b4c;hb=419b1c1cfdb2f6fee97312ab5b56a8579623534a;hp=0643befbdfbda03fa1f73f3d7fe9fae5fd3d2a71;hpb=f9906762a259dade14d63b208d0878325390348f;p=ardour.git diff --git a/gtk2_ardour/editor_regions.h b/gtk2_ardour/editor_regions.h index 0643befbdf..3284259ed7 100644 --- a/gtk2_ardour/editor_regions.h +++ b/gtk2_ardour/editor_regions.h @@ -19,6 +19,13 @@ #ifndef __gtk_ardour_editor_regions_h__ #define __gtk_ardour_editor_regions_h__ +#include + +#include +#include +#include +#include + #include "editor_component.h" class EditorRegions : public EditorComponent, public ARDOUR::SessionHandlePtr @@ -40,20 +47,20 @@ public: void reset_sort_type (Editing::RegionListSortType, bool); void set_selected (RegionSelection &); void selection_mapover (sigc::slot >); - + boost::shared_ptr get_dragged_region (); boost::shared_ptr get_single_selection (); - + Editing::RegionListSortType sort_type () const { return _sort_type; } - + void redisplay (); void suspend_redisplay () { _no_redisplay = true; } - + void resume_redisplay () { _no_redisplay = false; redisplay (); @@ -67,6 +74,8 @@ public: _display.get_selection()->unselect_all (); } + void remove_unused_regions (); + XMLNode& get_state () const; void set_state (const XMLNode &); @@ -112,21 +121,22 @@ private: }; Columns _columns; - + Gtk::TreeModel::RowReference last_row; + void freeze_tree_model (); + void thaw_tree_model (); void region_changed (boost::shared_ptr, PBD::PropertyChange const &); void selection_changed (); - + sigc::connection _change_connection; - - bool set_selected_in_subrow (boost::shared_ptr, Gtk::TreeModel::Row const &, int); + bool selection_filter (const Glib::RefPtr& model, const Gtk::TreeModel::Path& path, bool yn); - Gtk::Widget* old_focus; - Gtk::CellEditable* name_editable; - void name_editing_started (Gtk::CellEditable*, const Glib::ustring&); - + Gtk::Widget* old_focus; + Gtk::CellEditable* name_editable; + void name_editing_started (Gtk::CellEditable*, const Glib::ustring&); + void name_edit (const std::string&, const std::string&); void locked_changed (std::string const &); void glued_changed (std::string const &); @@ -135,37 +145,38 @@ 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*); + + 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); - void format_position (ARDOUR::framepos_t pos, char* buf, size_t bufsize); + void format_position (ARDOUR::framepos_t pos, char* buf, size_t bufsize, bool onoff = true); void add_region (boost::shared_ptr); - void add_regions (std::vector > & ); - void populate_row (boost::shared_ptr, Gtk::TreeModel::Row const &); - void populate_row_used (boost::shared_ptr region, Gtk::TreeModel::Row const& row, uint32_t used); - void populate_row_position (boost::shared_ptr region, Gtk::TreeModel::Row const& row, uint32_t used); - void populate_row_end (boost::shared_ptr region, Gtk::TreeModel::Row const& row, uint32_t used); - void populate_row_sync (boost::shared_ptr region, Gtk::TreeModel::Row const& row, uint32_t used); - void populate_row_fade_in (boost::shared_ptr region, Gtk::TreeModel::Row const& row, uint32_t used, boost::shared_ptr); - void populate_row_fade_out (boost::shared_ptr region, Gtk::TreeModel::Row const& row, uint32_t used, boost::shared_ptr); - void populate_row_locked (boost::shared_ptr region, Gtk::TreeModel::Row const& row, uint32_t used); - void populate_row_muted (boost::shared_ptr region, Gtk::TreeModel::Row const& row, uint32_t used); - void populate_row_glued (boost::shared_ptr region, Gtk::TreeModel::Row const& row, uint32_t used); - void populate_row_opaque (boost::shared_ptr region, Gtk::TreeModel::Row const& row, uint32_t used); - void populate_row_length (boost::shared_ptr region, Gtk::TreeModel::Row const& row); - void populate_row_name (boost::shared_ptr region, Gtk::TreeModel::Row const& row); - void populate_row_source (boost::shared_ptr region, Gtk::TreeModel::Row const& row); + + void populate_row (boost::shared_ptr, Gtk::TreeModel::Row const &, PBD::PropertyChange const &); + void populate_row_used (boost::shared_ptr region, Gtk::TreeModel::Row const& row, uint32_t used); + void populate_row_position (boost::shared_ptr region, Gtk::TreeModel::Row const& row, uint32_t used); + void populate_row_end (boost::shared_ptr region, Gtk::TreeModel::Row const& row, uint32_t used); + void populate_row_sync (boost::shared_ptr region, Gtk::TreeModel::Row const& row, uint32_t used); + void populate_row_fade_in (boost::shared_ptr region, Gtk::TreeModel::Row const& row, uint32_t used, boost::shared_ptr); + void populate_row_fade_out (boost::shared_ptr region, Gtk::TreeModel::Row const& row, uint32_t used, boost::shared_ptr); + void populate_row_locked (boost::shared_ptr region, Gtk::TreeModel::Row const& row, uint32_t used); + void populate_row_muted (boost::shared_ptr region, Gtk::TreeModel::Row const& row, uint32_t used); + void populate_row_glued (boost::shared_ptr region, Gtk::TreeModel::Row const& row, uint32_t used); + void populate_row_opaque (boost::shared_ptr region, Gtk::TreeModel::Row const& row, uint32_t used); + void populate_row_length (boost::shared_ptr region, Gtk::TreeModel::Row const& row); + void populate_row_name (boost::shared_ptr region, Gtk::TreeModel::Row const& row); + void populate_row_source (boost::shared_ptr region, Gtk::TreeModel::Row const& row); void update_row (boost::shared_ptr); - bool update_subrows (boost::shared_ptr, Gtk::TreeModel::Row const &, int); void update_all_rows (); - void update_all_subrows (Gtk::TreeModel::Row const &, int); + void insert_into_tmp_regionlist (boost::shared_ptr); void drag_data_received ( @@ -177,23 +188,40 @@ private: Glib::RefPtr hide_action () const; Glib::RefPtr show_action () const; + Glib::RefPtr remove_unused_regions_action () const; Glib::RefPtr toggle_full_action () const; Glib::RefPtr toggle_show_auto_regions_action () const; - + Gtk::Menu* _menu; Gtk::ScrolledWindow _scroller; Gtk::Frame _frame; + Gtkmm2ext::DnDTreeView > _display; + Glib::RefPtr _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 > tmp_region_list; + + typedef boost::unordered_map, Gtk::TreeModel::RowReference> RegionRowMap; + typedef boost::unordered_map 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; - bool expanded; + + PBD::ScopedConnection editor_freeze_connection; + PBD::ScopedConnection editor_thaw_connection; + + bool expanded; }; #endif /* __gtk_ardour_editor_regions_h__ */