Make the L,G,M and O buttons in the region list respond to clicks. Fixes #3252.

git-svn-id: svn://localhost/ardour2/branches/3.0@7307 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2010-06-28 00:41:01 +00:00
parent c5bbca0cf5
commit bc32e5b5eb
2 changed files with 77 additions and 1 deletions

View File

@ -102,6 +102,22 @@ EditorRegions::EditorRegions (Editor* e)
tv_col->add_attribute(renderer->property_text(), _columns.name);
tv_col->add_attribute(renderer->property_foreground_gdk(), _columns.color_);
CellRendererToggle* locked_cell = dynamic_cast<CellRendererToggle*> (_display.get_column_cell_renderer (7));
locked_cell->property_activatable() = true;
locked_cell->signal_toggled().connect (sigc::mem_fun (*this, &EditorRegions::locked_changed));
CellRendererToggle* glued_cell = dynamic_cast<CellRendererToggle*> (_display.get_column_cell_renderer (8));
glued_cell->property_activatable() = true;
glued_cell->signal_toggled().connect (sigc::mem_fun (*this, &EditorRegions::glued_changed));
CellRendererToggle* muted_cell = dynamic_cast<CellRendererToggle*> (_display.get_column_cell_renderer (9));
muted_cell->property_activatable() = true;
muted_cell->signal_toggled().connect (sigc::mem_fun (*this, &EditorRegions::muted_changed));
CellRendererToggle* opaque_cell = dynamic_cast<CellRendererToggle*> (_display.get_column_cell_renderer (10));
opaque_cell->property_activatable() = true;
opaque_cell->signal_toggled().connect (sigc::mem_fun (*this, &EditorRegions::opaque_changed));
_display.get_selection()->set_mode (SELECTION_MULTIPLE);
_display.add_object_drag (_columns.region.index(), "regions");
@ -306,7 +322,11 @@ EditorRegions::region_changed (boost::shared_ptr<Region> r, const PropertyChange
if (what_changed.contains (ARDOUR::Properties::name) ||
what_changed.contains (ARDOUR::Properties::start) ||
what_changed.contains (ARDOUR::Properties::position) ||
what_changed.contains (ARDOUR::Properties::length)) {
what_changed.contains (ARDOUR::Properties::length) ||
what_changed.contains (ARDOUR::Properties::locked) ||
what_changed.contains (ARDOUR::Properties::position_lock_style) ||
what_changed.contains (ARDOUR::Properties::muted) ||
what_changed.contains (ARDOUR::Properties::opaque)) {
/* find the region in our model and update its row */
TreeModel::Children rows = _model->children ();
@ -1196,3 +1216,55 @@ EditorRegions::get_single_selection ()
return (*iter)[_columns.region];
}
void
EditorRegions::locked_changed (Glib::ustring const & path)
{
TreeIter i = _model->get_iter (path);
if (i) {
boost::shared_ptr<ARDOUR::Region> region = (*i)[_columns.region];
if (region) {
region->set_locked (!(*i)[_columns.locked]);
}
}
}
void
EditorRegions::glued_changed (Glib::ustring const & path)
{
TreeIter i = _model->get_iter (path);
if (i) {
boost::shared_ptr<ARDOUR::Region> region = (*i)[_columns.region];
if (region) {
/* `glued' means MusicTime, and we're toggling here */
region->set_position_lock_style ((*i)[_columns.glued] ? AudioTime : MusicTime);
}
}
}
void
EditorRegions::muted_changed (Glib::ustring const & path)
{
TreeIter i = _model->get_iter (path);
if (i) {
boost::shared_ptr<ARDOUR::Region> region = (*i)[_columns.region];
if (region) {
region->set_muted (!(*i)[_columns.muted]);
}
}
}
void
EditorRegions::opaque_changed (Glib::ustring const & path)
{
TreeIter i = _model->get_iter (path);
if (i) {
boost::shared_ptr<ARDOUR::Region> region = (*i)[_columns.region];
if (region) {
region->set_opaque (!(*i)[_columns.opaque]);
}
}
}

View File

@ -109,6 +109,10 @@ private:
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);
void name_edit (const Glib::ustring&, const Glib::ustring&);
void locked_changed (Glib::ustring const &);
void glued_changed (Glib::ustring const &);
void muted_changed (Glib::ustring const &);
void opaque_changed (Glib::ustring const &);
bool key_press (GdkEventKey *);
bool button_press (GdkEventButton *);