1
0
Fork 0
mirror of https://github.com/librespot-org/librespot.git synced 2025-10-04 18:29:45 +02:00

Move decoder to playback crate

This commit is contained in:
johannesd3 2021-04-13 10:29:34 +02:00
parent 255f0c6ccf
commit 555274b5af
No known key found for this signature in database
GPG key ID: 8C2739E91D410F75
25 changed files with 116 additions and 111 deletions

View file

@ -1,6 +1,6 @@
use super::{Open, Sink, SinkAsBytes};
use crate::audio::AudioPacket;
use crate::config::AudioFormat;
use crate::decoder::AudioPacket;
use crate::player::{NUM_CHANNELS, SAMPLES_PER_SECOND, SAMPLE_RATE};
use alsa::device_name::HintIter;
use alsa::pcm::{Access, Format, Frames, HwParams, PCM};

View file

@ -1,6 +1,6 @@
use super::{Open, Sink, SinkAsBytes};
use crate::audio::AudioPacket;
use crate::config::AudioFormat;
use crate::decoder::AudioPacket;
use crate::player::{NUM_CHANNELS, SAMPLE_RATE};
use gstreamer as gst;

View file

@ -1,6 +1,6 @@
use super::{Open, Sink};
use crate::audio::AudioPacket;
use crate::config::AudioFormat;
use crate::decoder::AudioPacket;
use crate::player::NUM_CHANNELS;
use jack::{
AsyncClient, AudioOut, Client, ClientOptions, Control, Port, ProcessHandler, ProcessScope,

View file

@ -1,5 +1,5 @@
use crate::audio::AudioPacket;
use crate::config::AudioFormat;
use crate::decoder::AudioPacket;
use std::io;
pub trait Open {
@ -26,7 +26,7 @@ fn mk_sink<S: Sink + Open + 'static>(device: Option<String>, format: AudioFormat
macro_rules! sink_as_bytes {
() => {
fn write(&mut self, packet: &AudioPacket) -> io::Result<()> {
use crate::audio::convert::{self, i24};
use crate::convert::{self, i24};
use zerocopy::AsBytes;
match packet {
AudioPacket::Samples(samples) => match self.format {

View file

@ -1,6 +1,6 @@
use super::{Open, Sink, SinkAsBytes};
use crate::audio::AudioPacket;
use crate::config::AudioFormat;
use crate::decoder::AudioPacket;
use std::fs::OpenOptions;
use std::io::{self, Write};

View file

@ -1,6 +1,7 @@
use super::{Open, Sink};
use crate::audio::{convert, AudioPacket};
use crate::config::AudioFormat;
use crate::convert;
use crate::decoder::AudioPacket;
use crate::player::{NUM_CHANNELS, SAMPLE_RATE};
use portaudio_rs::device::{get_default_output_index, DeviceIndex, DeviceInfo};
use portaudio_rs::stream::*;

View file

@ -1,6 +1,6 @@
use super::{Open, Sink, SinkAsBytes};
use crate::audio::AudioPacket;
use crate::config::AudioFormat;
use crate::decoder::AudioPacket;
use crate::player::{NUM_CHANNELS, SAMPLE_RATE};
use libpulse_binding::{self as pulse, stream::Direction};
use libpulse_simple_binding::Simple;

View file

@ -5,8 +5,9 @@ use cpal::traits::{DeviceTrait, HostTrait};
use thiserror::Error;
use super::Sink;
use crate::audio::{convert, AudioPacket};
use crate::config::AudioFormat;
use crate::convert;
use crate::decoder::AudioPacket;
use crate::player::{NUM_CHANNELS, SAMPLE_RATE};
#[cfg(all(

View file

@ -1,6 +1,7 @@
use super::{Open, Sink};
use crate::audio::{convert, AudioPacket};
use crate::config::AudioFormat;
use crate::convert;
use crate::decoder::AudioPacket;
use crate::player::{NUM_CHANNELS, SAMPLE_RATE};
use sdl2::audio::{AudioQueue, AudioSpecDesired};
use std::{io, thread, time};

View file

@ -1,6 +1,6 @@
use super::{Open, Sink, SinkAsBytes};
use crate::audio::AudioPacket;
use crate::config::AudioFormat;
use crate::decoder::AudioPacket;
use shell_words::split;
use std::io::{self, Write};