@music-lyric-player/base 0.14.0 → 0.15.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/README.md +1 -0
- package/dist/index.comm.js +1 -1
- package/dist/index.comm.js.map +1 -1
- package/dist/index.ecma.d.ts +23 -5
- package/dist/index.ecma.js +1207 -772
- package/dist/index.ecma.js.map +1 -1
- package/package.json +3 -3
package/dist/index.ecma.d.ts
CHANGED
|
@@ -10,17 +10,18 @@ export declare class BaseLyricPlayer {
|
|
|
10
10
|
private state;
|
|
11
11
|
private active;
|
|
12
12
|
private time;
|
|
13
|
-
private offset;
|
|
14
13
|
private info;
|
|
15
|
-
private
|
|
14
|
+
private merger;
|
|
15
|
+
private offset;
|
|
16
|
+
private driver;
|
|
16
17
|
constructor();
|
|
17
18
|
private onConfigUpdate;
|
|
18
19
|
private handleGetCurrentTime;
|
|
19
20
|
private handleGetEffectiveTime;
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Rebuild the merged line-end table from the current lyric and merge config.
|
|
23
|
+
*/
|
|
22
24
|
private handleBuildMergedLineEnd;
|
|
23
|
-
private handleGetMergedLineTime;
|
|
24
25
|
private handleGetActiveIndex;
|
|
25
26
|
private handleBridgeActive;
|
|
26
27
|
private handleEmitLinesUpdate;
|
|
@@ -30,6 +31,7 @@ export declare class BaseLyricPlayer {
|
|
|
30
31
|
updateLyric(info: Lyric.Info): void;
|
|
31
32
|
/**
|
|
32
33
|
* Start playback
|
|
34
|
+
*
|
|
33
35
|
* @param time Optional time in ms to seek to before starting playback. If not provided, playback will start from the current position.
|
|
34
36
|
*/
|
|
35
37
|
play(time?: number): void;
|
|
@@ -43,13 +45,17 @@ export declare class BaseLyricPlayer {
|
|
|
43
45
|
dispose(): void;
|
|
44
46
|
/**
|
|
45
47
|
* Update the temp offset in ms (the user's temporary adjustment).
|
|
48
|
+
*
|
|
46
49
|
* Stacked on top of the global config offset and the lyric's meta offset, then resyncs immediately.
|
|
50
|
+
*
|
|
47
51
|
* @param value temp offset in ms; non-finite values are treated as 0.
|
|
48
52
|
*/
|
|
49
53
|
updateTempOffset(value: number): void;
|
|
50
54
|
/**
|
|
51
55
|
* Find all active lines at the given time (ms). Does not mutate internal state.
|
|
56
|
+
*
|
|
52
57
|
* Assumes `info.lines` is sorted by `time.start` ascending.
|
|
58
|
+
*
|
|
53
59
|
* @param time time in ms to find active lines for.
|
|
54
60
|
*/
|
|
55
61
|
matchLinesWithTime(time: number): {
|
|
@@ -58,7 +64,9 @@ export declare class BaseLyricPlayer {
|
|
|
58
64
|
};
|
|
59
65
|
/**
|
|
60
66
|
* Convert a content (lyric) time to the playback clock by removing the active offset.
|
|
67
|
+
*
|
|
61
68
|
* Seeking playback to the returned time makes a line at `contentTime` become active.
|
|
69
|
+
*
|
|
62
70
|
* @param contentTime content time in ms (e.g. a line's start).
|
|
63
71
|
*/
|
|
64
72
|
convertContentTime(contentTime: number): number;
|
|
@@ -182,6 +190,16 @@ declare interface Root {
|
|
|
182
190
|
* @default 300
|
|
183
191
|
*/
|
|
184
192
|
mergeWindow?: number;
|
|
193
|
+
/**
|
|
194
|
+
* Maximum number of consecutive lines that {@link mergeWindow} may fold into a single deactivation batch.
|
|
195
|
+
*
|
|
196
|
+
* When a run of close‑ending lines is longer than this, the batch is force‑flushed every `mergeLimit` lines so no batch ever holds more than this many lines.
|
|
197
|
+
*
|
|
198
|
+
* A value of `0` or less removes the cap; `1` effectively disables merging.
|
|
199
|
+
*
|
|
200
|
+
* @default 3
|
|
201
|
+
*/
|
|
202
|
+
mergeLimit?: number;
|
|
185
203
|
/**
|
|
186
204
|
* Lyric time offset settings.
|
|
187
205
|
*/
|