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
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# SPDX-License-Identifier: GPL-3.0-only
SDK ?= ../osos-lab/rvx-sdk
OUT ?= build
extensions := balance crossfeed dsp night-shift playback-log
extensions := balance chapter-marks chapter-menu crossfeed dsp fast-seek long-audio-fix night-shift \
playback-log sleep-timer

.PHONY: all $(extensions)
all: $(extensions)
Expand All @@ -14,6 +15,8 @@ $(extensions):
.PHONY: check
check:
$(PYTHON) extensions/balance/tests/run.py "$(abspath $(SDK))"
$(PYTHON) extensions/chapter-marks/tests/run.py "$(abspath $(SDK))"
$(PYTHON) extensions/chapter-menu/tests/run.py "$(abspath $(SDK))"
$(PYTHON) extensions/crossfeed/tests/run.py "$(abspath $(SDK))"
$(PYTHON) extensions/dsp/tests/run.py "$(abspath $(SDK))"
@mkdir -p "$(OUT)"
Expand Down
10 changes: 9 additions & 1 deletion NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@ Balance, Crossfeed, DSP and the Night Shift scheduling and gamma code are from
RevolaOS extensions, revision 36d197b180e55a304ea0468de4330c0d07fe715f.
Night Shift derives from kayboll’s RepriseOS work. Playback Log derives from
the work of brilliant-alien and lgreitis in osos-lab. Its Settings artwork is
from osos-lab commit 10485fa. The original RevolaOS notice follows.
from osos-lab commit 10485fa. Sleep Timer, Fast Seek and Long Audio Fix are
from RevolaOS extensions, revision c179e6dc21ea8a32e46bf9af1d0906c8793190e8.
Sleep Timer is based on kayboll’s RepriseOS Sleep Timer shortcut; Fast Seek
and Long Audio Fix are the same fixes as kayboll’s RepriseOS pull requests
63 and 62. Their catalog icons and the Sleep Timer moon are Cupertino Icons
glyphs (MIT), see the LICENSE.cupertino-icons beside each. Chapter Menu and
Chapter Marks are from RevolaOS extensions, revision
72562b52fe7e4074a3479caac86b84ec1d285966; their catalog icons are Cupertino
Icons glyphs (MIT) as well. The original RevolaOS notice follows.

RevolaOS
Copyright (C) 2026 The RevolaOS Authors. GPL-3.0-only.
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,10 @@ This repository hosts the source for these RepriseOS extensions and accepts prop
- [Night Shift](extensions/night-shift/) warms the display manually or automatically from sunset to sunrise.
- [Playback Log](extensions/playback-log/) records listening history for scrobbling and optional detailed reports.
- [Crossfeed](extensions/crossfeed/) blends a little of each stereo channel into the other for headphone listening. It uses the included [DSP library](extensions/dsp/).
- [Sleep Timer](extensions/sleep-timer/) sets Apple's sleep timer from the Now Playing context menu and shows the minutes left in Now Playing.
- [Fast Seek](extensions/fast-seek/) makes seeks in long AAC and Apple Lossless files jump to the target instead of stepping through every frame.
- [Long Audio Fix](extensions/long-audio-fix/) plays AAC and Apple Lossless files longer than 13.5 hours to the end.
- [Chapter Menu](extensions/chapter-menu/) lists the chapters of a podcast or iTunes U episode, or of the playing track, in its context menu and jumps to one.
- [Chapter Marks](extensions/chapter-marks/) leaves the chapter marks off the Now Playing bar when there are too many to tell apart.

To add your extension to the catalog, open a PR following the [submission guide](catalog/README.md). Later releases are picked up automatically.
25 changes: 25 additions & 0 deletions catalog/sources.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,28 @@ tag_prefix = "playback-log/v"
repo = "RepriseOS/repriseos-extensions"
path = "extensions/dsp"
tag_prefix = "dsp/v"

[fast-seek]
repo = "RepriseOS/repriseos-extensions"
path = "extensions/fast-seek"
tag_prefix = "fast-seek/v"

[long-audio-fix]
repo = "RepriseOS/repriseos-extensions"
path = "extensions/long-audio-fix"
tag_prefix = "long-audio-fix/v"

[sleep-timer]
repo = "RepriseOS/repriseos-extensions"
path = "extensions/sleep-timer"
tag_prefix = "sleep-timer/v"

[chapter-menu]
repo = "RepriseOS/repriseos-extensions"
path = "extensions/chapter-menu"
tag_prefix = "chapter-menu/v"

[chapter-marks]
repo = "RepriseOS/repriseos-extensions"
path = "extensions/chapter-marks"
tag_prefix = "chapter-marks/v"
3 changes: 3 additions & 0 deletions extensions/chapter-marks/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SPDX-License-Identifier: GPL-3.0-only
main_SOURCES := main.c marks.c
include $(SDK)/rv.mk
9 changes: 9 additions & 0 deletions extensions/chapter-marks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Chapter Marks

Leaves all chapter marks off the Now Playing bar once they would average under 3 px each, about 55 chapters on the classic's bar. Fewer chapters keep the stock marks.

| | |
|---|---|
| Default | on |
| Memory | image only, plus 8 bytes for the bar being drawn |
| Settings | none |
20 changes: 20 additions & 0 deletions extensions/chapter-marks/assets/LICENSE.cupertino-icons
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2016 Vladimir Kharlampidi

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions extensions/chapter-marks/assets/settings-chapter-marks.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions extensions/chapter-marks/listing.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
details = "Hides the chapter marks on the Now Playing progress bar once a track has so many that they blur into a band, about 55 or more. Tracks with fewer chapters keep the stock marks."

icon = "assets/settings-chapter-marks.png"

[[screenshots]]
file = "screenshots/stock.png"
alt = "Now Playing of an episode with 80 chapters as Apple draws it: the progress bar is a dense comb of chapter marks."

[[screenshots]]
file = "screenshots/hidden.png"
alt = "The same episode with Chapter Marks: a plain progress bar."
47 changes: 47 additions & 0 deletions extensions/chapter-marks/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/* SPDX-License-Identifier: GPL-3.0-only */

/* Chapter marks on the Now Playing bar. Apple draws one mark per chapter after
* the fill: the first hook measures the pass, the second leaves every mark out
* when they are too crowded to read. */

#include "marks.h"
#include "osos-2.0.5.h"
#include "rv_api.h"
#include "rv_sites.h"
#include "rv_ui.h"

static const struct rv_api *api;
static int hidden;

static uint32_t draw_marks(uintptr_t view, uintptr_t context, uintptr_t bar,
const void *next)
{
const int32_t *rect = (const int32_t *)bar;
hidden = marks_hidden(rect[3] - rect[1],
RV_FIELD(view, ProgressBar_marker_count, uint32_t));
return api->hook_next(next, view, context, bar, 0, 0, 0);
}

static uint32_t blit_mark(uintptr_t cache, uintptr_t context, uintptr_t source,
uintptr_t rect, const void *next, uint32_t alpha)
{
return hidden ? 0 : api->hook_next(next, cache, context, source, rect, alpha, 0);
}

static const struct rv_hook hooks[] = {
RV_HOOK_FILTER(RV_SITE_ProgressBar_DrawMarkers_slot, draw_marks),
RV_HOOK_FILTER(RV_SITE_ProgressBarStyle8_DrawMarkers_slot, draw_marks),
RV_HOOK_FILTER(RV_SITE_ProgressBar_MarkerBlit_call, blit_mark),
};
static const struct rv_descriptor descriptor = {
.size = sizeof descriptor,
RV_HOOKS(hooks),
};

const struct rv_descriptor *rv_module_entry(const struct rv_api *core,
rv_extension_handle handle)
{
(void)handle;
api = core;
return &descriptor;
}
13 changes: 13 additions & 0 deletions extensions/chapter-marks/manifest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
id = "chapter-marks"
name = "Chapter Marks"
description = "Leave the chapter marks off the Now Playing bar when there are too many to tell apart."
version = "0.1.0"
author = "RevolaOS"
license = "GPL-3.0-only"
api = "1.82"
stability = "beta"
category = "media"

[[module]]
name = "main"
trigger = "always"
14 changes: 14 additions & 0 deletions extensions/chapter-marks/marks.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* SPDX-License-Identifier: GPL-3.0-only */

/* Chapter marks are hidden once they average under MARKS_MIN_SPACING_PX of bar
* each: at that spacing they merge into a block that says nothing about where
* the chapters are. Fewer marks are left exactly as stock draws them. */

#include "marks.h"

#define MARKS_MIN_SPACING_PX 3

int marks_hidden(int bar_width, uint32_t count)
{
return bar_width > 0 && count * MARKS_MIN_SPACING_PX > (uint32_t)bar_width;
}
10 changes: 10 additions & 0 deletions extensions/chapter-marks/marks.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* SPDX-License-Identifier: GPL-3.0-only */
#ifndef MARKS_H
#define MARKS_H
#include <stdint.h>

/* Whether `count` chapter marks on a bar `bar_width` px wide are too crowded
* to tell apart, in which case none is drawn. */
int marks_hidden(int bar_width, uint32_t count);

#endif
Binary file added extensions/chapter-marks/screenshots/hidden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extensions/chapter-marks/screenshots/stock.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions extensions/chapter-marks/tests/contracts.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* SPDX-License-Identifier: GPL-3.0-only */
#include <assert.h>
#include <stdio.h>
#include "../marks.c"

int main(void)
{
/* A 170 px bar keeps up to 170 / MARKS_MIN_SPACING_PX marks. */
assert(!marks_hidden(170, 0));
assert(!marks_hidden(170, 25));
assert(!marks_hidden(170, 170 / MARKS_MIN_SPACING_PX));
assert(marks_hidden(170, 170 / MARKS_MIN_SPACING_PX + 1));
assert(marks_hidden(170, 120));
assert(marks_hidden(170, 2000));
/* A degenerate bar hides nothing. */
assert(!marks_hidden(0, 500));
assert(!marks_hidden(-5, 500));
puts("Chapter Marks contracts passed");
return 0;
}
27 changes: 27 additions & 0 deletions extensions/chapter-marks/tests/run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-3.0-only
"""Run the mark selection tests: python3 tests/run.py SDK (the SDK is not needed)."""

import subprocess
import tempfile
from pathlib import Path

root = Path(__file__).resolve().parent
with tempfile.TemporaryDirectory(prefix="chapter-marks-tests-") as name:
executable = Path(name) / "contracts"
subprocess.run(
[
"cc",
"-std=c11",
"-Wall",
"-Wextra",
"-Werror",
"-g",
"-fsanitize=address,undefined",
str(root / "contracts.c"),
"-o",
str(executable),
],
check=True,
)
subprocess.run([str(executable)], check=True)
3 changes: 3 additions & 0 deletions extensions/chapter-menu/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SPDX-License-Identifier: GPL-3.0-only
main_SOURCES := main.c chapters.c
include $(SDK)/rv.mk
16 changes: 16 additions & 0 deletions extensions/chapter-menu/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Chapter Menu

Adds Chapters to the context menu (hold Select) of a podcast or iTunes U episode, and to the Now Playing context menu, when the item has chapters. The screen lists each chapter's title and start time, "m:ss" or "h:mm:ss".

| Opened from | Highlighted | Choosing a chapter |
|---|---|---|
| Now Playing | the chapter playing | seeks the track there and returns to Now Playing |
| An episode list | the first chapter | plays the episode from there in Now Playing, as choosing an audiobook chapter does |

A chapter with an empty title shows as "Chapter 3"; one with no name atom is missing from Apple's library and from the list. Videos are not covered, and audiobooks keep Apple's own chapter list. If the track changed or the library reloaded while the list was open, choosing a chapter does nothing.

| | |
|---|---|
| Default | on |
| Memory | image only, plus 44 bytes for the row being drawn |
| Settings | none |
20 changes: 20 additions & 0 deletions extensions/chapter-menu/assets/LICENSE.cupertino-icons
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2016 Vladimir Kharlampidi

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions extensions/chapter-menu/assets/settings-chapter-menu.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading