The core component of LyricsV.
LyricsV uses IPC to communicate with the core. And inside the core, worker threads of different components use MessagePort to communicate with each other.
We encapsulated IPC and MessagePort into "events" inside the SerializedEventEmitter
. Now the event list is shown below.
EventName | Parameters | EmittedBy | HandledBy | Comment |
---|---|---|---|---|
trackChange |
track: Track |
PlayerInterface | [all] | |
togglePlayPause |
isPlaying: boolean |
PlayerInterface | [all] | |
timeUpdate |
pos: number |
PlayerInterface | LyricsWorker | Real number in seconds, with milliseconds accuracy |
playerQuit |
PlayerInterface | [Parent] | ||
seek |
pos: number |
[Parent] | PlayerWorker | |
lyricChange |
trackUID: string, lyrics: Lyric[], offset: Number |
LyricsWorker | [Parent] | |
lyricIndex |
index: number |
LyricsWorker | [Parent] | |
lyricPreviewIndex |
index: number, previewTrackUID: string |
LyricsWorker | [Parent] | |
updateConfig |
config: Config |
[Parent] | [all] | |
disableLyrics |
trackUID: string |
[Parent] | LyricsWorker | |
setLyrics |
track: Track, lyricPassed: Lrc | string, offset?: number |
[Parent] | LyricsWorker | |
setOffset |
trackUID: string, offset: number |
[Parent] | LyricsWorker | |
searchLyrics |
transactionId: number, track: Track |
[Parent] | LyricsWorker | |
lyricsSearchResult |
transactionId: number, searchResults: LyricsSearchResult[] |
LyricsWorker | [Parent] | |
getLyrics |
transactionId: number, searchResult: LyricsSearchResult, track: Track, preview?: boolean |
[Parent] | LyricsWorker | |
lyricsGot |
transactionId: number, result: Lrc |
LyricsWorker | [Parent] | |
cancelPreview |
[Parent] | LyricsWorker |
LyricsV fetches lyrics from some music providers. Currently supported (most in China):
- Netease Cloud Music
- QQ Music
- Kugou Music
- Migu Music
- Kuwo Music
- Gecimi 歌词迷 (A standalone platform to redistribute lyrics only)
- iTunes and Music.app for macOS support
- System now playing support for Windows (via SMTC)
- System now playing support for macOS
LyricsV-core is licensed under the Apache License 2.0.
Code with ♥ by Victor Huang <[email protected]>