add enumeration type for SnapTarget

this defines how the grid interacts with other snap targets (ph, etc)

* Grid: we ignore other snap targets when the grid is enabled
* Both: we snap to both grid and other snap-targets when grid is enabled
* Other: we only snap to other snap-targets and ignore the grid, even
    though the grid is enabled
This commit is contained in:
Ben Loftis 2023-09-11 09:41:58 -05:00
parent c7e5f38aa5
commit e99305c4dd
4 changed files with 18 additions and 0 deletions

View File

@ -435,6 +435,12 @@ enum EditMode {
Lock
};
enum SnapTarget {
SnapTargetGrid,
SnapTargetOther,
SnapTargetBoth
};
enum RippleMode {
RippleSelected,
RippleAll,

View File

@ -62,6 +62,7 @@ DEFINE_ENUM_CONVERT(ARDOUR::ShuttleUnits)
DEFINE_ENUM_CONVERT(ARDOUR::ClockDeltaMode)
DEFINE_ENUM_CONVERT(ARDOUR::DenormalModel)
DEFINE_ENUM_CONVERT(ARDOUR::FadeShape)
DEFINE_ENUM_CONVERT(ARDOUR::SnapTarget)
DEFINE_ENUM_CONVERT(ARDOUR::RegionSelectionAfterSplit)
DEFINE_ENUM_CONVERT(ARDOUR::RangeSelectionAfterSplit)
DEFINE_ENUM_CONVERT(ARDOUR::TimeSelectionAfterSectionPaste)

View File

@ -107,6 +107,7 @@ setup_enum_writer ()
TimecodeFormat _Session_TimecodeFormat;
Session::PullupFormat _Session_PullupFormat;
FadeShape _FadeShape;
SnapTarget _SnapTarget;
RegionSelectionAfterSplit _RegionSelectionAfterSplit;
RangeSelectionAfterSplit _RangeSelectionAfterSplit;
TimeSelectionAfterSectionPaste _TimeSelectionAfterSectionPaste;
@ -574,6 +575,11 @@ setup_enum_writer ()
REGISTER (_RegionSelectionAfterSplit);
REGISTER (_RangeSelectionAfterSplit);
REGISTER_ENUM (SnapTargetGrid);
REGISTER_ENUM (SnapTargetOther);
REGISTER_ENUM (SnapTargetBoth);
REGISTER (_SnapTarget);
REGISTER_ENUM(SectionSelectNoop);
REGISTER_ENUM(SectionSelectClear);
REGISTER_ENUM(SectionSelectRetain);

View File

@ -2619,6 +2619,11 @@ LuaBindings::common (lua_State* L)
.addConst ("ExternalMonitoring", ARDOUR::MonitorModel(ExternalMonitoring))
.endNamespace ()
.beginNamespace ("SnapTarget")
.addConst ("SnapTargetGrid", ARDOUR::SnapTarget(SnapTargetGrid))
.addConst ("SnapTargetOther", ARDOUR::SnapTarget(SnapTargetOther))
.addConst ("SnapTargetBoth", ARDOUR::SnapTarget(SnapTargetBoth))
.beginNamespace ("RegionSelectionAfterSplit")
.addConst ("None", ARDOUR::RegionSelectionAfterSplit(None))
.addConst ("NewlyCreatedLeft", ARDOUR::RegionSelectionAfterSplit(NewlyCreatedLeft))