summaryrefslogtreecommitdiff
path: root/libs/ardour/region.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2010-09-22 15:21:06 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2010-09-22 15:21:06 +0000
commitded4a143db069785aa33eeb6dc9da02770e3ae8e (patch)
treed1a2b94e11a4fe4a1d173e7972414cc16ecee7fd /libs/ardour/region.cc
parentd4aaa9c10cd21ef7e1b0f5509963b57c2465302b (diff)
much craziness with canvas cursors; fix 0 beat cursor text when shortening notes; fix crash when trimming locked regions; don't show trim cursors when region is locked; partial version of enumwriter validation fix from 2.X (less necessary with 3.0; probably more ...
git-svn-id: svn://localhost/ardour2/branches/3.0@7831 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/region.cc')
-rw-r--r--libs/ardour/region.cc28
1 files changed, 28 insertions, 0 deletions
diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc
index 7e78475eb3..6d4be37b6d 100644
--- a/libs/ardour/region.cc
+++ b/libs/ardour/region.cc
@@ -1587,3 +1587,31 @@ Region::use_sources (SourceList const & s)
}
}
}
+
+Trimmable::CanTrim
+Region::can_trim () const
+{
+ CanTrim ct = CanTrim (0);
+
+ if (locked()) {
+ return ct;
+ }
+
+ /* if not locked, we can always move the front later, and the end earlier
+ */
+
+ ct = CanTrim (ct | FrontTrimLater | EndTrimEarlier);
+
+ if (start() != 0) {
+ ct = CanTrim (ct | FrontTrimEarlier);
+ }
+
+ if (!_sources.empty()) {
+ if (last_frame() < _sources.front()->length (0)) {
+ ct = CanTrim (ct | EndTrimLater);
+ }
+ }
+
+ return ct;
+}
+