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

Add rotate reset functionality #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions scripts/cycle-video-rotate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
--
-- -----------------------------------------------------------

function cycle_video_rotate_reset()
-- Reset rotation and tell the user.
mp.set_property_number("video-rotate", 0)
mp.osd_message("Rotate: Reset")
end

function cycle_video_rotate(amt)
-- Ensure that amount is a base 10 integer.
amt = tonumber(amt, 10)
Expand All @@ -31,6 +37,10 @@ function cycle_video_rotate(amt)
end

-- Bind this via input.conf. Example:
-- Alt+LEFT script-message Cycle_Video_Rotate -90
-- Alt+RIGHT script-message Cycle_Video_Rotate 90
-- Alt+SHIFT+LEFT script-message Cycle_Video_Rotate -90
-- Alt+SHIFT+RIGHT script-message Cycle_Video_Rotate 90
mp.register_script_message("Cycle_Video_Rotate", cycle_video_rotate)

-- Bind this via input.conf. Example:
-- Alt+SHIFT+DOWN script-message Cycle_Video_Rotate_Reset
mp.register_script_message("Cycle_Video_Rotate_Reset", cycle_video_rotate_reset)