forked from mia/Aegisub
Change keyframe snapping distance from frames to milliseconds
Snapping based on frames works poorly with VFR, and is pointlessly different from the other adjustments. Originally committed to SVN as r6311.
This commit is contained in:
parent
f6c3be4776
commit
be07cca9f6
2 changed files with 14 additions and 12 deletions
|
@ -183,18 +183,18 @@ DialogTimingProcessor::DialogTimingProcessor(agi::Context *c)
|
||||||
}
|
}
|
||||||
|
|
||||||
make_ctrl(this, KeyframesFlexSizer, _("Starts before thres.:"), &beforeStart, keysEnable,
|
make_ctrl(this, KeyframesFlexSizer, _("Starts before thres.:"), &beforeStart, keysEnable,
|
||||||
_("Threshold for 'before start' distance, that is, how many frames a subtitle must start before a keyframe to snap to it."));
|
_("Threshold for 'before start' distance, that is, how many milliseconds a subtitle must start before a keyframe to snap to it."));
|
||||||
|
|
||||||
make_ctrl(this, KeyframesFlexSizer, _("Starts after thres.:"), &afterStart, keysEnable,
|
make_ctrl(this, KeyframesFlexSizer, _("Starts after thres.:"), &afterStart, keysEnable,
|
||||||
_("Threshold for 'after start' distance, that is, how many frames a subtitle must start after a keyframe to snap to it."));
|
_("Threshold for 'after start' distance, that is, how many milliseconds a subtitle must start after a keyframe to snap to it."));
|
||||||
|
|
||||||
KeyframesFlexSizer->AddStretchSpacer(1);
|
KeyframesFlexSizer->AddStretchSpacer(1);
|
||||||
|
|
||||||
make_ctrl(this, KeyframesFlexSizer, _("Ends before thres.:"), &beforeEnd, keysEnable,
|
make_ctrl(this, KeyframesFlexSizer, _("Ends before thres.:"), &beforeEnd, keysEnable,
|
||||||
_("Threshold for 'before end' distance, that is, how many frames a subtitle must end before a keyframe to snap to it."));
|
_("Threshold for 'before end' distance, that is, how many milliseconds a subtitle must end before a keyframe to snap to it."));
|
||||||
|
|
||||||
make_ctrl(this, KeyframesFlexSizer, _("Ends after thres.:"), &afterEnd, keysEnable,
|
make_ctrl(this, KeyframesFlexSizer, _("Ends after thres.:"), &afterEnd, keysEnable,
|
||||||
_("Threshold for 'after end' distance, that is, how many frames a subtitle must end after a keyframe to snap to it."));
|
_("Threshold for 'after end' distance, that is, how many milliseconds a subtitle must end after a keyframe to snap to it."));
|
||||||
|
|
||||||
KeyframesSizer->Add(KeyframesFlexSizer,0,wxEXPAND);
|
KeyframesSizer->Add(KeyframesFlexSizer,0,wxEXPAND);
|
||||||
KeyframesSizer->AddStretchSpacer(1);
|
KeyframesSizer->AddStretchSpacer(1);
|
||||||
|
@ -397,14 +397,16 @@ void DialogTimingProcessor::Process() {
|
||||||
|
|
||||||
// Get closest for start
|
// Get closest for start
|
||||||
int closest = get_closest_kf(kf, startF);
|
int closest = get_closest_kf(kf, startF);
|
||||||
if ((closest > startF && closest-startF <= beforeStart) || (closest < startF && startF-closest <= afterStart)) {
|
int time = c->videoController->TimeAtFrame(closest, agi::vfr::START);
|
||||||
cur->Start = c->videoController->TimeAtFrame(closest, agi::vfr::START);
|
if ((closest > startF && time - cur->Start <= beforeStart) || (closest < startF && cur->Start - time <= afterStart)) {
|
||||||
|
cur->Start = time;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get closest for end
|
// Get closest for end
|
||||||
closest = get_closest_kf(kf, endF) - 1;
|
closest = get_closest_kf(kf, endF) - 1;
|
||||||
if ((closest > endF && closest-endF <= beforeEnd) || (closest < endF && endF-closest <= afterEnd)) {
|
time = c->videoController->TimeAtFrame(closest, agi::vfr::END);
|
||||||
cur->End = c->videoController->TimeAtFrame(closest, agi::vfr::END);
|
if ((closest > endF && time - cur->End <= beforeEnd) || (closest < endF && cur->End - time <= afterEnd)) {
|
||||||
|
cur->End = time;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -497,10 +497,10 @@
|
||||||
"Only Selection" : false,
|
"Only Selection" : false,
|
||||||
"Threshold" : {
|
"Threshold" : {
|
||||||
"Adjacent" : 300,
|
"Adjacent" : 300,
|
||||||
"Key End After" : 6,
|
"Key End After" : 250,
|
||||||
"Key End Before" : 5,
|
"Key End Before" : 200,
|
||||||
"Key Start After" : 4,
|
"Key Start After" : 150,
|
||||||
"Key Start Before" : 5
|
"Key Start Before" : 200
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Translation Assistant" : {
|
"Translation Assistant" : {
|
||||||
|
|
Loading…
Reference in a new issue