Compare commits

..
5 Commits
Author SHA1 Message Date
meoware.exe 8fc0241611 Merge pull request #75 from meowarex/dev
Syllable Level Lyrics <3
2026-08-10 03:20:25 +10:00
meowarex a648e1a97c Syllable Level Lyrics <3 2026-08-09 17:11:50 +00:00
meoware.exe 2150b87371 Merge pull request #71 from meowarex/dev
Word by Word Lyrics <3
2026-07-18 15:04:56 +10:00
meoware.exe 0d82c16168 Readme Update 2026-07-18 15:04:31 +10:00
meoware.exe 4c257f7ad9 Word by Word Lyrics <3 2026-07-18 15:02:07 +10:00
19 changed files with 4167 additions and 40 deletions
@@ -32,11 +32,78 @@
"order": 20,
"fileNames": [
"lyrics-rl-api.patch",
"lyrics-rl-api-observer.patch"
"lyrics-rl-api-observer.patch",
"lyrics-rl-api-isrc.patch"
],
"title": "Radiant Lyrics API - WIP",
"description": "Use Radiant Lyrics API to fetch Lyrics (Higher quality & More providers)",
"default": false
"description": "Use Radiant Lyrics API to fetch Lyrics (Syllable Level & Higher Quality)",
"default": false,
"defaultVariantIndex": 0,
"variants": [
{
"title": "Line",
"fileNames": []
},
{
"title": "Word",
"fileNames": [
"lyrics-rl-api-word.patch"
]
},
{
"title": "Syllable",
"fileNames": [
"lyrics-rl-api-syllable.patch"
]
}
],
"extensionFiles": [
"radiant/RLAPILyricsHook.smali",
"radiant/RLAPILyricsWorker.smali",
"radiant/IsrcCache.smali",
"radiant/WordLyrics.smali",
"radiant/WordLyricsTick.smali",
"radiant/SylBrush.smali",
"radiant/SylLayout.smali"
],
"advancedOptions": [
{
"type": "toggle",
"key": "romanize",
"title": "Romanization",
"description": "Return a romanized transcription and show that instead of the original script",
"default": false,
"token": "RL_ROMANIZE",
"inline": true
},
{
"type": "toggle",
"key": "context_aware",
"title": "Context Aware Lyrics",
"description": "Display voice context cues (adlibs and duet singers get displayed seperately)",
"default": true,
"token": "RL_CTX_ON"
},
{
"type": "choice",
"key": "context_aware_mode",
"title": "Show",
"description": "",
"entries": [
"Adlibs",
"Singers",
"Both"
],
"values": [
"0x1",
"0x2",
"0x3"
],
"defaultIndex": 0,
"requiresOption": "context_aware",
"token": "RL_CTX"
}
]
},
{
"id": "PlayerBackdrop",
@@ -144,7 +211,7 @@
"type": "toggle",
"key": "cover_everywhere",
"title": "Cover Everywhere - WIP",
"description": "Applies TIDAL's player backdrop to every Compose based page (Home & Collection)",
"description": "Applies TIDAL's native blurred album-art backdrop to every Compose based page (Home & Collection)",
"default": false,
"inline": true,
"fileNames": [
@@ -79,6 +79,8 @@ data class PatchOptions(
if (spec.variants.isEmpty()) {
if (!enabled) addAll(spec.fileNames)
} else {
// base fileNames apply for every variant while enabled; disable them when off
if (!enabled) addAll(spec.fileNames)
val selected = variantIndex(spec)
spec.variants.forEachIndexed { index, variant ->
if (!enabled || index != selected) addAll(variant.fileNames)
@@ -48,6 +48,7 @@ data class VariantSpec(
val title: String,
val fileNames: List<String> = emptyList(),
val extensionFiles: List<String> = emptyList(),
val enabled: Boolean = true,
)
/** A single advanced option. Discriminated by `"type"` in JSON. */
@@ -173,7 +174,7 @@ fun builtinPatchSpecs(context: Context, json: Json): List<PatchSpec> = try {
}
@Immutable
data class EffectiveVariant(val originalIndex: Int, val title: String)
data class EffectiveVariant(val originalIndex: Int, val title: String, val enabled: Boolean = true)
fun PatchSpec.effectiveVariants(isOptionOn: (OptionSpec.Toggle) -> Boolean): List<EffectiveVariant> {
if (variants.isEmpty()) return emptyList()
@@ -186,19 +187,22 @@ fun PatchSpec.effectiveVariants(isOptionOn: (OptionSpec.Toggle) -> Boolean): Lis
}
}
return variants.mapIndexedNotNull { index, variant ->
if (index in hidden) null else EffectiveVariant(index, relabel[index] ?: variant.title)
if (index in hidden) null
else EffectiveVariant(index, relabel[index] ?: variant.title, variant.enabled)
}
}
fun PatchSpec.resolveVariantIndex(stored: Int, isOptionOn: (OptionSpec.Toggle) -> Boolean): Int {
val visible = effectiveVariants(isOptionOn)
if (visible.isEmpty() || visible.any { it.originalIndex == stored }) return stored
// never resolve onto a greyed/disabled variant
if (visible.isEmpty() || visible.any { it.originalIndex == stored && it.enabled }) return stored
val relabelKeys = buildSet {
for (option in advancedOptions) {
if (option is OptionSpec.Toggle && isOptionOn(option)) addAll(option.relabelVariants.keys)
}
}
return visible.firstOrNull { it.originalIndex in relabelKeys }?.originalIndex
return visible.firstOrNull { it.originalIndex in relabelKeys && it.enabled }?.originalIndex
?: visible.firstOrNull { it.enabled }?.originalIndex
?: visible.first().originalIndex
}
@@ -169,15 +169,18 @@ fun PatchSelectionAccordion(
.fillMaxWidth()
.padding(bottom = 8.dp),
) {
if (patch.variants.isNotEmpty()) {
val effective = patch.effectiveVariants { optionState.toggle(patch, it) }
val resolved = patch.resolveVariantIndex(variantIndex(patch)) {
val resolvedVariant =
if (patch.variants.isNotEmpty())
patch.resolveVariantIndex(variantIndex(patch)) {
optionState.toggle(patch, it)
}
else -1
if (patch.variants.isNotEmpty()) {
val effective = patch.effectiveVariants { optionState.toggle(patch, it) }
PatchVariantSelector(
variants = effective,
selectedIndex = effective
.indexOfFirst { it.originalIndex == resolved }
.indexOfFirst { it.originalIndex == resolvedVariant }
.coerceAtLeast(0),
onSelect = { pos ->
effective.getOrNull(pos)?.let { onSelectVariant(patch, it.originalIndex) }
@@ -186,6 +189,9 @@ fun PatchSelectionAccordion(
}
for (option in inlineToggles) key(option.key) {
val show = option.requiresVariant == null ||
option.requiresVariant == resolvedVariant
if (show) {
InlineToggleRow(
title = option.title,
description = option.description,
@@ -193,6 +199,7 @@ fun PatchSelectionAccordion(
onCheckedChange = { optionState.setToggle(patch, option, it) },
)
}
}
if (hasSheetOptions) {
Box(
@@ -22,7 +22,8 @@ fun PatchVariantSelector(
variants.forEachIndexed { index, variant ->
SegmentedButton(
selected = index == selectedIndex,
onClick = { onSelect(index) },
enabled = variant.enabled,
onClick = { if (variant.enabled) onSelect(index) },
shape = SegmentedButtonDefaults.itemShape(
index = index,
count = variants.size,
+2 -1
View File
@@ -15,7 +15,8 @@ Every Patch & Integration can be disabled/enabled & adjusted exactly how you wan
- Keeps lyrics controls visible
- One-handed player controls
- Redesigned mini-player with gestures
- Syllable Level lyrics (SoonTM)
- Word Level Lyrics (Word by Word) <3
- Syllable Level Lyrics (Syllable by Syllable) <3
### Integrations
+1 -1
View File
@@ -1,5 +1,5 @@
{
"tidalVersionCode": 10004,
"tidalApkUrl": "https://github.com/meowarex/rl-mobile/releases/download/latest/tidal-stock.apk",
"patchesVersion": "0.11.1"
"patchesVersion": "0.12.0"
}
+61
View File
@@ -0,0 +1,61 @@
.class public final Lradiant/IsrcCache;
.super Ljava/lang/Object;
# Caches trackId(String) -> ISRC(String), captured from TIDAL's own track mapper
.field public static final map:Ljava/util/concurrent/ConcurrentHashMap;
.method static constructor <clinit>()V
.locals 1
new-instance v0, Ljava/util/concurrent/ConcurrentHashMap;
invoke-direct {v0}, Ljava/util/concurrent/ConcurrentHashMap;-><init>()V
sput-object v0, Lradiant/IsrcCache;->map:Ljava/util/concurrent/ConcurrentHashMap;
return-void
.end method
.method private constructor <init>()V
.locals 0
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public static put(Ljava/lang/String;Ljava/lang/String;)V
.locals 1
if-eqz p0, :ret
if-eqz p1, :ret
sget-object v0, Lradiant/IsrcCache;->map:Ljava/util/concurrent/ConcurrentHashMap;
invoke-virtual {v0, p0, p1}, Ljava/util/concurrent/ConcurrentHashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
:ret
return-void
.end method
.method public static get(Ljava/lang/String;)Ljava/lang/String;
.locals 2
const/4 v0, 0x0
if-eqz p0, :none
sget-object v1, Lradiant/IsrcCache;->map:Ljava/util/concurrent/ConcurrentHashMap;
invoke-virtual {v1, p0}, Ljava/util/concurrent/ConcurrentHashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/lang/String;
:none
return-object v0
.end method
@@ -156,13 +156,27 @@
goto :invalid_track
:title_ok
# match desktop: primary artist name (artist?.name), fall back to the joined list
invoke-virtual {p1}, Lcom/aspiro/wamp/model/MediaItem;->getArtist()Lcom/aspiro/wamp/model/Artist;
move-result-object v3
if-eqz v3, :use_artist_names
invoke-virtual {v3}, Lcom/aspiro/wamp/model/Artist;->getName()Ljava/lang/String;
move-result-object v2
if-nez v2, :artist_present
:use_artist_names
invoke-virtual {p1}, Lcom/aspiro/wamp/model/MediaItem;->getArtistNames()Ljava/lang/String;
move-result-object v2
if-nez v2, :artist_present
const-string v3, "bail: getArtistNames() returned null"
const-string v3, "bail: artist name null"
invoke-static {v3}, Lradiant/RLAPILyricsHook;->dlog(Ljava/lang/String;)V
+277 -11
View File
@@ -14,6 +14,8 @@
.field public final lyricsId:Ljava/lang/String;
.field public static volatile clientIp:Ljava/lang/String;
# direct methods
.method public constructor <init>(Lcom/tidal/android/feature/playerscreen/ui/PlayerViewModel;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
@@ -43,6 +45,8 @@
if-eqz v0, :done
invoke-static {}, Lradiant/WordLyrics;->clear()V
const/4 v0, 0x0
sput-object v0, Lradiant/RLAPILyricsHook;->currentKey:Ljava/lang/String;
@@ -114,6 +118,99 @@
return v3
.end method
# Public client IP (needed for debugging with ratelimits)
.method static clientIp()Ljava/lang/String;
.locals 6
sget-object v0, Lradiant/RLAPILyricsWorker;->clientIp:Ljava/lang/String;
if-eqz v0, :fetch
return-object v0
:fetch
:try_start
new-instance v0, Ljava/net/URL;
const-string v1, "https://api.ipify.org?format=text"
invoke-direct {v0, v1}, Ljava/net/URL;-><init>(Ljava/lang/String;)V
invoke-virtual {v0}, Ljava/net/URL;->openConnection()Ljava/net/URLConnection;
move-result-object v0
check-cast v0, Ljava/net/HttpURLConnection;
const/16 v1, 0x5dc
invoke-virtual {v0, v1}, Ljava/net/URLConnection;->setConnectTimeout(I)V
invoke-virtual {v0, v1}, Ljava/net/URLConnection;->setReadTimeout(I)V
invoke-virtual {v0}, Ljava/net/HttpURLConnection;->getResponseCode()I
move-result v1
const/16 v2, 0xc8
if-eq v1, v2, :ok
invoke-virtual {v0}, Ljava/net/HttpURLConnection;->disconnect()V
goto :fail
:ok
invoke-virtual {v0}, Ljava/net/HttpURLConnection;->getInputStream()Ljava/io/InputStream;
move-result-object v1
new-instance v2, Ljava/io/InputStreamReader;
const-string v3, "UTF-8"
invoke-direct {v2, v1, v3}, Ljava/io/InputStreamReader;-><init>(Ljava/io/InputStream;Ljava/lang/String;)V
new-instance v3, Ljava/io/BufferedReader;
invoke-direct {v3, v2}, Ljava/io/BufferedReader;-><init>(Ljava/io/Reader;)V
invoke-virtual {v3}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;
move-result-object v4
invoke-virtual {v3}, Ljava/io/BufferedReader;->close()V
invoke-virtual {v0}, Ljava/net/HttpURLConnection;->disconnect()V
if-eqz v4, :fail
invoke-virtual {v4}, Ljava/lang/String;->trim()Ljava/lang/String;
move-result-object v4
invoke-virtual {v4}, Ljava/lang/String;->isEmpty()Z
move-result v5
if-nez v5, :fail
sput-object v4, Lradiant/RLAPILyricsWorker;->clientIp:Ljava/lang/String;
return-object v4
:try_end
.catchall {:try_start .. :try_end} :catch_all
:catch_all
move-exception v0
:fail
const-string v0, "null"
return-object v0
.end method
.method public static fetch(Ljava/lang/String;Z)Ljava/lang/String;
.locals 7
@@ -136,6 +233,8 @@
invoke-virtual {v0, v1}, Ljava/net/URLConnection;->setConnectTimeout(I)V
const v1, 0xafc8
invoke-virtual {v0, v1}, Ljava/net/URLConnection;->setReadTimeout(I)V
if-eqz p1, :no_auth
@@ -154,7 +253,9 @@
const-string v1, "x-client-ip"
const-string v2, "null"
invoke-static {}, Lradiant/RLAPILyricsWorker;->clientIp()Ljava/lang/String;
move-result-object v2
invoke-virtual {v0, v1, v2}, Ljava/net/URLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V
@@ -347,11 +448,7 @@
move-result-object v4
const-string v5, "text"
const-string v6, ""
invoke-virtual {v4, v5, v6}, Lorg/json/JSONObject;->optString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
invoke-static {v4}, Lradiant/WordLyrics;->lineText(Lorg/json/JSONObject;)Ljava/lang/String;
move-result-object v5
@@ -393,20 +490,168 @@
return-object v1
.end method
# Returns "&isrc=<enc>" for the current track
.method private isrcParam()Ljava/lang/String;
.locals 6
iget-object v0, p0, Lradiant/RLAPILyricsWorker;->key:Ljava/lang/String;
const/4 v1, 0x0
:loop
invoke-static {v0}, Lradiant/IsrcCache;->get(Ljava/lang/String;)Ljava/lang/String;
move-result-object v2
if-eqz v2, :retry
invoke-virtual {v2}, Ljava/lang/String;->trim()Ljava/lang/String;
move-result-object v2
invoke-virtual {v2}, Ljava/lang/String;->isEmpty()Z
move-result v3
if-nez v3, :retry
:try_enc_start
invoke-static {v2}, Lradiant/RLAPILyricsWorker;->uric(Ljava/lang/String;)Ljava/lang/String;
move-result-object v2
:try_enc_end
.catchall {:try_enc_start .. :try_enc_end} :enc_fail
:enc_done
new-instance v3, Ljava/lang/StringBuilder;
const-string v4, "&isrc="
invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {v3, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v2
return-object v2
:enc_fail
move-exception v3
goto :enc_done
:retry
# keep waiting for TIDAL's mapper to cache the ISRC while this track is still current
invoke-direct {p0}, Lradiant/RLAPILyricsWorker;->isCurrent()Z
move-result v3
if-eqz v3, :giveup
const/16 v3, 0x28
if-ge v1, v3, :giveup
:try_sleep_start
const-wide/16 v3, 0x64
invoke-static {v3, v4}, Ljava/lang/Thread;->sleep(J)V
:try_sleep_end
.catchall {:try_sleep_start .. :try_sleep_end} :sleep_catch
:sleep_done
add-int/lit8 v1, v1, 0x1
goto :loop
:sleep_catch
move-exception v3
goto :sleep_done
:giveup
const-string v0, ""
return-object v0
.end method
# URL-encode like JS encodeURIComponent (so requests are byte identical to the desktop plugin)
.method static uric(Ljava/lang/String;)Ljava/lang/String;
.locals 3
const-string v0, "UTF-8"
invoke-static {p0, v0}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
const-string v1, "+"
const-string v2, "%20"
invoke-virtual {v0, v1, v2}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
move-result-object v0
const-string v1, "%21"
const-string v2, "!"
invoke-virtual {v0, v1, v2}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
move-result-object v0
const-string v1, "%27"
const-string v2, "\'"
invoke-virtual {v0, v1, v2}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
move-result-object v0
const-string v1, "%28"
const-string v2, "("
invoke-virtual {v0, v1, v2}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
move-result-object v0
const-string v1, "%29"
const-string v2, ")"
invoke-virtual {v0, v1, v2}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
move-result-object v0
const-string v1, "%7E"
const-string v2, "~"
invoke-virtual {v0, v1, v2}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method private runImpl()V
.locals 11
.locals 13
iget-object v0, p0, Lradiant/RLAPILyricsWorker;->title:Ljava/lang/String;
const-string v1, "UTF-8"
invoke-static {v0, v1}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
invoke-static {v0}, Lradiant/RLAPILyricsWorker;->uric(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
iget-object v2, p0, Lradiant/RLAPILyricsWorker;->artist:Ljava/lang/String;
invoke-static {v2, v1}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
invoke-static {v2}, Lradiant/RLAPILyricsWorker;->uric(Ljava/lang/String;)Ljava/lang/String;
move-result-object v1
@@ -424,6 +669,23 @@
invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-direct {p0}, Lradiant/RLAPILyricsWorker;->isrcParam()Ljava/lang/String;
move-result-object v0
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-static {}, Lradiant/WordLyrics;->romanizeOn()Z
move-result v0
if-eqz v0, :no_romanize
const-string v0, "&romanize=true"
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
:no_romanize
const-string v0, "&platform=rl-mobile"
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
@@ -479,6 +741,8 @@
goto :request_failed
:got_body
move-object v11, v3
invoke-static {v3}, Lradiant/RLAPILyricsWorker;->parseLines(Ljava/lang/String;)Ljava/util/ArrayList;
move-result-object v3
@@ -536,6 +800,8 @@
return-void
:key_ok
invoke-static {v11}, Lradiant/WordLyrics;->ingest(Ljava/lang/String;)V
iget-object v4, p0, Lradiant/RLAPILyricsWorker;->vm:Lcom/tidal/android/feature/playerscreen/ui/PlayerViewModel;
iget-object v5, v4, Lcom/tidal/android/feature/playerscreen/ui/PlayerViewModel;->O:Lkotlinx/coroutines/flow/MutableStateFlow;
+59
View File
@@ -0,0 +1,59 @@
.class public final Lradiant/SylBrush;
.super Landroidx/compose/ui/graphics/ShaderBrush;
# Paints the syllable wipe gradient
# x0 = wipe edge, x1 = end of the soft trail
# instance state
.field public final x0:F
.field public final x1:F
.field public final c0:I
.field public final c1:I
.method public constructor <init>(FFII)V
.locals 0
invoke-direct {p0}, Landroidx/compose/ui/graphics/ShaderBrush;-><init>()V
iput p1, p0, Lradiant/SylBrush;->x0:F
iput p2, p0, Lradiant/SylBrush;->x1:F
iput p3, p0, Lradiant/SylBrush;->c0:I
iput p4, p0, Lradiant/SylBrush;->c1:I
return-void
.end method
# Gradient across the whole line
.method public createShader-uvyYCjk(J)Landroid/graphics/Shader;
.locals 8
new-instance v0, Landroid/graphics/LinearGradient;
iget v1, p0, Lradiant/SylBrush;->x0:F
const/4 v2, 0x0
iget v3, p0, Lradiant/SylBrush;->x1:F
const/4 v4, 0x0
iget v5, p0, Lradiant/SylBrush;->c0:I
iget v6, p0, Lradiant/SylBrush;->c1:I
sget-object v7, Landroid/graphics/Shader$TileMode;->CLAMP:Landroid/graphics/Shader$TileMode;
invoke-direct/range {v0 .. v7}, Landroid/graphics/LinearGradient;-><init>(FFFFIILandroid/graphics/Shader$TileMode;)V
return-object v0
.end method
+264
View File
@@ -0,0 +1,264 @@
.class public final Lradiant/SylLayout;
.super Ljava/lang/Object;
# interfaces
.implements Lam0/l;
# Remembers where each line's glyphs landed
# static state
.field public static cbs:[Lradiant/SylLayout;
.field public static layouts:[Landroidx/compose/ui/text/TextLayoutResult;
# instance state
.field public final idx:I
.method public constructor <init>(I)V
.locals 0
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput p1, p0, Lradiant/SylLayout;->idx:I
return-void
.end method
# One reusable callback per line
.method public static cb(I)Lam0/l;
.locals 5
if-gez p0, :have_idx
const/4 p0, 0x0
:have_idx
sget-object v0, Lradiant/SylLayout;->cbs:[Lradiant/SylLayout;
if-eqz v0, :grow
array-length v1, v0
if-gt v1, p0, :have_arr
:grow
add-int/lit8 v1, p0, 0x1
const/16 v2, 0x40
if-ge v1, v2, :cap_ok
const/16 v1, 0x40
:cap_ok
if-nez v0, :copy
new-array v0, v1, [Lradiant/SylLayout;
goto :store_arr
:copy
invoke-static {v0, v1}, Ljava/util/Arrays;->copyOf([Ljava/lang/Object;I)[Ljava/lang/Object;
move-result-object v0
check-cast v0, [Lradiant/SylLayout;
:store_arr
sput-object v0, Lradiant/SylLayout;->cbs:[Lradiant/SylLayout;
:have_arr
aget-object v1, v0, p0
if-nez v1, :ret
new-instance v1, Lradiant/SylLayout;
invoke-direct {v1, p0}, Lradiant/SylLayout;-><init>(I)V
aput-object v1, v0, p0
:ret
return-object v1
.end method
.method public static get(I)Landroidx/compose/ui/text/TextLayoutResult;
.locals 2
if-ltz p0, :none
sget-object v0, Lradiant/SylLayout;->layouts:[Landroidx/compose/ui/text/TextLayoutResult;
if-eqz v0, :none
array-length v1, v0
if-ge p0, v1, :none
aget-object v0, v0, p0
return-object v0
:none
const/4 v0, 0x0
return-object v0
.end method
# Forget the layouts on track change
.method public static reset()V
.locals 1
const/4 v0, 0x0
sput-object v0, Lradiant/SylLayout;->layouts:[Landroidx/compose/ui/text/TextLayoutResult;
return-void
.end method
# Font size in pixels
.method public static em(Landroidx/compose/ui/text/TextLayoutResult;)F
.locals 8
invoke-virtual {p0}, Landroidx/compose/ui/text/TextLayoutResult;->getLayoutInput()Landroidx/compose/ui/text/TextLayoutInput;
move-result-object v0
invoke-virtual {v0}, Landroidx/compose/ui/text/TextLayoutInput;->getStyle()Landroidx/compose/ui/text/TextStyle;
move-result-object v1
invoke-virtual {v1}, Landroidx/compose/ui/text/TextStyle;->getFontSize-XSAIIZE()J
move-result-wide v1
# Only Sp converts to pixels
invoke-static {v1, v2}, Landroidx/compose/ui/unit/TextUnit;->getType-UIouoOA(J)J
move-result-wide v3
sget-object v5, Landroidx/compose/ui/unit/TextUnitType;->Companion:Landroidx/compose/ui/unit/TextUnitType$Companion;
invoke-virtual {v5}, Landroidx/compose/ui/unit/TextUnitType$Companion;->getSp-UIouoOA()J
move-result-wide v5
invoke-static {v3, v4, v5, v6}, Landroidx/compose/ui/unit/TextUnitType;->equals-impl0(JJ)Z
move-result v3
if-eqz v3, :fallback
invoke-virtual {v0}, Landroidx/compose/ui/text/TextLayoutInput;->getDensity()Landroidx/compose/ui/unit/Density;
move-result-object v0
invoke-interface {v0, v1, v2}, Landroidx/compose/ui/unit/Density;->toPx--R2X_6o(J)F
move-result v0
const/4 v1, 0x0
cmpg-float v1, v0, v1
if-lez v1, :fallback
return v0
:fallback
# No font size, guess from the line box
const/4 v0, 0x0
invoke-virtual {p0, v0}, Landroidx/compose/ui/text/TextLayoutResult;->getLineBottom(I)F
move-result v1
const/4 v0, 0x0
invoke-virtual {p0, v0}, Landroidx/compose/ui/text/TextLayoutResult;->getLineTop(I)F
move-result v2
sub-float/2addr v1, v2
const/4 v0, 0x0
cmpg-float v0, v1, v0
if-lez v0, :default_em
const v0, 0x3f4ccccd # 0.8f
mul-float/2addr v0, v1
return v0
:default_em
const/high16 v0, 0x42200000 # 40.0f
return v0
.end method
# virtual methods
.method public invoke(Ljava/lang/Object;)Ljava/lang/Object;
.locals 4
iget v0, p0, Lradiant/SylLayout;->idx:I
if-ltz v0, :ret
instance-of v1, p1, Landroidx/compose/ui/text/TextLayoutResult;
if-eqz v1, :ret
sget-object v1, Lradiant/SylLayout;->layouts:[Landroidx/compose/ui/text/TextLayoutResult;
if-eqz v1, :grow
array-length v2, v1
if-gt v2, v0, :store
:grow
add-int/lit8 v2, v0, 0x1
const/16 v3, 0x40
if-ge v2, v3, :cap_ok
const/16 v2, 0x40
:cap_ok
if-nez v1, :copy
new-array v1, v2, [Landroidx/compose/ui/text/TextLayoutResult;
goto :store
:copy
invoke-static {v1, v2}, Ljava/util/Arrays;->copyOf([Ljava/lang/Object;I)[Ljava/lang/Object;
move-result-object v1
check-cast v1, [Landroidx/compose/ui/text/TextLayoutResult;
:store
sput-object v1, Lradiant/SylLayout;->layouts:[Landroidx/compose/ui/text/TextLayoutResult;
check-cast p1, Landroidx/compose/ui/text/TextLayoutResult;
aput-object p1, v1, v0
:ret
sget-object v0, Lkotlin/u;->a:Lkotlin/u;
return-object v0
.end method
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,21 @@
.class public final Lradiant/WordLyricsTick;
.super Ljava/lang/Object;
.implements Ljava/lang/Runnable;
# 50ms clock tick driver for word level lyrics highlighting
.method public constructor <init>()V
.locals 0
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public run()V
.locals 0
invoke-static {}, Lradiant/WordLyrics;->tick()V
return-void
.end method
+26
View File
@@ -0,0 +1,26 @@
--- a/cg0/h.smali
+++ b/cg0/h.smali
@@ -363,6 +363,23 @@
.method public static final d(Lcom/tidal/sdk/tidalapi/generated/models/TracksResourceObject;Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/util/Map;)Lcom/tidal/android/tidalapi/domain/model/o;
.locals 23
+ invoke-virtual/range {p0 .. p0}, Lcom/tidal/sdk/tidalapi/generated/models/TracksResourceObject;->getAttributes()Lcom/tidal/sdk/tidalapi/generated/models/TracksAttributes;
+
+ move-result-object v1
+
+ if-eqz v1, :rl_isrc_skip
+
+ invoke-virtual/range {p0 .. p0}, Lcom/tidal/sdk/tidalapi/generated/models/TracksResourceObject;->getId()Ljava/lang/String;
+
+ move-result-object v0
+
+ invoke-virtual {v1}, Lcom/tidal/sdk/tidalapi/generated/models/TracksAttributes;->getIsrc()Ljava/lang/String;
+
+ move-result-object v1
+
+ invoke-static {v0, v1}, Lradiant/IsrcCache;->put(Ljava/lang/String;Ljava/lang/String;)V
+
+ :rl_isrc_skip
move-object/from16 v0, p4
move-object/from16 v1, p7
+13 -4
View File
@@ -1,14 +1,23 @@
--- a/com/tidal/android/feature/playerscreen/ui/PlayerViewModel$observeLyricsProgress$1$a.smali
+++ b/com/tidal/android/feature/playerscreen/ui/PlayerViewModel$observeLyricsProgress$1$a.smali
@@ -191,6 +191,13 @@
@@ -58,6 +58,8 @@
.line 5
int-to-long p1, p1
+ invoke-static {p1, p2}, Lradiant/WordLyrics;->onProgress(J)V
+
.line 6
iget-object v0, p0, Lcom/tidal/android/feature/playerscreen/ui/PlayerViewModel$observeLyricsProgress$1$a;->a:Lcom/tidal/android/feature/playerscreen/ui/PlayerViewModel;
@@ -191,6 +193,13 @@
.line 67
:cond_3
+ sget-boolean v6, Lradiant/RLAPILyricsHook;->isRlState:Z # read RL flag
+ sget-boolean v6, Lradiant/RLAPILyricsHook;->isRlState:Z
+
+ if-eqz v6, :radiant_skip # skip if not RL
+ if-eqz v6, :radiant_skip
+
+ const/4 v5, -0x1 # RL no-match default = -1
+ const/4 v5, -0x1
+
+ :radiant_skip
if-gez v4, :cond_4
+80
View File
@@ -0,0 +1,80 @@
--- a/com/tidal/android/feature/playerscreen/ui/composables/f2.smali
+++ b/com/tidal/android/feature/playerscreen/ui/composables/f2.smali
@@ -932,7 +932,7 @@
# virtual methods
.method public final invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
- .locals 28
+ .locals 40
.line 1
move-object/from16 v0, p0
@@ -1158,6 +1158,8 @@
.line 100
check-cast v1, Lcom/tidal/android/feature/playerscreen/ui/f;
+ move/16 v33, v2 # lazy item index
+
.line 101
.line 102
const v3, 0x6b82e849
@@ -1646,6 +1648,26 @@
.line 331
iget-object v3, v1, Lcom/tidal/android/feature/playerscreen/ui/f;->a:Ljava/lang/String;
+ iget v4, v0, Lcom/tidal/android/feature/playerscreen/ui/composables/f2;->b:I
+
+ move/16 v34, v4 # TIDALs active line
+
+ iget-object v4, v1, Lcom/tidal/android/feature/playerscreen/ui/f;->a:Ljava/lang/String;
+
+ move-object/16 v35, v4 # plain line text
+
+ iget-wide v4, v0, Lcom/tidal/android/feature/playerscreen/ui/composables/f2;->d:J
+
+ move-wide/16 v36, v4 # sung colour
+
+ iget-wide v4, v0, Lcom/tidal/android/feature/playerscreen/ui/composables/f2;->e:J
+
+ move-wide/16 v38, v4 # unsung colour
+
+ invoke-static/range {v33 .. v39}, Lradiant/WordLyrics;->renderSyl(IILjava/lang/String;JJ)Landroidx/compose/ui/text/AnnotatedString;
+
+ move-result-object v3 # syllable-wiped line
+
.line 332
.line 333
invoke-interface {v2}, Landroidx/compose/runtime/State;->getValue()Ljava/lang/Object;
@@ -1672,7 +1694,7 @@
.line 344
.line 345
- const v27, 0xfff8
+ const v27, 0x7ff8 # $default: pass onTextLayout
.line 346
.line 347
@@ -1727,7 +1749,13 @@
.line 369
.line 370
- const/16 v22, 0x0
+ move/from16 v1, v33 # line index
+
+ invoke-static {v1}, Lradiant/SylLayout;->cb(I)Lam0/l; # per-line layout capture
+
+ move-result-object v1
+
+ move-object/from16 v22, v1 # onTextLayout
.line 371
.line 372
@@ -1743,7 +1771,7 @@
.line 377
.line 378
- invoke-static/range {v3 .. v27}, Landroidx/compose/material3/TextKt;->Text--4IGK_g(Ljava/lang/String;Landroidx/compose/ui/Modifier;JJLandroidx/compose/ui/text/font/FontStyle;Landroidx/compose/ui/text/font/FontWeight;Landroidx/compose/ui/text/font/FontFamily;JLandroidx/compose/ui/text/style/TextDecoration;Landroidx/compose/ui/text/style/TextAlign;JIZIILam0/l;Landroidx/compose/ui/text/TextStyle;Landroidx/compose/runtime/Composer;III)V
+ invoke-static/range {v3 .. v27}, Landroidx/compose/material3/TextKt;->Text--4IGK_g(Landroidx/compose/ui/text/AnnotatedString;Landroidx/compose/ui/Modifier;JJLandroidx/compose/ui/text/font/FontStyle;Landroidx/compose/ui/text/font/FontWeight;Landroidx/compose/ui/text/font/FontFamily;JLandroidx/compose/ui/text/style/TextDecoration;Landroidx/compose/ui/text/style/TextAlign;JIZILjava/util/Map;Lam0/l;Landroidx/compose/ui/text/TextStyle;Landroidx/compose/runtime/Composer;III)V
.line 379
.line 380
+56
View File
@@ -0,0 +1,56 @@
--- a/com/tidal/android/feature/playerscreen/ui/composables/f2.smali
+++ b/com/tidal/android/feature/playerscreen/ui/composables/f2.smali
@@ -87,7 +87,7 @@
# virtual methods
.method public final invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
- .locals 28
+ .locals 40
.line 1
move-object/from16 v0, p0
@@ -313,6 +313,8 @@
.line 100
check-cast v1, Lcom/tidal/android/feature/playerscreen/ui/f;
+ move/16 v33, v2
+
.line 101
.line 102
const v3, 0x6b82e849
@@ -801,6 +803,26 @@
.line 331
iget-object v3, v1, Lcom/tidal/android/feature/playerscreen/ui/f;->a:Ljava/lang/String;
+ iget v4, v0, Lcom/tidal/android/feature/playerscreen/ui/composables/f2;->b:I
+
+ move/16 v34, v4
+
+ iget-object v4, v1, Lcom/tidal/android/feature/playerscreen/ui/f;->a:Ljava/lang/String;
+
+ move-object/16 v35, v4
+
+ iget-wide v4, v0, Lcom/tidal/android/feature/playerscreen/ui/composables/f2;->d:J
+
+ move-wide/16 v36, v4
+
+ iget-wide v4, v0, Lcom/tidal/android/feature/playerscreen/ui/composables/f2;->e:J
+
+ move-wide/16 v38, v4
+
+ invoke-static/range {v33 .. v39}, Lradiant/WordLyrics;->render(IILjava/lang/String;JJ)Landroidx/compose/ui/text/AnnotatedString;
+
+ move-result-object v3
+
.line 332
.line 333
invoke-interface {v2}, Landroidx/compose/runtime/State;->getValue()Ljava/lang/Object;
@@ -898,7 +920,7 @@
.line 377
.line 378
- invoke-static/range {v3 .. v27}, Landroidx/compose/material3/TextKt;->Text--4IGK_g(Ljava/lang/String;Landroidx/compose/ui/Modifier;JJLandroidx/compose/ui/text/font/FontStyle;Landroidx/compose/ui/text/font/FontWeight;Landroidx/compose/ui/text/font/FontFamily;JLandroidx/compose/ui/text/style/TextDecoration;Landroidx/compose/ui/text/style/TextAlign;JIZIILam0/l;Landroidx/compose/ui/text/TextStyle;Landroidx/compose/runtime/Composer;III)V
+ invoke-static/range {v3 .. v27}, Landroidx/compose/material3/TextKt;->Text--4IGK_g(Landroidx/compose/ui/text/AnnotatedString;Landroidx/compose/ui/Modifier;JJLandroidx/compose/ui/text/font/FontStyle;Landroidx/compose/ui/text/font/FontWeight;Landroidx/compose/ui/text/font/FontFamily;JLandroidx/compose/ui/text/style/TextDecoration;Landroidx/compose/ui/text/style/TextAlign;JIZILjava/util/Map;Lam0/l;Landroidx/compose/ui/text/TextStyle;Landroidx/compose/runtime/Composer;III)V
.line 379
.line 380
+70 -3
View File
@@ -32,11 +32,78 @@
"order": 20,
"fileNames": [
"lyrics-rl-api.patch",
"lyrics-rl-api-observer.patch"
"lyrics-rl-api-observer.patch",
"lyrics-rl-api-isrc.patch"
],
"title": "Radiant Lyrics API - WIP",
"description": "Use Radiant Lyrics API to fetch Lyrics (Higher quality & More providers)",
"default": false
"description": "Use Radiant Lyrics API to fetch Lyrics (Syllable Level & Higher Quality)",
"default": false,
"defaultVariantIndex": 0,
"variants": [
{
"title": "Line",
"fileNames": []
},
{
"title": "Word",
"fileNames": [
"lyrics-rl-api-word.patch"
]
},
{
"title": "Syllable",
"fileNames": [
"lyrics-rl-api-syllable.patch"
]
}
],
"extensionFiles": [
"radiant/RLAPILyricsHook.smali",
"radiant/RLAPILyricsWorker.smali",
"radiant/IsrcCache.smali",
"radiant/WordLyrics.smali",
"radiant/WordLyricsTick.smali",
"radiant/SylBrush.smali",
"radiant/SylLayout.smali"
],
"advancedOptions": [
{
"type": "toggle",
"key": "romanize",
"title": "Romanization",
"description": "Return a romanized transcription and show that instead of the original script",
"default": false,
"token": "RL_ROMANIZE",
"inline": true
},
{
"type": "toggle",
"key": "context_aware",
"title": "Context Aware Lyrics",
"description": "Return a romanized transcription and show that instead of the original script",
"default": true,
"token": "RL_CTX_ON"
},
{
"type": "choice",
"key": "context_aware_mode",
"title": "Show",
"description": "",
"entries": [
"Adlibs",
"Singers",
"Both"
],
"values": [
"0x1",
"0x2",
"0x3"
],
"defaultIndex": 0,
"requiresOption": "context_aware",
"token": "RL_CTX"
}
]
},
{
"id": "PlayerBackdrop",