Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pipe as a backend #1284

Merged
merged 2 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ env_logger = "0.10"
alsa_backend = ["librespot-playback/alsa-backend", "alsa"]
dbus_keyring = ["keyring"]
dbus_mpris = ["dbus", "dbus-tokio", "dbus-crossroads", "rspotify"]
default = ["alsa_backend"]
pipe_backend = []
default = ["alsa_backend", "pipe_backend"]
portaudio_backend = ["librespot-playback/portaudio-backend"]
pulseaudio_backend = ["librespot-playback/pulseaudio-backend"]
rodio_backend = ["librespot-playback/rodio-backend"]
Expand Down
8 changes: 7 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const CONFIG_FILE_NAME: &str = "spotifyd.conf";
feature = "pulseaudio_backend",
feature = "portaudio_backend",
feature = "alsa_backend",
feature = "pipe_backend",
feature = "rodio_backend",
feature = "rodiojack_backend",
)))]
Expand All @@ -38,6 +39,8 @@ static BACKEND_VALUES: &[&str] = &[
"portaudio",
#[cfg(feature = "rodio_backend")]
"rodio",
#[cfg(feature = "pipe_backend")]
"pipe",
#[cfg(feature = "rodiojack_backend")]
"rodiojack",
];
Expand All @@ -50,6 +53,7 @@ pub enum Backend {
PortAudio,
PulseAudio,
Rodio,
Pipe,
RodioJack,
}

Expand All @@ -66,6 +70,7 @@ impl FromStr for Backend {
"portaudio" => Ok(Backend::PortAudio),
"pulseaudio" => Ok(Backend::PulseAudio),
"rodio" => Ok(Backend::Rodio),
"pipe" => Ok(Backend::Pipe),
"rodiojack" => Ok(Backend::RodioJack),
_ => unreachable!(),
}
Expand All @@ -79,6 +84,7 @@ impl fmt::Display for Backend {
Backend::PortAudio => write!(f, "portaudio"),
Backend::PulseAudio => write!(f, "pulseaudio"),
Backend::Rodio => write!(f, "rodio"),
Backend::Pipe => write!(f, "pipe"),
Backend::RodioJack => write!(f, "rodiojack"),
}
}
Expand Down Expand Up @@ -444,7 +450,7 @@ pub struct SharedConfigValues {
#[serde(alias = "volume-control")]
volume_controller: Option<VolumeController>,

/// The audio device
/// The audio device (or file handle if using pipe backend)
#[structopt(long, value_name = "string")]
device: Option<String>,

Expand Down
Loading