@open-orpheus/plugin-api 0.0.0-stage → 0.0.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/dist/host/_native/open-orpheus__database.d.ts +50 -0
- package/dist/host/_native/open-orpheus__window.d.ts +266 -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/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/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/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 +118 -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/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 +12 -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 +69 -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 +6 -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 +39 -0
- package/dist/host/src/main/plugin/discover.d.ts +36 -0
- package/dist/host/src/main/plugin/index.d.ts +12 -0
- package/dist/host/src/main/plugin/loader.d.ts +43 -0
- package/dist/host/src/main/plugin/manager.d.ts +15 -0
- package/dist/host/src/main/plugin/metadata.d.ts +24 -0
- package/dist/host/src/main/plugin/state.d.ts +17 -0
- package/dist/host/src/main/plugin/tree.d.ts +13 -0
- package/dist/host/src/main/plugin/types.d.ts +18 -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 +6 -0
- package/dist/host/src/main/shortcuts.d.ts +10 -0
- package/dist/host/src/main/shutdown.d.ts +32 -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/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 +294 -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.d.ts +5 -0
- package/dist/host/src/main/xeapi.d.ts +53 -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 +221 -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/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/desktop-lyrics-api.d.ts +23 -0
- package/dist/host/src/shared/contracts/input-region-api.d.ts +6 -0
- package/dist/host/src/shared/contracts/lyrics-api.d.ts +11 -0
- package/dist/host/src/shared/contracts/manage-api.d.ts +33 -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 +34 -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/registry.d.ts +32 -0
- package/dist/host/src/shared/types/desktop-lyrics.d.ts +44 -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 +90 -0
- package/dist/host/src/shared/types/ncae.d.ts +21 -0
- package/dist/host/src/shared/types/package-download.d.ts +6 -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/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 +221 -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/playbackMode.d.ts +13 -0
- package/dist/preload/host/src/preload/plugin/types.d.ts +18 -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/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/playbackMode.d.ts +2 -0
- package/dist/preload/host/src/shared/plugin/registry.d.ts +32 -0
- package/dist/preload/host/src/shared/types/ncae.d.ts +21 -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 +36 -0
- package/dist/registry-map.d.ts +145 -0
- package/package.json +58 -4
- package/README.md +0 -3
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare function toError(error: unknown): Error;
|
|
2
|
+
/**
|
|
3
|
+
* Get or set the image size of a Netease CDN URL.
|
|
4
|
+
*
|
|
5
|
+
* To get, leave `sizeOrWidth` and `height` empty.
|
|
6
|
+
* To set, set `sizeOrWidth` and/or `height`.
|
|
7
|
+
*
|
|
8
|
+
* @param url
|
|
9
|
+
* @param sizeOrWidth If provided, sets the image size or width
|
|
10
|
+
* @param height If provided, use this as the height, or `sizeOrWidth` will be used for height
|
|
11
|
+
*/
|
|
12
|
+
export declare function imageSize(url: string): [number, number] | null;
|
|
13
|
+
export declare function imageSize(url: string, sizeOrWidth: number, height?: number): string;
|
|
14
|
+
/** Convert dB to linear gain. */
|
|
15
|
+
export declare function dbToGain(db: number): number;
|
|
16
|
+
/**
|
|
17
|
+
* Convert volume (0-1) to linear gain, logarithmic mapping.
|
|
18
|
+
*
|
|
19
|
+
* @param input
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
export declare function volumeToGain(input: number, minDb?: number): number;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// AUTO-GENERATED by packages/plugin-api/scripts/build.ts. Do not edit.
|
|
2
|
+
// The plugin-facing type surface. Generated from the host; contains no
|
|
3
|
+
// references back to the host repository.
|
|
4
|
+
|
|
5
|
+
export type { PluginModule, PluginRuntime } from "./host/src/main/plugin/types";
|
|
6
|
+
export type { PluginRegistry, Registry } from "./host/src/shared/plugin/registry";
|
|
7
|
+
export type { RegistryLoad } from "./registry-map";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const BUILD: string;
|
|
2
|
+
export declare const VERSION: string;
|
|
3
|
+
export declare const CORE_VERSION: string;
|
|
4
|
+
export declare const NATIVE_VERSION = "60316";
|
|
5
|
+
export declare const SECRET_KEY = "7ada0f7ccadbe165e6e7fbe01113f4df";
|
|
6
|
+
export declare const OSVER = "Microsoft-Windows-11--build-22631-64bit";
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export interface NetworkFetchRequest {
|
|
2
|
+
url: string;
|
|
3
|
+
method: string;
|
|
4
|
+
headers?: Record<string, string>;
|
|
5
|
+
body?: string | Buffer;
|
|
6
|
+
isDecrypt?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* How many retries the network client may perform after the first attempt.
|
|
9
|
+
* `0` disables retries; omit it to use the default.
|
|
10
|
+
*
|
|
11
|
+
* The client only retries idempotent methods (GET, HEAD, …): `POST` requests
|
|
12
|
+
* are never retried, so this field has no effect on them.
|
|
13
|
+
*/
|
|
14
|
+
retryCount?: number;
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
}
|
|
17
|
+
export interface NetworkFetchResponse {
|
|
18
|
+
code: number;
|
|
19
|
+
error: string;
|
|
20
|
+
blob: string;
|
|
21
|
+
headers: Record<string, string>;
|
|
22
|
+
status: number;
|
|
23
|
+
retryTimes: number;
|
|
24
|
+
globalSucCount: number;
|
|
25
|
+
globalFailCount: number;
|
|
26
|
+
}
|
|
27
|
+
export interface GlobalStats {
|
|
28
|
+
globalSucCount: number;
|
|
29
|
+
globalFailCount: number;
|
|
30
|
+
}
|
|
31
|
+
export interface InterceptorState {
|
|
32
|
+
stats: GlobalStats;
|
|
33
|
+
tags: Record<string, unknown>;
|
|
34
|
+
}
|
|
35
|
+
export interface RequestContext {
|
|
36
|
+
request: NetworkFetchRequest;
|
|
37
|
+
state: InterceptorState;
|
|
38
|
+
/**
|
|
39
|
+
* Perform the request now, bypassing the rest of the request pipeline.
|
|
40
|
+
*
|
|
41
|
+
* The pipeline reuses the most recent execution as its response instead of
|
|
42
|
+
* running the request a second time, unless a `respondWith` response is set
|
|
43
|
+
* (a later `respondWith` overrides it). Only the last call is reused; earlier
|
|
44
|
+
* executions are not cancelled.
|
|
45
|
+
*
|
|
46
|
+
* Catching a rejection here does not make the request succeed: the pipeline
|
|
47
|
+
* still fails unless `respondWith` provides a fallback response.
|
|
48
|
+
*/
|
|
49
|
+
execute(this: void, req?: NetworkFetchRequest): Promise<Partial<NetworkFetchResponse>>;
|
|
50
|
+
/** Respond with a synthetic response; the pipeline stops running further interceptors. */
|
|
51
|
+
respondWith(this: void, response: Partial<NetworkFetchResponse>): void;
|
|
52
|
+
}
|
|
53
|
+
export interface ResponseContext {
|
|
54
|
+
request: NetworkFetchRequest;
|
|
55
|
+
state: InterceptorState;
|
|
56
|
+
response: NetworkFetchResponse;
|
|
57
|
+
synthetic: boolean;
|
|
58
|
+
}
|
|
59
|
+
export interface ErrorContext {
|
|
60
|
+
request: NetworkFetchRequest;
|
|
61
|
+
state: InterceptorState;
|
|
62
|
+
error: unknown;
|
|
63
|
+
}
|
|
64
|
+
export interface NetworkInterceptor {
|
|
65
|
+
name: string;
|
|
66
|
+
onRequest?(ctx: RequestContext): Promise<void> | void;
|
|
67
|
+
onResponse?(ctx: ResponseContext): Promise<void> | void;
|
|
68
|
+
onError?(ctx: ErrorContext): Promise<void> | void;
|
|
69
|
+
}
|
|
70
|
+
export type NetworkExecutor = (request: NetworkFetchRequest, state: InterceptorState) => Promise<Partial<NetworkFetchResponse>>;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/** A PEQ band (0–8). Presence in the `setPeqBands` array = active. */
|
|
2
|
+
export interface PeqBand {
|
|
3
|
+
band: number;
|
|
4
|
+
freq?: number;
|
|
5
|
+
gain?: number;
|
|
6
|
+
q?: number;
|
|
7
|
+
type?: number;
|
|
8
|
+
}
|
|
9
|
+
export default class AudioEffectManager {
|
|
10
|
+
private enabled;
|
|
11
|
+
private ctx;
|
|
12
|
+
/** Entry point — external source connects here */
|
|
13
|
+
input: GainNode;
|
|
14
|
+
/** Exit point — connects to destination */
|
|
15
|
+
output: GainNode;
|
|
16
|
+
private readonly bassFilter;
|
|
17
|
+
private readonly trebleFilter;
|
|
18
|
+
private readonly eqBands;
|
|
19
|
+
private readonly eqTail;
|
|
20
|
+
private _workletNode;
|
|
21
|
+
private readonly compressorNode;
|
|
22
|
+
private readonly limiterNode;
|
|
23
|
+
private readonly peqBands;
|
|
24
|
+
private readonly peqTail;
|
|
25
|
+
private readonly peqGainNode;
|
|
26
|
+
private readonly convolverNode;
|
|
27
|
+
private convolverLoadSerial;
|
|
28
|
+
private readonly slots;
|
|
29
|
+
private readonly pendingSlotStates;
|
|
30
|
+
private readonly _workletPromise;
|
|
31
|
+
constructor(ctx: AudioContext);
|
|
32
|
+
/**
|
|
33
|
+
* Resolves when the audio-effect worklet module has been loaded and the
|
|
34
|
+
* AudioWorkletNode is ready. Safe to await before activating the worklet
|
|
35
|
+
* slot.
|
|
36
|
+
*/
|
|
37
|
+
get workletReady(): Promise<void>;
|
|
38
|
+
private _initWorklet;
|
|
39
|
+
/**
|
|
40
|
+
* Set if the audio effects should be enabled.
|
|
41
|
+
*
|
|
42
|
+
* @param enabled Should audio effects be enabled.
|
|
43
|
+
*/
|
|
44
|
+
setEnabled(enabled: boolean): void;
|
|
45
|
+
/**
|
|
46
|
+
* Set the 10-band graphic equalizer.
|
|
47
|
+
*
|
|
48
|
+
* @param eq Array of 10 gain values (dB), index-mapped to
|
|
49
|
+
* `[31, 63, 125, 250, 500, 1k, 2k, 4k, 8k, 16k]` Hz.
|
|
50
|
+
* Pass `null` to bypass the EQ stage entirely.
|
|
51
|
+
*/
|
|
52
|
+
setEqualizers(eq: number[] | null): void;
|
|
53
|
+
/**
|
|
54
|
+
* Set bass gain (low-shelf).
|
|
55
|
+
*
|
|
56
|
+
* @param bass Gain in dB, range -10 … +10.
|
|
57
|
+
* Pass `0` to bypass the bass stage.
|
|
58
|
+
*/
|
|
59
|
+
setBass(bass: number): void;
|
|
60
|
+
/**
|
|
61
|
+
* Set treble gain (high-shelf).
|
|
62
|
+
*
|
|
63
|
+
* @param treble Gain in dB, range -10 … +10.
|
|
64
|
+
* Pass `0` to bypass the treble stage.
|
|
65
|
+
*/
|
|
66
|
+
setTreble(treble: number): void;
|
|
67
|
+
/**
|
|
68
|
+
* The underlying AudioWorkletNode, or `null` if the module hasn't loaded
|
|
69
|
+
* yet or failed to load.
|
|
70
|
+
*/
|
|
71
|
+
get workletNode(): AudioWorkletNode | null;
|
|
72
|
+
/**
|
|
73
|
+
* Send a parameter update to the audio-effect worklet.
|
|
74
|
+
*
|
|
75
|
+
* Safe to call before the worklet is ready — the message is queued and
|
|
76
|
+
* delivered once the node is available.
|
|
77
|
+
*
|
|
78
|
+
* @param data Arbitrary structured-cloneable payload forwarded to the
|
|
79
|
+
* worklet's `port.onmessage` handler.
|
|
80
|
+
*/
|
|
81
|
+
postWorkletMessage(data: unknown): void;
|
|
82
|
+
/**
|
|
83
|
+
* Activate or bypass the WASM worklet slot.
|
|
84
|
+
*
|
|
85
|
+
* Call this whenever worklet-backed effects (SE, rotate, ER, FDN)
|
|
86
|
+
* are enabled or disabled.
|
|
87
|
+
*/
|
|
88
|
+
setWorkletActive(on: boolean): void;
|
|
89
|
+
/**
|
|
90
|
+
* Set PEQ bands. Pass `[]` or an empty array to bypass PEQ entirely.
|
|
91
|
+
* Each band's optional fields (`freq`, `gain`, `q`, `type`) preserve
|
|
92
|
+
* the current value when omitted.
|
|
93
|
+
*/
|
|
94
|
+
setPeqBands(bands: PeqBand[]): void;
|
|
95
|
+
/** Set overall PEQ output gain in dB. */
|
|
96
|
+
setPeqGain(gainDb: number): void;
|
|
97
|
+
/** Toggle the dynamics compressor. */
|
|
98
|
+
setCompressorEnabled(on: boolean): void;
|
|
99
|
+
/** Toggle the peak limiter. */
|
|
100
|
+
setLimiterEnabled(on: boolean): void;
|
|
101
|
+
/**
|
|
102
|
+
* Load a WAV impulse response into the convolution reverb.
|
|
103
|
+
*
|
|
104
|
+
* The WAV buffer is decoded asynchronously via `decodeAudioData`.
|
|
105
|
+
* On success, the convolver is activated as an optional FIR effect slot.
|
|
106
|
+
*
|
|
107
|
+
* @param wavBuffer Raw RIFF/WAVE bytes (e.g. from NCAE type 2 payload).
|
|
108
|
+
*/
|
|
109
|
+
setConvolutionIR(wavBuffer: Uint8Array): Promise<void>;
|
|
110
|
+
/** Remove the current convolution impulse response. */
|
|
111
|
+
clearConvolutionIR(): void;
|
|
112
|
+
/** Toggle a slot. Rebuilds the chain only when the active state actually changes. */
|
|
113
|
+
private setSlotActive;
|
|
114
|
+
private addSlot;
|
|
115
|
+
/**
|
|
116
|
+
* Rebuild the entire effect chain from scratch.
|
|
117
|
+
*
|
|
118
|
+
* Signal flow:
|
|
119
|
+
* input → [active slots in order] → output
|
|
120
|
+
*
|
|
121
|
+
* When no slots are active the chain is simply input → output.
|
|
122
|
+
*/
|
|
123
|
+
private rebuildChain;
|
|
124
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import Emittery from "emittery";
|
|
2
|
+
export type MusicRecognizeResult = {
|
|
3
|
+
code: number;
|
|
4
|
+
duration: number;
|
|
5
|
+
httpmsg: string | object;
|
|
6
|
+
recordtime: number;
|
|
7
|
+
responsetime: number;
|
|
8
|
+
sessionId: string;
|
|
9
|
+
times: number;
|
|
10
|
+
};
|
|
11
|
+
export type MusicRecognizerEvents = {
|
|
12
|
+
result: MusicRecognizeResult;
|
|
13
|
+
};
|
|
14
|
+
export default class MusicRecognizer extends Emittery<MusicRecognizerEvents> {
|
|
15
|
+
sampleRate: number;
|
|
16
|
+
duration: number;
|
|
17
|
+
interval: number;
|
|
18
|
+
private state;
|
|
19
|
+
start(): Promise<MusicRecognizeResult | null>;
|
|
20
|
+
stop(): void;
|
|
21
|
+
private match;
|
|
22
|
+
private fail;
|
|
23
|
+
private finish;
|
|
24
|
+
private cleanup;
|
|
25
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { AudioPlayInfo } from "./Player";
|
|
2
|
+
/**
|
|
3
|
+
* The uniform media events a playback backend raises. `Player` re-emits these
|
|
4
|
+
* as its typed `PlayerEvents`, so consumers never touch the underlying engine.
|
|
5
|
+
* `load` is the backend's readiness signal ("can play now").
|
|
6
|
+
*/
|
|
7
|
+
export type PlaybackEventName = "load" | "play" | "playing" | "pause" | "ended" | "error" | "stalled" | "seeking" | "seeked" | "timeupdate" | "durationchange" | "ratechange";
|
|
8
|
+
/** Callback through which a backend reports media events to `Player`. */
|
|
9
|
+
export type PlaybackEventSink = (name: PlaybackEventName, data?: unknown) => void;
|
|
10
|
+
/**
|
|
11
|
+
* A playback engine behind `Player`'s media surface: either the hidden
|
|
12
|
+
* `<audio>` element or the AV3A decode backend. `Player` holds whichever is
|
|
13
|
+
* active and delegates every transport/state call to it; it never branches on
|
|
14
|
+
* which one it is.
|
|
15
|
+
*/
|
|
16
|
+
export interface PlaybackBackend {
|
|
17
|
+
/** Node feeding the effect chain and audio-data capture (null until ready). */
|
|
18
|
+
readonly sourceNode: AudioNode | null;
|
|
19
|
+
/** Start playing `playInfo`. Raises `load` when playback can start. */
|
|
20
|
+
load(playInfo: AudioPlayInfo): Promise<void>;
|
|
21
|
+
play(): Promise<void>;
|
|
22
|
+
pause(): void;
|
|
23
|
+
stop(): void;
|
|
24
|
+
/** Seek to a content time in seconds. */
|
|
25
|
+
seek(seconds: number): void;
|
|
26
|
+
readonly currentTime: number;
|
|
27
|
+
readonly duration: number;
|
|
28
|
+
readonly paused: boolean;
|
|
29
|
+
readonly ended: boolean;
|
|
30
|
+
readonly playbackRate: number;
|
|
31
|
+
setPlaybackRate(rate: number): void;
|
|
32
|
+
/** Release resources (media source / decode session). */
|
|
33
|
+
dispose(): Promise<void>;
|
|
34
|
+
}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import Emittery from "emittery";
|
|
2
|
+
import AudioEffectManager from "./AudioEffectManager";
|
|
3
|
+
export declare enum AudioPlayerState {
|
|
4
|
+
Null = 0,
|
|
5
|
+
Playing = 1,
|
|
6
|
+
Paused = 2,
|
|
7
|
+
Error = 3
|
|
8
|
+
}
|
|
9
|
+
export type SongInfo = {
|
|
10
|
+
playId: string;
|
|
11
|
+
songName: string;
|
|
12
|
+
artistName: string;
|
|
13
|
+
albumId: string;
|
|
14
|
+
albumName: string;
|
|
15
|
+
songType: string;
|
|
16
|
+
artworkUrl: string;
|
|
17
|
+
cover: string;
|
|
18
|
+
totalTime: number;
|
|
19
|
+
liked: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type LyricContent = {
|
|
22
|
+
krc: string;
|
|
23
|
+
lrc: string;
|
|
24
|
+
romalrc: string;
|
|
25
|
+
tlrc: string;
|
|
26
|
+
yrc: string;
|
|
27
|
+
};
|
|
28
|
+
export type PlaylistItem = {
|
|
29
|
+
id: string;
|
|
30
|
+
from: string;
|
|
31
|
+
title: string;
|
|
32
|
+
track_id: string;
|
|
33
|
+
program: unknown | null;
|
|
34
|
+
mv: string;
|
|
35
|
+
album: string;
|
|
36
|
+
artist: string;
|
|
37
|
+
alias: string;
|
|
38
|
+
cloud: number;
|
|
39
|
+
};
|
|
40
|
+
export type Playlist = {
|
|
41
|
+
items: PlaylistItem[];
|
|
42
|
+
currentPlay: string;
|
|
43
|
+
};
|
|
44
|
+
export type AudioPlayInfo = {
|
|
45
|
+
playId: string;
|
|
46
|
+
aiprocessorRatio: number;
|
|
47
|
+
destLevel: string;
|
|
48
|
+
songId: string;
|
|
49
|
+
songQuality: "standard" | "exhigh" | "hires" | "jyeffect" | "vivid" | "sky" | "jymaster" | string;
|
|
50
|
+
} & ({
|
|
51
|
+
type: 0;
|
|
52
|
+
bitrate: "exhigh" | "hires" | string;
|
|
53
|
+
path: string;
|
|
54
|
+
playbrt: number;
|
|
55
|
+
} | {
|
|
56
|
+
type: 4;
|
|
57
|
+
songId: string;
|
|
58
|
+
audioFormat: "m4a" | "flac" | "av3a" | string;
|
|
59
|
+
audioType: "track" | string;
|
|
60
|
+
bitrate: number;
|
|
61
|
+
br: string;
|
|
62
|
+
expireTime: number;
|
|
63
|
+
extHeader: string;
|
|
64
|
+
fileSize: number;
|
|
65
|
+
format: unknown;
|
|
66
|
+
freeTrialInfo: unknown | null;
|
|
67
|
+
freeTrialPrivilege: {
|
|
68
|
+
resConsumable: boolean;
|
|
69
|
+
userConsumable: boolean;
|
|
70
|
+
listenType: unknown | null;
|
|
71
|
+
playReason: unknown | null;
|
|
72
|
+
cannotListenReason: unknown | null;
|
|
73
|
+
freeLimitTagType: unknown | null;
|
|
74
|
+
};
|
|
75
|
+
level: string;
|
|
76
|
+
md5: string;
|
|
77
|
+
playInfoStr: string;
|
|
78
|
+
podcastCtrp: unknown | null;
|
|
79
|
+
rightSource: number;
|
|
80
|
+
songDuration: string;
|
|
81
|
+
musicurl: string;
|
|
82
|
+
});
|
|
83
|
+
export type PlayerEvents = {
|
|
84
|
+
volumechange: number;
|
|
85
|
+
audiodata: {
|
|
86
|
+
data: ArrayBuffer;
|
|
87
|
+
pts: number;
|
|
88
|
+
};
|
|
89
|
+
lyricstyleupdate: {
|
|
90
|
+
key: string | symbol;
|
|
91
|
+
value: unknown;
|
|
92
|
+
};
|
|
93
|
+
playinfoupdate: AudioPlayInfo;
|
|
94
|
+
load: {
|
|
95
|
+
id: string;
|
|
96
|
+
};
|
|
97
|
+
play: undefined;
|
|
98
|
+
playing: undefined;
|
|
99
|
+
pause: undefined;
|
|
100
|
+
ended: undefined;
|
|
101
|
+
/** Decode error (Error, AV3A) or a media-element error event. */
|
|
102
|
+
error: Error | Event;
|
|
103
|
+
stalled: undefined;
|
|
104
|
+
seeking: undefined;
|
|
105
|
+
seeked: undefined;
|
|
106
|
+
timeupdate: undefined;
|
|
107
|
+
durationchange: undefined;
|
|
108
|
+
ratechange: undefined;
|
|
109
|
+
};
|
|
110
|
+
export default class Player extends Emittery<PlayerEvents> {
|
|
111
|
+
private _audioCtx;
|
|
112
|
+
private _audioEffectManager;
|
|
113
|
+
private _honeyPotPromise;
|
|
114
|
+
private _media;
|
|
115
|
+
private _av3a;
|
|
116
|
+
private _backend;
|
|
117
|
+
private _playInfo;
|
|
118
|
+
/**
|
|
119
|
+
* The user's desired playing state: the last explicit transport command
|
|
120
|
+
* (`play`/`pause`/`stop`). Device-change recovery reads it to decide whether
|
|
121
|
+
* an interruption should be undone.
|
|
122
|
+
*
|
|
123
|
+
* Only a transport command writes it, and only before that command awaits.
|
|
124
|
+
* The backend pause a sink change causes is an interruption, not intent, so
|
|
125
|
+
* deriving intent from `paused` mid-switch is what let a second switch erase
|
|
126
|
+
* the intent the first one was going to restore.
|
|
127
|
+
*
|
|
128
|
+
* `_intentSeq` bumps with every command, so a caller that had to await can
|
|
129
|
+
* tell that a newer command took over while it waited.
|
|
130
|
+
*/
|
|
131
|
+
private _desiredPlayingState;
|
|
132
|
+
private _intentSeq;
|
|
133
|
+
/**
|
|
134
|
+
* Sink switches currently awaiting `setSinkId`. Overlapping switches observe
|
|
135
|
+
* the same transient pause, so only the last one to settle restores playback
|
|
136
|
+
* (an earlier one would resume in the middle of a newer device change).
|
|
137
|
+
*/
|
|
138
|
+
private _sinkSwitchesInFlight;
|
|
139
|
+
private _volume;
|
|
140
|
+
/**
|
|
141
|
+
* Monotonic sequence for `load` requests; only the newest request may win.
|
|
142
|
+
* Sniffing (local format detection) and engine disposal are async, so an
|
|
143
|
+
* older request could otherwise resume after a newer one finished and
|
|
144
|
+
* overwrite it (stale load replacing the freshly chosen song). Each `load`
|
|
145
|
+
* claims a sequence at entry and drops itself once stale, checked at every
|
|
146
|
+
* await boundary before it mutates state or notifies main.
|
|
147
|
+
*/
|
|
148
|
+
private loadRequestSeq;
|
|
149
|
+
get audioContext(): AudioContext;
|
|
150
|
+
get currentTime(): number;
|
|
151
|
+
set currentTime(value: number);
|
|
152
|
+
get duration(): number;
|
|
153
|
+
get paused(): boolean;
|
|
154
|
+
get ended(): boolean;
|
|
155
|
+
get playbackRate(): number;
|
|
156
|
+
set playbackRate(value: number);
|
|
157
|
+
get isAv3aActive(): boolean;
|
|
158
|
+
get gainNode(): GainNode;
|
|
159
|
+
get currentId(): string;
|
|
160
|
+
get currentPlayInfo(): AudioPlayInfo | null;
|
|
161
|
+
get volume(): number;
|
|
162
|
+
set volume(value: number);
|
|
163
|
+
get replayGain(): GainNode;
|
|
164
|
+
/**
|
|
165
|
+
* The audio effect manager of the player.
|
|
166
|
+
*
|
|
167
|
+
* Note that its input is currently being used as replay gain, and
|
|
168
|
+
* its output is currently being used as volume gain.
|
|
169
|
+
*/
|
|
170
|
+
get audioEffectManager(): AudioEffectManager;
|
|
171
|
+
constructor();
|
|
172
|
+
private ensureAudioContextState;
|
|
173
|
+
/**
|
|
174
|
+
* Record a transport command as the user's intent and return that intent's
|
|
175
|
+
* epoch. A caller that must await before acting compares the epoch
|
|
176
|
+
* afterwards: a different value means a newer command owns playback, so the
|
|
177
|
+
* caller must not force its now-stale intent onto the backend.
|
|
178
|
+
*/
|
|
179
|
+
private claimPlaybackIntent;
|
|
180
|
+
/** Whether no transport command has changed the intent since `epoch`. */
|
|
181
|
+
private isIntentCurrent;
|
|
182
|
+
/**
|
|
183
|
+
* Whether `playInfo` should play through the AV3A decode backend. URL av3a
|
|
184
|
+
* is signalled by `audioFormat`; a local file's codec is not part of the
|
|
185
|
+
* play info, so it is sniffed (in main, which owns `fs`).
|
|
186
|
+
*/
|
|
187
|
+
private resolveAv3a;
|
|
188
|
+
/**
|
|
189
|
+
* Switch the output device.
|
|
190
|
+
*
|
|
191
|
+
* The switch can transiently suspend the audio context, and `statechange`
|
|
192
|
+
* turns a suspended context into a backend pause, so a device change can stop
|
|
193
|
+
* playback without the user asking. Undo that here, without ever overriding a
|
|
194
|
+
* transport command issued while the switch was in flight.
|
|
195
|
+
*/
|
|
196
|
+
setSinkId(sinkId: string): Promise<void>;
|
|
197
|
+
load(playInfo: AudioPlayInfo): Promise<void>;
|
|
198
|
+
play(): Promise<void>;
|
|
199
|
+
/**
|
|
200
|
+
* Claim the playback intent, wait for the audio context, then start the
|
|
201
|
+
* backend.
|
|
202
|
+
*
|
|
203
|
+
* The claim happens before the wait, so a pause/stop/play issued meanwhile
|
|
204
|
+
* wins: this call drops out instead of starting a stale play — possibly on a
|
|
205
|
+
* different song. `mayStart` is checked last and covers conditions that are
|
|
206
|
+
* not a change of intent; sink-change recovery uses it to hand a resume over
|
|
207
|
+
* to a switch that started while the context was resuming. That switch
|
|
208
|
+
* re-reads the intent claimed here when it settles, so it restores playback
|
|
209
|
+
* itself and nothing is lost by dropping out.
|
|
210
|
+
*/
|
|
211
|
+
private playWhen;
|
|
212
|
+
pause(): void;
|
|
213
|
+
stop(): void;
|
|
214
|
+
setAudioDataEnabled(enabled: boolean): Promise<void>;
|
|
215
|
+
/**
|
|
216
|
+
* Route a media event from `source` into the typed Player event stream, but
|
|
217
|
+
* only when `source` is the currently active backend (so a retired backend's
|
|
218
|
+
* late events never leak through).
|
|
219
|
+
*/
|
|
220
|
+
private onBackendEvent;
|
|
221
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default class YunxinIM extends EventTarget {
|
|
2
|
+
static APP_KEY: string;
|
|
3
|
+
private nimInst;
|
|
4
|
+
private accountId;
|
|
5
|
+
private chatroom;
|
|
6
|
+
private roomId;
|
|
7
|
+
get account(): string | null;
|
|
8
|
+
get room(): string | null;
|
|
9
|
+
connect(): Promise<unknown>;
|
|
10
|
+
private disconnectPromise;
|
|
11
|
+
disconnect(): Promise<unknown>;
|
|
12
|
+
joinRoom(roomId: string): Promise<unknown>;
|
|
13
|
+
private leaveRoomPromise;
|
|
14
|
+
leaveRoom(): Promise<unknown>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { AudioPlayInfo } from "../Player";
|
|
2
|
+
import type { Av3aTrackInfo } from "../../shared/contracts/av3a-api";
|
|
3
|
+
/**
|
|
4
|
+
* Renders the AV3A decode stream inside the player window's AudioContext.
|
|
5
|
+
*
|
|
6
|
+
* Decoded PCM16 frames arrive on the direct channel from the AV3A decode
|
|
7
|
+
* utility process (`av3aChannel`) — not through main — and this class converts
|
|
8
|
+
* them to stereo Float32 and pushes them into the `av3a-player` AudioWorklet.
|
|
9
|
+
* The worklet reports consumed frames back, giving an accurate `currentTime`
|
|
10
|
+
* and letting us pause/resume the decode (over the same direct channel) when
|
|
11
|
+
* the buffer grows or shrinks past watermarks. Because the decode + PCM path
|
|
12
|
+
* bypasses main, playback keeps flowing even while main is busy (e.g. a window
|
|
13
|
+
* drag on Windows blocking the main process).
|
|
14
|
+
*/
|
|
15
|
+
export interface Av3aPcmPlayerEvents {
|
|
16
|
+
onOpened?: (info: Av3aTrackInfo) => void;
|
|
17
|
+
onEnded?: () => void;
|
|
18
|
+
onError?: (message: string) => void;
|
|
19
|
+
onBuffering?: (buffering: boolean) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare class Av3aPcmPlayer {
|
|
22
|
+
private readonly ctx;
|
|
23
|
+
private readonly events;
|
|
24
|
+
private node;
|
|
25
|
+
private active;
|
|
26
|
+
private playing;
|
|
27
|
+
private stopped;
|
|
28
|
+
private flowPaused;
|
|
29
|
+
private streamEnded;
|
|
30
|
+
private endedEmitted;
|
|
31
|
+
private buffering;
|
|
32
|
+
/** Output rate = the shared AudioContext's sample rate. */
|
|
33
|
+
private readonly outputRate;
|
|
34
|
+
/** Source (decoded) sample rate; known once the track is opened. */
|
|
35
|
+
private sourceRate;
|
|
36
|
+
/** Resamples decoded (e.g. 44.1k) PCM up to the context rate. */
|
|
37
|
+
private resampler;
|
|
38
|
+
private durationSeconds;
|
|
39
|
+
private pushedFrames;
|
|
40
|
+
private consumedFrames;
|
|
41
|
+
private startToken;
|
|
42
|
+
/** Content time (seconds) playback started / last seeked to. */
|
|
43
|
+
private baseTimeSeconds;
|
|
44
|
+
/** Frames with an index below this are stale (emitted before a seek). */
|
|
45
|
+
private dropUntilFrame;
|
|
46
|
+
private playbackRate;
|
|
47
|
+
constructor(ctx: AudioContext, events?: Av3aPcmPlayerEvents);
|
|
48
|
+
get isActive(): boolean;
|
|
49
|
+
get isPlaying(): boolean;
|
|
50
|
+
get currentTime(): number;
|
|
51
|
+
get duration(): number;
|
|
52
|
+
/** The worklet node; connect this into the effect chain / honeypot. */
|
|
53
|
+
get sourceNode(): AudioWorkletNode | null;
|
|
54
|
+
/**
|
|
55
|
+
* Load the worklet and connect it to `destination`. Safe to call once per
|
|
56
|
+
* `start()`/`stop()` cycle (re-attaches to the same node).
|
|
57
|
+
*/
|
|
58
|
+
attach(destination: AudioNode): Promise<void>;
|
|
59
|
+
start(playInfo: AudioPlayInfo): Promise<void>;
|
|
60
|
+
stop(): Promise<void>;
|
|
61
|
+
play(): Promise<void>;
|
|
62
|
+
pause(): void;
|
|
63
|
+
/** Mirror `playing` into the worklet so it stops consuming while paused. */
|
|
64
|
+
private setWorkletPlaying;
|
|
65
|
+
/**
|
|
66
|
+
* Set the playback rate. The resampler step changes from the current
|
|
67
|
+
* position onward; already-buffered audio finishes at the old tempo.
|
|
68
|
+
*/
|
|
69
|
+
setPlaybackRate(rate: number): void;
|
|
70
|
+
/**
|
|
71
|
+
* Seek to a content time (seconds). Flushes buffered audio, resets the
|
|
72
|
+
* resampler, and repositions the main-process decode to the target frame.
|
|
73
|
+
*/
|
|
74
|
+
seekTo(seconds: number): Promise<void>;
|
|
75
|
+
/** (Re)build or update the resampler for the current source/output/rate. */
|
|
76
|
+
private updateResamplerStep;
|
|
77
|
+
private av3aEventBound;
|
|
78
|
+
private bindEvents;
|
|
79
|
+
private onWorkletMessage;
|
|
80
|
+
private queuedSeconds;
|
|
81
|
+
private evaluateFlow;
|
|
82
|
+
private maybeEmitEnded;
|
|
83
|
+
private pushFrame;
|
|
84
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { AudioPlayInfo } from "../Player";
|
|
2
|
+
import type { Av3aContract } from "../../shared/contracts/av3a-api";
|
|
3
|
+
/**
|
|
4
|
+
* Typed client for the main-process `av3a` bridge (the player window).
|
|
5
|
+
*
|
|
6
|
+
* Mirrors `Av3aContract` on top of `ipcRenderer`: methods become
|
|
7
|
+
* `ipcRenderer.invoke("av3a.<method>", ...)`, events become
|
|
8
|
+
* `ipcRenderer.on("av3a.<event>", ...)`.
|
|
9
|
+
*
|
|
10
|
+
* Decode events/frames + pause/resume/seek are NOT here — they use the direct
|
|
11
|
+
* renderer <-> decode-utility channel (`av3aChannel`).
|
|
12
|
+
*/
|
|
13
|
+
export declare const av3aBridge: {
|
|
14
|
+
start(playInfo: AudioPlayInfo): Promise<void>;
|
|
15
|
+
stop(): Promise<void>;
|
|
16
|
+
/** Fallback terminal errors originating in main (e.g. process crash). */
|
|
17
|
+
onError(callback: (message: string) => void): void;
|
|
18
|
+
onProgress(callback: (loaded: number, total: number) => void): void;
|
|
19
|
+
};
|
|
20
|
+
export type Av3aBridge = typeof av3aBridge;
|
|
21
|
+
export type { Av3aContract };
|