-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAppConstants.qml
More file actions
68 lines (55 loc) · 2.32 KB
/
AppConstants.qml
File metadata and controls
68 lines (55 loc) · 2.32 KB
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
pragma Singleton
import QtQuick
QtObject {
// Supported file extensions
readonly property var videoExtensions: ["mp4", "avi", "mkv", "mov", "wmv", "flv", "webm", "m4v", "mpg"]
readonly property var audioExtensions: ["mp3", "wav", "ogg", "flac", "aac", "wma", "m4a"]
// UI timing constants
readonly property int controlsHideDelay: 3000
readonly property int tooltipDelay: 1000
readonly property int tooltipTimeout: 5000
readonly property int snackbarDuration: 3000
readonly property int volumeDisplayDuration: 2000
readonly property int zoomDisplayDuration: 2000
readonly property int animationDuration: 300
// Volume constants
readonly property real volumeStep: 0.05
readonly property real defaultVolume: 0.5
// Zoom constants
readonly property real zoomMin: 1.0
readonly property real zoomMax: 5.0
readonly property real zoomFactor: 1.25
// Brightness and contrast constants
readonly property real defaultBrightness: 0.0
readonly property real defaultContrast: 0.0
readonly property real brightnessMin: -1.0
readonly property real brightnessMax: 1.0
readonly property real contrastMin: -1.0
readonly property real contrastMax: 1.0
readonly property real brightnessContrastStep: 0.01
// Seek constants (in milliseconds)
readonly property int seekStep: 5000
readonly property int seekStepSmall: 1000
// Playback speed options
readonly property var playbackSpeeds: [0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0]
// Helper functions
function getVideoExtensionsFilter(): string {
return "Video Files (*." + videoExtensions.join(" *.") + ")";
}
function getAudioExtensionsFilter(): string {
return "Audio Files (*." + audioExtensions.join(" *.") + ")";
}
function getSupportedFormatsString(): string {
var allExts = videoExtensions.concat(audioExtensions);
return allExts.map(ext => ext.toUpperCase()).join(", ");
}
function isVideoExtension(ext: string): bool {
return videoExtensions.indexOf(ext.toLowerCase()) !== -1;
}
function isAudioExtension(ext: string): bool {
return audioExtensions.indexOf(ext.toLowerCase()) !== -1;
}
function isSupportedExtension(ext: string): bool {
return isVideoExtension(ext) || isAudioExtension(ext);
}
}