Commit Graph

218 Commits

Author SHA1 Message Date
tomasklaen
3226a0d33e fix: improve file-end event detection
closes #235
2022-09-23 11:51:49 +02:00
tomasklaen
0ede5ef54a fix: curtain flashing when replacing menu
closes #246
2022-09-23 09:49:51 +02:00
tomasklaen
e05c6b6749 feat: removed directory_navigation_loops option in favor of loop-playlist
This is behavior is now controlled by mpv's `loop-playlist` property.
2022-09-23 09:32:06 +02:00
christoph-heinrich
ff041fe895 refactor: simplify rounding function (#245) 2022-09-23 09:16:58 +02:00
christoph-heinrich
36cd31e23b fix: border in thumbnail decoration calculation was already scaled (#242) 2022-09-22 22:16:38 +02:00
christoph-heinrich
bbe32ba65a fix: time can be nil when creating chapter menu (#243) 2022-09-22 22:16:15 +02:00
tomasklaen
1df7a47005 fix: overeager match patterns for chapter ranges 2022-09-22 22:10:21 +02:00
tomasklaen
ac5fd9cc03 fix: uncached ranges resetting initial range prematurely
ref #240
2022-09-22 18:25:18 +02:00
Zhong Lufan
d20f47c8ea fix: show cache indication whenever cache is available (#240) 2022-09-22 15:34:50 +02:00
tomasklaen
5082ad0a83 fix: buggy active chapter detection in chapters menu
closes #226
2022-09-22 15:05:44 +02:00
tomasklaen
d2dd7e4415 feat: implemented shuffle and next_file_on_end options
The `shuffle` option built into mpv doesn't shuffle playlist playback, but instead just randomizes the order of every new opened playlist. So when you enable this after opening a playlist, it does nothing. If you enable it before opening a playlist, it'll randomize its list order, so you can't browse alphabetically. None wants this, none expects this. And since its is expected from a ui such as uosc to provide a shuffle button that works like in any other media player on the planet, I had to simulate it.

It decides on the next file 300ms before the end, so it can potentially cut out punchlines from short videos such as those from r/perfectlycutscreams. But this is necessary because a lot of files actually end like ~100ms or more before their duration, but on corrupted files or files where stream ended prematurely, this can happen way before that. If file is force ended by mpv before our timer kicks in, our simulated `file-end` event won't fire, and uosc is unable to take over to decide to play the next one.

I couldn't figure out a better way to implement this. There's no 'fil-reached-end' even in mpv. There are only 'im-unloading-the-file' events (`file-end`, `on_unload`, ... etc), which is useless here because it triggers even when user opens a different file during playback.

Implementing `shuffle` allowed for trivial `next_file_on_end`, so that got added as well. It load next file in directory when current file ends.

Directory navigation now also adheres to `shuffle` uosc option, and `playlist-loop`, `playlist-repeat`, & `loop-file` mpv options.

Additionally, the `<has_playlist>` disposition was removed from the `shuffle` and `loop-playlist` control bar buttons as they now affect directory navigation as well.

closes #235
2022-09-22 14:57:54 +02:00
tomasklaen
2adfc36c24 feat: add top_bar_title_opacity option
ref #237
2022-09-21 23:18:01 +02:00
christoph-heinrich
4e49a22009 fix: thumbnail decoration with scaling (#238) 2022-09-21 23:06:37 +02:00
tomasklaen
a4638fcdef feat!: improve chapter ranges serialization
Users can no longer create their own or edit existing chapter range serializers, but that was always very limited and prone to errors. Instead, all common use cases for chapter ranges: intros/openings, outros/endings, and sponsor blocks serializers are now internal.

Users can still disable and configure colors for each individual serializer by specifying a `{type}:{color}` pairs delimited by a comma on a `chapter_ranges` property. The color is now an RGB(A) HEX code.
2022-09-21 22:58:00 +02:00
tomasklaen
a03fe26f38 refactor: update default controls bar and its dispositions 2022-09-21 14:55:05 +02:00
christoph-heinrich
f3d492912a fix: anchor texture instead of align and shift (#221)
* fix: anchor texture instead of align and shift

* fix: texture offset for timeline and volume

The black lines are now nicely centered between the white ones.
2022-09-21 14:50:49 +02:00
tomasklaen
6d54e0fdfe fix: speed_opacity option being ignored
closes #231
2022-09-21 14:10:59 +02:00
tomasklaen
a4257d7c31 feat!: accept colors in RGB(A) HEX format
Affects options `foreground`, `foreground_text`, `background`, `background_text`.

Other configurable colors will follow suit in next commits.
2022-09-21 14:02:43 +02:00
tomasklaen
d24cb25e56 fix: timeline chapter tooltip sometimes disappearing 2022-09-21 13:47:11 +02:00
tomasklaen
5d396512ee refactor: thumbnail handling and styling
ref #213
2022-09-21 13:12:52 +02:00
Eva
b3b5b15406 feat: thumbfast intergration (#213)
* feat: thumbfast intergration

* fix: respect ui scale, hidpi scale, support wrapped chapter titles
2022-09-21 09:19:37 +02:00
christoph-heinrich
43644c1f59 fix: decay opacity of parent menus text (#232) 2022-09-20 22:33:51 +02:00
tomasklaen
e06c34686d fix: current chapter selector crashing on videos without chapters
closes #230
2022-09-20 15:59:52 +02:00
dyphire
6ac00f9115 fix: add .vob and .lrc in *_types (#224) 2022-09-20 12:24:14 +02:00
tomasklaen
81d9426930 feat: show current chapter as a top bar subtitle
ref #228
2022-09-20 11:55:13 +02:00
tomasklaen
ee629f6f6a tweak: shifted chapter diamonds 1px up
They looked too sunk into the foreground, and now they look like they are just sitting on top of it. Looks better, and improves visibility when minimized.
2022-09-20 09:29:51 +02:00
hooke007
4dc4a8ee3d fix: add more formats in *_types (#220) 2022-09-19 23:43:45 +02:00
tomasklaen
ed8cb8741e feat: added has_many_* disposition types
Adds `has_many_audio`, `has_many_sub`, and `has_many_video` disposition types that can
be used when constructing the controls bar.

The audio track selector button now has a `<has_many_audio>` disposition instead of the old `<has_audio,!audio>`.
2022-09-19 23:42:32 +02:00
tomasklaen
0ef4ddf92d perf: optimized control bar reflow on disposition changes 2022-09-19 23:25:50 +02:00
tomasklaen
5d92c73481 feat: added control bar button badge limits
It is now possible to specify a threshold when to hide the badge by doing `#audio>1` to display the audio counter badge only when there's more than 1 audio track.

ref #212
2022-09-19 22:08:13 +02:00
Zhong Lufan
3fcafbd64a fix: add .mka to media types (#219) 2022-09-19 21:15:16 +02:00
christoph-heinrich
13afa971cc fix: show fully uncached range for network streams (#214)
* fix: show fully uncached range for network streams

* fix: correctly filter and fuse uncached ranges

Overlapping cached ranges were not handled correctly and sometimes it
could end up with very short uncached ranges.

Now overlaps and small gaps are fused together, and very short ranges
are filtered out.
2022-09-19 18:47:50 +02:00
tomasklaen
d63d5a7434 fix: badge counters broken by previous commit 2022-09-19 17:33:22 +02:00
tomasklaen
fca0dff196 feat: improved top bar playlist position indicator
Also removes the counter from built-in playlist related control buttons, as big playlists create badges that are too big and overlap/overflow the button too much. And having the counter there will make people ask for position (understandable), which would further worsen this problem. Better to have it in the top bar.

ref #212
2022-09-19 17:18:13 +02:00
tomasklaen
273374f4bd feat!: changed peek-{x} commands to toggle-{x}
Previously, all of the `peek-{element}` commands such as `peek-ui` would force the elements' visibility only until pressed again, OR MOUSE MOVED. This was sometimes annoying (small mouse movements would reset it), and limiting, for no really good reason.

With this, the commands are renamed to `toggle-{x}`, and toggle each element's permanent `min_visibility` between `0` and `1`.

ref #48
2022-09-19 16:25:32 +02:00
tomasklaen
08d4dd9e4d fix: removed leftover ending uncached range on some streams
The end time of the last cached range on fully buffered video is sometimes lower than reported duration, which was causing a redundant uncached range indicator at the end of the timeline.

ref #214
2022-09-19 15:00:49 +02:00
tomasklaen
c8f4f22d15 feat: added counters and other badges to control buttons
Implements control element `#{badge}` syntax. Example:

```
command:subtitles:script-binding uosc/subtitles#sub?Subtitles
```

ref #212
2022-09-19 14:47:14 +02:00
tomasklaen
b610b6cda5 fix: work around mpv's cycle window-maximized quirks
closes #203
2022-09-19 12:28:17 +02:00
tomasklaen
bc79205951 feat: display buffered time in timeline
closes #208
2022-09-19 11:37:08 +02:00
tomasklaen
e54744b475 refactor: assorted tweaks 2022-09-19 09:55:33 +02:00
tomasklaen
bfa322b7c3 fix: glitchy uncached ranges texture rendering
closes #215
2022-09-19 09:11:10 +02:00
christoph-heinrich
3deb8dbb52 refactor: move chapter and chapter ranges stuff around (#201) 2022-09-18 18:54:11 +02:00
tomasklaen
36dd0a622d feat!: convert timeline_chapters option into timeline_chapters_opacity
Controls opacity of chapter indicators with option to disable completely when set to `0`.

ref #206
2022-09-18 15:15:28 +02:00
tomasklaen
f6cad02037 fix: control element command broken when overriding shorthand title
ref #210
2022-09-18 14:51:18 +02:00
tomasklaen
3c85721f1a feat!: improve chapters rendering style
All of the old styles had visibility issues, and rendering code was a bit too overcomplicated. This fixes all if it by rendering chapters as diamond indicators on top of the timeline.

`timeline_chapters` option is now a boolean, and `timeline_chapters_opacity` & `timeline_chapters_width` have been removed.

This means chapter rendering is no longer configurable, as they resize based on timeline size, and inherit its opacity and border size, so I don't see what anyone would want to configure here, but I'm sure I'll get some requests as always :'(.

ref #206
2022-09-18 14:26:01 +02:00
tomasklaen
852b724b6a fix: timeline dragging not released when file is closed
closes #211
2022-09-18 13:14:12 +02:00
Zhong Lufan
d1f2f70227 fix: overriding control shorthand tooltip not working (#210) 2022-09-18 13:10:44 +02:00
tomasklaen
3793fa574a fix: font_bold options being ignored
closes #209
2022-09-18 13:05:29 +02:00
tomasklaen
fc4caee11e fix: removed leftover debugging code 2022-09-18 00:21:59 +02:00
tomasklaen
63b7573bde refactor!: removed color_ prefixes from options 2022-09-18 00:21:36 +02:00