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

Volume indicator/mute button #4

Open
Mayurifag opened this issue Jan 29, 2022 · 4 comments
Open

Volume indicator/mute button #4

Mayurifag opened this issue Jan 29, 2022 · 4 comments

Comments

@Mayurifag
Copy link

@maoiscat hi! Thanks to your mpv extension, its so much better than default osc, I liked it very much! ❤️

However, I'm missing volume button: that was very handy to have ability to mute sound fast (via left-clicking on volume button) and change volume (via scrolling on icon up and down). Still, I see the code about volume in .lua file. Is there any way I can get volume button back? Isn't it just forgotten to be shown on interface? I can't see in Windows nor Linux environments.

Thanks in advance! 👍🏻

@Mayurifag
Copy link
Author

I see its already coded, but seems to be not used?

    -- volume
    ne = new_element("volume", "button")

    ne.content = function()
        local volume = mp.get_property_number("volume", 0)
        local mute = mp.get_property_native("mute")
        local volicon = {"\238\132\139", "\238\132\140",
                         "\238\132\141", "\238\132\142"}
        if volume == 0 or mute then
            return "\238\132\138"
        else
            return volicon[math.min(4,math.ceil(volume / (100/3)))]
        end
    end
    ne.eventresponder["mbtn_left_up"] =
        function () mp.commandv("cycle", "mute") end

    ne.eventresponder["wheel_up_press"] =
        function () mp.commandv("osd-auto", "add", "volume", 5) end
    ne.eventresponder["wheel_down_press"] =
        function () mp.commandv("osd-auto", "add", "volume", -5) end

@Mayurifag
Copy link
Author

Mayurifag commented Feb 4, 2022

Okay, I've actually opened a pull request with the naive implementation.
#5

mpv

Its not that fancy as mpv-dark-box's interface, but more looks like the stock mpv interface one. Still I'd rather have volume button to be presented in the interface even if its ugly, then not to have it.

Link to .lua file, if you want to use this interface with volume https://raw.githubusercontent.com/Mayurifag/mpv-dark-box/add-volume-button/dark-box.lua

@maoiscat
Copy link
Owner

Thank you for your work.
however the hidden volume icon is a feature rather than a bug, so i suggest you keep it in your own fork.
anyway, i will decline your pull request.

@Mayurifag
Copy link
Author

Thanks! Lets have open this issue to let users know? Or, maybe, we may have option, that is disabled by default.

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

No branches or pull requests

2 participants