Show x-run count in source-list

This commit is contained in:
Robin Gareus 2021-02-14 16:20:36 +01:00
parent f4f9d76e53
commit 887f8a70bc
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
2 changed files with 24 additions and 12 deletions

View file

@ -143,9 +143,15 @@ EditorSources::EditorSources (Editor* e)
col_path->set_sizing (TREE_VIEW_COLUMN_FIXED); col_path->set_sizing (TREE_VIEW_COLUMN_FIXED);
col_path->set_sort_column(6); col_path->set_sort_column(6);
TreeViewColumn* captd_xruns = manage (new TreeViewColumn ("", _columns.captd_xruns));
captd_xruns->set_fixed_width (chan_width * 1.25);
captd_xruns->set_sizing (TREE_VIEW_COLUMN_FIXED);
captd_xruns->set_sort_column(10);
_display.append_column (*col_name); _display.append_column (*col_name);
_display.append_column (*col_chans); _display.append_column (*col_chans);
_display.append_column (*captd_for); _display.append_column (*captd_for);
_display.append_column (*captd_xruns);
_display.append_column (*col_tags); _display.append_column (*col_tags);
_display.append_column (*col_take_id); _display.append_column (*col_take_id);
_display.append_column (*col_nat_pos); _display.append_column (*col_nat_pos);
@ -158,17 +164,18 @@ EditorSources::EditorSources (Editor* e)
{ 0, _("Name"), _("Region name") }, { 0, _("Name"), _("Region name") },
{ 1, _("# Ch"), _("# Channels") }, { 1, _("# Ch"), _("# Channels") },
{ 2, _("Captured For"), _("Original Track this was recorded on") }, { 2, _("Captured For"), _("Original Track this was recorded on") },
{ 3, _("Tags"), _("Tags") }, { 3, _("# Xruns"), _("Number of dropouts that occured during recording") },
{ 4, _("Take ID"), _("Take ID") }, { 4, _("Tags"), _("Tags") },
{ 5, _("Orig Pos"), _("Original Position of the file on timeline, when it was recorded") }, { 5, _("Take ID"), _("Take ID") },
{ 6, _("Path"), _("Path (folder) of the file location") }, { 6, _("Orig Pos"), _("Original Position of the file on timeline, when it was recorded") },
{ 7, _("Path"), _("Path (folder) of the file location") },
{ -1, 0, 0 } { -1, 0, 0 }
}; };
/* make Name and Path columns manually resizable */ /* make Name and Path columns manually resizable */
_display.get_column (0)->set_resizable (true); _display.get_column (0)->set_resizable (true);
_display.get_column (4)->set_resizable (true); _display.get_column (5)->set_resizable (true);
for (int i = 0; ci[i].index >= 0; ++i) { for (int i = 0; ci[i].index >= 0; ++i) {
col = _display.get_column (ci[i].index); col = _display.get_column (ci[i].index);
@ -200,22 +207,22 @@ EditorSources::EditorSources (Editor* e)
region_name_cell->signal_editing_started().connect (sigc::mem_fun (*this, &EditorSources::name_editing_started)); region_name_cell->signal_editing_started().connect (sigc::mem_fun (*this, &EditorSources::name_editing_started));
/* Tags cell: make editable */ /* Tags cell: make editable */
CellRendererText* region_tags_cell = dynamic_cast<CellRendererText*>(_display.get_column_cell_renderer (3)); CellRendererText* region_tags_cell = dynamic_cast<CellRendererText*>(_display.get_column_cell_renderer (4));
region_tags_cell->property_editable() = true; region_tags_cell->property_editable() = true;
region_tags_cell->signal_edited().connect (sigc::mem_fun (*this, &EditorSources::tag_edit)); region_tags_cell->signal_edited().connect (sigc::mem_fun (*this, &EditorSources::tag_edit));
region_tags_cell->signal_editing_started().connect (sigc::mem_fun (*this, &EditorSources::tag_editing_started)); region_tags_cell->signal_editing_started().connect (sigc::mem_fun (*this, &EditorSources::tag_editing_started));
/* right-align the Natural Pos column */ /* right-align the Natural Pos column */
TreeViewColumn* nat_col = _display.get_column(5); TreeViewColumn* nat_col = _display.get_column(6);
nat_col->set_alignment (ALIGN_RIGHT); nat_col->set_alignment (ALIGN_RIGHT);
renderer = dynamic_cast<CellRendererText*>(_display.get_column_cell_renderer (5)); renderer = dynamic_cast<CellRendererText*>(_display.get_column_cell_renderer (6));
if (renderer) { if (renderer) {
renderer->property_xalign() = 1.0; renderer->property_xalign() = 1.0;
} }
/* the PATH field should expand when the pane is opened wider */ /* the PATH field should expand when the pane is opened wider */
tv_col = _display.get_column(6); tv_col = _display.get_column(7);
renderer = dynamic_cast<CellRendererText*>(_display.get_column_cell_renderer (6)); renderer = dynamic_cast<CellRendererText*>(_display.get_column_cell_renderer (7));
tv_col->add_attribute(renderer->property_text(), _columns.path); tv_col->add_attribute(renderer->property_text(), _columns.path);
tv_col->set_expand (true); tv_col->set_expand (true);
@ -401,6 +408,9 @@ EditorSources::populate_row (TreeModel::Row row, boost::shared_ptr<ARDOUR::Regio
/* CAPTURED FOR */ /* CAPTURED FOR */
row[_columns.captd_for] = source->captured_for(); row[_columns.captd_for] = source->captured_for();
/* CAPTURED DROPOUTS */
row[_columns.captd_xruns] = source->n_captured_xruns();
/* TAGS */ /* TAGS */
row[_columns.tags] = region->tags(); row[_columns.tags] = region->tags();

View file

@ -70,6 +70,7 @@ private:
add (color_); add (color_);
add (region); add (region);
add (natural_s); add (natural_s);
add (captd_xruns);
} }
Gtk::TreeModelColumn<std::string> name; Gtk::TreeModelColumn<std::string> name;
@ -82,6 +83,7 @@ private:
Gtk::TreeModelColumn<std::string> path; Gtk::TreeModelColumn<std::string> path;
Gtk::TreeModelColumn<std::string> take_id; Gtk::TreeModelColumn<std::string> take_id;
Gtk::TreeModelColumn<samplepos_t> natural_s; Gtk::TreeModelColumn<samplepos_t> natural_s;
Gtk::TreeModelColumn<size_t> captd_xruns;
}; };
Columns _columns; Columns _columns;