fix: align paused scope requests at the exclusive clip end to the final visible frame

这个提交包含在:
mac 于 2026-11-05 11:07:17 +08:00 提交
1 父节点 b60ae3e45b
当前提交 dad77aff77
8 个文件已更改
+71 -28

没有与搜索条件相匹配的文件

+7 -1
查看文件
@@ -7,6 +7,8 @@
#import "DYInspector.h"
#import "DYManagedColor.h"
#include "DYScopeMath.hpp"
#include "DYScopeDisplayTime.h"
#import <os/log.h>
#include <cmath>
static NSButton *DYWorkspaceButton(NSString *title,id target,SEL action){NSButton *b=[NSButton buttonWithTitle:title target:target action:action];b.bezelStyle=NSBezelStyleRounded;b.bordered=NO;b.font=[NSFont systemFontOfSize:11];b.accessibilityLabel=title;return b;}
@@ -185,7 +187,11 @@ static BOOL DYWorkspaceEnabled(DYUniforms u,NSString *type){if([type isEqual:@"b
}
- (void)pageChanged:(id)sender{
if(_editorMode==2)[self bindLUTTarget];_scopePane.hidden=NO;_lutPane.hidden=_editorMode!=2;_lutExplanation.hidden=YES;_toolEditor.hidden=_editorMode!=0;_maskPane.hidden=_editorMode!=1;_selectionTitle.hidden=_editorMode==2;
[_renderer setScopeEnabled:_visible atTime:_toolTime];if(_editorMode==2)[self ensureBrowser];[self scopeChanged:nil];[self layoutWorkspace];
CMTime displayTime=_toolTime;id<FxCustomParameterActionAPI_v4>action=[self actionAPI];if(_visible&&action){[action startAction:self];@try{
id<FxTimingAPI_v4>timing=[[self rootHost]apiForProtocol:@protocol(FxTimingAPI_v4)];CMTime start=kCMTimeInvalid,duration=kCMTimeInvalid,frame=kCMTimeInvalid;
if([timing respondsToSelector:@selector(startTimeOfInputToFilter:)]&&[timing respondsToSelector:@selector(durationTimeOfInputToFilter:)]&&[timing respondsToSelector:@selector(frameDuration:)]){[timing startTimeOfInputToFilter:&start];[timing durationTimeOfInputToFilter:&duration];[timing frameDuration:&frame];displayTime=DYScopeDisplayTime(_toolTime,start,duration,frame);if(CMTimeCompare(displayTime,_toolTime)!=0)os_log(OS_LOG_DEFAULT,"dayu_scope_end_boundary requested=%{public}.9f display=%{public}.9f",CMTimeGetSeconds(_toolTime),CMTimeGetSeconds(displayTime));}
}@finally{[action endAction:self];}}
[_renderer setScopeEnabled:_visible atTime:displayTime];if(_editorMode==2)[self ensureBrowser];[self scopeChanged:nil];[self layoutWorkspace];
}
- (void)toggleHostScopes:(id)sender{
id<FxCustomParameterActionAPI_v4> action=[self actionAPI];NSError *error=nil;BOOL done=NO;if(action){[action startAction:self];@try{id<FxCommandAPI> commands=[_manager apiForProtocol:@protocol(FxCommandAPI)];done=[commands performCommand:kFxCommand_ToggleWaveforms error:&error];}@finally{[action endAction:self];}}
+1
查看文件
@@ -1,4 +1,5 @@
#import "DYScopeSample.h"
#include "DYScopeDisplayTime.h"
#import "DYHistogram.h"
#include "DYFilmMath.h"
#include "DYFilmTime.h"
+1 -1
查看文件
@@ -855,7 +855,7 @@ NSView<DYWorkspaceMaskEditing> *DYCreateWorkspaceMaskEditor(id<PROAPIAccessing>
if([row.identifier hasPrefix:@"heading:"])for(NSView *view in row.subviews)view.frame=NSMakeRect(2,5,rw-4,18);
if([row.identifier hasSuffix:@"Controls"]){CGFloat bw=(rw-4*(row.subviews.count-1))/MAX((NSUInteger)1,row.subviews.count);NSInteger i=0;for(NSView *view in row.subviews)view.frame=NSMakeRect((bw+4)*i++,3,bw,25);}
}
if(rows.count)x+=columns*columnWidth+(columns-1)*16;else if(tabs)x+=available;
if(rows.count)x+=columns*columnWidth+(columns-1)*16;else if(tabs)x+=available;else if(graphics.count)x-=16;
}
card.frame=NSMakeRect(0,6,MAX(_scroll.contentSize.width,x+12),height);y=_scroll.contentSize.height;
}
+9
查看文件
@@ -0,0 +1,9 @@
#pragma once
#import <CoreMedia/CoreMedia.h>
// FCP can expose the exclusive input out point to custom views while its viewer
// holds the last visible frame. Only that exact boundary has a previous frame.
static inline CMTime DYScopeDisplayTime(CMTime requested,CMTime start,CMTime duration,CMTime frame){
if(!CMTIME_IS_NUMERIC(requested)||!CMTIME_IS_NUMERIC(start)||!CMTIME_IS_NUMERIC(duration)||!CMTIME_IS_NUMERIC(frame)||duration.value<=0||frame.value<=0||duration.epoch||frame.epoch)return requested;
CMTime end=CMTimeAdd(start,duration);if(!CMTIME_IS_NUMERIC(end)||CMTimeCompare(requested,end)!=0)return requested;
CMTime last=CMTimeSubtract(end,frame);return CMTimeCompare(last,start)<0?start:last;
}
@@ -1,3 +1,11 @@
{
CMTime end=CMTimeMake(4,1),start=kCMTimeZero,duration=CMTimeMake(100,25),frame=CMTimeMake(1,25);
run.record(@"scope-exclusive-clip-end-aligns-to-last-visible-frame",CMTimeCompare(DYScopeDisplayTime(end,start,duration,frame),CMTimeMake(99,25))==0);
run.record(@"scope-interior-time-is-never-replaced-by-previous-frame",CMTimeCompare(DYScopeDisplayTime(CMTimeMake(50,25),start,duration,frame),CMTimeMake(50,25))==0);
run.record(@"scope-after-end-is-not-silently-clamped",CMTimeCompare(DYScopeDisplayTime(CMTimeMake(101,25),start,duration,frame),CMTimeMake(101,25))==0);
run.record(@"scope-end-alignment-requires-valid-positive-host-frame",CMTimeCompare(DYScopeDisplayTime(end,start,duration,kCMTimeInvalid),end)==0&&CMTimeCompare(DYScopeDisplayTime(end,start,duration,kCMTimeZero),end)==0);
run.record(@"scope-trimmed-input-end-preserves-native-time-origin",CMTimeCompare(DYScopeDisplayTime(CMTimeMake(6,1),CMTimeMake(2,1),duration,frame),CMTimeMake(149,25))==0);
}
{
auto workspaceDrain=[](){double end=NSProcessInfo.processInfo.systemUptime+.04;while(NSProcessInfo.processInfo.systemUptime<end)[[NSRunLoop mainRunLoop]runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:.002]];};
NSString *oldLUT=[runtime stringByAppendingPathComponent:@"old.cube"],*retainLUT=[runtime stringByAppendingPathComponent:@"retain.cube"],*newLUT=[runtime stringByAppendingPathComponent:@"new.cube"],*lateLUT=[runtime stringByAppendingPathComponent:@"late.cube"],*userLUT=[runtime stringByAppendingPathComponent:@"user-new.cube"],*nodeLUT=[runtime stringByAppendingPathComponent:@"node.cube"],*deletedLUT=[runtime stringByAppendingPathComponent:@"deleted.cube"];