84 class ExportSpecification;
103 ,
public std::enable_shared_from_this<Region>
118 typedef std::map <PBD::PropertyChange, RegionList>
ChangeMap;
185 if (_retained_group_id == 0) {
186 _retained_take_cnt = 0;
188 _operation_rgroup_map.clear ();
189 _retained_group_id = _next_group_id << 4;
190 _clear_on_destruction =
true;
192 _clear_on_destruction =
false;
197 if (_clear_on_destruction) {
199 _retained_group_id = 0;
200 _next_group_id += _retained_take_cnt;
201 _operation_rgroup_map.clear();
216 _retained_take_cnt = std::max (_retained_take_cnt, take);
217 return _retained_group_id + (take << 4);
224 void set_region_group (uint64_t rg,
bool explicitly =
false) { _reg_group = rg | (explicitly ? Explicit : NoGroup); }
225 void unset_region_group (
bool explicitly =
false) { _reg_group = (explicitly ? Explicit : NoGroup); }
232 float shift ()
const {
return _shift; }
268 bool muted ()
const {
return _muted; }
275 bool captured ()
const {
return !(_import || _external); }
276 bool can_move ()
const {
return !_position_locked && !_locked; }
279 bool import ()
const {
return _import; }
290 return first_sample() <= sample && sample <= last_sample();
294 return position() <= pos && pos <= nt_last();
314 bool uses_source (std::shared_ptr<const Source>,
bool shallow =
false)
const;
374 return position().distance (region_beats_to_absolute_time (beats)).beats ();
398 std::shared_ptr<ARDOUR::Playlist>
playlist ()
const {
return _playlist.lock(); }
405 std::shared_ptr<Source>
source (uint32_t n=0)
const {
return _sources[ (n < _sources.size()) ? n : 0 ]; }
416 virtual std::shared_ptr<Evoral::Control>
419 virtual std::shared_ptr<const Evoral::Control>
424 std::string
tags()
const {
return _tags; }
446 virtual bool depends_on (std::shared_ptr<Region> )
const {
return false; }
504 _changemap = changemap;
513 bool add_plugin (std::shared_ptr<RegionFxPlugin>, std::shared_ptr<RegionFxPlugin> pos = std::shared_ptr<RegionFxPlugin> ());
514 virtual bool remove_plugin (std::shared_ptr<RegionFxPlugin>) {
return false; }
518 Glib::Threads::RWLock::ReaderLock lm (_fx_lock);
519 return !_plugins.empty ();
522 std::shared_ptr<RegionFxPlugin>
nth_plugin (uint32_t n)
const {
523 Glib::Threads::RWLock::ReaderLock lm (_fx_lock);
524 for (
auto const& i : _plugins) {
529 return std::shared_ptr<RegionFxPlugin> ();
532 void foreach_plugin (std::function<
void(std::weak_ptr<RegionFxPlugin>)> method)
const {
533 Glib::Threads::RWLock::ReaderLock lm (_fx_lock);
534 for (
auto const& i : _plugins) {
535 method (std::weak_ptr<RegionFxPlugin> (i));
564 virtual bool _add_plugin (std::shared_ptr<RegionFxPlugin>, std::shared_ptr<RegionFxPlugin>,
bool) {
return false; }
Temporal::timepos_t source_beats_to_region_time(Temporal::Beats beats) const
void trim_front(timepos_t const &new_position)
bool exact_equivalent(std::shared_ptr< const Region >) const
timepos_t sync_position() const
void set_region_group(uint64_t rg, bool explicitly=false)
virtual void set_length_internal(timecnt_t const &)
AnalysisFeatureList _user_transients
void use_sources(SourceList const &)
virtual timecnt_t tail() const
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
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()
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)
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
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)
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)
bool is_implicitly_ungrouped()
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)
bool is_explicitly_grouped()
std::atomic< int > _source_deleted
timecnt_t sync_offset(int &dir) const
void move_cue_marker(CueMarker const &, timepos_t const ®ion_relative_position)
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
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
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
PBD::Signal< void()> RegionFxChanged
void set_sync_position(timepos_t const &n)
timepos_t source_position() const
virtual int set_state(const XMLNode &, int version)
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
static void make_property_quarks()
void set_layer(layer_t l)
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 &)
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
std::map< PBD::PropertyChange, RegionList > ChangeMap
PBD::PropertyList derive_properties(bool with_times=true, bool with_envelope=false) 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)
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
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)
bool is_explicitly_ungrouped()
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 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
RegionEditState _first_edit
Temporal::TimeDomain time_domain() const
PBD::Property< bool > _automatic
virtual XMLNode & state() const
Temporal::Beats absolute_time_to_region_beats(Temporal::timepos_t const &) const
const SourceList & master_sources() 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
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
PBD::Property< bool > _muted
bool position_locked() const
timepos_t decrement() const
GtkImageIconNameData name
PBD::PropertyDescriptor< bool > hidden
PBD::PropertyDescriptor< uint64_t > layering_index
PBD::PropertyDescriptor< bool > contents
PBD::PropertyDescriptor< bool > valid_transients
PBD::PropertyDescriptor< timepos_t > sync_position
PBD::PropertyDescriptor< bool > left_of_split
PBD::PropertyDescriptor< bool > external
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
OverlapType coverage_exclusive_ends(T sa, T eaE, T sb, T ebE)
bool _clear_on_destruction