47 lines
1005 B
Rust
47 lines
1005 B
Rust
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
|
pub enum IpcPacket {
|
|
/// Quit the player process
|
|
Quit,
|
|
|
|
/// Connect to Spotify with the given token and device name
|
|
Connect(String, String),
|
|
|
|
/// Disconnect from Spotify (unused)
|
|
Disconnect,
|
|
|
|
/// Unable to connect to Spotify
|
|
ConnectError(String),
|
|
|
|
/// The audio sink has started writing
|
|
StartPlayback,
|
|
|
|
/// The audio sink has stopped writing
|
|
StopPlayback,
|
|
|
|
/// The current Spotify track was changed
|
|
TrackChange(String),
|
|
|
|
/// Spotify playback was started/resumed
|
|
Playing(String, u32, u32),
|
|
|
|
/// Spotify playback was paused
|
|
Paused(String, u32, u32),
|
|
|
|
/// Sent when the user has switched their Spotify device away from Spoticord
|
|
Stopped,
|
|
|
|
/// Request the player to advance to the next track
|
|
Next,
|
|
|
|
/// Request the player to go back to the previous track
|
|
Previous,
|
|
|
|
/// Request the player to pause playback
|
|
Pause,
|
|
|
|
/// Request the player to resume playback
|
|
Resume,
|
|
}
|