@open-orpheus/plugin-api 0.0.0-stage → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +7 -0
- package/README.md +191 -2
- package/dist/client/index.d.ts +37 -0
- package/dist/client/index.js +53 -0
- package/dist/client/index.js.map +1 -0
- package/dist/configuration/host/src/shared/plugin/configuration/index.d.ts +21 -0
- package/dist/configuration/index.d.ts +5 -0
- package/dist/host/_native/open-orpheus__database.d.ts +50 -0
- package/dist/host/_native/open-orpheus__window.d.ts +284 -0
- package/dist/host/src/constants.d.ts +6 -0
- package/dist/host/src/main/afp.d.ts +1 -0
- package/dist/host/src/main/arguments.d.ts +4 -0
- package/dist/host/src/main/assets.d.ts +2 -0
- package/dist/host/src/main/audio/ChunkTracker.d.ts +23 -0
- package/dist/host/src/main/audio/DownloadScheduler.d.ts +53 -0
- package/dist/host/src/main/audio/MediaEngine.d.ts +47 -0
- package/dist/host/src/main/audio/OnlineStreamer.d.ts +66 -0
- package/dist/host/src/main/audio/StorageManager.d.ts +18 -0
- package/dist/host/src/main/audio.d.ts +6 -0
- package/dist/host/src/main/av3a/Av3aEngine.d.ts +24 -0
- package/dist/host/src/main/av3a/Av3aM4aSession.d.ts +101 -0
- package/dist/host/src/main/av3a/Av3aPlaybackProcess.d.ts +52 -0
- package/dist/host/src/main/av3a/detect.d.ts +6 -0
- package/dist/host/src/main/av3a/sources.d.ts +13 -0
- package/dist/host/src/main/av3a/types.d.ts +54 -0
- package/dist/host/src/main/bridge/ipc-main-bridge.d.ts +24 -0
- package/dist/host/src/main/bridge/modules/inputRegion.d.ts +1 -0
- package/dist/host/src/main/bridge/modules/lyrics.d.ts +1 -0
- package/dist/host/src/main/bridge/modules/settings.d.ts +1 -0
- package/dist/host/src/main/bridge/register.d.ts +9 -0
- package/dist/host/src/main/bridge/window.d.ts +7 -0
- package/dist/host/src/main/cache/HttpCacheStorage.d.ts +10 -0
- package/dist/host/src/main/cache/LyricCahceManager.d.ts +21 -0
- package/dist/host/src/main/cache/PlayCacheManager.d.ts +72 -0
- package/dist/host/src/main/cache.d.ts +7 -0
- package/dist/host/src/main/calls/app.d.ts +1 -0
- package/dist/host/src/main/calls/audioeffect.d.ts +1 -0
- package/dist/host/src/main/calls/browser.d.ts +1 -0
- package/dist/host/src/main/calls/desktop.d.ts +2 -0
- package/dist/host/src/main/calls/desktoppet.d.ts +1 -0
- package/dist/host/src/main/calls/download.d.ts +1 -0
- package/dist/host/src/main/calls/index.d.ts +16 -0
- package/dist/host/src/main/calls/musiclibrary.d.ts +1 -0
- package/dist/host/src/main/calls/network.d.ts +1 -0
- package/dist/host/src/main/calls/os.d.ts +1 -0
- package/dist/host/src/main/calls/player.d.ts +22 -0
- package/dist/host/src/main/calls/process.d.ts +1 -0
- package/dist/host/src/main/calls/rtc.d.ts +1 -0
- package/dist/host/src/main/calls/storage.d.ts +1 -0
- package/dist/host/src/main/calls/trayicon.d.ts +1 -0
- package/dist/host/src/main/calls/update.d.ts +1 -0
- package/dist/host/src/main/calls/winhelper.d.ts +1 -0
- package/dist/host/src/main/calls.d.ts +5 -0
- package/dist/host/src/main/channel.d.ts +1 -0
- package/dist/host/src/main/cookie.d.ts +13 -0
- package/dist/host/src/main/crypto.d.ts +46 -0
- package/dist/host/src/main/database/KeyvSqliteDriver.d.ts +6 -0
- package/dist/host/src/main/database.d.ts +5 -0
- package/dist/host/src/main/dawn.d.ts +31 -0
- package/dist/host/src/main/device.d.ts +3 -0
- package/dist/host/src/main/download.d.ts +40 -0
- package/dist/host/src/main/error.d.ts +1 -0
- package/dist/host/src/main/folders.d.ts +18 -0
- package/dist/host/src/main/fonts.d.ts +1 -0
- package/dist/host/src/main/gui.d.ts +4 -0
- package/dist/host/src/main/id3.d.ts +42 -0
- package/dist/host/src/main/lifecycle.d.ts +127 -0
- package/dist/host/src/main/logger.d.ts +12 -0
- package/dist/host/src/main/lyrics/DbusLyricsService.d.ts +115 -0
- package/dist/host/src/main/lyrics/LyricsDispatcher.d.ts +26 -0
- package/dist/host/src/main/lyrics/dbus.d.ts +16 -0
- package/dist/host/src/main/lyrics/parse.d.ts +21 -0
- package/dist/host/src/main/lyrics.d.ts +2 -0
- package/dist/host/src/main/mediaSession.d.ts +42 -0
- package/dist/host/src/main/menu/AppMenu.d.ts +35 -0
- package/dist/host/src/main/menu/anchor.d.ts +13 -0
- package/dist/host/src/main/menu/backend/DesktopWindowBackend.d.ts +30 -0
- package/dist/host/src/main/menu/backend/MenuBackend.d.ts +28 -0
- package/dist/host/src/main/menu/backend/WaylandLayerShellBackend.d.ts +35 -0
- package/dist/host/src/main/menu/backend/WaylandOverlayBackend.d.ts +15 -0
- package/dist/host/src/main/menu/backend/WaylandPopupBackend.d.ts +31 -0
- package/dist/host/src/main/menu/constants.d.ts +14 -0
- package/dist/host/src/main/menu/index.d.ts +2 -0
- package/dist/host/src/main/menu/native-popup.d.ts +16 -0
- package/dist/host/src/main/menu/patch.d.ts +3 -0
- package/dist/host/src/main/menu/skin.d.ts +3 -0
- package/dist/host/src/main/menu/surface/BaseWindowMenuSurface.d.ts +81 -0
- package/dist/host/src/main/menu/surface/CaptureLayerSurface.d.ts +22 -0
- package/dist/host/src/main/menu/surface/MenuSurface.d.ts +29 -0
- package/dist/host/src/main/menu/surface/MenuSurfacePath.d.ts +29 -0
- package/dist/host/src/main/menu/surface/SurfacePool.d.ts +15 -0
- package/dist/host/src/main/menu/workaround.d.ts +12 -0
- package/dist/host/src/main/ncae.d.ts +8 -0
- package/dist/host/src/main/network/handler.d.ts +3 -0
- package/dist/host/src/main/network/interceptor.d.ts +2 -0
- package/dist/host/src/main/network/interceptors/anonymous.d.ts +2 -0
- package/dist/host/src/main/network/pipeline.d.ts +8 -0
- package/dist/host/src/main/network/types.d.ts +70 -0
- package/dist/host/src/main/orpheus.d.ts +10 -0
- package/dist/host/src/main/pack.d.ts +27 -0
- package/dist/host/src/main/packs/Pack.d.ts +12 -0
- package/dist/host/src/main/packs/SkinPack.d.ts +6 -0
- package/dist/host/src/main/packs/WebPack.d.ts +6 -0
- package/dist/host/src/main/playback/PlaybackController.d.ts +57 -0
- package/dist/host/src/main/playback/PlayerCommandRouter.d.ts +85 -0
- package/dist/host/src/main/playback/adapters/MediaSessionAdapter.d.ts +61 -0
- package/dist/host/src/main/playback/adapters/MprisAdapter.d.ts +48 -0
- package/dist/host/src/main/playback/adapters/NowPlayingAdapter.d.ts +23 -0
- package/dist/host/src/main/playback/adapters/SmtcAdapter.d.ts +23 -0
- package/dist/host/src/main/playback/artwork.d.ts +47 -0
- package/dist/host/src/main/playback/modes.d.ts +8 -0
- package/dist/host/src/main/playback/types.d.ts +59 -0
- package/dist/host/src/main/plugin/assets.d.ts +8 -0
- package/dist/host/src/main/plugin/catalog.d.ts +42 -0
- package/dist/host/src/main/plugin/discover.d.ts +33 -0
- package/dist/host/src/main/plugin/index.d.ts +15 -0
- package/dist/host/src/main/plugin/loader.d.ts +90 -0
- package/dist/host/src/main/plugin/manager.d.ts +61 -0
- package/dist/host/src/main/plugin/metadata.d.ts +34 -0
- package/dist/host/src/main/plugin/state.d.ts +27 -0
- package/dist/host/src/main/plugin/tree.d.ts +13 -0
- package/dist/host/src/main/protocol.d.ts +4 -0
- package/dist/host/src/main/request.d.ts +16 -0
- package/dist/host/src/main/settings.d.ts +21 -0
- package/dist/host/src/main/shortcuts.d.ts +10 -0
- package/dist/host/src/main/shutdown.d.ts +50 -0
- package/dist/host/src/main/skin/color.d.ts +2 -0
- package/dist/host/src/main/skin/dui.d.ts +15 -0
- package/dist/host/src/main/tray.d.ts +8 -0
- package/dist/host/src/main/update.d.ts +2 -0
- package/dist/host/src/main/util/color.d.ts +7 -0
- package/dist/host/src/main/util/display.d.ts +3 -0
- package/dist/host/src/main/util/env.d.ts +1 -0
- package/dist/host/src/main/util/fs.d.ts +21 -0
- package/dist/host/src/main/util/image.d.ts +1 -0
- package/dist/host/src/main/util/musicFile.d.ts +1 -0
- package/dist/host/src/main/util/musicPicture.d.ts +2 -0
- package/dist/host/src/main/util/path.d.ts +2 -0
- package/dist/host/src/main/util/send.d.ts +13 -0
- package/dist/host/src/main/util/url.d.ts +19 -0
- package/dist/host/src/main/util/window.d.ts +2 -0
- package/dist/host/src/main/window.d.ts +316 -0
- package/dist/host/src/main/windows/color-picker.d.ts +3 -0
- package/dist/host/src/main/windows/desktop-lyrics.d.ts +12 -0
- package/dist/host/src/main/windows/desktop-pet.d.ts +8 -0
- package/dist/host/src/main/windows/main.d.ts +6 -0
- package/dist/host/src/main/windows/manage.d.ts +2 -0
- package/dist/host/src/main/windows/mini-player.d.ts +16 -0
- package/dist/host/src/main/windows/music-desktop.d.ts +13 -0
- package/dist/host/src/main/windows/package-download.d.ts +2 -0
- package/dist/host/src/main/windows/plugin-manager-events.d.ts +7 -0
- package/dist/host/src/main/windows/plugin-manager.d.ts +5 -0
- package/dist/host/src/main/xeapi.d.ts +48 -0
- package/dist/host/src/preload/AudioEffectManager.d.ts +124 -0
- package/dist/host/src/preload/PlaybackBackend.d.ts +34 -0
- package/dist/host/src/preload/Player.d.ts +229 -0
- package/dist/host/src/preload/av3a/Av3aPcmPlayer.d.ts +84 -0
- package/dist/host/src/preload/av3a/bridge.d.ts +21 -0
- package/dist/host/src/preload/av3a/channel.d.ts +40 -0
- package/dist/host/src/preload/av3a/detect.d.ts +6 -0
- package/dist/host/src/preload/backends/Av3aPlaybackBackend.d.ts +32 -0
- package/dist/host/src/preload/backends/MediaPlaybackBackend.d.ts +25 -0
- package/dist/host/src/shared/CallDispatcher.d.ts +12 -0
- package/dist/host/src/shared/bridge/constants.d.ts +2 -0
- package/dist/host/src/shared/bridge/endpoint.d.ts +29 -0
- package/dist/host/src/shared/bridge/hub.d.ts +136 -0
- package/dist/host/src/shared/bridge/protocol.d.ts +91 -0
- package/dist/host/src/shared/bridge/realm.d.ts +14 -0
- package/dist/host/src/shared/bridge/routes.d.ts +37 -0
- package/dist/host/src/shared/contracts/av3a-api.d.ts +50 -0
- package/dist/host/src/shared/contracts/av3a-process.d.ts +56 -0
- package/dist/host/src/shared/contracts/color-picker-api.d.ts +17 -0
- package/dist/host/src/shared/contracts/desktop-lyrics-api.d.ts +22 -0
- package/dist/host/src/shared/contracts/input-region-api.d.ts +5 -0
- package/dist/host/src/shared/contracts/lyrics-api.d.ts +11 -0
- package/dist/host/src/shared/contracts/manage-api.d.ts +31 -0
- package/dist/host/src/shared/contracts/menu-surface-api.d.ts +35 -0
- package/dist/host/src/shared/contracts/mini-player-api.d.ts +19 -0
- package/dist/host/src/shared/contracts/plugin-manager-api.d.ts +223 -0
- package/dist/host/src/shared/contracts/settings-api.d.ts +15 -0
- package/dist/host/src/shared/playbackMode.d.ts +2 -0
- package/dist/host/src/shared/plugin/cache-bust.d.ts +8 -0
- package/dist/host/src/shared/plugin/lifecycle.d.ts +217 -0
- package/dist/host/src/shared/plugin/realms/main/index.d.ts +18 -0
- package/dist/host/src/shared/plugin/registry.d.ts +69 -0
- package/dist/host/src/shared/plugin/runtime-state.d.ts +4 -0
- package/dist/host/src/shared/settings/defaults.d.ts +35 -0
- package/dist/host/src/shared/settings/index.d.ts +3 -0
- package/dist/host/src/shared/settings/keys.d.ts +21 -0
- package/dist/host/src/shared/settings/values.d.ts +13 -0
- package/dist/host/src/shared/types/desktop-lyrics.d.ts +61 -0
- package/dist/host/src/shared/types/dui.d.ts +37 -0
- package/dist/host/src/shared/types/input-region.d.ts +6 -0
- package/dist/host/src/shared/types/lyrics.d.ts +15 -0
- package/dist/host/src/shared/types/manage.d.ts +14 -0
- package/dist/host/src/shared/types/menu-surface.d.ts +43 -0
- package/dist/host/src/shared/types/menu.d.ts +29 -0
- package/dist/host/src/shared/types/mini-player.d.ts +97 -0
- package/dist/host/src/shared/types/ncae.d.ts +29 -0
- package/dist/host/src/shared/types/package-download.d.ts +14 -0
- package/dist/host/src/shared/types/playback-mode.d.ts +3 -0
- package/dist/host/src/shared/types/settings.d.ts +9 -0
- package/dist/host/src/shared/types/update.d.ts +6 -0
- package/dist/host/src/shared/util.d.ts +22 -0
- package/dist/index.d.ts +7 -0
- package/dist/plugin-manager/host/src/preload/logger.d.ts +10 -0
- package/dist/plugin-manager/host/src/preload/util.d.ts +1 -0
- package/dist/plugin-manager/host/src/shared/bridge/constants.d.ts +2 -0
- package/dist/plugin-manager/host/src/shared/bridge/endpoint.d.ts +29 -0
- package/dist/plugin-manager/host/src/shared/bridge/hub.d.ts +136 -0
- package/dist/plugin-manager/host/src/shared/bridge/protocol.d.ts +91 -0
- package/dist/plugin-manager/host/src/shared/bridge/routes.d.ts +37 -0
- package/dist/plugin-manager/host/src/shared/contracts/plugin-manager-api.d.ts +223 -0
- package/dist/plugin-manager/host/src/shared/plugin/lifecycle.d.ts +217 -0
- package/dist/plugin-manager/host/src/shared/plugin/realms/common/index.d.ts +34 -0
- package/dist/plugin-manager/host/src/shared/plugin/realms/plugin-manager/index.d.ts +11 -0
- package/dist/plugin-manager/host/src/shared/plugin/registry.d.ts +69 -0
- package/dist/plugin-manager/host/src/shared/util.d.ts +22 -0
- package/dist/plugin-manager/index.d.ts +7 -0
- package/dist/plugin-manager/registry-map.d.ts +16 -0
- package/dist/preload/host/src/constants.d.ts +6 -0
- package/dist/preload/host/src/main/network/types.d.ts +70 -0
- package/dist/preload/host/src/preload/AudioEffectManager.d.ts +124 -0
- package/dist/preload/host/src/preload/MusicRecognizer.d.ts +25 -0
- package/dist/preload/host/src/preload/PlaybackBackend.d.ts +34 -0
- package/dist/preload/host/src/preload/Player.d.ts +229 -0
- package/dist/preload/host/src/preload/YunxinIM.d.ts +15 -0
- package/dist/preload/host/src/preload/audioplayer.d.ts +4 -0
- package/dist/preload/host/src/preload/av3a/Av3aPcmPlayer.d.ts +84 -0
- package/dist/preload/host/src/preload/av3a/bridge.d.ts +21 -0
- package/dist/preload/host/src/preload/av3a/channel.d.ts +40 -0
- package/dist/preload/host/src/preload/av3a/detect.d.ts +6 -0
- package/dist/preload/host/src/preload/backends/Av3aPlaybackBackend.d.ts +32 -0
- package/dist/preload/host/src/preload/backends/MediaPlaybackBackend.d.ts +25 -0
- package/dist/preload/host/src/preload/calls/app.d.ts +1 -0
- package/dist/preload/host/src/preload/calls/audioeffect.d.ts +1 -0
- package/dist/preload/host/src/preload/calls/audioplayer.d.ts +1 -0
- package/dist/preload/host/src/preload/calls/im.d.ts +1 -0
- package/dist/preload/host/src/preload/calls/index.d.ts +6 -0
- package/dist/preload/host/src/preload/calls/network.d.ts +1 -0
- package/dist/preload/host/src/preload/calls/nimsys.d.ts +1 -0
- package/dist/preload/host/src/preload/calls/os.d.ts +1 -0
- package/dist/preload/host/src/preload/calls/player.d.ts +1 -0
- package/dist/preload/host/src/preload/calls/update.d.ts +1 -0
- package/dist/preload/host/src/preload/calls.d.ts +4 -0
- package/dist/preload/host/src/preload/channel.d.ts +1 -0
- package/dist/preload/host/src/preload/logger.d.ts +10 -0
- package/dist/preload/host/src/preload/playbackMode.d.ts +13 -0
- package/dist/preload/host/src/preload/util.d.ts +1 -0
- package/dist/preload/host/src/shared/CallDispatcher.d.ts +12 -0
- package/dist/preload/host/src/shared/bridge/endpoint.d.ts +29 -0
- package/dist/preload/host/src/shared/bridge/hub.d.ts +136 -0
- package/dist/preload/host/src/shared/bridge/protocol.d.ts +91 -0
- package/dist/preload/host/src/shared/bridge/routes.d.ts +37 -0
- package/dist/preload/host/src/shared/contracts/av3a-api.d.ts +50 -0
- package/dist/preload/host/src/shared/contracts/av3a-process.d.ts +56 -0
- package/dist/preload/host/src/shared/contracts/plugin-manager-api.d.ts +223 -0
- package/dist/preload/host/src/shared/playbackMode.d.ts +2 -0
- package/dist/preload/host/src/shared/plugin/lifecycle.d.ts +217 -0
- package/dist/preload/host/src/shared/plugin/realms/common/index.d.ts +34 -0
- package/dist/preload/host/src/shared/plugin/realms/preload/index.d.ts +11 -0
- package/dist/preload/host/src/shared/plugin/registry.d.ts +69 -0
- package/dist/preload/host/src/shared/types/ncae.d.ts +29 -0
- package/dist/preload/host/src/shared/types/playback-mode.d.ts +3 -0
- package/dist/preload/host/src/shared/util.d.ts +22 -0
- package/dist/preload/index.d.ts +7 -0
- package/dist/preload/registry-map.d.ts +43 -0
- package/dist/registry-map.d.ts +164 -0
- package/package.json +73 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import "./app.js";
|
|
2
|
+
import "./audioeffect.js";
|
|
3
|
+
import "./winhelper.js";
|
|
4
|
+
import "./browser.js";
|
|
5
|
+
import "./desktop.js";
|
|
6
|
+
import "./desktoppet.js";
|
|
7
|
+
import "./storage.js";
|
|
8
|
+
import "./musiclibrary.js";
|
|
9
|
+
import "./os.js";
|
|
10
|
+
import "./trayicon.js";
|
|
11
|
+
import "./network.js";
|
|
12
|
+
import "./download.js";
|
|
13
|
+
import "./rtc.js";
|
|
14
|
+
import "./update.js";
|
|
15
|
+
import "./player.js";
|
|
16
|
+
import "./process.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type PlayInfo = {
|
|
2
|
+
songType: "normal";
|
|
3
|
+
albumId: string;
|
|
4
|
+
albumName: string;
|
|
5
|
+
artistName: string;
|
|
6
|
+
playId: string;
|
|
7
|
+
songName: string;
|
|
8
|
+
url: string;
|
|
9
|
+
} | {
|
|
10
|
+
songType: "local";
|
|
11
|
+
artistName: string;
|
|
12
|
+
playId: string;
|
|
13
|
+
songName: string;
|
|
14
|
+
} | {
|
|
15
|
+
songType: "djradio";
|
|
16
|
+
albumId: string;
|
|
17
|
+
albumName: string;
|
|
18
|
+
artistName: string;
|
|
19
|
+
playId: string;
|
|
20
|
+
songName: string;
|
|
21
|
+
url: "";
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IpcMainInvokeEvent } from "electron";
|
|
2
|
+
import CallDispatcher, { CallbackHandlerFunction, HandlerFunction } from "../shared/CallDispatcher.js";
|
|
3
|
+
export declare const dispatcher: CallDispatcher;
|
|
4
|
+
export declare function registerCallHandler<Args extends unknown[], Return extends unknown[] | void>(cmd: string, handler: HandlerFunction<[IpcMainInvokeEvent, ...Args], Return>): void;
|
|
5
|
+
export declare function registerCallbackHandler<Args extends unknown[]>(cmd: string, handler: CallbackHandlerFunction<[IpcMainInvokeEvent, ...Args]>): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./calls/index.js";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as cookie from "cookie";
|
|
2
|
+
export declare function getFullCookies(url: string): Promise<Electron.Cookie[]>;
|
|
3
|
+
export declare function getCookies(url: string): Promise<{
|
|
4
|
+
[k: string]: string;
|
|
5
|
+
}>;
|
|
6
|
+
export declare function removeCookie(url: string, name: string): Promise<void>;
|
|
7
|
+
export declare function setCookie(url: string, setCookieValue: cookie.SetCookie): Promise<void>;
|
|
8
|
+
/**
|
|
9
|
+
* Initializes the cookies.
|
|
10
|
+
*
|
|
11
|
+
* Some cookies are required to be inserted ahead of time, this function will do the job.
|
|
12
|
+
*/
|
|
13
|
+
export default function initializeCookies(): Promise<void>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export declare const ID_XOR_KEY_1: Buffer<ArrayBuffer>;
|
|
2
|
+
export declare const DATA_AES_KEY: Buffer<ArrayBuffer>;
|
|
3
|
+
export declare const SERIAL_AES_KEY: Buffer<ArrayBuffer>;
|
|
4
|
+
export declare const ID3_AES_KEY: Buffer<ArrayBuffer>;
|
|
5
|
+
export declare const EAPI_KEY: Buffer<ArrayBuffer>;
|
|
6
|
+
export declare const EAPI_SEPARATOR = "-36cd479b6b5-";
|
|
7
|
+
/**
|
|
8
|
+
* Encodes an anonymous user ID.
|
|
9
|
+
*
|
|
10
|
+
* Algorithm:
|
|
11
|
+
* 1. XOR each byte of the UTF-8 encoded ID against the repeating key
|
|
12
|
+
* 2. MD5-hash the XORed bytes → 16 raw bytes
|
|
13
|
+
* 3. Base64-encode the raw MD5 digest
|
|
14
|
+
*/
|
|
15
|
+
export declare function encodeAnonymousId(anonymousId: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* Encrypts plaintext using AES-128-ECB + double Base64.
|
|
18
|
+
*
|
|
19
|
+
* Pipeline:
|
|
20
|
+
* plaintext → PKCS#7 pad → AES-128-ECB → Base64 #1 → Base64 #2 (optional)
|
|
21
|
+
*/
|
|
22
|
+
export declare function enData(plaintext: string, key?: Buffer<ArrayBuffer>, doubleBase64?: boolean): string | null;
|
|
23
|
+
/**
|
|
24
|
+
* Decrypts a double-Base64-encoded or buffer AES-128-ECB ciphertext.
|
|
25
|
+
*
|
|
26
|
+
* Pipeline (reversed):
|
|
27
|
+
* Base64 #2 decode → Base64 #1 decode → AES-128-ECB decrypt → PKCS#7 unpad
|
|
28
|
+
*/
|
|
29
|
+
export declare function deData(bufOr2Base64: string | Buffer, key?: Buffer<ArrayBuffer>, doubleBase64?: boolean): Buffer | null;
|
|
30
|
+
/**
|
|
31
|
+
* Encrypts an EAPI request for /eapi/* endpoints.
|
|
32
|
+
*
|
|
33
|
+
* Algorithm:
|
|
34
|
+
* 1. Build signing message: `nobody{path}use{body}md5forencrypt`
|
|
35
|
+
* 2. MD5-hash it → 32-char lowercase hex digest
|
|
36
|
+
* 3. Build plaintext: `{path}-36cd479b6b5-{body}-36cd479b6b5-{digest}`
|
|
37
|
+
* 4. AES-128-ECB encrypt with PKCS#7 auto-padding
|
|
38
|
+
* 5. HEX encode, uppercase → final `params` string
|
|
39
|
+
*/
|
|
40
|
+
export declare function serialData(apiPath: string, body: string | object): string;
|
|
41
|
+
/**
|
|
42
|
+
* Decrypts serialData back to plaintext.
|
|
43
|
+
*/
|
|
44
|
+
export declare function deserialData(hexParams: string | ArrayBuffer): string;
|
|
45
|
+
export declare function chacha20Encrypt(key: Buffer, nonce12: Buffer, initialCounter: number, plaintext: Buffer): Buffer;
|
|
46
|
+
export declare function rawRsaEncrypt(plaintext: Buffer, exponent: bigint, modulus: bigint): Buffer;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Database } from "../../../_native/open-orpheus__database.js";
|
|
2
|
+
import { SqliteDriver } from "@keyv/sqlite";
|
|
3
|
+
export type DatabaseSqliteDriver = SqliteDriver & {
|
|
4
|
+
db: Database;
|
|
5
|
+
};
|
|
6
|
+
export default function createKeyvSqliteDriver(db: Database): DatabaseSqliteDriver;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface DawnEntry {
|
|
2
|
+
time?: string;
|
|
3
|
+
action: string;
|
|
4
|
+
data: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Process dawn-log entries from the NCM web app.
|
|
8
|
+
*
|
|
9
|
+
* Entries are buffered in RAM. When the queue reaches {@link MAX_QUEUE_SIZE}
|
|
10
|
+
* entries they are encrypted into a bundle and queued for upload.
|
|
11
|
+
*
|
|
12
|
+
* If no endpoint has been set via {@link setStatisEndpoint}, bundles simply
|
|
13
|
+
* accumulate in RAM until the endpoint is configured.
|
|
14
|
+
*
|
|
15
|
+
* @param type The statis type — only `"dawn"` entries are processed.
|
|
16
|
+
* @param entries Array of log entries to buffer.
|
|
17
|
+
*/
|
|
18
|
+
export declare function statisV2(type: string, entries: DawnEntry[]): void;
|
|
19
|
+
/**
|
|
20
|
+
* Set the remote upload endpoint and begin periodic uploads.
|
|
21
|
+
*
|
|
22
|
+
* There is no default URL — uploads will not occur until this is called.
|
|
23
|
+
* Typically wired to the `dawn` field from `app.initUrls`.
|
|
24
|
+
*
|
|
25
|
+
* Any bundles queued before calling this function will be uploaded
|
|
26
|
+
* on the next timer tick.
|
|
27
|
+
*
|
|
28
|
+
* @param url The full upload URL.
|
|
29
|
+
* @param referer The Referer URL to be used when uploading.
|
|
30
|
+
*/
|
|
31
|
+
export declare function setStatisEndpoint(url: string, referer?: string): void;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import Emittery from "emittery";
|
|
2
|
+
export type DownloadStartOptions = {
|
|
3
|
+
headers?: Record<string, string>;
|
|
4
|
+
md5?: string;
|
|
5
|
+
size?: number;
|
|
6
|
+
};
|
|
7
|
+
export type DownloadProgress = {
|
|
8
|
+
path: string;
|
|
9
|
+
percent: number;
|
|
10
|
+
total: number;
|
|
11
|
+
downloaded: number;
|
|
12
|
+
speed: number;
|
|
13
|
+
};
|
|
14
|
+
export type DownloadTaskEvents = {
|
|
15
|
+
progress: DownloadProgress;
|
|
16
|
+
end: DownloadProgress;
|
|
17
|
+
error: unknown;
|
|
18
|
+
};
|
|
19
|
+
export declare class DownloadTask extends Emittery<DownloadTaskEvents> {
|
|
20
|
+
url: string;
|
|
21
|
+
path: string;
|
|
22
|
+
options: DownloadStartOptions;
|
|
23
|
+
private hash;
|
|
24
|
+
private fsHandle;
|
|
25
|
+
private request;
|
|
26
|
+
private writeStream;
|
|
27
|
+
private ema;
|
|
28
|
+
private lastTime;
|
|
29
|
+
private lastBytes;
|
|
30
|
+
private static readonly UPDATE_INTERVAL_MS;
|
|
31
|
+
get isPaused(): boolean;
|
|
32
|
+
constructor(url: string, path: string, options: DownloadStartOptions);
|
|
33
|
+
private updateSpeed;
|
|
34
|
+
private errored;
|
|
35
|
+
start(): Promise<void>;
|
|
36
|
+
pause(): void;
|
|
37
|
+
resume(): void;
|
|
38
|
+
cancel(): Promise<void>;
|
|
39
|
+
}
|
|
40
|
+
export default function startDownload(url: string, path: string, options: DownloadStartOptions, start?: boolean): Promise<DownloadTask>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const tempDir: string;
|
|
2
|
+
export declare const downloadTemp: string;
|
|
3
|
+
export declare const streamerTemp: string;
|
|
4
|
+
export declare const data: string;
|
|
5
|
+
export declare const log: string;
|
|
6
|
+
export declare const pack: string;
|
|
7
|
+
export declare const userdata: string;
|
|
8
|
+
export declare const storage: string;
|
|
9
|
+
export declare const wasm: string;
|
|
10
|
+
export declare const aegisPublicKey: string;
|
|
11
|
+
export declare const plugins: string;
|
|
12
|
+
export declare const disableHardwareAccelerationFlag: string;
|
|
13
|
+
export declare const lastWebpackHash: string;
|
|
14
|
+
export declare const defaultCache: string;
|
|
15
|
+
export declare let cache: string;
|
|
16
|
+
export declare let download: string;
|
|
17
|
+
export declare function setCachePath(path: string): void;
|
|
18
|
+
export declare function setDownloadPath(path: string): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export type ID3MusicMetadata = {
|
|
2
|
+
musicId: string;
|
|
3
|
+
musicName: string;
|
|
4
|
+
artist: [string, string][];
|
|
5
|
+
albumId: string;
|
|
6
|
+
album: string;
|
|
7
|
+
albumPicDocId: string;
|
|
8
|
+
albumPic: string;
|
|
9
|
+
bitrate: number;
|
|
10
|
+
mp3DocId: string;
|
|
11
|
+
duration: number;
|
|
12
|
+
mvId: string;
|
|
13
|
+
alias: string[];
|
|
14
|
+
transNames: string[];
|
|
15
|
+
format: string;
|
|
16
|
+
fee: number;
|
|
17
|
+
volumeDelta: number;
|
|
18
|
+
privilege: {
|
|
19
|
+
flag: number;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Convert music metadata JSON string prefixed with `music:` to ID3 comment.
|
|
24
|
+
*
|
|
25
|
+
* @param json
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
28
|
+
export declare function ID3JsonToComment(json: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* Convert ID3 comment to music metadata in JSON string, with `music:` prefix.
|
|
31
|
+
*
|
|
32
|
+
* @param comment
|
|
33
|
+
* @returns
|
|
34
|
+
*/
|
|
35
|
+
export declare function commentToID3Json(comment: string | null): string | null;
|
|
36
|
+
/**
|
|
37
|
+
* Convert ID3 comment to music metadata.
|
|
38
|
+
*
|
|
39
|
+
* @param comment
|
|
40
|
+
* @returns
|
|
41
|
+
*/
|
|
42
|
+
export declare function commentToID3Metadata(comment: string | null): ID3MusicMetadata | null;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { BrowserWindow } from "electron";
|
|
2
|
+
import Emittery from "emittery";
|
|
3
|
+
export type StartupTask = {
|
|
4
|
+
type: "openFile";
|
|
5
|
+
file: string;
|
|
6
|
+
} | {
|
|
7
|
+
type: "openUrl";
|
|
8
|
+
url: string;
|
|
9
|
+
};
|
|
10
|
+
export declare let startupTask: StartupTask | null;
|
|
11
|
+
export declare function setStartupTask(task: StartupTask): void;
|
|
12
|
+
export declare const LifecycleState: {
|
|
13
|
+
readonly Starting: 0;
|
|
14
|
+
readonly MainWindowCreated: 1;
|
|
15
|
+
readonly MainWindowLoaded: 2;
|
|
16
|
+
readonly Started: 3;
|
|
17
|
+
readonly Quitting: 4;
|
|
18
|
+
readonly [x: number]: string;
|
|
19
|
+
};
|
|
20
|
+
export type LifecycleState = 0 | 1 | 2 | 3 | 4;
|
|
21
|
+
export declare namespace LifecycleState {
|
|
22
|
+
type Starting = 0;
|
|
23
|
+
type MainWindowCreated = 1;
|
|
24
|
+
type MainWindowLoaded = 2;
|
|
25
|
+
type Started = 3;
|
|
26
|
+
type Quitting = 4;
|
|
27
|
+
}
|
|
28
|
+
export type LifecycleEvents = {
|
|
29
|
+
/**
|
|
30
|
+
* This event fires when main window has just been created, and the content
|
|
31
|
+
* is not loaded yet.
|
|
32
|
+
*
|
|
33
|
+
* Note that in this event, `mainWindow` is not set yet, but you can get it
|
|
34
|
+
* in the event data.
|
|
35
|
+
*/
|
|
36
|
+
mainwindowcreated: BrowserWindow;
|
|
37
|
+
mainwindowloaded: BrowserWindow;
|
|
38
|
+
/**
|
|
39
|
+
* This event fires when app is fully started and ready.
|
|
40
|
+
*
|
|
41
|
+
* At this point, `mainWindow` should be fully available to use, if not,
|
|
42
|
+
* something's seriously wrong.
|
|
43
|
+
*/
|
|
44
|
+
started: undefined;
|
|
45
|
+
quitting: undefined;
|
|
46
|
+
};
|
|
47
|
+
declare const STATE_EVENT_MAP: {
|
|
48
|
+
readonly 1: "mainwindowcreated";
|
|
49
|
+
readonly 2: "mainwindowloaded";
|
|
50
|
+
readonly 3: "started";
|
|
51
|
+
readonly 4: "quitting";
|
|
52
|
+
};
|
|
53
|
+
export declare const events: Emittery<LifecycleEvents>;
|
|
54
|
+
export declare let state: LifecycleState;
|
|
55
|
+
type StateEventData = {
|
|
56
|
+
[K in keyof typeof STATE_EVENT_MAP]: LifecycleEvents[(typeof STATE_EVENT_MAP)[K] & keyof LifecycleEvents];
|
|
57
|
+
};
|
|
58
|
+
export declare function setLifecycleState<K extends LifecycleState>(lifecycleState: K, ...args: K extends keyof StateEventData ? [undefined] extends [StateEventData[K]] ? [eventData?: StateEventData[K]] : [eventData: StateEventData[K]] : []): void;
|
|
59
|
+
export interface LifecycleOptions {
|
|
60
|
+
/**
|
|
61
|
+
* Upper bound on the whole shutdown sequence, in milliseconds.
|
|
62
|
+
*
|
|
63
|
+
* Overridable so the bounds below can be exercised by tests without waiting
|
|
64
|
+
* out the real budget. This is not a user-facing setting.
|
|
65
|
+
*/
|
|
66
|
+
shutdownDeadlineMs?: number;
|
|
67
|
+
/** Default per-task timeout, in milliseconds. */
|
|
68
|
+
taskTimeoutMs?: number;
|
|
69
|
+
/**
|
|
70
|
+
* Per-finalizer timeout, in milliseconds. Finalizers are outside the shutdown
|
|
71
|
+
* deadline, so this is the only bound they have.
|
|
72
|
+
*/
|
|
73
|
+
finalizerTimeoutMs?: number;
|
|
74
|
+
}
|
|
75
|
+
export interface ShutdownTask {
|
|
76
|
+
/** Stable identifier, used for logging only. */
|
|
77
|
+
name: string;
|
|
78
|
+
/**
|
|
79
|
+
* The work to run. `signal` is aborted when this task's own timeout, or the
|
|
80
|
+
* overall shutdown deadline, is reached, so tasks that own cancellable I/O
|
|
81
|
+
* can stop it instead of being abandoned mid-flight.
|
|
82
|
+
*/
|
|
83
|
+
run: (signal: AbortSignal) => void | Promise<void>;
|
|
84
|
+
/** Defaults to `DEFAULT_TASK_TIMEOUT_MS`. */
|
|
85
|
+
timeoutMs?: number;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Register work to run when the app shuts down.
|
|
89
|
+
*
|
|
90
|
+
* Tasks run in reverse registration order, so a resource registered later is
|
|
91
|
+
* torn down first.
|
|
92
|
+
*/
|
|
93
|
+
export declare function registerShutdownTask(task: ShutdownTask): void;
|
|
94
|
+
/**
|
|
95
|
+
* A last action that must happen however the tasks went.
|
|
96
|
+
*
|
|
97
|
+
* The deadline above exists so that quitting stays bounded, which means a slow
|
|
98
|
+
* task can skip the tasks behind it. For work that is the *point* of the
|
|
99
|
+
* shutdown rather than cleanup — powering the machine off at the end of an
|
|
100
|
+
* auto-exit countdown, say — being skipped silently turns the feature into a
|
|
101
|
+
* lie, so it is registered here instead: finalizers run after every task and
|
|
102
|
+
* after the log buffer is flushed, and the overall deadline does not apply to
|
|
103
|
+
* them.
|
|
104
|
+
*/
|
|
105
|
+
export interface ShutdownFinalizer {
|
|
106
|
+
/** Stable identifier, used for logging only. */
|
|
107
|
+
name: string;
|
|
108
|
+
/**
|
|
109
|
+
* The work to run. Keep it quick and self-contained: everything else is
|
|
110
|
+
* already done by this point, and it is bounded only by `finalizerTimeoutMs`.
|
|
111
|
+
*/
|
|
112
|
+
run: () => void | Promise<void>;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Register a finalizer, described by {@link ShutdownFinalizer}.
|
|
116
|
+
*
|
|
117
|
+
* They run in reverse registration order, like the tasks.
|
|
118
|
+
*/
|
|
119
|
+
export declare function registerShutdownFinalizer(finalizer: ShutdownFinalizer): void;
|
|
120
|
+
/**
|
|
121
|
+
* Wire quitting and signals into the shutdown sequence. Idempotent.
|
|
122
|
+
*
|
|
123
|
+
* Call this as early as possible: it is what makes a signal arriving during
|
|
124
|
+
* startup, before any task is registered, still exit with the right code.
|
|
125
|
+
*/
|
|
126
|
+
export declare function installLifecycle(options?: LifecycleOptions): void;
|
|
127
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import pino from "pino";
|
|
2
|
+
declare const logger: pino.Logger<never, boolean>;
|
|
3
|
+
/**
|
|
4
|
+
* Flush records still buffered in the log transport's worker.
|
|
5
|
+
*
|
|
6
|
+
* The transport writes from a worker thread, so records can still be in flight
|
|
7
|
+
* when the process starts to exit. Synchronous on purpose: it has to work from
|
|
8
|
+
* the shutdown path, where there is no time left to await anything.
|
|
9
|
+
*/
|
|
10
|
+
export declare function flushLogs(): void;
|
|
11
|
+
export default logger;
|
|
12
|
+
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { LyricsStore } from "../../shared/types/lyrics.js";
|
|
2
|
+
import type { TrackInfo } from "../playback/types.js";
|
|
3
|
+
/**
|
|
4
|
+
* The shape NAPI expects for a single timed word.
|
|
5
|
+
*
|
|
6
|
+
* The native struct uses snake_case Rust fields, which napi-rs reports as
|
|
7
|
+
* camelCase properties on the JS side. The conversion helpers below bridge the
|
|
8
|
+
* app's snake_case `LyricsStore` fields to this boundary.
|
|
9
|
+
*/
|
|
10
|
+
export interface DbusLyricsWord {
|
|
11
|
+
text: string;
|
|
12
|
+
startTime: number;
|
|
13
|
+
duration: number;
|
|
14
|
+
}
|
|
15
|
+
/** The shape NAPI expects for a single lyric line. */
|
|
16
|
+
export interface DbusLyricsLine {
|
|
17
|
+
startTime: number;
|
|
18
|
+
endTime: number;
|
|
19
|
+
words: DbusLyricsWord[];
|
|
20
|
+
}
|
|
21
|
+
/** The shape NAPI expects for `setLyrics`. */
|
|
22
|
+
export interface DbusLyricsDocument {
|
|
23
|
+
regular: DbusLyricsLine[];
|
|
24
|
+
perWord?: DbusLyricsLine[];
|
|
25
|
+
translate?: DbusLyricsLine[];
|
|
26
|
+
roma?: DbusLyricsLine[];
|
|
27
|
+
}
|
|
28
|
+
/** The shape NAPI expects for `setTrack`. Duration is in milliseconds. */
|
|
29
|
+
export interface DbusLyricsTrack {
|
|
30
|
+
id: string;
|
|
31
|
+
title: string;
|
|
32
|
+
artist: string;
|
|
33
|
+
album: string;
|
|
34
|
+
duration?: number;
|
|
35
|
+
}
|
|
36
|
+
/** The subset of the native `LyricsService` this adapter needs. */
|
|
37
|
+
export interface LyricsServiceHandle {
|
|
38
|
+
setTrack(track?: DbusLyricsTrack | null): Promise<void>;
|
|
39
|
+
setLyrics(lyrics?: DbusLyricsDocument | null, slogan?: string | null): Promise<void>;
|
|
40
|
+
dispose(): Promise<void>;
|
|
41
|
+
}
|
|
42
|
+
/** The lyrics state this adapter reads from. */
|
|
43
|
+
export interface LyricsSource {
|
|
44
|
+
readonly lyrics: LyricsStore | null;
|
|
45
|
+
readonly slogan: string | null;
|
|
46
|
+
on(event: "lyricsupdate" | "sloganupdate", listener: (event: {
|
|
47
|
+
name: string;
|
|
48
|
+
data: unknown;
|
|
49
|
+
}) => void): () => void;
|
|
50
|
+
}
|
|
51
|
+
/** The playback state this adapter reads from. */
|
|
52
|
+
export interface PlaybackSource {
|
|
53
|
+
readonly snapshot: {
|
|
54
|
+
readonly track: TrackInfo | null;
|
|
55
|
+
readonly duration: number | null;
|
|
56
|
+
};
|
|
57
|
+
on(event: "trackchanged" | "durationchanged", listener: (event: {
|
|
58
|
+
name: string;
|
|
59
|
+
data: unknown;
|
|
60
|
+
}) => void): () => void;
|
|
61
|
+
}
|
|
62
|
+
export interface DbusLyricsServiceOptions {
|
|
63
|
+
service: LyricsServiceHandle;
|
|
64
|
+
lyrics: LyricsSource;
|
|
65
|
+
playback: PlaybackSource;
|
|
66
|
+
/** Reports a failed native update without stopping later updates. */
|
|
67
|
+
onError?: (error: unknown, operation: string) => void;
|
|
68
|
+
}
|
|
69
|
+
/** Map `LyricsStore` onto the native document, preserving optional variants. */
|
|
70
|
+
export declare function toDbusLyricsDocument(store: LyricsStore | null): DbusLyricsDocument | null;
|
|
71
|
+
/** Map a track and its duration (seconds) onto the native track (milliseconds). */
|
|
72
|
+
export declare function toDbusLyricsTrack(track: TrackInfo | null, durationSeconds: number | null): DbusLyricsTrack | null;
|
|
73
|
+
/**
|
|
74
|
+
* Mirrors the current lyrics/track state into the native D-Bus lyrics service.
|
|
75
|
+
*
|
|
76
|
+
* Only existing `LyricsDispatcher` / `PlaybackController` events are used; the
|
|
77
|
+
* adapter never touches the player or the renderer. Writes are serialized so a
|
|
78
|
+
* burst of events cannot land out of order, and identical state is not pushed
|
|
79
|
+
* again.
|
|
80
|
+
*/
|
|
81
|
+
export default class DbusLyricsService {
|
|
82
|
+
private readonly service;
|
|
83
|
+
private readonly lyrics;
|
|
84
|
+
private readonly playback;
|
|
85
|
+
private readonly onError;
|
|
86
|
+
private readonly unsubscribers;
|
|
87
|
+
private queue;
|
|
88
|
+
private disposePromise;
|
|
89
|
+
/** `undefined` is the "never pushed" sentinel. */
|
|
90
|
+
private lastLyrics;
|
|
91
|
+
private lastSlogan;
|
|
92
|
+
private lastTrackKey;
|
|
93
|
+
constructor({ service, lyrics, playback, onError }: DbusLyricsServiceOptions);
|
|
94
|
+
/** Stop listening and close the native service. Idempotent. */
|
|
95
|
+
dispose(): Promise<void>;
|
|
96
|
+
private disposeOnce;
|
|
97
|
+
private refreshLyrics;
|
|
98
|
+
/**
|
|
99
|
+
* Forget the previous track's lyrics before the new track is published.
|
|
100
|
+
*
|
|
101
|
+
* The renderer only sends lyrics while a lyrics consumer is active, so the
|
|
102
|
+
* dispatcher can still hold the previous song's lyrics when the track
|
|
103
|
+
* changes. The dispatcher clears them too, but that happens from its own
|
|
104
|
+
* event listener; clearing here synchronously guarantees the D-Bus writes
|
|
105
|
+
* are queued in the safe order: clear first, then the new track.
|
|
106
|
+
*/
|
|
107
|
+
private clearLyrics;
|
|
108
|
+
private refreshTrack;
|
|
109
|
+
/**
|
|
110
|
+
* Append a write to the serial queue. A failure is reported and swallowed so
|
|
111
|
+
* one broken update cannot wedge every later one.
|
|
112
|
+
*/
|
|
113
|
+
private enqueue;
|
|
114
|
+
private reportError;
|
|
115
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import Emittery from "emittery";
|
|
2
|
+
import { LyricsStore } from "../../shared/types/lyrics.js";
|
|
3
|
+
export type LyricsDispatcherEvents = {
|
|
4
|
+
lyricsupdate: LyricsStore | null;
|
|
5
|
+
sloganupdate: string | null;
|
|
6
|
+
playstateupdate: boolean;
|
|
7
|
+
timeupdate: number;
|
|
8
|
+
playbackratechange: number;
|
|
9
|
+
};
|
|
10
|
+
export default class LyricsDispatcher extends Emittery<LyricsDispatcherEvents> {
|
|
11
|
+
private _lyrics;
|
|
12
|
+
private _slogan;
|
|
13
|
+
private _playState;
|
|
14
|
+
private _time;
|
|
15
|
+
private _playbackRate;
|
|
16
|
+
get lyrics(): LyricsStore | null;
|
|
17
|
+
set lyrics(value: LyricsStore | null);
|
|
18
|
+
get slogan(): string | null;
|
|
19
|
+
set slogan(value: string | null);
|
|
20
|
+
get playState(): boolean;
|
|
21
|
+
set playState(value: boolean);
|
|
22
|
+
get time(): number;
|
|
23
|
+
set time(value: number);
|
|
24
|
+
get playbackRate(): number;
|
|
25
|
+
set playbackRate(value: number);
|
|
26
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import DbusLyricsService from "./DbusLyricsService.js";
|
|
2
|
+
/** The well-known name that owns the app's custom D-Bus services. */
|
|
3
|
+
export declare const DBUS_LYRICS_BUS_NAME = "io.github.yucling.OpenOrpheus";
|
|
4
|
+
/** The object path of the lyrics service. */
|
|
5
|
+
export declare const DBUS_LYRICS_OBJECT_PATH = "/io/github/yucling/OpenOrpheus/Lyrics";
|
|
6
|
+
/** The lyrics D-Bus interface. */
|
|
7
|
+
export declare const DBUS_LYRICS_INTERFACE = "io.github.yucling.OpenOrpheus.Lyrics";
|
|
8
|
+
/**
|
|
9
|
+
* Start the D-Bus lyrics service.
|
|
10
|
+
*
|
|
11
|
+
* Linux only: `@open-orpheus/dbus` is a Linux native module. The listener
|
|
12
|
+
* wiring is event-driven, so an idle app does no periodic work. Failures are
|
|
13
|
+
* logged and reported as `null` rather than aborting startup — the rest of the
|
|
14
|
+
* app (and MPRIS) must keep working without a session bus.
|
|
15
|
+
*/
|
|
16
|
+
export declare function createDbusLyricsService(): Promise<DbusLyricsService | null>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Lyrics } from "../../shared/types/lyrics.js";
|
|
2
|
+
/**
|
|
3
|
+
* Parse an LRC string into {@link Lyrics}.
|
|
4
|
+
*
|
|
5
|
+
* Each `[mm:ss.xx]` line becomes a {@link LyricsLine} with a single
|
|
6
|
+
* {@link LyricWord} spanning the entire line (plain LRC has no per-word
|
|
7
|
+
* timing). `end_time` is inferred from the next line's `start_time`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function parseLrc(lrc: string): Lyrics;
|
|
10
|
+
/**
|
|
11
|
+
* Parse a YRC (per-character lyrics) string into {@link Lyrics}.
|
|
12
|
+
*
|
|
13
|
+
* Format:
|
|
14
|
+
* `[line_start_ms, line_duration_ms](char_start_ms, char_duration_ms, flag)字...`
|
|
15
|
+
*
|
|
16
|
+
* Each line opens with a `[start, duration]` header (both in milliseconds)
|
|
17
|
+
* followed by zero or more per-character `(start, duration, flag)` tuples.
|
|
18
|
+
* The character itself immediately follows the closing parenthesis.
|
|
19
|
+
* `start_time` on each {@link LyricWord} is stored relative to its line.
|
|
20
|
+
*/
|
|
21
|
+
export declare function parseYrc(yrc: string): Lyrics;
|