Introduce global default-fade-shape configuration variable
authorAdrian Knoth <adi@drcomp.erfurt.thur.de>
Mon, 24 Mar 2014 12:22:49 +0000 (13:22 +0100)
committerAdrian Knoth <adi@drcomp.erfurt.thur.de>
Thu, 1 May 2014 18:02:14 +0000 (20:02 +0200)
Some users always want the same fade in/out style, e.g., constant power,
symmetric, fast etc.

To avoid having them change the fade style manually for each fade, use a
global configuration variable instead.

libs/ardour/ardour/rc_configuration_vars.h
libs/ardour/ardour/types.h
libs/ardour/audioregion.cc
libs/ardour/enums.cc

index 4401b1f74ca952f9cdd31fb622fdfe289467c990..c0c76d3826ff67c8e07be0c26a71adce554f11c3 100644 (file)
@@ -90,6 +90,7 @@ CONFIG_VARIABLE (bool, automation_follows_regions, "automation-follows-regions",
 CONFIG_VARIABLE (bool, region_boundaries_from_selected_tracks, "region-boundaries-from-selected-tracks", true)
 CONFIG_VARIABLE (bool, region_boundaries_from_onscreen_tracks, "region-boundaries-from-onscreen_tracks", true)
 CONFIG_VARIABLE (bool, autoscroll_editor, "autoscroll-editor", true)
+CONFIG_VARIABLE (FadeShape, default_fade_shape, "default-fade-shape", FadeLinear)
 
 /* monitoring, mute, solo etc */
 
index ab76208c0b7b55d85ad75b6db862973532e3e9a8..1b9c3326c00f64b724ddc8e810e1135672adeb5d 100644 (file)
@@ -632,6 +632,7 @@ std::istream& operator>>(std::istream& o, ARDOUR::DenormalModel& sf);
 std::istream& operator>>(std::istream& o, ARDOUR::WaveformScale& sf);
 std::istream& operator>>(std::istream& o, ARDOUR::WaveformShape& sf);
 std::istream& operator>>(std::istream& o, ARDOUR::PositionLockStyle& sf);
+std::istream& operator>>(std::istream& o, ARDOUR::FadeShape& sf);
 
 std::ostream& operator<<(std::ostream& o, const ARDOUR::SampleFormat& sf);
 std::ostream& operator<<(std::ostream& o, const ARDOUR::HeaderFormat& sf);
@@ -655,6 +656,7 @@ std::ostream& operator<<(std::ostream& o, const ARDOUR::DenormalModel& sf);
 std::ostream& operator<<(std::ostream& o, const ARDOUR::WaveformScale& sf);
 std::ostream& operator<<(std::ostream& o, const ARDOUR::WaveformShape& sf);
 std::ostream& operator<<(std::ostream& o, const ARDOUR::PositionLockStyle& sf);
+std::ostream& operator<<(std::ostream& o, const ARDOUR::FadeShape& sf);
 
 static inline ARDOUR::framepos_t
 session_frame_to_track_frame (ARDOUR::framepos_t session_frame, double speed)
index 45454b0909028661da4ae1d377b1677efb60f5d3..63530e2f01774b48835ff02d26e84652df270e4f 100644 (file)
@@ -1211,14 +1211,14 @@ void
 AudioRegion::set_default_fade_in ()
 {
        _fade_in_suspended = 0;
-       set_fade_in (FadeLinear, 64);
+       set_fade_in (Config->get_default_fade_shape(), 64);
 }
 
 void
 AudioRegion::set_default_fade_out ()
 {
        _fade_out_suspended = 0;
-       set_fade_out (FadeLinear, 64);
+       set_fade_out (Config->get_default_fade_shape(), 64);
 }
 
 void
index e32fe329af16ba2693fa425cfe1b54f54d759803..948025cc2b7e80d64a7045faccd5973013e4c23f 100644 (file)
@@ -941,3 +941,16 @@ std::ostream& operator<<(std::ostream& o, const Evoral::OverlapType& var)
        std::string s = enum_2_string (var);
        return o << s;
 }
+std::istream& operator>>(std::istream& o, FadeShape& var)
+{
+       std::string s;
+       o >> s;
+       var = (FadeShape) string_2_enum (s, var);
+       return o;
+}
+
+std::ostream& operator<<(std::ostream& o, const FadeShape& var)
+{
+       std::string s = enum_2_string (var);
+       return o << s;
+}