Create IPC socket on UNIX platforms (#1018)

* Create IPC socket on UNIX platforms

Creates an IPC socket which remote programs/scripts can connect to. This
can be used to control ncspot or fetch the current playback status.

At the moment, only remote control is implemented. Next step is to send
the current player status as a JSON object.

Fixes #524

* Publish status changes to connected sockets

Whenever the playback mode (playing, paused, stopped) or the track changes, all
socket listeners will be notified.

Fixes #924, fixes #1019

* Document IPC feature
This commit is contained in:
Henrik Friedrichsen
2022-12-28 19:01:59 +01:00
committed by GitHub
parent 93816af654
commit ec4b7c209a
7 changed files with 168 additions and 4 deletions

View File

@@ -32,7 +32,7 @@ use crate::ASYNC_RUNTIME;
pub const VOLUME_PERCENT: u16 = ((u16::max_value() as f64) * 1.0 / 100.0) as u16;
#[derive(Clone, Debug, PartialEq, Eq)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize)]
pub enum PlayerEvent {
Playing(SystemTime),
Paused(Duration),