Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions docs/CONTROLS.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ Below is a list that explains the OSC buttons function depending on how you inte
| ----------------- | -------------------- |
| Left mouse click | Toggle loop on/off |

### Shuffle

| Action | Function |
| ----------------- | -------------------- |
| Left mouse click | Shuffle/Unshuffle playlist |

### Speed Control

| Action | Function |
Expand Down
53 changes: 28 additions & 25 deletions docs/TRANSLATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ ModernZ currently has translations for the following languages:
"ontop_disable": "Unpin Window",
"loop_enable": "Loop",
"loop_disable": "Disable Loop",
"shuffle": "Shuffle Playlist",
"unshuffle": "Unshuffle Playlist",
"speed_control": "Speed Control",
"screenshot": "Screenshot",
"stats_info": "Information",
Expand Down Expand Up @@ -104,31 +106,32 @@ ModernZ currently has translations for the following languages:

## Translation Keys Reference

| Key | Description | Format Notes |
| ------------------------ | ----------------------- | --------------------------- |
| idle | Idle state message | Be brief |
| na | Not available | Menu label |
| video | Video label | Menu label |
| audio | Audio label | Menu label |
| subtitle | Subtitle label | Menu label |
| no_subs | No subtitles label | Menu label |
| no_audio | No audio label | Menu label |
| playlist | Playlist label | Menu label |
| no_playlist | No playlist label | Menu label |
| chapter | Chapter label | Menu label |
| ontop/ontop_disable | Window pin states | Action labels |
| loop_enable/loop_disable | Loop states | Action labels |
| screenshot | Screenshot label | Action label |
| stats_info | Information label | Menu label |
| cache | Information label | Text label |
| buffering | Information label | Text label |
| zoom_in | Information label | Menu label |
| zoom_out | Information label | Menu label |
| download | Information label | Menu label |
| download_in_progress | Information label | Menu label |
| downloading | Information label | Menu label |
| downloaded | Information label | Menu label |
| menu | Information label | Menu label |
| Key | Description | Format Notes |
| ------------------------------ | ----------------------- | --------------------------- |
| idle | Idle state message | Be brief |
| na | Not available | Menu label |
| video | Video label | Menu label |
| audio | Audio label | Menu label |
| subtitle | Subtitle label | Menu label |
| no_subs | No subtitles label | Menu label |
| no_audio | No audio label | Menu label |
| playlist | Playlist label | Menu label |
| no_playlist | No playlist label | Menu label |
| chapter | Chapter label | Menu label |
| ontop/ontop_disable | Window pin states | Action labels |
| loop_enable/loop_disable | Loop states | Action labels |
| shuffle/unshuffle | Playlist shuffle states | Action labels |
| screenshot | Screenshot label | Action label |
| stats_info | Information label | Menu label |
| cache | Information label | Text label |
| buffering | Information label | Text label |
| zoom_in | Information label | Menu label |
| zoom_out | Information label | Menu label |
| download | Information label | Menu label |
| download_in_progress | Information label | Menu label |
| downloading | Information label | Menu label |
| downloaded | Information label | Menu label |
| menu | Information label | Menu label |

## Contributing

Expand Down
9 changes: 5 additions & 4 deletions docs/USER_OPTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ Create `modernz.conf` in your mpv script-opts directory:
| screenshot_flag | subtitles | Flag options for the screenshot button: `"subtitles"`, `"video"`, `"window"`, `"each-frame"`. [Find out more about these options](https://mpv.io/manual/master/#command-interface-screenshot-<flags>). |
| ontop_button | yes | show `window on top (pin)` button |
| loop_button | no | show `loop` button |
| shuffle_button | no | show `shuffle` button |
| speed_button | no | show speed control button |
| speed_button_click | 1 | speed change amount per click |
| speed_button_scroll | 0.25 | speed change amount on scroll |
Expand Down Expand Up @@ -164,10 +165,10 @@ Create `modernz.conf` in your mpv script-opts directory:

### Tooltips and hints

| Option | Value | Description |
| ------------------------------ | ----- | --------------------------------------------------------------- |
| tooltips_for_disabled_elements | yes | enable tooltips for disabled buttons and elements |
| tooltip_hints | yes | enable text hints for info, loop, ontop, and screenshot buttons |
| Option | Value | Description |
| ------------------------------ | ----- | -------------------------------------------------------------------------|
| tooltips_for_disabled_elements | yes | enable tooltips for disabled buttons and elements |
| tooltip_hints | yes | enable text hints for info, loop, shuffle, ontop, and screenshot buttons |

### Progress bar settings

Expand Down
6 changes: 4 additions & 2 deletions modernz.conf
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ screenshot_flag=subtitles
ontop_button=yes
# show loop button
loop_button=no
# show shuffle button
shuffle_button=no
# show speed control button
speed_button=no
# speed change amount per click
Expand Down Expand Up @@ -254,7 +256,7 @@ tooltips_for_disabled_elements=yes
# enable text hints for info, loop, ontop, and screenshot buttons
tooltip_hints=yes

# Progress bar settings
# Progress bar settings
# size ratio of the seekbar handle (range: 0 ~ 1)
seek_handle_size=0.8
# show seek range overlay
Expand All @@ -274,7 +276,7 @@ nibbles_style=triangle

# automatically set keyframes for the seekbar based on video length
automatickeyframemode=yes
# videos longer than this (in seconds) will have keyframes on the seekbar
# videos longer than this (in seconds) will have keyframes on the seekbar
automatickeyframelimit=600

# always show a small progress line at the bottom of the screen
Expand Down
36 changes: 35 additions & 1 deletion modernz.lua
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ local user_opts = {
download_button = true, -- show download button on web videos (requires yt-dlp and ffmpeg)
download_path = "~~desktop/mpv", -- default download directory for videos (https://mpv.io/manual/master/#paths)

loop_button = false, -- show loop button
loop_button = false, -- show loop
shuffle_button = false, -- show shuffle
speed_button = false, -- show speed control button
speed_button_click = 1, -- speed change amount per click
speed_button_scroll = 0.25, -- speed change amount on scroll
Expand Down Expand Up @@ -320,6 +321,8 @@ local icon_theme = {
screenshot = "\238\169\150",
loop_off = "\239\133\178",
loop_on = "\239\133\181",
shuffle_off = "\238\188\188",
shuffle_on = "\238\188\184",
speed = "\239\160\177",
download = "\239\133\144",
downloading = "\239\140\174",
Expand Down Expand Up @@ -366,6 +369,8 @@ local icon_theme = {
screenshot = '\243\176\132\128',
loop_off = '\243\176\145\151',
loop_on = '\243\176\145\150',
shuffle_off = '\243\176\146\158',
shuffle_on = '\243\176\146\157',
speed = '\243\176\163\191',
download = '\243\176\129\136',
downloading = '\243\176\166\151',
Expand All @@ -392,6 +397,8 @@ local language = {
ontop_disable = "Unpin Window",
loop_enable = "Loop",
loop_disable = "Disable Loop",
shuffle = "Shuffle Playlist",
unshuffle = "Unshuffle Playlist",
speed_control = "Speed Control",
screenshot = "Screenshot",
stats_info = "Information",
Expand Down Expand Up @@ -575,6 +582,7 @@ local state = {
visibility_modes = {}, -- visibility_modes to cycle through
mute = false,
looping = false,
shuffled = false,
sliderpos = 0,
touchingprogressbar = false, -- if the mouse is touching the progress bar
initialborder = mp.get_property("border"),
Expand Down Expand Up @@ -1796,6 +1804,7 @@ layouts["modern"] = function ()
local ontop_button = user_opts.ontop_button
local screenshot_button = user_opts.screenshot_button
local loop_button = user_opts.loop_button
local shuffle_button = user_opts.shuffle_button
local speed_button = user_opts.speed_button
local download_button = user_opts.download_button and state.is_URL
local playlist_button = user_opts.playlist_button and (not user_opts.hide_empty_playlist_button or mp.get_property_number("playlist-count", 0) > 1)
Expand Down Expand Up @@ -1981,6 +1990,14 @@ layouts["modern"] = function ()
end_x = end_x - 45
end

if shuffle_button then
lo = add_layout("tog_shuffle")
lo.geometry = { x = end_x, y = refY - 35, an = 5, w = 24, h = 24 }
lo.style = osc_styles.control_3
lo.visible = (osc_param.playresx >= 600 - outeroffset) and shuffle_button
end_x = end_x - 45
end

if speed_button then
lo = add_layout("tog_speed")
lo.geometry = {x = end_x, y = refY - 35, an = 5, w = 24, h = 24}
Expand Down Expand Up @@ -2641,6 +2658,23 @@ local function osc_init()
end
visible_min_width = visible_min_width + (user_opts.loop_button and 100 or 0)

--tog_shuffle
ne = new_element("tog_shuffle", "button")
ne.content = function() return state.shuffled and icons.shuffle_on or icons.shuffle_off end
ne.visible = (osc_param.playresx >= visible_min_width)
ne.tooltip_style = osc_styles.tooltip
ne.tooltipF = function() return user_opts.tooltip_hints and (state.shuffled and locale.unshuffle or locale.shuffle) or "" end
ne.eventresponder["mbtn_left_up"] = function()
mp.command("show-text '" .. (state.shuffled and locale.unshuffle or locale.shuffle) .. "'")
state.shuffled = not state.shuffled
if state.shuffled then
mp.command("playlist-shuffle")
else
mp.command("playlist-unshuffle")
end
end
visible_min_width = visible_min_width + (user_opts.loop_button and 100 or 0)

--tog_speed
ne = new_element("tog_speed", "button")
ne.content = icons.speed
Expand Down