#define __gtk_ardour_editor_regions_h__
#include "editor_component.h"
+#include <boost/unordered_map.hpp>
class EditorRegions : public EditorComponent, public ARDOUR::SessionHandlePtr
{
void reset_sort_type (Editing::RegionListSortType, bool);
void set_selected (RegionSelection &);
void selection_mapover (sigc::slot<void,boost::shared_ptr<ARDOUR::Region> >);
-
+
boost::shared_ptr<ARDOUR::Region> get_dragged_region ();
boost::shared_ptr<ARDOUR::Region> 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 ();
_display.get_selection()->unselect_all ();
}
+ void remove_unused_regions ();
+
XMLNode& get_state () const;
void set_state (const XMLNode &);
add (position);
add (end);
add (length);
- add (start);
add (sync);
add (fadein);
add (fadeout);
Gtk::TreeModelColumn<std::string> position;
Gtk::TreeModelColumn<std::string> end;
Gtk::TreeModelColumn<std::string> length;
- Gtk::TreeModelColumn<std::string> start;
Gtk::TreeModelColumn<std::string> sync;
Gtk::TreeModelColumn<std::string> fadein;
Gtk::TreeModelColumn<std::string> fadeout;
};
Columns _columns;
-
+
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;
+ 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 &);
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);
- 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<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 (boost::shared_ptr<ARDOUR::Region>, Gtk::TreeModel::Row const &, PBD::PropertyChange 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);
void populate_row_end (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row, uint32_t used);
- void populate_row_start (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row, uint32_t used);
void populate_row_sync (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row, uint32_t used);
void populate_row_fade_in (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row, uint32_t used, boost::shared_ptr<ARDOUR::AudioRegion>);
void populate_row_fade_out (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row, uint32_t used, boost::shared_ptr<ARDOUR::AudioRegion>);
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_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 (
Glib::RefPtr<Gtk::Action> hide_action () const;
Glib::RefPtr<Gtk::Action> show_action () const;
+ Glib::RefPtr<Gtk::Action> remove_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;
- bool expanded;
- void select_one (Glib::RefPtr<Gtk::TreeSelection>, Glib::RefPtr<Gtk::TreeModel>, Gtk::TreeView&,
- Gtk::TreeIter, Gtk::TreePath, Gtk::TreeViewColumn*);
- void select_next ();
- void select_previous ();
+ PBD::ScopedConnection editor_freeze_connection;
+ PBD::ScopedConnection editor_thaw_connection;
+
+ bool expanded;
};
#endif /* __gtk_ardour_editor_regions_h__ */