Skip to content

PlaylistView: Fix loop* issues #3704

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

Merged
merged 1 commit into from
May 9, 2022
Merged

PlaylistView: Fix loop* issues #3704

merged 1 commit into from
May 9, 2022

Conversation

CarterLi
Copy link
Contributor

@CarterLi CarterLi commented Apr 28, 2022


Description:

  1. Store preference for playlist loop status
  2. Make loop file actually work and add a loop file button

TODO: The style of the new loop file button in active mode doesn't
match other buttons in playlist view, which needs rework

Related PR: #3700

@CarterLi
Copy link
Contributor Author

Ref: #3701 (comment)

@low-batt
Copy link
Contributor

I tested the PR and it worked for me. The only thing I find odd about the changes is this:

low-batt@gag iina (pr3704)$ defaults read com.colliderli.iina | grep -i loop
    enableFileLoop = 1;
    enablePlaylistLoop = 1;

These are not global controls, one IINA window can have file loop enabled while another window has it disabled. Same for playlist loop. So it seems odd to be persisting a global setting in user defaults. The persisted settings are ignored. Even though they are both enabled in defaults when IINA is restarted both are disabled when IINA comes up. That seems like the correct behavior as if you had two IINA windows open at the time you quit IINA with settings enabled in one and not in the other it is not clear which should "win" and be used when IINA restarts.

@CarterLi
Copy link
Contributor Author

Saving preference of file loop and playlist loop is useful when people use IINA as a music player. Although IINA is mainly a video player, it does support music (mini) mode.

The persisted settings are ignored.

I tested it with single window and it worked for me. As for multi window, I didn't test that case.

That seems like the correct behavior as if you had two IINA windows open at the time you quit IINA with settings enabled in one and not in the other it is not clear which should "win" and be used when IINA restarts.

The last changed settings should win, like you open two text editors for one file.

In my honest opinion multi window for a media player is over-design. I don't think it's very useful to watch 2 movies at the same time.

@low-batt
Copy link
Contributor

Well I'm confused. It is definitely not working for me. I checked IINA+ and not working for me there either. As can be seen above both kinds of looping are enabled in the persisted user defaults, but when I start IINA and play a file, neither items are checked on the Playback menu. I hacked in the following code to MPVController.mpvInit:

setUserOption(PK.enableFileLoop, type: .other, forName: MPVOption.PlaybackControl.loopFile) { key in
  return Preference.bool(for: key) ? "inf" : "no"
}
setUserOption(PK.enablePlaylistLoop, type: .other, forName: MPVOption.PlaybackControl.loopPlaylist) { key in
  return Preference.bool(for: key) ? "inf" : "no"
}

And restarted IINA and then the menu items were both initially enabled. Maybe some changes were lost at some point during all the merging? Can you confirm it is still working for you?

The example of when preserving this setting is useful for video playback would be continuous playback for advertising, kiosk, demos, that kind of thing.

I am embarrassed to say that I am a multi-window user. Usually it is because I was in the middle of watching some instructional video and got interrupted. I know I can depend upon watch later to remember where I was, but I usually leave the window open so I don't forget to come back to it.

@CarterLi CarterLi force-pushed the hdr branch 2 times, most recently from 2adeea7 to b79baa8 Compare April 30, 2022 02:14
@CarterLi
Copy link
Contributor Author

I removed preference related code. I'll just keep it in iina-plus

@lhc70000
Copy link
Member

I have two quick comments:

  • I do hope we have vector images for all UI elements, and the icon should derive from the current file loop icon. I will try to draw a new one.
  • The standard logic in a music player should be: we have only one button for looping, and clicking the button switches among "off", "playlist loop" and "file loop" mode. It makes no sense to have two buttons, with both playlist loop and file loop enabled.

@lhc70000
Copy link
Member

lhc70000 commented May 8, 2022

Hi @CarterLi, could you remove the changes to the button for now? I hope the playlist related fixes can be merged into 1.3.0, but we need to discuss more on the UI changes.

@CarterLi
Copy link
Contributor Author

CarterLi commented May 8, 2022

Hi @CarterLi, could you remove the changes to the button for now? I hope the playlist related fixes can be merged into 1.3.0, but we need to discuss more on the UI changes.

Done.

However I want to say that loop file is very useful for a music player. Please add it sometime

@lhc70000 lhc70000 merged commit 063b274 into iina:develop May 9, 2022
@lhc70000
Copy link
Member

lhc70000 commented May 9, 2022

Thanks. Sure!

@CarterLi CarterLi mentioned this pull request Mar 2, 2023
2 tasks
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.

3 participants