Giter VIP home page Giter VIP logo

Comments (10)

CogentRedTester avatar CogentRedTester commented on August 22, 2024 1

The cycle-profile script predates the profile restore feature. I'd suggest using the cycle-commands script instead, which you can use to replicate the behaviour:

script-message cycle-commands "apply-profile profile1" "apply-profile profile1 restore"

from mpv-scripts.

CogentRedTester avatar CogentRedTester commented on August 22, 2024 1

I've written a modified version of cycle-profile.lua in PR #27 that support profile restoration and has nicer syntax. It probably works better than using cycle-commands.

from mpv-scripts.

CogentRedTester avatar CogentRedTester commented on August 22, 2024 1

Oh man, I'm so sorry, I got busy and hadn't even read this message before nor tested the new version. I'm afraid it's too late now, but I could finally test it, and it works fine to apply and un-apply a profiile for a first time, but not for a second. If I press the keybind again after the profile-restore options is used, it won't work anymore (no profiles are applied anymore). In my input.conf I put: e script-message cycle-profiles profile profile-restore

1st e press: profile is applied; 2nd e press: profile restore is used and default profile is back; 3rd e press: nothing happens.

You're doing it wrong, you don't do profile-restore to restore the previous profile, that happens automatically. What you have tried to do is apply a profile called profile on the first e, and then apply a profile called profile-restore on the second e. There was also a bug that should have been fixed in the latest commit where the script would crash if you tried to apply an unknown profile, that's why you couldn't keep cycling.

from mpv-scripts.

KonoVitoDa avatar KonoVitoDa commented on August 22, 2024

Thanks, that's what I've done already haha.

from mpv-scripts.

KonoVitoDa avatar KonoVitoDa commented on August 22, 2024

How can I make it show profile name and description like cycle-profile does?

from mpv-scripts.

CogentRedTester avatar CogentRedTester commented on August 22, 2024

I don't think you can automatically grab the profile description with this method, but you can print some text manually:

script-message cycle-commands "apply-profile profile1 ; show-text 'applying profile1'" "apply-profile profile1 restore ; show-text 'restoring profile1'"


Also, if you want to actually cycle between profiles you could do:

script-message cycle-commands "apply-profile profile2 restore ; apply-profile profile1 ; show-text 'applying profile1'" "apply-profile profile1 restore ; apply-profile profile2 ; show-text 'applying profile2'"


Or if you're using mpv v0.36+ you could use the user-data property and auto profiles:

mpv.conf:

[profile1]
profile-cond=user_data.profile == 'profile1'
profile-restore=copy

[profile2]
profile-cond=user_data.profile == 'profile2'
profile-restore=copy

input.conf:

script-message cycle-commands "set user-data/profile profile1" "set user-data/profile profile2"

from mpv-scripts.

KonoVitoDa avatar KonoVitoDa commented on August 22, 2024

WOW, that was fast, thank you so much! ❤️

from mpv-scripts.

CogentRedTester avatar CogentRedTester commented on August 22, 2024

It would be nice if you could test if it works and let me know. It works for me, but it's always good to have an extra person test. This is also your opportunity to recommend any changes to how it works before I push the change to master.

Edit: if it's working then we can close this issue.

from mpv-scripts.

KonoVitoDa avatar KonoVitoDa commented on August 22, 2024

It would be nice if you could test if it works and let me know. It works for me, but it's always good to have an extra person test. This is also your opportunity to recommend any changes to how it works before I push the change to master.

Edit: if it's working then we can close this issue.

Oh man, I'm so sorry, I got busy and hadn't even read this message before nor tested the new version. I'm afraid it's too late now, but I could finally test it, and it works fine to apply and un-apply a profiile for a first time, but not for a second. If I press the keybind again after the profile-restore options is used, it won't work anymore (no profiles are applied anymore). In my input.conf I put:
e script-message cycle-profiles profile profile-restore

1st e press: profile is applied;
2nd e press: profile restore is used and default profile is back;
3rd e press: nothing happens.

from mpv-scripts.

KonoVitoDa avatar KonoVitoDa commented on August 22, 2024

Ooooh, I see. I fixed it and now it works perfectly!
e script-message cycle-profiles profile1 profile2 profile3 ""

I was afraid it wouldn't work properly with multiple profiles, but gladly I was wrong haha.
Again, thank you so much! ❤️

from mpv-scripts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.