Commit Graph

686 Commits

Author SHA1 Message Date
hooke007
bb0d1ace0d fix: a couple config defaults not matching script defaults (#265) 2022-09-25 09:54:25 +02:00
christoph-heinrich
439b085417 fix: draw chapter indicators of chapter ranges (#264) 2022-09-25 09:53:14 +02:00
christoph-heinrich
4c219a6b00 fix: ads end could be recognized as single chapter ad (#263) 2022-09-25 09:52:06 +02:00
christoph-heinrich
caf98dd28f feat: support single chapter ads (#262) 2022-09-24 22:41:27 +02:00
tomasklaen
4fbc437382 release: 4.0.1 2022-09-24 17:23:31 +02:00
tomasklaen
6df05e6377 style: move some lines around 2022-09-24 17:21:30 +02:00
tomasklaen
d953b158bf fix: confusing collisions between progress line and timeline ranges
Timeline ranges such as uncached indicators or chapter ranges were treating line as if it's infinitely thin line located at `time_x`. This lead to ranges overlapping progress line even though the current time hasn't reached their start time, or went past their end time yet. This was confusing.

The new behavior essentially makes line push all of the x coordinates of timeline ranges apart, never allowing any to lie inside it. In other words, it's as if the line cuts timeline in half, and squeezes itself in between.
2022-09-24 17:16:58 +02:00
tomasklaen
1a11a43853 chore: add .gitignore 2022-09-24 09:55:34 +02:00
tomasklaen
5e2192acbd chore: update readme 2022-09-24 09:49:33 +02:00
tomasklaen
e47e7e59bb chore: bump version 2022-09-24 09:41:34 +02:00
Tomas Klaen
d967110dbc Update README.md 2022-09-24 01:19:46 +02:00
tomasklaen
f27e17e7dc feat!: removed wasd and hjkl menu navigation 2022-09-24 01:16:06 +02:00
christoph-heinrich
ed784c38cd fix: possible nil error in uncached ranges generation (#256) 2022-09-24 00:53:51 +02:00
christoph-heinrich
cc75e8d15f fix: integer resolution when scaling (#251) 2022-09-23 23:04:28 +02:00
christoph-heinrich
ca1780f111 fix: showing uncached ranges when not caching (#252)
This still shows uncached ranges as early as we can, but is more
reliable.

ref #244
2022-09-23 22:59:01 +02:00
christoph-heinrich
940e6eaf86 fix: ensure cache ranges extend to 0 and duration (#253) 2022-09-23 22:50:06 +02:00
tomasklaen
df37ca748e refactor: use commandv instead of command 2022-09-23 18:22:25 +02:00
tomasklaen
702bea8e51 fix: initialization of required props causing osd messages 2022-09-23 17:49:04 +02:00
tomasklaen
6f9865e281 fix: remove code committed by accident 2022-09-23 17:25:58 +02:00
tomasklaen
958359209a fix: more file-end handling bugs
ref #251
2022-09-23 17:16:59 +02:00
tomasklaen
6ef4a2a53a tweak: colors 2022-09-23 16:58:24 +02:00
tomasklaen
810616a131 feat: implement chapter_range_patterns option
Effectively facilitates localization of simple chapter ranges.

ref #247
2022-09-23 16:15:11 +02:00
tomasklaen
850563dbef feat: implemented buffered_time_threshold option 2022-09-23 14:45:31 +02:00
tomasklaen
882186f984 fix: visual tweaks
- Volume hides when timeline is hovered to not render over thumbnail.
- Progress line starts growing only at the end of minimization.
- Buffered time is bottom capped to 0.
2022-09-23 14:38:28 +02:00
dyphire
9bc72328f0 fix: improve formats in media types (#249) 2022-09-23 14:15:17 +02:00
tomasklaen
1cf1d5e1f5 fix: overlapping sponsor block segment issues
Fixed:
- tooltip for adjacent sponsor block segment was not showing because last previous chapter belonged to end of the previous segment
- overlapping chapter range backgrounds in timeline
2022-09-23 14:13:39 +02:00
christoph-heinrich
3b2a2f300f feat: set uncached ranges as early as possible (#244) 2022-09-23 13:02:42 +02:00
tomasklaen
01cf36081d fix: chapter ranges broken by old configs
Implements chapter range validation, and detects & swaps the old default config for the new one.

closes #247
2022-09-23 12:50:59 +02:00
tomasklaen
eca7836889 feat: split intros & outros into their own chapter range types
ref #163
2022-09-23 12:34:33 +02:00
tomasklaen
de41a10c07 feat: implemented menu-blurred command
Opens a menu without preselecting any item. Suitable when opening menu with a mouse input.

closes #248
2022-09-23 12:28:05 +02:00
tomasklaen
612e2a5cc4 refactor: renamed next_file_on_end to autoload 2022-09-23 11:59:00 +02:00
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