mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
adjust segment math
This commit is contained in:
parent
282c92c9c8
commit
a4c406c911
@ -217,10 +217,8 @@ export function MotionSegment({
|
|||||||
className={`h-[2px] rounded-full bg-motion_review`}
|
className={`h-[2px] rounded-full bg-motion_review`}
|
||||||
onClick={segmentClick}
|
onClick={segmentClick}
|
||||||
style={{
|
style={{
|
||||||
width:
|
width: interpolateMotionAudioData(
|
||||||
maxSegmentWidth -
|
getMotionSegmentValue(segmentTime),
|
||||||
interpolateMotionAudioData(
|
|
||||||
getMotionSegmentValue(segmentTime - segmentDuration / 2),
|
|
||||||
0,
|
0,
|
||||||
100,
|
100,
|
||||||
1,
|
1,
|
||||||
@ -236,7 +234,7 @@ export function MotionSegment({
|
|||||||
onClick={segmentClick}
|
onClick={segmentClick}
|
||||||
style={{
|
style={{
|
||||||
width: interpolateMotionAudioData(
|
width: interpolateMotionAudioData(
|
||||||
getAudioSegmentValue(segmentTime - segmentDuration / 2),
|
getAudioSegmentValue(segmentTime),
|
||||||
-100,
|
-100,
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
@ -254,10 +252,8 @@ export function MotionSegment({
|
|||||||
className={`h-[2px] rounded-full bg-motion_review`}
|
className={`h-[2px] rounded-full bg-motion_review`}
|
||||||
onClick={segmentClick}
|
onClick={segmentClick}
|
||||||
style={{
|
style={{
|
||||||
width:
|
width: interpolateMotionAudioData(
|
||||||
maxSegmentWidth -
|
getMotionSegmentValue(segmentTime - segmentDuration / 2),
|
||||||
interpolateMotionAudioData(
|
|
||||||
getMotionSegmentValue(segmentTime),
|
|
||||||
0,
|
0,
|
||||||
100,
|
100,
|
||||||
1,
|
1,
|
||||||
@ -273,7 +269,7 @@ export function MotionSegment({
|
|||||||
onClick={segmentClick}
|
onClick={segmentClick}
|
||||||
style={{
|
style={{
|
||||||
width: interpolateMotionAudioData(
|
width: interpolateMotionAudioData(
|
||||||
getAudioSegmentValue(segmentTime),
|
getAudioSegmentValue(segmentTime - segmentDuration / 2),
|
||||||
-100,
|
-100,
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
|
@ -45,13 +45,13 @@ export const useMotionSegmentUtils = (
|
|||||||
const matchingEvent = motion_events.find((event) => {
|
const matchingEvent = motion_events.find((event) => {
|
||||||
return (
|
return (
|
||||||
time >= getSegmentStart(event.start_time) &&
|
time >= getSegmentStart(event.start_time) &&
|
||||||
time < getSegmentEnd(event.end_time)
|
time < getSegmentEnd(event.start_time + segmentDuration / 2)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
return matchingEvent?.motionValue ?? 0;
|
return matchingEvent?.motionValue ?? 0;
|
||||||
},
|
},
|
||||||
[motion_events, getSegmentStart, getSegmentEnd],
|
[motion_events, getSegmentStart, getSegmentEnd, segmentDuration],
|
||||||
);
|
);
|
||||||
|
|
||||||
const getAudioSegmentValue = useCallback(
|
const getAudioSegmentValue = useCallback(
|
||||||
|
Loading…
Reference in New Issue
Block a user