| 1 |
/* |
| 2 |
* SPDX-FileCopyrightText: 2020 George Florea Bănuș <[email protected]> |
| 3 |
* |
| 4 |
* SPDX-License-Identifier: GPL-3.0-or-later |
| 5 |
*/ |
| 6 |
|
| 7 |
pragma ComponentBehavior: Bound |
| 8 |
|
| 9 |
import QtQuick |
| 10 |
import QtQuick.Controls |
| 11 |
|
| 12 |
import org.kde.haruna |
| 13 |
import org.kde.haruna.utilities |
| 14 |
import org.kde.haruna.settings |
| 15 |
|
| 16 |
Item { |
| 17 |
id: root |
| 18 |
|
| 19 |
required property ActionsModel m_actionsModel |
| 20 |
required property MpvItem m_mpv |
| 21 |
required property MpvContextMenu m_mpvContextMenuLoader |
| 22 |
required property SettingsWindow m_settingsLoader |
| 23 |
required property Osd m_osd |
| 24 |
required property Footer m_footer |
| 25 |
required property SelectActionPopup m_triggerActionPopup |
| 26 |
required property InputPopup m_openUrlPopup |
| 27 |
|
| 28 |
signal openFileDialog() |
| 29 |
signal openSubtitleDialog() |
| 30 |
signal togglePlaylist() |
| 31 |
|
| 32 |
Instantiator { |
| 33 |
model: root.m_actionsModel |
| 34 |
delegate: Action { |
| 35 |
id: delegate |
| 36 |
|
| 37 |
required property string actionName |
| 38 |
required property string actionText |
| 39 |
required property string actionDescription |
| 40 |
required property string actionShortcut |
| 41 |
required property string actionIcon |
| 42 |
required property string actionType |
| 43 |
|
| 44 |
enabled: HarunaApp.actionsEnabled |
| 45 |
objectName: delegate.actionName |
| 46 |
text: delegate.actionText |
| 47 |
shortcut: delegate.actionShortcut |
| 48 |
icon.name: delegate.actionIcon |
| 49 |
onTriggered: { |
| 50 |
if (delegate.actionType === "NormalAction") { |
| 51 |
root.m_actionsModel.signalEmitter(objectName) |
| 52 |
} |
| 53 |
if (delegate.actionType === "CustomAction") { |
| 54 |
root.m_mpv.userCommand(delegate.actionText) |
| 55 |
root.m_osd.message(root.m_mpv.expandText(delegate.actionDescription)) |
| 56 |
} |
| 57 |
} |
| 58 |
|
| 59 |
Component.onCompleted: HarunaApp.actions[objectName] = this |
| 60 |
} |
| 61 |
} |
| 62 |
|
| 63 |
Connections { |
| 64 |
target: root.m_actionsModel |
| 65 |
|
| 66 |
function onOpenActionsDialogAction() { |
| 67 |
root.m_triggerActionPopup.open() |
| 68 |
} |
| 69 |
|
| 70 |
function onAboutHarunaAction() { |
| 71 |
root.m_settingsLoader.openSettingPage(SettingsWindow.Page.About) |
| 72 |
} |
| 73 |
|
| 74 |
function onReportBugAction() { |
| 75 |
Qt.openUrlExternally("https://bugs.kde.org/enter_bug.cgi?product=Haruna") |
| 76 |
} |
| 77 |
|
| 78 |
function onSponsorAction() { |
| 79 |
Qt.openUrlExternally("https://github.com/sponsors/g-fb") |
| 80 |
} |
| 81 |
|
| 82 |
function onAudioCycleUpAction() { |
| 83 |
root.m_mpv.setNextTrack(MpvItem.TrackType.Audio) |
| 84 |
} |
| 85 |
|
| 86 |
function onAudioCycleDownAction() { |
| 87 |
root.m_mpv.setPreviousTrack(MpvItem.TrackType.Audio) |
| 88 |
} |
| 89 |
|
| 90 |
function onConfigureAction() { |
| 91 |
root.m_settingsLoader.openSettingPage(root.m_settingsLoader.activePage) |
| 92 |
} |
| 93 |
|
| 94 |
function onConfigureShortcutsAction() { |
| 95 |
root.m_settingsLoader.openSettingPage(SettingsWindow.Page.Shortcuts) |
| 96 |
} |
| 97 |
|
| 98 |
function onExitFullscreenAction() { |
| 99 |
const mainWindow = root.Window.window as Main |
| 100 |
mainWindow.exitFullscreen() |
| 101 |
} |
| 102 |
|
| 103 |
function onFrameStepForwardAction() { |
| 104 |
root.m_mpv.command(["frame-step"]) |
| 105 |
} |
| 106 |
|
| 107 |
function onFrameStepBackwardAction() { |
| 108 |
root.m_mpv.command(["frame-back-step"]) |
| 109 |
} |
| 110 |
|
| 111 |
function onLoadLastPlayedFileAction() { |
| 112 |
if (GeneralSettings.lastPlayedFile === "") { |
| 113 |
return |
| 114 |
} |
| 115 |
|
| 116 |
const mainWindow = root.Window.window as Main |
| 117 |
mainWindow.openFile(GeneralSettings.lastPlayedFile, RecentFilesModel.OpenedFrom.Other) |
| 118 |
} |
| 119 |
|
| 120 |
function onMuteAction() { |
| 121 |
root.m_mpv.mute = !root.m_mpv.mute |
| 122 |
} |
| 123 |
|
| 124 |
function onOpenContextMenuAction() { |
| 125 |
// if menu is open it will be closed because of the Popup.CloseOnPressOutside close policy |
| 126 |
// but that happens after the call to openMpvContextMenuLoader() below |
| 127 |
// resulting in the menu being opened for a very short time and then closed |
| 128 |
root.m_mpvContextMenuLoader.close() |
| 129 |
root.m_mpvContextMenuLoader.open() |
| 130 |
} |
| 131 |
|
| 132 |
function onOpenFileAction() { |
| 133 |
root.openFileDialog() |
| 134 |
} |
| 135 |
|
| 136 |
function onAddExternalSubtitleAction() { |
| 137 |
if (root.m_mpv.currentUrl.toString() === "") { |
| 138 |
const osdMsg = i18nc("osd message when trying to open subtitle selection dialog while no file is open", |
| 139 |
"Can’t load subtitle when no file is open") |
| 140 |
root.m_osd.message(osdMsg) |
| 141 |
return |
| 142 |
} |
| 143 |
|
| 144 |
root.openSubtitleDialog() |
| 145 |
} |
| 146 |
|
| 147 |
function onOpenUrlAction() { |
| 148 |
if (root.m_openUrlPopup.visible) { |
| 149 |
root.m_openUrlPopup.close() |
| 150 |
} else { |
| 151 |
root.m_openUrlPopup.open() |
| 152 |
} |
| 153 |
} |
| 154 |
|
| 155 |
function onPlaybackSpeedIncreaseAction() { |
| 156 |
const speed = root.m_mpv.getProperty(MpvProperties.Speed) + 0.1 |
| 157 |
root.m_mpv.setProperty(MpvProperties.Speed, speed) |
| 158 |
root.m_osd.message(i18nc("@info:tooltip", "Playback speed: %1", speed.toFixed(2))) |
| 159 |
} |
| 160 |
|
| 161 |
function onPlaybackSpeedDecreaseAction() { |
| 162 |
const speed = root.m_mpv.getProperty(MpvProperties.Speed) - 0.1 |
| 163 |
root.m_mpv.setProperty(MpvProperties.Speed, speed) |
| 164 |
root.m_osd.message(i18nc("@info:tooltip", "Playback speed: %1", speed.toFixed(2))) |
| 165 |
} |
| 166 |
|
| 167 |
function onPlaybackSpeedResetAction() { |
| 168 |
root.m_mpv.setProperty(MpvProperties.Speed, 1.0) |
| 169 |
root.m_osd.message(i18nc("@info:tooltip", "Playback speed: %1", 1.0)) |
| 170 |
} |
| 171 |
|
| 172 |
function onPlayPauseAction() { |
| 173 |
root.m_mpv.pause = !root.m_mpv.pause |
| 174 |
} |
| 175 |
|
| 176 |
function onPlayNextAction() { |
| 177 |
root.m_mpv.activeFilterProxyModel.playNext() |
| 178 |
} |
| 179 |
|
| 180 |
function onStopAction() { |
| 181 |
root.m_mpv.stop() |
| 182 |
} |
| 183 |
|
| 184 |
function onPlayPreviousAction() { |
| 185 |
root.m_mpv.activeFilterProxyModel.playPrevious() |
| 186 |
} |
| 187 |
|
| 188 |
function onQuitApplicationAction() { |
| 189 |
Qt.quit() |
| 190 |
} |
| 191 |
|
| 192 |
function onRestartPlaybackAction() { |
| 193 |
root.m_mpv.command(["seek", 0, "absolute"]) |
| 194 |
} |
| 195 |
|
| 196 |
function onSeekForwardSmallAction() { |
| 197 |
root.m_mpv.command(["seek", PlaybackSettings.seekSmallStep, "exact"]) |
| 198 |
} |
| 199 |
|
| 200 |
function onSeekBackwardSmallAction() { |
| 201 |
root.m_mpv.command(["seek", -PlaybackSettings.seekSmallStep, "exact"]) |
| 202 |
} |
| 203 |
|
| 204 |
function onSeekForwardMediumAction() { |
| 205 |
root.m_mpv.command(["seek", PlaybackSettings.seekMediumStep, "exact"]) |
| 206 |
} |
| 207 |
|
| 208 |
function onSeekBackwardMediumAction() { |
| 209 |
root.m_mpv.command(["seek", -PlaybackSettings.seekMediumStep, "exact"]) |
| 210 |
} |
| 211 |
|
| 212 |
function onSeekForwardBigAction() { |
| 213 |
root.m_mpv.command(["seek", PlaybackSettings.seekBigStep, "exact"]) |
| 214 |
} |
| 215 |
|
| 216 |
function onSeekBackwardBigAction() { |
| 217 |
root.m_mpv.command(["seek", -PlaybackSettings.seekBigStep, "exact"]) |
| 218 |
} |
| 219 |
|
| 220 |
function onSeekNextChapterAction() { |
| 221 |
const chapters = root.m_mpv.getProperty(MpvProperties.ChapterList) |
| 222 |
const currentChapter = root.m_mpv.getProperty(MpvProperties.Chapter) |
| 223 |
const nextChapter = currentChapter + 1 |
| 224 |
if (nextChapter === chapters.length) { |
| 225 |
root.m_actionsModel.signalEmitter("playNextAction") |
| 226 |
return |
| 227 |
} |
| 228 |
root.m_mpv.command(["add", "chapter", "1"]) |
| 229 |
} |
| 230 |
|
| 231 |
function onSeekPreviousChapterAction() { |
| 232 |
root.m_mpv.command(["add", "chapter", "-1"]) |
| 233 |
} |
| 234 |
|
| 235 |
function onSeekNextSubtitleAction() { |
| 236 |
if (root.m_mpv.getProperty(MpvProperties.SubtitleId) !== false) { |
| 237 |
root.m_mpv.command(["sub-seek", "1"]) |
| 238 |
} else { |
| 239 |
root.m_actionsModel.signalEmitter("seekForwardSmallAction") |
| 240 |
} |
| 241 |
} |
| 242 |
|
| 243 |
function onSeekPreviousSubtitleAction() { |
| 244 |
if (root.m_mpv.getProperty(MpvProperties.SubtitleId) !== false) { |
| 245 |
root.m_mpv.command(["sub-seek", "-1"]) |
| 246 |
} else { |
| 247 |
root.m_actionsModel.signalEmitter("seekBackwardSmallAction") |
| 248 |
} |
| 249 |
} |
| 250 |
|
| 251 |
function onSeekToWatchLaterPositionAction() { |
| 252 |
if (root.m_mpv.watchLaterPosition === 0) { |
| 253 |
return |
| 254 |
} |
| 255 |
root.m_mpv.command(["seek", root.m_mpv.watchLaterPosition, "absolute"]) |
| 256 |
} |
| 257 |
|
| 258 |
function onSetLoopAction() { |
| 259 |
var a = root.m_mpv.getProperty(MpvProperties.ABLoopA) |
| 260 |
var b = root.m_mpv.getProperty(MpvProperties.ABLoopB) |
| 261 |
|
| 262 |
var aIsSet = a !== "no" |
| 263 |
var bIsSet = b !== "no" |
| 264 |
|
| 265 |
if (!aIsSet && !bIsSet) { |
| 266 |
root.m_mpv.setProperty(MpvProperties.ABLoopA, root.m_mpv.position) |
| 267 |
root.m_footer.progressBar.loopIndicator.startPosition = root.m_mpv.position |
| 268 |
root.m_osd.message(i18nc("@info:tooltip; %1 is the timestamp where the loop starts", "Loop start: %1", MiscUtils.formatTime(root.m_mpv.position))) |
| 269 |
} else if (aIsSet && !bIsSet) { |
| 270 |
// set b position slightly ahead to ensure the loop section is not skipped |
| 271 |
const bPosition = root.m_mpv.position + 0.1 |
| 272 |
root.m_mpv.setPropertyBlocking(MpvProperties.ABLoopB, bPosition) |
| 273 |
root.m_footer.progressBar.loopIndicator.endPosition = bPosition |
| 274 |
root.m_osd.message(i18nc("@info:tooltip, use en dash for the range", "Loop: %1–%2", MiscUtils.formatTime(a), MiscUtils.formatTime(bPosition))) |
| 275 |
} else { |
| 276 |
root.m_mpv.setProperty(MpvProperties.ABLoopA, "no") |
| 277 |
root.m_mpv.setProperty(MpvProperties.ABLoopB, "no") |
| 278 |
root.m_footer.progressBar.loopIndicator.startPosition = -1 |
| 279 |
root.m_footer.progressBar.loopIndicator.endPosition = -1 |
| 280 |
root.m_osd.message(i18nc("@info:tooltip", "Loop cleared")) |
| 281 |
} |
| 282 |
} |
| 283 |
|
| 284 |
function onScreenshotAction() { |
| 285 |
root.m_mpv.commandAsync(["screenshot"], MpvItem.Screenshot) |
| 286 |
} |
| 287 |
|
| 288 |
function onSubtitleQuickenAction() { |
| 289 |
const delay = root.m_mpv.getProperty(MpvProperties.SubtitleDelay) - 0.1 |
| 290 |
root.m_mpv.setProperty(MpvProperties.SubtitleDelay, delay) |
| 291 |
} |
| 292 |
|
| 293 |
function onSubtitleDelayAction() { |
| 294 |
const delay = root.m_mpv.getProperty(MpvProperties.SubtitleDelay) + 0.1 |
| 295 |
root.m_mpv.setProperty(MpvProperties.SubtitleDelay, delay) |
| 296 |
} |
| 297 |
|
| 298 |
function onSubtitleToggleAction() { |
| 299 |
const visible = root.m_mpv.getProperty(MpvProperties.SubtitleVisibility) |
| 300 |
const message = visible ? i18nc("@info:tooltip", "Subtitles off") : i18nc("@info:tooltip", "Subtitles on") |
| 301 |
root.m_mpv.setProperty(MpvProperties.SubtitleVisibility, !visible) |
| 302 |
root.m_osd.message(message) |
| 303 |
} |
| 304 |
|
| 305 |
function onSubtitleCycleUpAction() { |
| 306 |
root.m_mpv.setNextTrack(MpvItem.TrackType.Subtitle) |
| 307 |
} |
| 308 |
|
| 309 |
function onSubtitleCycleDownAction() { |
| 310 |
root.m_mpv.setPreviousTrack(MpvItem.TrackType.Subtitle) |
| 311 |
} |
| 312 |
|
| 313 |
function onSubtitleIncreaseFontSizeAction() { |
| 314 |
const subScale = root.m_mpv.getProperty(MpvProperties.SubtitleScale) + 0.1 |
| 315 |
root.m_mpv.setProperty(MpvProperties.SubtitleScale, subScale) |
| 316 |
root.m_osd.message(i18nc("@info:tooltip", "Subtitle scale: %1", subScale.toFixed(1))) |
| 317 |
} |
| 318 |
|
| 319 |
function onSubtitleDecreaseFontSizeAction() { |
| 320 |
const subScale = root.m_mpv.getProperty(MpvProperties.SubtitleScale) - 0.1 |
| 321 |
root.m_mpv.setProperty(MpvProperties.SubtitleScale, subScale) |
| 322 |
root.m_osd.message(i18nc("@info:tooltip", "Subtitle scale: %1", subScale.toFixed(1))) |
| 323 |
} |
| 324 |
|
| 325 |
function onSubtitleMoveUpAction() { |
| 326 |
root.m_mpv.command(["add", "sub-pos", "-1"]) |
| 327 |
} |
| 328 |
|
| 329 |
function onSubtitleMoveDownAction() { |
| 330 |
root.m_mpv.command(["add", "sub-pos", "+1"]) |
| 331 |
} |
| 332 |
|
| 333 |
function onToggleDeinterlacingAction() { |
| 334 |
const deinterlaced = !root.m_mpv.getProperty(MpvProperties.Deinterlace) |
| 335 |
root.m_mpv.setProperty(MpvProperties.Deinterlace, deinterlaced) |
| 336 |
root.m_osd.message(i18nc("@info:tooltip", "Deinterlace: %1", deinterlaced)) |
| 337 |
} |
| 338 |
|
| 339 |
function onToggleFullscreenAction() { |
| 340 |
const mainWindow = root.Window.window as Main |
| 341 |
mainWindow.toggleFullScreen() |
| 342 |
} |
| 343 |
|
| 344 |
function onToggleMenuBarAction() { |
| 345 |
GeneralSettings.showMenuBar = !GeneralSettings.showMenuBar |
| 346 |
GeneralSettings.save() |
| 347 |
} |
| 348 |
|
| 349 |
function onToggleHeaderAction() { |
| 350 |
GeneralSettings.showHeader = !GeneralSettings.showHeader |
| 351 |
GeneralSettings.save() |
| 352 |
} |
| 353 |
|
| 354 |
function onTogglePlaylistAction() { |
| 355 |
root.togglePlaylist() |
| 356 |
} |
| 357 |
|
| 358 |
function onVideoPanXLeftAction() { |
| 359 |
const pan = root.m_mpv.getProperty(MpvProperties.VideoPanX) - 0.01 |
| 360 |
root.m_mpv.setProperty(MpvProperties.VideoPanX, pan) |
| 361 |
} |
| 362 |
|
| 363 |
function onVideoPanXRightAction() { |
| 364 |
const pan = root.m_mpv.getProperty(MpvProperties.VideoPanX) + 0.01 |
| 365 |
root.m_mpv.setProperty(MpvProperties.VideoPanX, pan) |
| 366 |
} |
| 367 |
|
| 368 |
function onVideoPanYUpAction() { |
| 369 |
const pan = root.m_mpv.getProperty(MpvProperties.VideoPanY) - 0.01 |
| 370 |
root.m_mpv.setProperty(MpvProperties.VideoPanY, pan) |
| 371 |
} |
| 372 |
|
| 373 |
function onVideoPanYDownAction() { |
| 374 |
const pan = root.m_mpv.getProperty(MpvProperties.VideoPanY) + 0.01 |
| 375 |
root.m_mpv.setProperty(MpvProperties.VideoPanY, pan) |
| 376 |
} |
| 377 |
|
| 378 |
function onRotateClockwiseAction() { |
| 379 |
root.m_mpv.commandAsync(["cycle_values", "video-rotate", "90", "180", "270", "0"]) |
| 380 |
} |
| 381 |
|
| 382 |
function onRotateCounterClockwiseAction() { |
| 383 |
root.m_mpv.commandAsync(["cycle_values", "video-rotate", "270", "180", "90", "0"]) |
| 384 |
} |
| 385 |
|
| 386 |
function onVolumeUpAction() { |
| 387 |
root.m_mpv.command(["add", "volume", AudioSettings.volumeStep]) |
| 388 |
} |
| 389 |
|
| 390 |
function onVolumeDownAction() { |
| 391 |
root.m_mpv.command(["add", "volume", -AudioSettings.volumeStep]) |
| 392 |
} |
| 393 |
|
| 394 |
function onZoomInAction() { |
| 395 |
const zoom = root.m_mpv.getProperty(MpvProperties.VideoZoom) + 0.1 |
| 396 |
root.m_mpv.setProperty(MpvProperties.VideoZoom, zoom) |
| 397 |
root.m_osd.message(i18nc("@info:tooltip", "Zoom: %1", zoom.toFixed(2))) |
| 398 |
} |
| 399 |
|
| 400 |
function onZoomOutAction() { |
| 401 |
const zoom = root.m_mpv.getProperty(MpvProperties.VideoZoom) - 0.1 |
| 402 |
root.m_mpv.setProperty(MpvProperties.VideoZoom, zoom) |
| 403 |
root.m_osd.message(i18nc("@info:tooltip", "Zoom: %1", zoom.toFixed(2))) |
| 404 |
} |
| 405 |
|
| 406 |
function onZoomResetAction() { |
| 407 |
root.m_mpv.setProperty(MpvProperties.VideoZoom, 0) |
| 408 |
root.m_osd.message(i18nc("@info:tooltip", "Zoom: 0")) |
| 409 |
} |
| 410 |
|
| 411 |
|
| 412 |
function onContrastUpAction() { |
| 413 |
const contrast = parseInt(root.m_mpv.getProperty(MpvProperties.Contrast)) + 1 |
| 414 |
root.m_mpv.setProperty(MpvProperties.Contrast, `${contrast}`) |
| 415 |
root.m_osd.message(i18nc("@info:tooltip", "Contrast: %1", contrast)) |
| 416 |
} |
| 417 |
|
| 418 |
function onContrastDownAction() { |
| 419 |
const contrast = parseInt(root.m_mpv.getProperty(MpvProperties.Contrast)) - 1 |
| 420 |
root.m_mpv.setProperty(MpvProperties.Contrast, `${contrast}`) |
| 421 |
root.m_osd.message(i18nc("@info:tooltip", "Contrast: %1", contrast)) |
| 422 |
} |
| 423 |
|
| 424 |
function onContrastResetAction() { |
| 425 |
root.m_mpv.setProperty(MpvProperties.Contrast, 0) |
| 426 |
root.m_osd.message(i18nc("@info:tooltip", "Contrast: 0")) |
| 427 |
} |
| 428 |
|
| 429 |
function onBrightnessUpAction() { |
| 430 |
const brightness = parseInt(root.m_mpv.getProperty(MpvProperties.Brightness)) + 1 |
| 431 |
root.m_mpv.setProperty(MpvProperties.Brightness, `${brightness}`) |
| 432 |
root.m_osd.message(i18nc("@info:tooltip", "Brightness: %1", brightness)) |
| 433 |
} |
| 434 |
|
| 435 |
function onBrightnessDownAction() { |
| 436 |
const brightness = parseInt(root.m_mpv.getProperty(MpvProperties.Brightness)) - 1 |
| 437 |
root.m_mpv.setProperty(MpvProperties.Brightness, `${brightness}`) |
| 438 |
root.m_osd.message(i18nc("@info:tooltip", "Brightness: %1", brightness)) |
| 439 |
} |
| 440 |
|
| 441 |
function onBrightnessResetAction() { |
| 442 |
root.m_mpv.setProperty(MpvProperties.Brightness, 0) |
| 443 |
root.m_osd.message(i18nc("@info:tooltip", "Brightness: 0")) |
| 444 |
} |
| 445 |
|
| 446 |
function onGammaUpAction() { |
| 447 |
const gamma = parseInt(root.m_mpv.getProperty(MpvProperties.Gamma)) + 1 |
| 448 |
root.m_mpv.setProperty(MpvProperties.Gamma, `${gamma}`) |
| 449 |
root.m_osd.message(i18nc("@info:tooltip", "Gamma: %1", gamma)) |
| 450 |
} |
| 451 |
|
| 452 |
function onGammaDownAction() { |
| 453 |
const gamma = parseInt(root.m_mpv.getProperty(MpvProperties.Gamma)) - 1 |
| 454 |
root.m_mpv.setProperty(MpvProperties.Gamma, `${gamma}`) |
| 455 |
root.m_osd.message(i18nc("@info:tooltip", "Gamma: %1", gamma)) |
| 456 |
} |
| 457 |
|
| 458 |
function onGammaResetAction() { |
| 459 |
root.m_mpv.setProperty(MpvProperties.Gamma, 0) |
| 460 |
root.m_osd.message(i18nc("@info:tooltip", "Gamma: 0")) |
| 461 |
} |
| 462 |
|
| 463 |
function onSaturationUpAction() { |
| 464 |
const saturation = parseInt(root.m_mpv.getProperty(MpvProperties.Saturation)) + 1 |
| 465 |
root.m_mpv.setProperty(MpvProperties.Saturation, `${saturation}`) |
| 466 |
root.m_osd.message(i18nc("@info:tooltip", "Saturation: %1", saturation)) |
| 467 |
} |
| 468 |
|
| 469 |
function onSaturationDownAction() { |
| 470 |
const saturation = parseInt(root.m_mpv.getProperty(MpvProperties.Saturation)) - 1 |
| 471 |
root.m_mpv.setProperty(MpvProperties.Saturation, `${saturation}`) |
| 472 |
root.m_osd.message(i18nc("@info:tooltip", "Saturation: %1", saturation)) |
| 473 |
} |
| 474 |
|
| 475 |
function onSaturationResetAction() { |
| 476 |
root.m_mpv.setProperty(MpvProperties.Saturation, 0) |
| 477 |
root.m_osd.message(i18nc("@info:tooltip", "Saturation: 0")) |
| 478 |
} |
| 479 |
} |
| 480 |
} |