/*
- Copyright (C) 2001-2006 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
+ * Copyright (C) 2006-2014 David Robillard <d@drobilla.net>
+ * Copyright (C) 2007-2012 Carl Hetherington <carl@carlh.net>
+ * Copyright (C) 2007-2019 Paul Davis <paul@linuxaudiosystems.com>
+ * Copyright (C) 2007 Doug McLain <doug@nostar.net>
+ * Copyright (C) 2013-2019 Robin Gareus <robin@gareus.org>
+ * Copyright (C) 2015-2017 Nick Mainsbridge <mainsbridge@gmail.com>
+ * Copyright (C) 2015 Tim Mayberry <mojofunk@gmail.com>
+ * Copyright (C) 2018 Ben Loftis <ben@harrisonconsoles.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
#include <cmath>
#include <algorithm>
bool automation)
: TimeAxisViewItem (r->name(), *parent, tv, spu, basic_color, r->position(), r->length(), false, automation,
(automation ? TimeAxisViewItem::ShowFrame :
- TimeAxisViewItem::Visibility (TimeAxisViewItem::ShowNameText|
+ TimeAxisViewItem::Visibility ((UIConfiguration::instance().get_show_region_name() ? TimeAxisViewItem::ShowNameText : 0) |
TimeAxisViewItem::ShowNameHighlight| TimeAxisViewItem::ShowFrame)))
, _region (r)
, sync_mark(0)
{
samplecnt_t shortest = max_samplecnt;
- /* remove old silent samples */
+ /* remove old silent frames */
drop_silent_frames ();
if (silences.empty()) {
unit_length = _region->length() / samples_per_pixel;
- for (vector<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
+ for (vector<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
- (*i)->set_duration (unit_length);
+ (*i)->set_duration (unit_length);
- }
+ }
}
}
}
/* Only trim region on the left if the first sample has gone beyond the left region's last sample. */
- if (region_left != 0 && (region_left->last_sample() > _region->first_sample() || regions_touching)) {
+ if (region_left != 0 && (region_left->last_sample() > _region->first_sample() || regions_touching)) {
region_left->trim_end (_region->first_sample() - 1);
}
}
/* back to region relative, keeping the relevant divisor */
return MusicSample (sample.sample - _region->position(), sample.division);
}
+
+void
+RegionView::update_visibility ()
+{
+ /* currently only the name visibility can be changed dynamically */
+
+ if (UIConfiguration::instance().get_show_region_name()) {
+ visibility = Visibility (visibility | ShowNameText);
+ } else {
+ visibility = Visibility (visibility & ~ShowNameText);
+ }
+
+ manage_name_text ();
+}