+ interp = dB_to_coefficient(interp);
+ dst->add ( (*c1)->when, interp );
+ c1++;
+ count++;
+ }
+}
+
+void
+AudioRegion::make_property_quarks ()
+{
+ Properties::envelope_active.property_id = g_quark_from_static_string (X_("envelope-active"));
+ DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for envelope-active = %1\n", Properties::envelope_active.property_id));
+ Properties::default_fade_in.property_id = g_quark_from_static_string (X_("default-fade-in"));
+ DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for default-fade-in = %1\n", Properties::default_fade_in.property_id));
+ Properties::default_fade_out.property_id = g_quark_from_static_string (X_("default-fade-out"));
+ DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for default-fade-out = %1\n", Properties::default_fade_out.property_id));
+ Properties::fade_in_active.property_id = g_quark_from_static_string (X_("fade-in-active"));
+ DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for fade-in-active = %1\n", Properties::fade_in_active.property_id));
+ Properties::fade_out_active.property_id = g_quark_from_static_string (X_("fade-out-active"));
+ DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for fade-out-active = %1\n", Properties::fade_out_active.property_id));
+ Properties::scale_amplitude.property_id = g_quark_from_static_string (X_("scale-amplitude"));
+ DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for scale-amplitude = %1\n", Properties::scale_amplitude.property_id));
+ Properties::fade_out_is_xfade.property_id = g_quark_from_static_string (X_("fade-out-is-xfade"));
+ DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for fade-out-is-xfade = %1\n", Properties::fade_out_is_xfade.property_id));
+ Properties::fade_out_is_short.property_id = g_quark_from_static_string (X_("fade-out-is-short"));
+ DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for fade-out-is-short = %1\n", Properties::fade_out_is_short.property_id));
+ Properties::fade_in_is_xfade.property_id = g_quark_from_static_string (X_("fade-in-is-xfade"));
+ DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for fade-in-is-xfade = %1\n", Properties::fade_in_is_xfade.property_id));
+ Properties::fade_in_is_short.property_id = g_quark_from_static_string (X_("fade-in-is-short"));
+ DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for fade-in-is-short = %1\n", Properties::fade_in_is_short.property_id));
+}
+
+void
+AudioRegion::register_properties ()
+{
+ /* no need to register parent class properties */
+
+ add_property (_envelope_active);
+ add_property (_default_fade_in);
+ add_property (_default_fade_out);
+ add_property (_fade_in_active);
+ add_property (_fade_out_active);
+ add_property (_scale_amplitude);
+ add_property (_fade_out_is_xfade);
+ add_property (_fade_out_is_short);
+ add_property (_fade_in_is_xfade);
+ add_property (_fade_in_is_short);
+}
+
+#define AUDIOREGION_STATE_DEFAULT \
+ _envelope_active (Properties::envelope_active, false) \
+ , _default_fade_in (Properties::default_fade_in, true) \
+ , _default_fade_out (Properties::default_fade_out, true) \
+ , _fade_in_active (Properties::fade_in_active, true) \
+ , _fade_out_active (Properties::fade_out_active, true) \
+ , _scale_amplitude (Properties::scale_amplitude, 1.0) \
+ , _fade_in_is_xfade (Properties::fade_in_is_xfade, false) \
+ , _fade_out_is_xfade (Properties::fade_out_is_xfade, false) \
+ , _fade_in_is_short (Properties::fade_in_is_short, false) \
+ , _fade_out_is_short (Properties::fade_out_is_short, false)
+
+#define AUDIOREGION_COPY_STATE(other) \
+ _envelope_active (Properties::envelope_active, other->_envelope_active) \
+ , _default_fade_in (Properties::default_fade_in, other->_default_fade_in) \
+ , _default_fade_out (Properties::default_fade_out, other->_default_fade_out) \
+ , _fade_in_active (Properties::fade_in_active, other->_fade_in_active) \
+ , _fade_out_active (Properties::fade_out_active, other->_fade_out_active) \
+ , _scale_amplitude (Properties::scale_amplitude, other->_scale_amplitude) \
+ , _fade_in_is_xfade (Properties::fade_in_is_xfade, other->_fade_in_is_xfade) \
+ , _fade_out_is_xfade (Properties::fade_out_is_xfade, other->_fade_out_is_xfade) \
+ , _fade_in_is_short (Properties::fade_in_is_short, other->_fade_in_is_short) \
+ , _fade_out_is_short (Properties::fade_out_is_short, other->_fade_out_is_short)
+/* a Session will reset these to its chosen defaults by calling AudioRegion::set_default_fade() */
+
+void
+AudioRegion::init ()
+{
+ register_properties ();
+
+ suspend_property_changes();
+ set_default_fades ();
+ set_default_envelope ();
+ resume_property_changes();
+
+ listen_to_my_curves ();
+ connect_to_analysis_changed ();
+ connect_to_header_position_offset_changed ();