X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fardour%2Faudioregion.h;h=e385863efa7af60482ba23c9a531074e178e98c3;hb=33c61757fc8352fdb1280bca28b54d1adee183ff;hp=b919b6572c847ac9964ca7afa70f7cff46887bc7;hpb=dadee4622d15218e0190b72797897fbb7b247711;p=ardour.git diff --git a/libs/ardour/ardour/audioregion.h b/libs/ardour/ardour/audioregion.h index b919b6572c..e385863efa 100644 --- a/libs/ardour/ardour/audioregion.h +++ b/libs/ardour/ardour/audioregion.h @@ -28,7 +28,7 @@ #include "ardour/ardour.h" #include "ardour/automatable.h" -#include "ardour/gain.h" +#include "ardour/automation_list.h" #include "ardour/logcurve.h" #include "ardour/region.h" @@ -44,7 +44,6 @@ namespace Properties { extern PBD::PropertyDescriptor fade_in_active; extern PBD::PropertyDescriptor fade_out_active; extern PBD::PropertyDescriptor scale_amplitude; - extern PBD::PropertyDescriptor scale_amplitude; /* the envelope and fades are not scalar items and so currently (2010/02) are not stored using Property. @@ -83,7 +82,7 @@ class AudioRegion : public Region gain_t scale_amplitude() const { return _scale_amplitude; } void normalize (float, float target_in_dB = 0.0f); - double maximum_amplitude () const; + double maximum_amplitude (Progress* p = 0) const; bool envelope_active () const { return _envelope_active; } bool fade_in_active () const { return _fade_in_active; } @@ -93,8 +92,8 @@ class AudioRegion : public Region boost::shared_ptr fade_out() { return _fade_out; } boost::shared_ptr envelope() { return _envelope; } - virtual nframes_t read_peaks (PeakData *buf, nframes_t npeaks, - nframes_t offset, nframes_t cnt, + virtual framecnt_t read_peaks (PeakData *buf, framecnt_t npeaks, + framecnt_t offset, framecnt_t cnt, uint32_t chan_n=0, double samples_per_unit= 1.0) const; /* Readable interface */ @@ -103,23 +102,20 @@ class AudioRegion : public Region ReadOpsNone = 0x0, ReadOpsOwnAutomation = 0x1, ReadOpsOwnScaling = 0x2, - ReadOpsCount = 0x4, - ReadOpsFades = 0x8 + ReadOpsFades = 0x4 }; virtual framecnt_t read (Sample*, framepos_t pos, framecnt_t cnt, int channel) const; virtual framecnt_t readable_length() const { return length(); } virtual framecnt_t read_at (Sample *buf, Sample *mixdown_buf, float *gain_buf, - framepos_t position, - framecnt_t cnt, - uint32_t chan_n = 0, - framecnt_t read_frames = 0, - framecnt_t skip_frames = 0) const; - + framepos_t position, + framecnt_t cnt, + uint32_t chan_n = 0) const; + virtual framecnt_t master_read_at (Sample *buf, Sample *mixdown_buf, float *gain_buf, framepos_t position, framecnt_t cnt, uint32_t chan_n=0) const; - + virtual framecnt_t read_raw_internal (Sample*, framepos_t, framecnt_t, int channel) const; XMLNode& state (); @@ -158,10 +154,6 @@ class AudioRegion : public Region return _automatable.control(id); } - /* export */ - - int exportme (ARDOUR::Session&, ARDOUR::ExportSpecification&); - /* xfade/fade interactions */ void suspend_fade_in (); @@ -176,7 +168,7 @@ class AudioRegion : public Region int update_transient (framepos_t old_position, framepos_t new_position); int adjust_transients (framepos_t delta); - std::list > find_silence (Sample, framecnt_t, InterThreadInfo&) const; + AudioIntervalResult find_silence (Sample, framecnt_t, InterThreadInfo&) const; private: friend class RegionFactory; @@ -184,7 +176,8 @@ class AudioRegion : public Region AudioRegion (boost::shared_ptr); AudioRegion (const SourceList &); - AudioRegion (boost::shared_ptr, frameoffset_t offset = 0, bool offset_relative = true); + AudioRegion (boost::shared_ptr); + AudioRegion (boost::shared_ptr, frameoffset_t offset); AudioRegion (boost::shared_ptr, const SourceList&); AudioRegion (SourceList &); @@ -194,10 +187,11 @@ class AudioRegion : public Region PBD::Property _default_fade_out; PBD::Property _fade_in_active; PBD::Property _fade_out_active; + /** linear gain to apply to the whole region */ PBD::Property _scale_amplitude; - + void register_properties (); - void post_set (); + void post_set (const PBD::PropertyChange&); void init (); void set_default_fades (); @@ -211,8 +205,6 @@ class AudioRegion : public Region Sample *buf, Sample *mixdown_buffer, float *gain_buffer, framepos_t position, framecnt_t cnt, uint32_t chan_n = 0, - framecnt_t read_frames = 0, - framecnt_t skip_frames = 0, ReadOps readops = ReadOps (~0)) const; void recompute_at_start ();