2024-06-20 22:01:12 +00:00
|
|
|
|
export type KeyboardAction = 'addSegment' | 'togglePlayResetSpeed' | 'togglePlayNoResetSpeed' | 'reducePlaybackRate' | 'reducePlaybackRateMore' | 'increasePlaybackRate' | 'increasePlaybackRateMore' | 'timelineToggleComfortZoom' | 'seekPreviousFrame' | 'seekNextFrame' | 'captureSnapshot' | 'setCutStart' | 'setCutEnd' | 'removeCurrentSegment' | 'cleanupFilesDialog' | 'splitCurrentSegment' | 'focusSegmentAtCursor' | 'increaseRotation' | 'goToTimecode' | 'seekBackwards' | 'seekBackwards2' | 'seekBackwards3' | 'seekBackwardsPercent' | 'seekBackwardsPercent' | 'seekBackwardsKeyframe' | 'jumpCutStart' | 'seekForwards' | 'seekForwards2' | 'seekForwards3' | 'seekForwardsPercent' | 'seekForwardsPercent' | 'seekForwardsKeyframe' | 'jumpCutEnd' | 'jumpTimelineStart' | 'jumpTimelineEnd' | 'jumpFirstSegment' | 'jumpPrevSegment' | 'timelineZoomIn' | 'timelineZoomIn' | 'batchPreviousFile' | 'jumpLastSegment' | 'jumpNextSegment' | 'timelineZoomOut' | 'timelineZoomOut' | 'batchNextFile' | 'batchOpenSelectedFile' | 'batchOpenPreviousFile' | 'batchOpenNextFile' | 'undo' | 'undo' | 'redo' | 'redo' | 'copySegmentsToClipboard' | 'copySegmentsToClipboard' | 'toggleFullscreenVideo' | 'labelCurrentSegment' | 'export' | 'toggleKeyboardShortcuts' | 'closeActiveScreen' | 'increaseVolume' | 'decreaseVolume' | 'toggleMuted' | 'detectBlackScenes' | 'detectSilentScenes' | 'detectSceneChanges' | 'toggleLastCommands' | 'play' | 'pause' | 'reloadFile' | 'html5ify' | 'togglePlayOnlyCurrentSegment' | 'toggleLoopOnlyCurrentSegment' | 'toggleLoopStartEndOnlyCurrentSegment' | 'toggleLoopSelectedSegments' | 'editCurrentSegmentTags' | 'duplicateCurrentSegment' | 'reorderSegsByStartTime' | 'invertAllSegments' | 'fillSegmentsGaps' | 'shiftAllSegmentTimes' | 'alignSegmentTimesToKeyframes' | 'createSegmentsFromKeyframes' | 'createFixedDurationSegments' | 'createNumSegments' | 'createRandomSegments' | 'shuffleSegments' | 'combineOverlappingSegments' | 'combineSelectedSegments' | 'clearSegments' | 'toggleSegmentsList' | 'selectOnlyCurrentSegment' | 'deselectAllSegments' | 'selectAllSegments' | 'toggleCurrentSegmentSelected' | 'invertSelectedSegments' | 'removeSelectedSegments' | 'toggleStreamsSelector' | 'extractAllStreams' | 'showStreamsSelector' | 'showIncludeExternalStreamsDialog' | 'captureSnapshotAsCoverArt' | 'extractCurrentSegmentFramesAsImages' | 'extractSelectedSegmentsFramesAsImages' | 'convertFormatBatch' | 'convertFormatCurrentFile' | 'fixInvalidDuration' | 'closeBatch' | 'concatBatch' | 'toggleKeyframeCutMode' | 'toggleCaptureFormat' | 'toggleStripAudio' | 'toggleStripThumbnail' | 'setStartTimeOffset' | 'toggleWaveformMode' | 'toggleShowThumbnails' | 'toggleShowKeyframes' | 'toggleSettings' | 'openSendReportDialog' | 'openFilesDialog' | 'openDirDialog' | 'exportYouTube' | 'closeCurrentFile' | 'quit';
|
2024-03-15 13:45:33 +00:00
|
|
|
|
|
|
|
|
|
export interface KeyBinding {
|
|
|
|
|
keys: string,
|
|
|
|
|
action: KeyboardAction,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export type CaptureFormat = 'jpeg' | 'png' | 'webp';
|
|
|
|
|
|
|
|
|
|
// https://www.electronjs.org/docs/api/locales
|
|
|
|
|
// See i18n.js
|
|
|
|
|
export const langNames = {
|
|
|
|
|
en: 'English',
|
|
|
|
|
cs: 'Čeština',
|
|
|
|
|
de: 'Deutsch',
|
|
|
|
|
es: 'Español',
|
|
|
|
|
fr: 'Français',
|
|
|
|
|
it: 'Italiano',
|
|
|
|
|
nl: 'Nederlands',
|
|
|
|
|
nb: 'Norsk (bokmål)',
|
|
|
|
|
nn: 'Norsk (nynorsk)',
|
|
|
|
|
pl: 'Polski',
|
|
|
|
|
pt: 'Português',
|
|
|
|
|
pt_BR: 'Português do Brasil',
|
|
|
|
|
sl: 'Slovenščina',
|
2024-06-04 18:36:15 +00:00
|
|
|
|
sk: 'slovenčina',
|
2024-03-15 13:45:33 +00:00
|
|
|
|
fi: 'Suomi',
|
|
|
|
|
ru: 'Русский',
|
|
|
|
|
// sr: 'Cрпски',
|
|
|
|
|
tr: 'Türkçe',
|
|
|
|
|
vi: 'Tiếng Việt',
|
|
|
|
|
ja: '日本語',
|
|
|
|
|
zh: '中文',
|
|
|
|
|
zh_Hant: '繁體中文',
|
|
|
|
|
zh_Hans: '简体中文',
|
|
|
|
|
ko: '한국어',
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type LanguageKey = keyof typeof langNames;
|
|
|
|
|
|
|
|
|
|
export type TimecodeFormat = 'timecodeWithDecimalFraction' | 'frameCount' | 'timecodeWithFramesFraction';
|
|
|
|
|
|
2024-03-20 08:02:34 +00:00
|
|
|
|
export type AvoidNegativeTs = 'make_zero' | 'auto' | 'make_non_negative' | 'disabled';
|
|
|
|
|
|
2024-09-29 07:04:51 +00:00
|
|
|
|
export type ModifierKey = 'ctrl' | 'shift' | 'alt' | 'meta';
|
|
|
|
|
|
2024-10-06 21:39:19 +00:00
|
|
|
|
export type PreserveMetadata = 'default' | 'nonglobal' | 'none'
|
|
|
|
|
|
2024-09-29 07:04:51 +00:00
|
|
|
|
|
2024-03-15 13:45:33 +00:00
|
|
|
|
export interface Config {
|
|
|
|
|
captureFormat: CaptureFormat,
|
|
|
|
|
customOutDir: string | undefined,
|
|
|
|
|
keyframeCut: boolean,
|
|
|
|
|
autoMerge: boolean,
|
|
|
|
|
autoDeleteMergedSegments: boolean,
|
|
|
|
|
segmentsToChaptersOnly: boolean,
|
|
|
|
|
enableSmartCut: boolean,
|
|
|
|
|
timecodeFormat: TimecodeFormat,
|
|
|
|
|
invertCutSegments: boolean,
|
|
|
|
|
autoExportExtraStreams: boolean,
|
|
|
|
|
exportConfirmEnabled: boolean,
|
|
|
|
|
askBeforeClose: boolean,
|
|
|
|
|
enableAskForImportChapters: boolean,
|
|
|
|
|
enableAskForFileOpenAction: boolean,
|
|
|
|
|
playbackVolume: number,
|
|
|
|
|
autoSaveProjectFile: boolean,
|
|
|
|
|
wheelSensitivity: number,
|
|
|
|
|
language: LanguageKey | undefined,
|
|
|
|
|
ffmpegExperimental: boolean,
|
2024-10-06 21:39:19 +00:00
|
|
|
|
preserveChapters: boolean,
|
|
|
|
|
preserveMetadata: PreserveMetadata,
|
|
|
|
|
preserveMetadataOnMerge: boolean,
|
2024-03-15 13:45:33 +00:00
|
|
|
|
preserveMovData: boolean,
|
|
|
|
|
movFastStart: boolean,
|
2024-03-20 08:02:34 +00:00
|
|
|
|
avoidNegativeTs: AvoidNegativeTs,
|
2024-03-15 13:45:33 +00:00
|
|
|
|
hideNotifications: 'all' | undefined,
|
2024-08-06 20:03:17 +00:00
|
|
|
|
hideOsNotifications: 'all' | undefined,
|
2024-03-15 13:45:33 +00:00
|
|
|
|
autoLoadTimecode: boolean,
|
|
|
|
|
segmentsToChapters: boolean,
|
|
|
|
|
simpleMode: boolean,
|
|
|
|
|
outSegTemplate: string | undefined,
|
2024-08-23 21:23:03 +00:00
|
|
|
|
mergedFileTemplate: string | undefined,
|
2024-03-15 13:45:33 +00:00
|
|
|
|
keyboardSeekAccFactor: number,
|
|
|
|
|
keyboardNormalSeekSpeed: number,
|
2024-05-14 10:13:35 +00:00
|
|
|
|
keyboardSeekSpeed2: number,
|
|
|
|
|
keyboardSeekSpeed3: number,
|
2024-03-15 13:45:33 +00:00
|
|
|
|
treatInputFileModifiedTimeAsStart: boolean,
|
|
|
|
|
treatOutputFileModifiedTimeAsStart: boolean | undefined | null,
|
|
|
|
|
outFormatLocked: string | undefined,
|
|
|
|
|
safeOutputFileName: boolean,
|
|
|
|
|
windowBounds: { x: number, y: number, width: number, height: number } | undefined,
|
2024-11-29 07:18:22 +00:00
|
|
|
|
storeWindowBounds: boolean,
|
2024-03-15 13:45:33 +00:00
|
|
|
|
enableAutoHtml5ify: boolean,
|
|
|
|
|
keyBindings: KeyBinding[],
|
|
|
|
|
customFfPath: string | undefined,
|
|
|
|
|
storeProjectInWorkingDir: boolean,
|
|
|
|
|
enableOverwriteOutput: boolean,
|
2024-09-29 07:04:51 +00:00
|
|
|
|
mouseWheelZoomModifierKey: ModifierKey,
|
2024-09-29 07:54:15 +00:00
|
|
|
|
mouseWheelFrameSeekModifierKey: ModifierKey,
|
|
|
|
|
mouseWheelKeyframeSeekModifierKey: ModifierKey,
|
2024-03-15 13:45:33 +00:00
|
|
|
|
captureFrameMethod: 'videotag' | 'ffmpeg',
|
|
|
|
|
captureFrameQuality: number,
|
|
|
|
|
captureFrameFileNameFormat: 'timestamp' | 'index',
|
|
|
|
|
enableNativeHevc: boolean,
|
|
|
|
|
enableUpdateCheck: boolean,
|
|
|
|
|
cleanupChoices: {
|
|
|
|
|
trashTmpFiles: boolean, askForCleanup: boolean, closeFile: boolean, cleanupAfterExport?: boolean | undefined,
|
|
|
|
|
},
|
|
|
|
|
allowMultipleInstances: boolean,
|
|
|
|
|
darkMode: boolean,
|
|
|
|
|
preferStrongColors: boolean,
|
|
|
|
|
outputFileNameMinZeroPadding: number,
|
|
|
|
|
cutFromAdjustmentFrames: number,
|
2024-12-10 09:42:09 +00:00
|
|
|
|
cutToAdjustmentFrames: number,
|
2024-03-15 13:45:33 +00:00
|
|
|
|
invertTimelineScroll: boolean | undefined,
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-20 08:02:34 +00:00
|
|
|
|
export interface Waveform {
|
|
|
|
|
buffer: Buffer,
|
|
|
|
|
}
|
2024-03-21 15:28:25 +00:00
|
|
|
|
|
2024-08-04 23:22:34 +00:00
|
|
|
|
export interface ApiActionRequest {
|
2024-03-21 15:28:25 +00:00
|
|
|
|
id: number
|
|
|
|
|
action: string
|
2024-08-04 23:22:34 +00:00
|
|
|
|
args?: unknown[] | undefined,
|
2024-03-21 15:28:25 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export type Html5ifyMode = 'fastest' | 'fast-audio-remux' | 'fast-audio' | 'fast' | 'slow' | 'slow-audio' | 'slowest';
|
2024-05-19 21:16:52 +00:00
|
|
|
|
|
2024-05-20 10:17:53 +00:00
|
|
|
|
export type WaveformMode = 'big-waveform' | 'waveform';
|
|
|
|
|
|
2024-05-19 21:16:52 +00:00
|
|
|
|
// This is the contract with the user, see https://github.com/mifi/lossless-cut/blob/master/expressions.md
|
|
|
|
|
export interface ScopeSegment {
|
|
|
|
|
label: string,
|
|
|
|
|
start: number,
|
|
|
|
|
end: number,
|
|
|
|
|
duration: number,
|
|
|
|
|
tags: Record<string, string>,
|
|
|
|
|
}
|