Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements #78

Merged
merged 17 commits into from
Jan 9, 2017
Merged

Improvements #78

merged 17 commits into from
Jan 9, 2017

Conversation

uiryuu
Copy link
Member

@uiryuu uiryuu commented Jan 7, 2017

  1. Handle error code when adding unsupported subtitles and audios.
  2. Enable dragging subtitles in VideoView.
  3. Change the original behavior in PlaylistDragDestView when dragging. It will not add non-video files into playlist now.

lhc70000 and others added 8 commits January 6, 2017 23:09

override func performDragOperation(_ sender: NSDraggingInfo) -> Bool {
let board = sender.draggingPasteboard()
let fileURL: NSURL? = NSURL(from: board)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This solution only supports single file.

Please refer to PlaylistDragDestView.swift.

override func performDragOperation(_ sender: NSDraggingInfo) -> Bool {
let board = sender.draggingPasteboard()
let fileURL: NSURL? = NSURL(from: board)
playerCore.loadExternalSubFile(fileURL as! URL)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe need to check whether it's a subtitle file, if not, load the dragged file (as video).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have a list of the support format of subtitles, audio tracks and videos? I think it helps to handle.

func loadExternalAudioFile(_ url: URL) {
mpvController.command(.audioAdd, args: [url.path])
mpvController.command(.audioAdd, args: [url.path], checkError: false, returnValueCallback: failedLoadExternalAudioFile)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer using a block here. What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Revise later.

func loadExternalSubFile(_ url: URL) {
mpvController.command(.subAdd, args: [url.path])
mpvController.command(.subAdd, args: [url.path], checkError: false, returnValueCallback: failedLoadExternalSubFile)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

@uiryuu uiryuu changed the title Improvements [WIP] Improvements Jan 7, 2017
Change the original behavior in PlaylistDragDestView when dragging. It will not add non-video files into playlist now.
@uiryuu uiryuu changed the title [WIP] Improvements Improvements Jan 7, 2017
@lhc70000 lhc70000 merged commit d4aade9 into iina:develop Jan 9, 2017
@uiryuu uiryuu deleted the develop branch January 9, 2017 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants