Ardour  9.0-pre0-1699-gfaebc7ab35
ardour/ardour/region.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2000-2017 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2006-2014 David Robillard <d@drobilla.net>
4  * Copyright (C) 2007-2012 Carl Hetherington <carl@carlh.net>
5  * Copyright (C) 2013-2019 Robin Gareus <robin@gareus.org>
6  * Copyright (C) 2015-2017 Nick Mainsbridge <mainsbridge@gmail.com>
7  * Copyright (C) 2018 Ben Loftis <ben@harrisonconsoles.com>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License along
20  * with this program; if not, write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22  */
23 
24 #pragma once
25 
26 #include <memory>
27 #include <optional>
28 #include <vector>
29 
30 #include "temporal/domain_swap.h"
31 #include "temporal/timeline.h"
32 #include "temporal/range.h"
33 #include "temporal/tempo.h"
34 
35 #include "pbd/undo.h"
36 #include "pbd/signals.h"
37 #include "ardour/ardour.h"
38 #include "ardour/data_type.h"
39 #include "ardour/automatable.h"
40 #include "ardour/movable.h"
41 #include "ardour/readable.h"
42 #include "ardour/session_object.h"
43 #include "ardour/trimmable.h"
44 #include "ardour/types_convert.h"
45 
46 class XMLNode;
47 
48 namespace PBD {
49  class Progress;
50 }
51 
52 namespace ARDOUR {
53 
54 namespace Properties {
68  LIBARDOUR_API extern PBD::PropertyDescriptor<bool> valid_transients; // used for signal only
80  LIBARDOUR_API extern PBD::PropertyDescriptor<bool> contents; // type doesn't matter here, used for signal only
81  LIBARDOUR_API extern PBD::PropertyDescriptor<bool> region_fx; // type doesn't matter here, used for signal only
82  LIBARDOUR_API extern PBD::PropertyDescriptor<bool> region_tempo; // type doesn't matter here, used for signal only
83  LIBARDOUR_API extern PBD::PropertyDescriptor<bool> region_meter; // type doesn't matter here, used for signal only
84 };
85 
86 class Playlist;
87 class Filter;
88 class ExportSpecification;
89 class Plugin;
90 class RegionFxPlugin;
91 
95  EditChangesID = 2
96 };
97 
100  InnerSplit = 1, // when splitting a Range, there's left/center/right parts of the split
102  Paste = 4
103 };
104 
106  : public SessionObject
107  , public std::enable_shared_from_this<Region>
108  , public Trimmable
109  , public Movable
111 {
112 public:
113  typedef std::vector<std::shared_ptr<Source> > SourceList;
114  typedef std::list<std::shared_ptr<RegionFxPlugin>> RegionFxList;
115 
116  static void make_property_quarks ();
117 
118  static PBD::Signal<void(std::shared_ptr<RegionList>, const PBD::PropertyChange&)> RegionsPropertyChanged;
119 
121 
122  typedef std::map <PBD::PropertyChange, RegionList> ChangeMap;
123 
124  virtual ~Region();
125 
127  bool set_name (const std::string& str);
128 
129  PBD::PropertyList derive_properties (bool with_times = true, bool with_envelope = false) const;
130 
131  const DataType& data_type () const { return _type; }
135 
143  timepos_t position () const { return _length.val().position(); }
144  timepos_t start () const { return _start.val(); }
145  timecnt_t length () const { return _length.val(); }
146  timepos_t end() const;
147  timepos_t nt_last() const { return end().decrement(); }
148 
149  virtual timecnt_t tail () const { return timecnt_t (0); }
150 
154 
155  samplepos_t position_sample () const { return position().samples(); }
156  samplecnt_t start_sample () const { return _start.val().samples(); }
157  samplecnt_t length_samples () const { return _length.val().samples(); }
158 
159  layer_t layer () const { return _layer; }
160 
161  void set_selected_for_solo(bool yn);
162 
163  timepos_t source_length (uint32_t n) const;
164  uint32_t max_source_level () const;
165 
166  /* these two are valid ONLY during a StateChanged signal handler */
167 
168  timepos_t last_position () const { return _last_length.position(); }
169  timecnt_t last_length () const { return _last_length; }
170 
171  samplecnt_t ancestral_start_sample () const { return _ancestral_start.val().samples(); }
172  samplecnt_t ancestral_length_samples () const { return _ancestral_length.val().samples(); }
173  timepos_t ancestral_start () const { return _ancestral_start.val(); }
174  timecnt_t ancestral_length () const { return _ancestral_length.val(); }
175 
187  {
188  Glib::Threads::Mutex::Lock lm (_operation_rgroup_mutex);
189  if (_retained_group_id == 0) {
190  _retained_take_cnt = 0;
191  ++_next_group_id;
192  _operation_rgroup_map.clear (); // this is used for split & paste operations that honor the region's prior grouping
193  _retained_group_id = _next_group_id << 4; // this is used for newly created regions via recording or importing
194  _clear_on_destruction = true;
195  } else {
196  _clear_on_destruction = false;
197  }
198  }
200  {
201  if (_clear_on_destruction) {
202  Glib::Threads::Mutex::Lock lm (_operation_rgroup_mutex);
203  _retained_group_id = 0;
204  _next_group_id += _retained_take_cnt;
205  _operation_rgroup_map.clear();
206  }
207  }
209  };
210 
211  static uint64_t next_group_id () { return _next_group_id; }
212  static void set_next_group_id (uint64_t ngid) { _next_group_id = ngid; }
213 
214  /* access the retained group-id for actions like Recording, Import.
215  *
216  * Note When a single take creates multiple layered regions (e.g. loop recording)
217  * then the group id need to be bumped for each take
218  */
219  static uint64_t get_retained_group_id (uint64_t take = 0) {
220  _retained_take_cnt = std::max (_retained_take_cnt, take);
221  return _retained_group_id + (take << 4);
222  }
223 
224  /* access the group-id for an operation on a region, honoring the existing region's group status */
225  static uint64_t get_region_operation_group_id (uint64_t old_region_group, RegionOperationFlag flags);
226 
227  uint64_t region_group () const { return _reg_group; }
228  void set_region_group (uint64_t rg, bool explicitly = false) { _reg_group = rg | (explicitly ? Explicit : NoGroup); }
229  void unset_region_group (bool explicitly = false) { _reg_group = (explicitly ? Explicit : NoGroup); }
230 
231  bool is_explicitly_grouped() { return (_reg_group & Explicit) == Explicit; }
232  bool is_implicitly_ungrouped() { return (_reg_group == NoGroup); }
233  bool is_explicitly_ungrouped() { return (_reg_group == Explicit); }
234 
235  float stretch () const { return _stretch; }
236  float shift () const { return _shift; }
237 
238  void set_ancestral_data (timepos_t const & start, timecnt_t const & length, float stretch, float shift);
239 
240  timecnt_t sync_offset (int& dir) const;
242 
244 
245  /* first_sample() is an alias; last_sample() just hides some math */
246 
247  samplepos_t first_sample () const { return position().samples(); }
248  samplepos_t last_sample () const { return first_sample() + length_samples() - 1; }
249 
258 
260  return Temporal::TimeRange (last_position(), last_position() + _last_length);
261  }
262 
264  return Temporal::TimeRange (timepos_t (first_sample()), timepos_t (first_sample() + length_samples()));
265  }
266 
268  return Temporal::TimeRange (position(), position() + length());
269  }
270 
271  bool hidden () const { return _hidden; }
272  bool muted () const { return _muted; }
273  bool opaque () const { return _opaque; }
274  bool locked () const { return _locked; }
275  bool position_locked () const { return _position_locked; }
276  bool video_locked () const { return _video_locked; }
277  bool automatic () const { return _automatic; }
278  bool whole_file () const { return _whole_file; }
279  bool captured () const { return !(_import || _external); }
280  bool can_move () const { return !_position_locked && !_locked; }
281  bool sync_marked () const { return _sync_marked; }
282  bool external () const { return _external; }
283  bool import () const { return _import; }
284 
286 
290 
292 
293  bool covers (samplepos_t sample) const {
294  return first_sample() <= sample && sample <= last_sample();
295  }
296 
297  bool covers (timepos_t const & pos) const {
298  return position() <= pos && pos <= nt_last();
299  }
300 
307  Temporal::OverlapType coverage (timepos_t const & start, timepos_t const & end, bool with_tail = false) const {
308  return Temporal::coverage_exclusive_ends (position(), with_tail ? nt_last() + tail() : nt_last(), start, end);
309  }
310 
311  bool exact_equivalent (std::shared_ptr<const Region>) const;
312  bool size_equivalent (std::shared_ptr<const Region>) const;
313  bool overlap_equivalent (std::shared_ptr<const Region>) const;
314  bool enclosed_equivalent (std::shared_ptr<const Region>) const;
315  bool layer_and_time_equivalent (std::shared_ptr<const Region>) const;
316  bool source_equivalent (std::shared_ptr<const Region>) const;
317  bool any_source_equivalent (std::shared_ptr<const Region>) const;
318  bool uses_source (std::shared_ptr<const Source>, bool shallow = false) const;
319  void deep_sources (std::set<std::shared_ptr<Source> >&) const;
320 
321  std::string source_string () const;
322 
323 
324  /* EDITING OPERATIONS */
325 
326  void set_length (timecnt_t const &);
327  void set_start (timepos_t const &);
328  void set_position (timepos_t const &);
331  virtual void update_after_tempo_map_change (bool send_change = true);
332  void nudge_position (timecnt_t const &);
333 
334  bool at_natural_position () const;
336 
337  void move_start (timecnt_t const & distance);
338  void trim_front (timepos_t const & new_position);
339  void trim_end (timepos_t const & new_position);
340  void trim_to (timepos_t const & pos, timecnt_t const & length);
341 
342  /* fades are inherently audio in nature and we specify them in samples */
343  virtual void fade_range (samplepos_t, samplepos_t) {}
344 
345  void cut_front (timepos_t const & new_position);
346  void cut_end (timepos_t const & new_position);
347 
348  void raise ();
349  void lower ();
350  void raise_to_top ();
352 
353  void set_sync_position (timepos_t const & n);
355  void set_hidden (bool yn);
356  void set_muted (bool yn);
357  void set_whole_file (bool yn);
358  void set_automatic (bool yn);
359  void set_opaque (bool yn);
360  void set_locked (bool yn);
361  void set_video_locked (bool yn);
362  void set_position_locked (bool yn);
363 
364  /* ONLY Playlist can call this */
365  void set_layer (layer_t l);
368  void modify_front_unchecked (timepos_t const & new_position, bool reset_fade);
369  void modify_end_unchecked (timepos_t const & new_position, bool reset_fade);
370 
374  return timepos_t (position().distance (region_beats_to_absolute_time (beats)));
375  }
378  return position().distance (region_beats_to_absolute_time (beats)).beats ();
379  }
382 
385 
388 
391  return timepos_t (position().distance (source_beats_to_absolute_time (beats)));
392  }
395 
397 
399 
400  int apply (Filter &, PBD::Progress* progress = 0);
401 
402  std::shared_ptr<ARDOUR::Playlist> playlist () const { return _playlist.lock(); }
403  virtual void set_playlist (std::weak_ptr<ARDOUR::Playlist>);
404 
405  void source_deleted (std::weak_ptr<Source>);
406 
407  bool is_compound () const;
408 
409  std::shared_ptr<Source> source (uint32_t n=0) const { return _sources[ (n < _sources.size()) ? n : 0 ]; }
410 
411  SourceList& sources_for_edit () { return _sources; }
412  const SourceList& sources () const { return _sources; }
413  const SourceList& master_sources () const { return _master_sources; }
414 
415  std::vector<std::string> master_source_names();
417 
418  /* automation */
419 
420  virtual std::shared_ptr<Evoral::Control>
421  control (const Evoral::Parameter& id, bool create=false) = 0;
422 
423  virtual std::shared_ptr<const Evoral::Control>
424  control (const Evoral::Parameter& id) const = 0;
425 
426  /* tags */
427 
428  std::string tags() const { return _tags; }
429  virtual bool set_tags (const std::string& str) {
430  if (_tags != str) {
431  _tags = str;
432  PropertyChanged (PBD::PropertyChange (Properties::tags));
433  }
434  return true;
435  }
436 
437  /* serialization */
438 
439  XMLNode& get_state () const;
440  virtual int set_state (const XMLNode&, int version);
441 
442  virtual bool do_export (std::string const&) const = 0;
443 
444  virtual std::shared_ptr<Region> get_parent() const;
445 
446  uint64_t layering_index () const { return _layering_index; }
447  void set_layering_index (uint64_t when) { _layering_index = when; }
448 
449  virtual bool is_dependent() const { return false; }
450  virtual bool depends_on (std::shared_ptr<Region> /*other*/) const { return false; }
451 
452  virtual void add_transient (samplepos_t) {
453  // no transients, but its OK
454  }
455 
456  virtual void clear_transients () {
457  // no transients, but its OK
458  }
459 
460  virtual void update_transient (samplepos_t /* old_position */, samplepos_t /* new_position */) {
461  // no transients, but its OK
462  }
463 
464  virtual void remove_transient (samplepos_t /* where */) {
465  // no transients, but its OK
466  }
467 
468  virtual void set_onsets (AnalysisFeatureList&) {
469  // no transients, but its OK
470  }
471 
476 
477  void captured_xruns (XrunPositions&, bool abs = false) const;
478 
486  // no transients, but its OK
487  }
488 
489  /* wrapper to the above for easy access throug Lua */
492  get_transients (rv);
493  return rv;
494  }
495 
496  bool has_transients () const;
497 
498  virtual int separate_by_channel (std::vector< std::shared_ptr<Region> >&) const {
499  return -1;
500  }
501 
503 
504  void drop_sources ();
505 
506  /* Allow to collect RegionsPropertyChanged signal emissions */
507  void set_changemap (ChangeMap* changemap) {
508  _changemap = changemap;
509  }
510 
511  void get_cue_markers (CueMarkers&, bool abs = false) const;
512  void move_cue_marker (CueMarker const &, timepos_t const & region_relative_position);
513  void rename_cue_marker (CueMarker&, std::string const &);
514 
515  /* Region Fx */
516  bool load_plugin (ARDOUR::PluginType type, std::string const& name);
517  bool add_plugin (std::shared_ptr<RegionFxPlugin>, std::shared_ptr<RegionFxPlugin> pos = std::shared_ptr<RegionFxPlugin> ());
518  virtual bool remove_plugin (std::shared_ptr<RegionFxPlugin>) { return false; }
519  virtual void reorder_plugins (RegionFxList const&);
520 
521  bool has_region_fx () const {
522  Glib::Threads::RWLock::ReaderLock lm (_fx_lock);
523  return !_plugins.empty ();
524  }
525 
526  size_t n_region_fx () const {
527  Glib::Threads::RWLock::ReaderLock lm (_fx_lock);
528  return _plugins.size ();
529  }
530 
531  std::shared_ptr<RegionFxPlugin> nth_plugin (uint32_t n) const {
532  Glib::Threads::RWLock::ReaderLock lm (_fx_lock);
533  for (auto const& i : _plugins) {
534  if (0 == n--) {
535  return i;
536  }
537  }
538  return std::shared_ptr<RegionFxPlugin> ();
539  }
540 
541  void foreach_plugin (std::function<void(std::weak_ptr<RegionFxPlugin>)> method) const {
542  Glib::Threads::RWLock::ReaderLock lm (_fx_lock);
543  for (auto const& i : _plugins) {
544  method (std::weak_ptr<RegionFxPlugin> (i));
545  }
546  }
547 
548  std::optional<Temporal::Tempo> tempo() const { return _tempo; }
549  void set_tempo (Temporal::Tempo const &);
550  std::optional<Temporal::Meter> meter() const { return _meter; }
551  void set_meter (Temporal::Meter const &);
552 
553  std::shared_ptr<Temporal::TempoMap> tempo_map() const;
554 
555 protected:
556  virtual XMLNode& state () const;
557 
558  friend class RegionFactory;
559 
561  Region (const SourceList& srcs);
562 
564  Region (std::shared_ptr<const Region>);
565 
567  Region (std::shared_ptr<const Region>, timecnt_t const & start_offset);
568 
570  Region (std::shared_ptr<const Region>, const SourceList&);
571 
573  Region (Session& s, timepos_t const & start, timecnt_t const & length, const std::string& name, DataType);
574 
575  virtual bool can_trim_start_before_source_start () const {
576  return false;
577  }
578 
579 protected:
580  virtual bool _add_plugin (std::shared_ptr<RegionFxPlugin>, std::shared_ptr<RegionFxPlugin>, bool) { return false; }
581  virtual void fx_latency_changed (bool no_emit);
582  virtual void fx_tail_changed (bool no_emit);
583 
584  virtual void send_change (const PBD::PropertyChange&);
585  virtual int _set_state (const XMLNode&, int version, PBD::PropertyChange& what_changed, bool send_signal);
586  virtual void set_position_internal (timepos_t const & pos);
588  virtual void set_start_internal (timepos_t const &);
590  void first_edit ();
591  virtual void ensure_length_sanity () {}
592 
593  void override_opaqueness (bool yn) {
594  _opaque = yn;
595  }
596 
597  /* This is always using AudioTime. convenient for evenlopes in AudioRegion */
598  timepos_t len_as_tpos () const { return timepos_t((samplepos_t)_length.val().samples()); }
599 
601 
602  mutable Glib::Threads::RWLock _fx_lock;
603  uint32_t _fx_latency;
604  uint32_t _fx_tail;
606 
607  std::optional<Temporal::Tempo> _tempo;
608  std::optional<Temporal::Meter> _meter;
609 
618 
622 
623  std::weak_ptr<ARDOUR::Playlist> _playlist;
624 
626 
627  AnalysisFeatureList _onsets; // used by the Ferret (Aubio OnsetDetector)
628 
629  // _transient_user_start is covered by _valid_transients
631  samplepos_t _transient_user_start; // region's _start relative to user_transients
632 
633  // these are used by Playlist::find_next_transient() in absence of onsets
634  AnalysisFeatureList _transients; // Source Analysis (QM Transient), user read-only
637 
639 
640 private:
642 
644 
645  void maybe_uncopy ();
647 
648  bool verify_start (timepos_t const &);
650 
651  virtual void recompute_at_start () = 0;
652  virtual void recompute_at_end () = 0;
653 
671  PBD::Property<bool> _contents; // type is irrelevant
672 
676 
678 
680 
681  void use_sources (SourceList const &);
682 
683  enum RegionGroupFlags : uint64_t {
684  NoGroup = 0x0, // no flag: implicitly grouped if the id is nonzero; or implicitly 'un-grouped' if the group-id is zero
685  Explicit = 0x1, // the user has explicitly grouped or ungrouped this region. explicitly grouped regions can cross track-group boundaries
686  };
687  static uint64_t _retained_group_id;
688  static uint64_t _retained_take_cnt;
689  static uint64_t _next_group_id;
690 
691  static Glib::Threads::Mutex _operation_rgroup_mutex;
692  static std::map<uint64_t, uint64_t> _operation_rgroup_map;
693 
694  std::atomic<int> _source_deleted;
695  Glib::Threads::Mutex _source_list_lock;
697 };
698 
699 } /* namespace ARDOUR */
700 
Temporal::timepos_t source_beats_to_region_time(Temporal::Beats beats) const
void trim_front(timepos_t const &new_position)
void lower_to_bottom()
bool exact_equivalent(std::shared_ptr< const Region >) const
void set_hidden(bool yn)
timepos_t sync_position() const
void set_region_group(uint64_t rg, bool explicitly=false)
AnalysisFeatureList _user_transients
void use_sources(SourceList const &)
virtual timecnt_t tail() const
virtual void ensure_length_sanity()
void set_position_unchecked(timepos_t const &)
static uint64_t get_retained_group_id(uint64_t take=0)
bool covers(samplepos_t sample) const
void set_master_sources(const SourceList &)
samplepos_t first_sample() const
Temporal::Beats region_beats_to_source_beats(Temporal::Beats beats) const
void merge_features(AnalysisFeatureList &, const AnalysisFeatureList &, const sampleoffset_t) const
Temporal::Beats source_beats_to_absolute_beats(Temporal::Beats beats) const
std::optional< Temporal::Meter > _meter
timecnt_t ancestral_length() const
virtual void set_playlist(std::weak_ptr< ARDOUR::Playlist >)
timepos_t earliest_possible_position() const
PBD::Property< bool > _import
PBD::Property< bool > _opaque
void set_layering_index(uint64_t when)
std::weak_ptr< ARDOUR::Playlist > _playlist
virtual void remove_transient(samplepos_t)
Temporal::timepos_t region_beats_to_region_time(Temporal::Beats beats) const
std::shared_ptr< Source > source(uint32_t n=0) const
virtual void add_transient(samplepos_t)
virtual void recompute_at_end()=0
static uint64_t next_group_id()
void suspend_property_changes()
void set_meter(Temporal::Meter const &)
timepos_t last_position() const
void transients(AnalysisFeatureList &)
virtual int _set_state(const XMLNode &, int version, PBD::PropertyChange &what_changed, bool send_signal)
virtual void update_after_tempo_map_change(bool send_change=true)
virtual void update_transient(samplepos_t, samplepos_t)
float stretch() const
Temporal::timepos_t absolute_time_to_region_time(Temporal::timepos_t const &) const
PBD::Property< bool > _valid_transients
void foreach_plugin(std::function< void(std::weak_ptr< RegionFxPlugin >)> method) const
void set_whole_file(bool yn)
samplecnt_t length_samples() const
Region(Session &s, timepos_t const &start, timecnt_t const &length, const std::string &name, DataType)
Temporal::timepos_t source_beats_to_absolute_time(Temporal::Beats beats) const
void finish_domain_bounce(Temporal::DomainBounceInfo &)
bool source_equivalent(std::shared_ptr< const Region >) const
void trim_end(timepos_t const &new_position)
virtual bool can_trim_start_before_source_start() const
bool at_natural_position() const
virtual void clear_transients()
void set_initial_position(timepos_t const &)
PBD::Property< timepos_t > _start
void set_automatic(bool yn)
virtual bool depends_on(std::shared_ptr< Region >) const
Region(std::shared_ptr< const Region >)
bool size_equivalent(std::shared_ptr< const Region >) const
void get_cue_markers(CueMarkers &, bool abs=false) const
samplecnt_t start_sample() const
virtual bool do_export(std::string const &) const =0
void set_length_internal(timecnt_t const &)
std::shared_ptr< RegionFxPlugin > nth_plugin(uint32_t n) const
uint32_t max_source_level() const
PBD::Property< float > _stretch
bool set_name(const std::string &str)
std::optional< Temporal::Tempo > _tempo
std::shared_ptr< Temporal::TempoMap > tempo_map() const
PBD::Property< bool > _sync_marked
bool has_transients() const
bool enclosed_equivalent(std::shared_ptr< const Region >) const
PBD::Property< bool > _hidden
static uint64_t _retained_take_cnt
bool verify_start(timepos_t const &)
void trim_to(timepos_t const &pos, timecnt_t const &length)
static std::map< uint64_t, uint64_t > _operation_rgroup_map
virtual bool _add_plugin(std::shared_ptr< RegionFxPlugin >, std::shared_ptr< RegionFxPlugin >, bool)
timepos_t adjust_to_sync(timepos_t const &) const
samplecnt_t ancestral_start_sample() const
virtual std::shared_ptr< const Evoral::Control > control(const Evoral::Parameter &id) const =0
Region(std::shared_ptr< const Region >, timecnt_t const &start_offset)
void maybe_invalidate_transients()
static uint64_t _retained_group_id
void set_position_locked(bool yn)
virtual void fx_tail_changed(bool no_emit)
timepos_t start() const
std::atomic< int > _source_deleted
timecnt_t sync_offset(int &dir) const
void move_cue_marker(CueMarker const &, timepos_t const &region_relative_position)
void drop_sources()
timepos_t source_length(uint32_t n) const
void set_position(timepos_t const &)
virtual void fx_latency_changed(bool no_emit)
AnalysisFeatureList _transients
Temporal::OverlapType coverage(timepos_t const &start, timepos_t const &end, bool with_tail=false) const
bool has_region_fx() const
void set_length_unchecked(timecnt_t const &)
void clear_sync_position()
PBD::Property< float > _shift
bool whole_file() const
void trim_to_internal(timepos_t const &position, timecnt_t const &length)
PBD::Property< timepos_t > _ancestral_start
virtual std::shared_ptr< Region > get_parent() const
static uint64_t _next_group_id
std::optional< Temporal::Tempo > tempo() const
uint64_t layering_index() const
void set_start(timepos_t const &)
void modify_end_unchecked(timepos_t const &new_position, bool reset_fade)
std::vector< std::string > master_source_names()
uint64_t region_group() const
Temporal::TimeRange range() const
std::shared_ptr< ARDOUR::Playlist > playlist() const
Temporal::Beats absolute_time_to_soucre_beats(Temporal::timepos_t const &) const
PBD::Signal< void()> RegionFxChanged
bool sync_marked() const
void set_sync_position(timepos_t const &n)
timepos_t source_position() const
virtual int set_state(const XMLNode &, int version)
bool automatic() const
void override_opaqueness(bool yn)
virtual void fade_range(samplepos_t, samplepos_t)
Temporal::TimeDomain position_time_domain() const
bool uses_source(std::shared_ptr< const Source >, bool shallow=false) const
virtual ~Region()
static void make_property_quarks()
void set_layer(layer_t l)
void set_locked(bool yn)
XMLNode & get_state() const
PBD::Property< bool > _left_of_split
Glib::Threads::RWLock _fx_lock
bool load_plugin(ARDOUR::PluginType type, std::string const &name)
samplepos_t position_sample() const
timecnt_t last_length() const
static void set_next_group_id(uint64_t ngid)
void special_set_position(timepos_t const &)
AnalysisFeatureList _onsets
virtual bool remove_plugin(std::shared_ptr< RegionFxPlugin >)
timecnt_t source_relative_position(Temporal::timepos_t const &) const
bool verify_length(timecnt_t &)
timecnt_t length() const
void deep_sources(std::set< std::shared_ptr< Source > > &) const
PBD::ScopedConnectionList _source_deleted_connections
PBD::Property< timepos_t > _sync_position
void set_changemap(ChangeMap *changemap)
void set_video_locked(bool yn)
void set_length(timecnt_t const &)
PBD::Property< bool > _locked
virtual bool is_dependent() const
timepos_t end() const
std::map< PBD::PropertyChange, RegionList > ChangeMap
PBD::PropertyList derive_properties(bool with_times=true, bool with_envelope=false) const
std::string tags() const
PBD::Property< bool > _right_of_split
static PBD::Signal< void(std::shared_ptr< RegionList >, const PBD::PropertyChange &)> RegionsPropertyChanged
void set_selected_for_solo(bool yn)
const SourceList & sources() const
void mid_thaw(const PBD::PropertyChange &)
samplepos_t _transient_user_start
virtual void reorder_plugins(RegionFxList const &)
void register_properties()
virtual std::shared_ptr< Evoral::Control > control(const Evoral::Parameter &id, bool create=false)=0
PBD::Property< bool > _video_locked
virtual void send_change(const PBD::PropertyChange &)
void recompute_position_from_time_domain()
PBD::Property< bool > _contents
virtual bool set_tags(const std::string &str)
size_t n_region_fx() const
void set_muted(bool yn)
void rename_cue_marker(CueMarker &, std::string const &)
AnalysisFeatureList transients()
virtual void recompute_at_start()=0
timecnt_t region_relative_position(Temporal::timepos_t const &) const
void unset_region_group(bool explicitly=false)
bool add_plugin(std::shared_ptr< RegionFxPlugin >, std::shared_ptr< RegionFxPlugin > pos=std::shared_ptr< RegionFxPlugin >())
virtual int separate_by_channel(std::vector< std::shared_ptr< Region > > &) const
std::optional< Temporal::Meter > meter() const
Region(const SourceList &srcs)
timepos_t len_as_tpos() const
samplepos_t _transient_analysis_end
samplepos_t last_sample() const
samplepos_t _transient_analysis_start
timepos_t position() const
static uint64_t get_region_operation_group_id(uint64_t old_region_group, RegionOperationFlag flags)
Trimmable::CanTrim can_trim() const
bool covers(timepos_t const &pos) const
PBD::Property< timecnt_t > _length
std::string source_string() const
void cut_front(timepos_t const &new_position)
PBD::Property< uint64_t > _layering_index
PBD::Property< bool > _position_locked
SourceList & sources_for_edit()
timepos_t ancestral_start() const
PBD::Property< timecnt_t > _ancestral_length
bool layer_and_time_equivalent(std::shared_ptr< const Region >) const
PBD::Property< bool > _whole_file
void nudge_position(timecnt_t const &)
void source_deleted(std::weak_ptr< Source >)
const DataType & data_type() const
SourceList _master_sources
void move_start(timecnt_t const &distance)
void start_domain_bounce(Temporal::DomainBounceInfo &)
bool any_source_equivalent(std::shared_ptr< const Region >) const
virtual void set_onsets(AnalysisFeatureList &)
std::list< std::shared_ptr< RegionFxPlugin > > RegionFxList
Temporal::TimeRange last_range() const
timepos_t nt_last() const
bool video_locked() const
bool verify_start_and_length(timepos_t const &, timecnt_t &)
virtual void get_transients(AnalysisFeatureList &)
Region(std::shared_ptr< const Region >, const SourceList &)
static Glib::Threads::Mutex _operation_rgroup_mutex
void raise_to_top()
void set_ancestral_data(timepos_t const &start, timecnt_t const &length, float stretch, float shift)
void captured_xruns(XrunPositions &, bool abs=false) const
samplepos_t latest_possible_sample() const
void set_tempo(Temporal::Tempo const &)
RegionEditState _first_edit
Temporal::TimeDomain time_domain() const
PBD::Property< bool > _automatic
virtual XMLNode & state() const
const SourceList & master_sources() const
layer_t layer() const
void move_to_natural_position()
PBD::Property< std::string > _tags
Temporal::timepos_t region_beats_to_absolute_time(Temporal::Beats beats) const
void cut_end(timepos_t const &new_position)
samplecnt_t ancestral_length_samples() const
bool is_compound() const
void set_position_time_domain(Temporal::TimeDomain ps)
Glib::Threads::Mutex _source_list_lock
void modify_front_unchecked(timepos_t const &new_position, bool reset_fade)
int apply(Filter &, PBD::Progress *progress=0)
virtual void set_position_internal(timepos_t const &pos)
void subscribe_to_source_drop()
bool overlap_equivalent(std::shared_ptr< const Region >) const
PBD::Property< bool > _external
virtual void set_start_internal(timepos_t const &)
Temporal::Beats region_distance_to_region_beats(Temporal::timecnt_t const &) const
std::vector< std::shared_ptr< Source > > SourceList
Temporal::TimeRange range_samples() const
PBD::Property< uint64_t > _reg_group
Temporal::Beats absolute_time_to_source_beats(Temporal::timepos_t const &) const
void set_opaque(bool yn)
PBD::Property< bool > _muted
void maybe_uncopy()
bool position_locked() const
timepos_t decrement() const
Definition: timeline.h:192
Definition: xml++.h:114
int64_t val() const
Definition: int62.h:70
GtkImageIconNameData name
Definition: gtkimage.h:6
#define LIBARDOUR_API
PBD::PropertyDescriptor< bool > hidden
PBD::PropertyDescriptor< uint64_t > layering_index
PBD::PropertyDescriptor< bool > contents
PBD::PropertyDescriptor< bool > region_meter
PBD::PropertyDescriptor< bool > valid_transients
PBD::PropertyDescriptor< timepos_t > sync_position
PBD::PropertyDescriptor< bool > left_of_split
PBD::PropertyDescriptor< bool > external
PBD::PropertyDescriptor< bool > region_tempo
PBD::PropertyDescriptor< float > stretch
PBD::PropertyDescriptor< bool > sync_marked
PBD::PropertyDescriptor< bool > position_locked
PBD::PropertyDescriptor< timecnt_t > length
PBD::PropertyDescriptor< bool > muted
PBD::PropertyDescriptor< bool > region_fx
PBD::PropertyDescriptor< bool > whole_file
PBD::PropertyDescriptor< uint64_t > reg_group
PBD::PropertyDescriptor< timepos_t > ancestral_start
PBD::PropertyDescriptor< bool > automatic
PBD::PropertyDescriptor< timepos_t > start
PBD::PropertyDescriptor< bool > opaque
PBD::PropertyDescriptor< bool > locked
PBD::PropertyDescriptor< bool > video_locked
PBD::PropertyDescriptor< bool > right_of_split
PBD::PropertyDescriptor< layer_t > layer
PBD::PropertyDescriptor< timecnt_t > ancestral_length
PBD::PropertyDescriptor< float > shift
PBD::PropertyDescriptor< std::string > tags
std::list< samplepos_t > AnalysisFeatureList
std::set< CueMarker > CueMarkers
Temporal::samplecnt_t samplecnt_t
std::vector< samplepos_t > XrunPositions
Temporal::timecnt_t timecnt_t
Temporal::timepos_t timepos_t
Temporal::sampleoffset_t sampleoffset_t
Temporal::samplepos_t samplepos_t
uint32_t layer_t
DebugBits Properties
Definition: axis_view.h:42
OverlapType coverage_exclusive_ends(T sa, T eaE, T sb, T ebE)