diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc index 5646602e4c..46ec2e0a93 100644 --- a/gtk2_ardour/rc_option_editor.cc +++ b/gtk2_ardour/rc_option_editor.cc @@ -1719,6 +1719,25 @@ RCOptionEditor::RCOptionEditor () sigc::mem_fun (*_rc_config, &RCConfiguration::set_autoscroll_editor) )); + ComboOption *rsas = new ComboOption ( + "region-selection-after-split", + _("After splitting selected regions, select"), + sigc::mem_fun (*_rc_config, &RCConfiguration::get_region_selection_after_split), + sigc::mem_fun (*_rc_config, &RCConfiguration::set_region_selection_after_split)); + + // TODO: decide which of these modes are really useful + rsas->add(None, _("no regions")); + // rsas->add(NewlyCreatedLeft, _("newly-created regions before the split")); + // rsas->add(NewlyCreatedRight, _("newly-created regions after the split")); + rsas->add(NewlyCreatedBoth, _("newly-created regions")); + // rsas->add(Existing, _("unmodified regions in the existing selection")); + // rsas->add(ExistingNewlyCreatedLeft, _("existing selection and newly-created regions before the split")); + // rsas->add(ExistingNewlyCreatedRight, _("existing selection and newly-created regions after the split")); + rsas->add(ExistingNewlyCreatedBoth, _("existing selection and newly-created regions")); + + add_option (_("Editor"), rsas); + + /* AUDIO */ add_option (_("Audio"), new OptionEditorHeading (_("Buffering"))); diff --git a/libs/ardour/ardour/rc_configuration_vars.h b/libs/ardour/ardour/rc_configuration_vars.h index 0fd6c99218..0fd19aacd3 100644 --- a/libs/ardour/ardour/rc_configuration_vars.h +++ b/libs/ardour/ardour/rc_configuration_vars.h @@ -91,6 +91,7 @@ CONFIG_VARIABLE (bool, region_boundaries_from_selected_tracks, "region-boundarie 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) +CONFIG_VARIABLE (RegionSelectionAfterSplit, region_selection_after_split, "selection-after-split", None) /* monitoring, mute, solo etc */ diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h index 5daf9065e3..6cf373a016 100644 --- a/libs/ardour/ardour/types.h +++ b/libs/ardour/ardour/types.h @@ -353,6 +353,17 @@ namespace ARDOUR { Lock }; + enum RegionSelectionAfterSplit { + None = 0, + NewlyCreatedLeft = 1, // bit 0 + NewlyCreatedRight = 2, // bit 1 + NewlyCreatedBoth = 3, + Existing = 4, // bit 2 + ExistingNewlyCreatedLeft = 5, + ExistingNewlyCreatedRight = 6, + ExistingNewlyCreatedBoth = 7 + }; + enum RegionPoint { Start, End, @@ -629,6 +640,7 @@ 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::istream& operator>>(std::istream& o, ARDOUR::RegionSelectionAfterSplit& sf); std::ostream& operator<<(std::ostream& o, const ARDOUR::SampleFormat& sf); std::ostream& operator<<(std::ostream& o, const ARDOUR::HeaderFormat& sf); @@ -651,6 +663,7 @@ 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); +std::ostream& operator<<(std::ostream& o, const ARDOUR::RegionSelectionAfterSplit& sf); static inline ARDOUR::framepos_t session_frame_to_track_frame (ARDOUR::framepos_t session_frame, double speed) diff --git a/libs/ardour/enums.cc b/libs/ardour/enums.cc index c1eaa00977..0f60e3589d 100644 --- a/libs/ardour/enums.cc +++ b/libs/ardour/enums.cc @@ -88,6 +88,7 @@ setup_enum_writer () TimecodeFormat _Session_TimecodeFormat; Session::PullupFormat _Session_PullupFormat; FadeShape _FadeShape; + RegionSelectionAfterSplit _RegionSelectionAfterSplit; IOChange _IOChange; AutomationType _AutomationType; AutoState _AutoState; @@ -460,6 +461,16 @@ setup_enum_writer () REGISTER_ENUM (FadeSymmetric); REGISTER (_FadeShape); + REGISTER_ENUM(None); + REGISTER_ENUM(NewlyCreatedLeft); + REGISTER_ENUM(NewlyCreatedRight); + REGISTER_ENUM(NewlyCreatedBoth); + REGISTER_ENUM(Existing); + REGISTER_ENUM(ExistingNewlyCreatedLeft); + REGISTER_ENUM(ExistingNewlyCreatedRight); + REGISTER_ENUM(ExistingNewlyCreatedBoth); + REGISTER (_RegionSelectionAfterSplit); + REGISTER_CLASS_ENUM (Diskstream, Recordable); REGISTER_CLASS_ENUM (Diskstream, Hidden); REGISTER_CLASS_ENUM (Diskstream, Destructive); @@ -918,6 +929,7 @@ 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; @@ -931,3 +943,17 @@ std::ostream& operator<<(std::ostream& o, const FadeShape& var) std::string s = enum_2_string (var); return o << s; } + +std::istream& operator>>(std::istream& o, RegionSelectionAfterSplit& var) +{ + std::string s; + o >> s; + var = (RegionSelectionAfterSplit) string_2_enum (s, var); + return o; +} + +std::ostream& operator<<(std::ostream& o, const RegionSelectionAfterSplit& var) +{ + std::string s = enum_2_string (var); + return o << s; +}