Use typed CMTime values for canvas white-balance events

这个提交包含在:
mac 于 2026-11-05 17:02:00 +08:00 提交
1 父节点 585c83c8a1
当前提交 c9bd52fff5
2 个文件已更改
+3 -3

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

+2 -2
查看文件
@@ -50,7 +50,7 @@
- (void)applyValues:(NSDictionary*)values{if(!values){[self alert:@"尚未拿到当前片段画面,请移动播放头后重试。"];return;}id<FxCustomParameterActionAPI_v4>a=[_apiManager apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)];[a startAction:self];@try{id<FxParameterSettingAPI_v6>s=[_apiManager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];for(NSDictionary*r in DYDescriptors()){NSNumber*v=values[r[@"key"]];if(v)[s setFloatValue:v.doubleValue toParameter:[r[@"pid"]unsignedIntValue] atTime:a.currentTime];}}@finally{[a endAction:self];}[NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:_apiManager];}
- (void)autoRequested:(NSNotification*)n{NSData*frame=[_renderer preview];[self applyValues:[n.name isEqual:@"DYAutoGrade"]?DYAutoGrade(frame):DYAutoWhiteBalance(frame)];}
- (void)canvasWhiteBalanceRequested:(NSNotification*)note {
CMTime time=[note.userInfo[@"time"] CMTimeValue];
CMTime time=[(NSValue*)note.userInfo[@"time"] CMTimeValue];
if(_canvasSampler||!CMTIME_IS_NUMERIC(time))return;
_canvasSampler=[NSColorSampler new];
[_canvasSampler showSamplerWithSelectionHandler:^(NSColor *color){
@@ -96,7 +96,7 @@
[self alert:@"所选颜色过暗,请选择白色或中性灰区域。"];return;
}
NSDictionary *values=@{@"temperature":@(temperature),@"tint":@(tint)};
if(n.userInfo[@"time"])[self applyCanvasWhiteBalance:values atTime:[n.userInfo[@"time"] CMTimeValue]];
if(n.userInfo[@"time"])[self applyCanvasWhiteBalance:values atTime:[(NSValue*)n.userInfo[@"time"] CMTimeValue]];
else [self applyValues:values];
}
@end
@@ -24,7 +24,7 @@
run.record(@"viewer-persistent-mask-entries-route-shapes-to-shared-workspace",maskRoutes&&base->_undoStarts==undo);
[NSNotificationCenter.defaultCenter removeObserver:observer];[requestedPage release];
__block NSInteger eyedropperRequests=0;__block CMTime eyedropperTime=kCMTimeInvalid;
id sampleObserver=[NSNotificationCenter.defaultCenter addObserverForName:@"DYViewerWhiteBalanceRequested" object:host queue:nil usingBlock:^(NSNotification *note){eyedropperRequests++;eyedropperTime=[note.userInfo[@"time"] CMTimeValue];}];
id sampleObserver=[NSNotificationCenter.defaultCenter addObserverForName:@"DYViewerWhiteBalanceRequested" object:host queue:nil usingBlock:^(NSNotification *note){eyedropperRequests++;eyedropperTime=[(NSValue*)note.userInfo[@"time"] CMTimeValue];}];
click(areaFor(controls,@"tool",@"whiteBalance"));drain();
run.record(@"viewer-white-balance-icon-routes-a-single-time-bound-pick",eyedropperRequests==1&&CMTimeCompare(eyedropperTime,host->_time)==0&&!panelFor(@"whiteBalance")&&[initial isEqual:base->_values]);
[NSNotificationCenter.defaultCenter removeObserver:sampleObserver];