forked from iina/iina
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFreeSelectingViewController.swift
More file actions
39 lines (33 loc) · 1017 Bytes
/
FreeSelectingViewController.swift
File metadata and controls
39 lines (33 loc) · 1017 Bytes
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
//
// FreeSelectingViewController.swift
// iina
//
// Created by lhc on 5/9/2017.
// Copyright © 2017 lhc. All rights reserved.
//
import Cocoa
/** Currently only for adding delogo filters. */
class FreeSelectingViewController: CropBoxViewController {
@IBAction func doneBtnAction(_ sender: AnyObject) {
let player = mainWindow.player
mainWindow.exitInteractiveMode {
let filter = MPVFilter.init(lavfiName: "delogo", label: Constants.FilterName.delogo, paramDict: [
"x": String(self.cropx),
"y": String(self.cropy),
"w": String(self.cropw),
"h": String(self.croph)
])
if let existingFilter = player.info.delogoFilter {
let _ = player.removeVideoFilter(existingFilter)
}
if !player.addVideoFilter(filter) {
Utility.showAlert("filter.incorrect")
return
}
player.info.delogoFilter = filter
}
}
@IBAction func cancelBtnAction(_ sender: AnyObject) {
mainWindow.exitInteractiveMode()
}
}