mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
modularize discovery (wip)
This commit is contained in:
parent
977a6db3ef
commit
38c64e54be
4 changed files with 36 additions and 14 deletions
|
@ -24,6 +24,8 @@ doc = false
|
||||||
path = "audio"
|
path = "audio"
|
||||||
[dependencies.librespot-core]
|
[dependencies.librespot-core]
|
||||||
path = "core"
|
path = "core"
|
||||||
|
[dependencies.librespot-discovery]
|
||||||
|
path = "discovery"
|
||||||
[dependencies.librespot-metadata]
|
[dependencies.librespot-metadata]
|
||||||
path = "metadata"
|
path = "metadata"
|
||||||
[dependencies.librespot-protocol]
|
[dependencies.librespot-protocol]
|
||||||
|
@ -36,7 +38,6 @@ futures = "0.1.8"
|
||||||
getopts = "0.2.14"
|
getopts = "0.2.14"
|
||||||
hyper = "0.11.2"
|
hyper = "0.11.2"
|
||||||
log = "0.3.5"
|
log = "0.3.5"
|
||||||
mdns = { git = "https://github.com/plietar/rust-mdns" }
|
|
||||||
num-bigint = "0.1.35"
|
num-bigint = "0.1.35"
|
||||||
protobuf = "1.1"
|
protobuf = "1.1"
|
||||||
rand = "0.3.13"
|
rand = "0.3.13"
|
||||||
|
@ -55,7 +56,6 @@ portaudio-rs = { version = "0.3.0", optional = true }
|
||||||
libpulse-sys = { version = "0.0.0", optional = true }
|
libpulse-sys = { version = "0.0.0", optional = true }
|
||||||
jack = { version = "0.5.3", optional = true }
|
jack = { version = "0.5.3", optional = true }
|
||||||
libc = { version = "0.2", optional = true }
|
libc = { version = "0.2", optional = true }
|
||||||
dns-sd = { version = "0.1.3", optional = true }
|
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
rand = "0.3.13"
|
rand = "0.3.13"
|
||||||
|
@ -71,7 +71,7 @@ jackaudio-backend = ["jack"]
|
||||||
with-tremor = ["librespot-audio/with-tremor"]
|
with-tremor = ["librespot-audio/with-tremor"]
|
||||||
with-lewton = ["librespot-audio/with-lewton"]
|
with-lewton = ["librespot-audio/with-lewton"]
|
||||||
|
|
||||||
with-dns-sd = ["dns-sd"]
|
with-dns-sd = ["librespot-discovery/with-dns-sd"]
|
||||||
|
|
||||||
default = ["portaudio-backend"]
|
default = ["portaudio-backend"]
|
||||||
|
|
||||||
|
|
23
discovery/Cargo.toml
Normal file
23
discovery/Cargo.toml
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
[package]
|
||||||
|
name = "librespot-discovery"
|
||||||
|
version = "0.1.0"
|
||||||
|
authors = ["Paul Lietar <paul@lietar.net>"]
|
||||||
|
|
||||||
|
[dependencies.librespot-core]
|
||||||
|
path = "../core"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
base64 = "0.5.0"
|
||||||
|
futures = "0.1.8"
|
||||||
|
num-bigint = "0.1.35"
|
||||||
|
rand = "0.3.13"
|
||||||
|
rust-crypto = { git = "https://github.com/awmath/rust-crypto.git", branch = "avx2" }
|
||||||
|
tokio-core = "0.1.2"
|
||||||
|
url = "1.3"
|
||||||
|
|
||||||
|
dns-sd = { version = "0.1.3", optional = true }
|
||||||
|
mdns = { git = "https://github.com/plietar/rust-mdns", optional = true }
|
||||||
|
|
||||||
|
[features]
|
||||||
|
with-dns-sd = ["dns-sd"]
|
||||||
|
with-mdns = ["mdns"]
|
|
@ -1,4 +1,8 @@
|
||||||
use base64;
|
use base64;
|
||||||
|
use core::diffie_hellman::{DH_GENERATOR, DH_PRIME};
|
||||||
|
use core::authentication::Credentials;
|
||||||
|
use core::util;
|
||||||
|
use core::config::ConnectConfig;
|
||||||
use crypto::digest::Digest;
|
use crypto::digest::Digest;
|
||||||
use crypto::mac::Mac;
|
use crypto::mac::Mac;
|
||||||
use crypto;
|
use crypto;
|
||||||
|
@ -6,13 +10,6 @@ use futures::sync::mpsc;
|
||||||
use futures::{Future, Stream, Poll};
|
use futures::{Future, Stream, Poll};
|
||||||
use hyper::server::{Service, Request, Response, Http};
|
use hyper::server::{Service, Request, Response, Http};
|
||||||
use hyper::{self, Get, Post, StatusCode};
|
use hyper::{self, Get, Post, StatusCode};
|
||||||
|
|
||||||
#[cfg(feature = "with-dns-sd")]
|
|
||||||
use dns_sd::DNSService;
|
|
||||||
|
|
||||||
#[cfg(not(feature = "with-dns-sd"))]
|
|
||||||
use mdns;
|
|
||||||
|
|
||||||
use num_bigint::BigUint;
|
use num_bigint::BigUint;
|
||||||
use rand;
|
use rand;
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
|
@ -21,10 +18,11 @@ use std::sync::Arc;
|
||||||
use tokio_core::reactor::Handle;
|
use tokio_core::reactor::Handle;
|
||||||
use url;
|
use url;
|
||||||
|
|
||||||
use core::diffie_hellman::{DH_GENERATOR, DH_PRIME};
|
#[cfg(feature = "with-dns-sd")]
|
||||||
use core::authentication::Credentials;
|
use dns_sd::DNSService;
|
||||||
use core::util;
|
|
||||||
use core::config::ConnectConfig;
|
#[cfg(not(feature = "with-dns-sd"))]
|
||||||
|
use mdns;
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
struct Discovery(Arc<DiscoveryInner>);
|
struct Discovery(Arc<DiscoveryInner>);
|
|
@ -18,6 +18,7 @@ extern crate url;
|
||||||
|
|
||||||
pub extern crate librespot_audio as audio;
|
pub extern crate librespot_audio as audio;
|
||||||
pub extern crate librespot_core as core;
|
pub extern crate librespot_core as core;
|
||||||
|
pub extern crate librespot_discovery as discovery;
|
||||||
pub extern crate librespot_protocol as protocol;
|
pub extern crate librespot_protocol as protocol;
|
||||||
pub extern crate librespot_metadata as metadata;
|
pub extern crate librespot_metadata as metadata;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue