- uint32_t n_channels() { return sources.size(); }
- vector<string> master_source_names();
-
- bool envelope_active () const { return _flags & Region::EnvelopeActive; }
- bool fade_in_active () const { return _flags & Region::FadeIn; }
- bool fade_out_active () const { return _flags & Region::FadeOut; }
- bool captured() const { return !(_flags & (Region::Flag (Region::Import|Region::External))); }
-
- Curve& fade_in() { return _fade_in; }
- Curve& fade_out() { return _fade_out; }
- Curve& envelope() { return _envelope; }
-
- jack_nframes_t read_peaks (PeakData *buf, jack_nframes_t npeaks,
- jack_nframes_t offset, jack_nframes_t cnt,
- uint32_t chan_n=0, double samples_per_unit= 1.0) const;
-
- virtual jack_nframes_t read_at (Sample *buf, Sample *mixdown_buf,
- float *gain_buf, char * workbuf, jack_nframes_t position, jack_nframes_t cnt,
- uint32_t chan_n = 0,
- jack_nframes_t read_frames = 0,
- jack_nframes_t skip_frames = 0) const;
-
- jack_nframes_t master_read_at (Sample *buf, Sample *mixdown_buf,
- float *gain_buf, char * workbuf,
- jack_nframes_t position, jack_nframes_t cnt, uint32_t chan_n=0) const;
-
- XMLNode& state (bool);
- int set_state (const XMLNode&);
-
- static void set_default_fade (float steepness, jack_nframes_t len);
-
- enum FadeShape {
- Linear,
- Fast,
- Slow,
- LogA,
- LogB
- };
+ void normalize (float, float target_in_dB = 0.0f);
+ double maximum_amplitude (Progress* p = 0) const;
+
+ bool envelope_active () const { return _envelope_active; }
+ bool fade_in_active () const { return _fade_in_active; }
+ bool fade_out_active () const { return _fade_out_active; }
+
+ boost::shared_ptr<AutomationList> fade_in() { return _fade_in.val (); }
+ boost::shared_ptr<AutomationList> inverse_fade_in() { return _inverse_fade_in.val (); }
+ boost::shared_ptr<AutomationList> fade_out() { return _fade_out.val (); }
+ boost::shared_ptr<AutomationList> inverse_fade_out() { return _inverse_fade_out.val (); }
+ boost::shared_ptr<AutomationList> envelope() { return _envelope.val (); }
+
+ Evoral::Range<framepos_t> body_range () const;
+
+ virtual framecnt_t read_peaks (PeakData *buf, framecnt_t npeaks,
+ framecnt_t offset, framecnt_t cnt,
+ uint32_t chan_n=0, double frames_per_pixel = 1.0) const;
+
+ /* Readable interface */
+
+ 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) 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 ();
+ XMLNode& get_basic_state ();
+ int set_state (const XMLNode&, int version);
+
+ void fade_range (framepos_t, framepos_t);
+
+ bool fade_in_is_default () const;
+ bool fade_out_is_default () const;