NO-OP: clang format, comments & whitespace

This commit is contained in:
Robin Gareus 2019-08-13 00:56:48 +02:00
parent f940cbe794
commit e08ab1e30a
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04

View file

@ -22,22 +22,22 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdlib>
#include <sstream>
#include <string>
#include "pbd/basename.h"
#include "pbd/enumwriter.h"
#include "ardour/audioregion.h"
#include "ardour/audiofilesource.h"
#include "ardour/silentfilesource.h"
#include "ardour/audioregion.h"
#include "ardour/profile.h"
#include "ardour/region_factory.h"
#include "ardour/session.h"
#include "ardour/session_playlist.h"
#include "ardour/profile.h"
#include "ardour/silentfilesource.h"
#include "gtkmm2ext/treeutils.h"
#include "gtkmm2ext/utils.h"
@ -45,20 +45,20 @@
#include "widgets/choice.h"
#include "widgets/tooltips.h"
#include "actions.h"
#include "ardour_ui.h"
#include "audio_clock.h"
#include "editor.h"
#include "editing.h"
#include "editing_convert.h"
#include "keyboard.h"
#include "ardour_ui.h"
#include "gui_thread.h"
#include "actions.h"
#include "region_view.h"
#include "utils.h"
#include "editor_regions.h"
#include "editor.h"
#include "editor_drag.h"
#include "editor_regions.h"
#include "gui_thread.h"
#include "keyboard.h"
#include "main_clock.h"
#include "region_view.h"
#include "ui_config.h"
#include "utils.h"
#include "pbd/i18n.h"
@ -97,8 +97,7 @@ EditorRegions::EditorRegions (Editor* e)
_display.set_reorderable (false);
/* Try to prevent single mouse presses from initiating edits.
This relies on a hack in gtktreeview.c:gtk_treeview_button_press()
*/
* This relies on a hack in gtktreeview.c:gtk_treeview_button_press() */
_display.set_data ("mouse-edits-require-mod1", (gpointer)0x1);
_model = TreeStore::create (_columns);
@ -171,6 +170,7 @@ EditorRegions::EditorRegions (Editor* e)
TreeViewColumn* col;
Gtk::Label* l;
/* clang-format off */
ColumnInfo ci[] = {
{ 0, 0, ALIGN_LEFT, _("Region"), _("Region name, with number of channels in []'s") },
{ 1, 1, ALIGN_LEFT, _("Tags"), _("Tags") },
@ -188,12 +188,12 @@ EditorRegions::EditorRegions (Editor* e)
#endif
{ -1,-1, ALIGN_CENTER, 0, 0 }
};
/* clang-format on */
for (int i = 0; ci[i].index >= 0; ++i) {
col = _display.get_column (ci[i].index);
//add the label
/* add the label */
l = manage (new Label (ci[i].label));
l->set_alignment (ci[i].al);
set_tooltip (*l, ci[i].tooltip);
@ -204,10 +204,10 @@ EditorRegions::EditorRegions (Editor* e)
col->set_expand (false);
//this sets the alignment of the column header...
/* this sets the alignment of the column header... */
col->set_alignment (ci[i].al);
//...and this sets the alignment for the data cells
/* ...and this sets the alignment for the data cells */
CellRendererText* renderer = dynamic_cast<CellRendererText*> (_display.get_column_cell_renderer (i));
if (renderer) {
renderer->property_xalign () = (ci[i].al == ALIGN_RIGHT ? 1.0 : (ci[i].al == ALIGN_LEFT ? 0.0 : 0.5));
@ -225,20 +225,20 @@ EditorRegions::EditorRegions (Editor* e)
}
_display.get_selection ()->set_select_function (sigc::mem_fun (*this, &EditorRegions::selection_filter));
//Name cell: make editable
/* Name cell: make editable */
CellRendererText* region_name_cell = dynamic_cast<CellRendererText*> (_display.get_column_cell_renderer (0));
region_name_cell->property_editable () = true;
region_name_cell->signal_edited ().connect (sigc::mem_fun (*this, &EditorRegions::name_edit));
region_name_cell->signal_editing_started ().connect (sigc::mem_fun (*this, &EditorRegions::name_editing_started));
//Region Name: color turns red if source is missing.
/* Region Name: color turns red if source is missing. */
TreeViewColumn* tv_col = _display.get_column (0);
CellRendererText* renderer = dynamic_cast<CellRendererText*> (_display.get_column_cell_renderer (0));
tv_col->add_attribute (renderer->property_text (), _columns.name);
tv_col->add_attribute (renderer->property_foreground_gdk (), _columns.color_);
tv_col->set_expand (true);
//Tags cell: make editable
/* Tags cell: make editable */
CellRendererText* region_tags_cell = dynamic_cast<CellRendererText*> (_display.get_column_cell_renderer (1));
region_tags_cell->property_editable () = true;
region_tags_cell->signal_edited ().connect (sigc::mem_fun (*this, &EditorRegions::tag_edit));
@ -370,7 +370,7 @@ EditorRegions::add_region (boost::shared_ptr<Region> region)
return;
}
//whole-file regions are shown in the Source List
/* whole-file regions are shown in the Source List */
if (region->whole_file ()) {
return;
}
@ -427,8 +427,8 @@ EditorRegions::region_changed (boost::shared_ptr<Region> r, const PropertyChange
boost::shared_ptr<ARDOUR::Playlist> pl = r->playlist ();
if (!(pl && _session && _session->playlist_is_active (pl))) {
//this region is not on an active playlist
//maybe it got deleted, or whatever
/* this region is not on an active playlist
* maybe it got deleted, or whatever */
if (map_it != region_row_map.end ()) {
region_row_map.erase (map_it);
_model->erase (map_it->second);
@ -437,24 +437,21 @@ EditorRegions::region_changed (boost::shared_ptr<Region> r, const PropertyChange
}
if (map_it != region_row_map.end ()) {
//found the region, update its row properties
/* found the region, update its row properties */
TreeModel::Row row = *(map_it->second);
populate_row (r, row, what_changed);
} else {
//new region, add it to the list
/* new region, add it to the list */
TreeModel::iterator iter = _model->append ();
TreeModel::Row row = *iter;
region_row_map.insert (pair<boost::shared_ptr<ARDOUR::Region>, Gtk::TreeModel::iterator> (r, iter));
//set the properties that don't change
/* set the properties that don't change */
row[_columns.region] = r;
//now populate the properties that might change...
/* now populate the properties that might change... */
populate_row (r, row, PropertyChange ());
}
}
@ -464,16 +461,13 @@ EditorRegions::selection_changed ()
_editor->_region_selection_change_updates_region_list = false;
if (_display.get_selection ()->count_selected_rows () > 0) {
TreeIter iter;
TreeView::Selection::ListHandle_Path rows = _display.get_selection ()->get_selected_rows ();
_editor->get_selection ().clear_regions ();
for (TreeView::Selection::ListHandle_Path::iterator i = rows.begin (); i != rows.end (); ++i) {
if ((iter = _model->get_iter (*i))) {
boost::shared_ptr<Region> region = (*iter)[_columns.region];
// they could have clicked on a row that is just a placeholder, like "Hidden"
@ -481,13 +475,11 @@ EditorRegions::selection_changed ()
// since we need a region ptr.
if (region) {
_change_connection.block (true);
_editor->set_selected_regionview_from_region_list (region, Selection::Add);
_change_connection.block (false);
}
}
}
} else {
_editor->get_selection ().clear_regions ();
@ -500,7 +492,6 @@ void
EditorRegions::set_selected (RegionSelection& regions)
{
for (RegionSelection::iterator i = regions.begin (); i != regions.end (); ++i) {
boost::shared_ptr<Region> r ((*i)->region ());
RegionRowMap::iterator it;
@ -569,7 +560,6 @@ EditorRegions::clock_format_changed ()
RegionRowMap::iterator i;
for (i = region_row_map.begin (); i != region_row_map.end (); ++i) {
TreeModel::iterator j = i->second;
boost::shared_ptr<Region> region = (*j)[_columns.region];
@ -650,8 +640,8 @@ EditorRegions::format_position (samplepos_t pos, char* buf, size_t bufsize, bool
void
EditorRegions::populate_row (boost::shared_ptr<Region> region, TreeModel::Row const& row, PBD::PropertyChange const& what_changed)
{
//the grid is most interested in the regions that are *visible* in the editor.
//this is a convenient place to flag changes to the grid cache, on a visible region
/* the grid is most interested in the regions that are *visible* in the editor.
* this is a convenient place to flag changes to the grid cache, on a visible region */
PropertyChange grid_interests;
grid_interests.add (ARDOUR::Properties::position);
grid_interests.add (ARDOUR::Properties::length);
@ -949,7 +939,7 @@ EditorRegions::button_press (GdkEventButton *ev)
}
if (region != 0 && Keyboard::is_button2_event (ev)) {
// start/stop audition
/* start/stop audition */
if (!Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
_editor->consider_auditioning (region);
}
@ -974,7 +964,6 @@ EditorRegions::selection_mapover (sigc::slot<void,boost::shared_ptr<Region> > sl
TreeIter iter;
if ((iter = _model->get_iter (*i))) {
/* some rows don't have a region associated with them, but can still be
selected (XXX maybe prevent them from being selected)
*/
@ -988,7 +977,6 @@ EditorRegions::selection_mapover (sigc::slot<void,boost::shared_ptr<Region> > sl
}
}
void
EditorRegions::drag_data_received (const RefPtr<Gdk::DragContext>& context,
int x, int y,
@ -1021,15 +1009,13 @@ EditorRegions::drag_data_received (const RefPtr<Gdk::DragContext>& context,
bool
EditorRegions::selection_filter (const RefPtr<TreeModel>& model, const TreeModel::Path& path, bool already_selected)
{
/* not possible to select rows that do not represent regions, like "Hidden" */
if (already_selected) {
/* deselecting anything is OK with us */
/* deselecting path, if it is selected, is OK */
return true;
}
/* not possible to select rows that do not represent regions, like "Hidden" */
TreeModel::iterator iter = model->get_iter (path);
if (iter) {
boost::shared_ptr<Region> r = (*iter)[_columns.region];
if (!r) {
@ -1077,14 +1063,12 @@ EditorRegions::name_edit (const std::string& path, const std::string& new_text)
}
if (region) {
region->set_name (new_text);
populate_row_name (region, (*row_iter));
}
}
void
EditorRegions::tag_editing_started (CellEditable* ce, const Glib::ustring& path)
{
@ -1178,11 +1162,10 @@ EditorRegions::get_single_selection ()
}
void
EditorRegions::freeze_tree_model (){
EditorRegions::freeze_tree_model ()
{
_display.set_model (Glib::RefPtr<Gtk::TreeStore> (0));
_model->set_sort_column (-2, SORT_ASCENDING); //Disable sorting to gain performance
}
void
@ -1215,7 +1198,6 @@ EditorRegions::glued_changed (std::string const & path)
region->set_position_lock_style ((*i)[_columns.glued] ? AudioTime : MusicTime);
}
}
}
void
@ -1228,7 +1210,6 @@ EditorRegions::muted_changed (std::string const & path)
region->set_muted (!(*i)[_columns.muted]);
}
}
}
void
@ -1241,7 +1222,6 @@ EditorRegions::opaque_changed (std::string const & path)
region->set_opaque (!(*i)[_columns.opaque]);
}
}
}
XMLNode&