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:
parent
255f0c6ccf
commit
555274b5af
25 changed files with 116 additions and 111 deletions
|
@ -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};
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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};
|
||||
|
||||
|
|
|
@ -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::*;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue