13
0

Add a config option to control region selection after split.

Add a configuration variable to choose the behaviour of the region
selection after splitting selected regions.

Add options to choose between all eight possible combinations of 'existing
unmodified selected regions', 'newly-created regions to left of split',
and 'newly-created regions to right of split', but comment out all but the
three least crazy ones for now. If anyone wants them, they're there.
This commit is contained in:
Colin Fletcher 2014-11-18 13:52:42 +00:00
parent f4e0fec179
commit d4a3141927
4 changed files with 59 additions and 0 deletions

View File

@ -1719,6 +1719,25 @@ RCOptionEditor::RCOptionEditor ()
sigc::mem_fun (*_rc_config, &RCConfiguration::set_autoscroll_editor)
));
ComboOption<RegionSelectionAfterSplit> *rsas = new ComboOption<RegionSelectionAfterSplit> (
"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")));

View File

@ -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 */

View File

@ -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)

View File

@ -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;
}