-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
types.ts
137 lines (122 loc) · 6.63 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
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';
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',
sk: 'slovenčina',
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';
export type AvoidNegativeTs = 'make_zero' | 'auto' | 'make_non_negative' | 'disabled';
export type ModifierKey = 'ctrl' | 'shift' | 'alt' | 'meta';
export type PreserveMetadata = 'default' | 'nonglobal' | 'none'
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,
preserveChapters: boolean,
preserveMetadata: PreserveMetadata,
preserveMetadataOnMerge: boolean,
preserveMovData: boolean,
movFastStart: boolean,
avoidNegativeTs: AvoidNegativeTs,
hideNotifications: 'all' | undefined,
hideOsNotifications: 'all' | undefined,
autoLoadTimecode: boolean,
segmentsToChapters: boolean,
simpleMode: boolean,
outSegTemplate: string | undefined,
mergedFileTemplate: string | undefined,
keyboardSeekAccFactor: number,
keyboardNormalSeekSpeed: number,
keyboardSeekSpeed2: number,
keyboardSeekSpeed3: number,
treatInputFileModifiedTimeAsStart: boolean,
treatOutputFileModifiedTimeAsStart: boolean | undefined | null,
outFormatLocked: string | undefined,
safeOutputFileName: boolean,
windowBounds: { x: number, y: number, width: number, height: number } | undefined,
enableAutoHtml5ify: boolean,
keyBindings: KeyBinding[],
customFfPath: string | undefined,
storeProjectInWorkingDir: boolean,
enableOverwriteOutput: boolean,
mouseWheelZoomModifierKey: ModifierKey,
mouseWheelFrameSeekModifierKey: ModifierKey,
mouseWheelKeyframeSeekModifierKey: ModifierKey,
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,
invertTimelineScroll: boolean | undefined,
}
export interface Waveform {
buffer: Buffer,
}
export interface ApiActionRequest {
id: number
action: string
args?: unknown[] | undefined,
}
export type Html5ifyMode = 'fastest' | 'fast-audio-remux' | 'fast-audio' | 'fast' | 'slow' | 'slow-audio' | 'slowest';
export type WaveformMode = 'big-waveform' | 'waveform';
// 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>,
}