925 Commits

Author SHA1 Message Date
christoph-heinrich
9628d32937 fix: stream quality selection (#641)
Due to a recent change in mpv writing to playlist-pos doesn't restart
playback anymore, which was necessary for the format change to work for
the current file.
4b2276b730
2023-09-22 14:28:08 +02:00
christoph-heinrich
b1d39afe19 fix: external search in menu (#642) 2023-09-22 11:42:36 +02:00
christoph-heinrich
22d45b6c3b fix: prepare for shared-script-properties removal (#640)
mpv is about to remove `shared-script-properties`, which will cause
`utils.shared_script_property_set` to be nil.
Check for it's existence before calling it.
2023-09-22 11:41:25 +02:00
christoph-heinrich
f067ea336e fix: case insensitive menu search (#638)
The title was lowered, but not the query.
As a result searching for uppercase letters would never match anything.

Fixes #637
2023-09-21 20:51:17 +02:00
christoph-heinrich
18adf90af6 feat: searchable menus (#625)
* feat: make the menu searchable

Each menu/submenu can have a `on_search` and `search_debounce`.
`search_debounce` supports the special value 'submit' with which
searches only get executed upon pressing ctrl+enter.

Without a `on_search` an internal search implementation gets used.

The internal search has it's own menu update function that is needed to
keep the same menu item objects around because otherwise updates to
children get discarded when the parent search gets updated.

* feat: add `menu_type_to_search` option

Always listening to text breaks toggling the menu via a single keybind.
Add an option so users can choose to manually activate the search.
2023-09-21 10:28:43 +02:00
Tomas Klaen
7a4d687864 fix: shuffle history couldn't go back more than once (#635)
* fix: shuffle history couldn't go back more than once

ref #631

---------

Co-authored-by: christoph-heinrich <christoph-heinrich@users.noreply.github.com>
2023-09-21 10:27:21 +02:00
christoph-heinrich
230112bde8 fix: selected_index norm in reset_navigation() (#634)
It attempts to do what select_by_offset already does but worse and
the check also couldn't have been right.

Additionally select_by_offset() was missing a request_render(), but that
seems to never actually make a difference.
2023-09-20 12:05:47 +02:00
tomasklaen
5235272ceb fix: prev commands now play previously played file even when shuffle is enabled
closes #631
2023-09-19 23:54:52 +02:00
christoph-heinrich
bff4da80d3 fix: crash when using wrong syntax for speed scale (#633)
A speed control diffinition like e.g. `speed:{1.8}` would result in
a crash because the `scale` gets set to `{1.8}` which isn't a string
lua can convert to a number on the fly.

Fixes #632
2023-09-19 22:03:37 +02:00
christoph-heinrich
b4037ec471 fix: menu height and positioning (#629)
It was possible for menus with titles to clip on the bottom edge.
They also weren't sized and positioned the same as menus without titles.
2023-09-18 11:18:44 +02:00
christoph-heinrich
8fe748c4d2 feat: initial support for updating options at runtime (#571)
Options can be changed during runtime by changing `script-opts`.
So far such option changes were simply ignored.
Now most options work, and the rest can be implemented when the needed.
2023-09-18 11:13:48 +02:00
christoph-heinrich
f62a9d1bbb fix: don't select not selectable items (#627)
It was possible for not selectable items to be selected via page up/down
as well as when updating the menu.

Page down now goes to the next best selectable item after adding to the
index, like is the case for next(), with a fallback to an earlier index.
Page up is the same as page down but inverted direction.

Updating the menu now chooses the closes selectable item to the intended
index.

* refactor: unify menu item navigation
2023-09-17 11:55:21 +02:00
christoph-heinrich
d570e05388 fix: top bar enabled checks (#628)
`top_bar_title` was checked like a bool, but it is a string, so it was
always treated as true.
Playlist checks were also missing.
2023-09-17 11:53:54 +02:00
christoph-heinrich
ab7bee5e44 fix: crash when selecting "Empty" in chapters menu (#626)
The menu item representing an empty menu is supposed to be not
selectable, however it was possible to select it with the mouse.
That results in a crash in the chapters menu because it subtracts one
from the value, which is "ignore" for the "Empty" item.
2023-09-16 12:43:04 +02:00
tomasklaen
e897089f61 fix: vertically misaligned number in playlist indicator
closes #623
2023-09-12 22:24:00 +02:00
christoph-heinrich
f03b04496b feat: added background to tooltips (#621)
The text can sometimes be hard to read depending on the image behind it.
Drawing a background helps with readability in such situations.
2023-09-12 21:22:22 +02:00
tomasklaen
350f54f321 feat: open chapters menu when clicking on current chapter in title 2023-09-12 12:20:56 +02:00
Christoph Heinrich
d25f3e2e99 refactor: use new velocity measurement for menu flings 2023-08-25 09:13:45 +02:00
Christoph Heinrich
3f21df1a9d refactor: use cicular buffer for cursor.history
Circular buffers are more efficient then moving the entries around.

Cursor velocity is now calculated on the fly, with from the current
cursor position and time as well a cursor position that is either
the youngest sample >100ms old, or the oldest sample in the buffer,
which is 10 elements in size. Restricting the sample selection based on
time prevents the filter window from becomming too long in case of
setups with low cursor update frequency, while still bring more
responsive velocity measurements to systems with higher cursor update
frequencies.

Removed the timer for exact seeking after fast seeks, as fast/exact
seeks can now be controlled with cursor speed and thus there is no need
for this anymore.
2023-08-25 09:13:45 +02:00
tomasklaen
776ca17f66 feat: fast seek in timeline based on cursor velocity 2023-08-25 09:13:45 +02:00
Tomas Klaen
d1e9f9c4eb fix: stale (closed) menus triggering input events (#612) 2023-08-23 18:13:43 +02:00
christoph-heinrich
6606f3e11f fix: remove redundant symbol order from sorting algorithm (#608)
We were already using the same sorting algorithm as autoload.lua,
but with the addition of a custom symbol order. However that symbol
order was only applied to the first character, so when sorting absolute
paths it doesn't actually make a difference.

Using the exact same algorithm for autoload.lua and uosc also makes it
easier to apply any future improvements from one to the other.
2023-08-21 18:05:01 +02:00
tomasklaen
68b5b2aaed refactor: improved protocol matching patterns
ref #605
2023-08-16 12:52:07 +02:00
tomasklaen
f857d468e1 fix: error in matching pattern caused some files to be recognized as magnet links
closes #605
2023-08-16 10:07:36 +02:00
Andrei Shevchuk
bc7b1a12bc feat: add russian translation (#597) 2023-08-02 09:13:07 +02:00
/ˈɛvən/
cad0d174d7 fix: make the install procedure on linux use XDG_CONFIG_HOME (#595) 2023-08-01 09:51:40 +02:00
Felix Yan
71cdeda7b3 chore: correct typos in uosc.conf (#594) 2023-08-01 09:47:27 +02:00
Eva
e783ad1f13 fix: crash when a script menu update renders selected index unavailable (#591)
Co-authored-by: Christoph Heinrich <christoph.heinrich@student.tugraz.at>
2023-07-26 23:20:09 +02:00
tomasklaen
72982e29b3 fix: use mp.get_script_directory() instead of relative paths 2023-07-19 16:57:41 +02:00
tomasklaen
ade1d1f319 feat: dropped compatibility for mpv 0.32 and below
closes #359
2023-07-18 18:21:00 +02:00
christoph-heinrich
c8ad77a1a9 fix: crashes when dealing with invalid UTF-8 strings (#579)
Caps char byte count of UTF-8 to string length.

Closes #515
2023-06-28 21:20:36 +02:00
tomasklaen
442fe6b2e5 feat: shuffle now prevents repeating same files often
Specifically, shuffle now guarantees no path/url repetition until at least 80% of the playlist/directory has been exhausted.

closes #569
2023-05-30 20:26:59 +02:00
unavailable500
7e1d26c7a3 doc: add windows install commands (#568) 2023-05-25 14:57:29 +02:00
tomasklaen
e5a8bb813c refactor: use local function where appropriate 2023-05-18 10:15:22 +02:00
tomasklaen
10768d212d feat: improved menu cursor navigation
- Left side of the empty menu screen is no longer a huge invisible back button. Instead, each parent menu can be clicked individually to navigate to it. Clicking empty space now correctly closes the menu.
- Submenus can now also be clicked to navigate to them.
- Moving cursor towards a submenu will not cause other items in current menu to be selected if cursor moves through them.

ref #217
2023-05-17 21:06:17 +02:00
tomasklaen
78b5d9e59f fix: menu back navigation resetting selected index 2023-05-15 18:40:00 +02:00
tomasklaen
532a9b18e1 fix: removed debugging leftovers 2023-05-15 18:34:52 +02:00
christoph-heinrich
5b4ccc8874 fix: crash when opening a non blurred menu (#565)
itable_find() returns two values, so without specifying the second
parameter to select_index() lua will use the second return value for
that.
2023-05-15 18:32:34 +02:00
tomasklaen
8ad5330a4b fix: window title click events preventing window dragging
closes #563
2023-05-15 12:45:30 +02:00
tomasklaen
128c76c3ba feat: menu items now accept selectable and align options
Allows creating placeholder items like "Empty" that can't be selected or clicked.
2023-05-15 11:22:53 +02:00
tomasklaen
9c544bf565 fix: removed add-intl-directory API
It doesn't make sense for uosc to be the internationalization provider for other scripts.
2023-05-15 09:51:16 +02:00
tomasklaen
fb1268f0e4 fix: don't translate strings from input.conf
closes #561
2023-05-15 09:39:07 +02:00
christoph-heinrich
5e2c930551 feat: scroll to new position after moving item in menu (#552) 2023-05-05 08:50:17 +02:00
Eva
3369454a68 fix: take window_border_size into account for tooltip positioning (#554) 2023-05-04 23:26:28 +02:00
Eva
7b2f36efc1 fix: take window_border_size into account for thumbnail positioning (#553) 2023-05-04 23:24:21 +02:00
natural-harmonia-gropius
9960906abb fix: show empty placeholder for empty menus (#546) 2023-05-03 10:46:21 +02:00
Eva
85618617f7 fix: translate fallback chapter title (#540) 2023-04-28 09:15:25 +02:00
Eva
f4ef5e8990 fix: translate built-in menu titles (#539) 2023-04-27 14:51:50 +02:00
tomasklaen
618e4728f4 fix: remove redundant menu title translation 2023-04-27 08:48:42 +02:00
Eva
26b062d84f fix: update spanish, french, romanian translations (#537) 2023-04-26 20:36:58 +02:00