import { HistoryNodeOptionEvent , nodeOptionEvent } from '@/store/history/types' ; import SeriesPlayer from './series-player' ; enum SeriesPlayerEventType { SELECT_TIME_COLUMN = 'setTimeColumn' , INPUT_FRAMES_PER_SECOND = 'setFramesPerSecond' , SET_CURRENT_TIME_INDEX = 'setCurrentTimeIndex' } export const selectTimeColumnEvent = ( node , column , prevColumn ) : HistoryNodeOptionEvent => { return nodeOptionEvent ( SeriesPlayerEventType . SELECT_TIME_COLUMN , 'set time column' , node , node . setTimeColumn , column , prevColumn ) ; } ; export const setCurrentTimeIndexEvent = ( node , value , prevValue , message = 'set time' ) : HistoryNodeOptionEvent => { return nodeOptionEvent ( SeriesPlayerEventType . SET_CURRENT_TIME_INDEX , message , node , node . setCurrentTimeIndex , value , prevValue ) ; } ; export const inputFramesPerSecondEvent = ( node , value , prevValue ) : HistoryNodeOptionEvent => { return nodeOptionEvent ( SeriesPlayerEventType . INPUT_FRAMES_PER_SECOND , 'input frames per second' , node , node . setFramesPerSecond , value , prevValue ) ; } ;