extract isPlaybackActive to a global util function (#1393)

This commit is contained in:
Alex Christoffer Rasmussen
2024-12-18 12:44:48 +01:00
committed by GitHub
parent df1cf7a96b
commit cfcf6a5684
5 changed files with 25 additions and 19 deletions
+2
View File
@@ -89,3 +89,5 @@ export {
defaultImportMap,
isImportMap,
} from './src/feature/spreadsheet-import/spreadsheetImport.js';
export { isPlaybackActive } from './src/playback-utils/playbackstate.js';
@@ -0,0 +1,10 @@
import { Playback } from 'ontime-types';
/**
* Utility checks whether the playback is considered to be active
* @param state
* @returns
*/
export function isPlaybackActive(state: Playback): boolean {
return state === Playback.Play || state === Playback.Pause || state === Playback.Roll;
}