#pragma once #import // 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; }