connect: discovery and spirc

This commit is contained in:
awiouy 2018-02-11 16:57:55 +01:00
parent 191caca518
commit d900134114
10 changed files with 21 additions and 15 deletions

4
Cargo.lock generated
View file

@ -316,8 +316,8 @@ dependencies = [
"getopts 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", "getopts 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.11.14 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.11.14 (registry+https://github.com/rust-lang/crates.io-index)",
"librespot-audio 0.1.0", "librespot-audio 0.1.0",
"librespot-connect 0.1.0",
"librespot-core 0.1.0", "librespot-core 0.1.0",
"librespot-discovery 0.1.0",
"librespot-metadata 0.1.0", "librespot-metadata 0.1.0",
"librespot-playback 0.1.0", "librespot-playback 0.1.0",
"librespot-protocol 0.1.0", "librespot-protocol 0.1.0",
@ -388,7 +388,7 @@ dependencies = [
] ]
[[package]] [[package]]
name = "librespot-discovery" name = "librespot-connect"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",

View file

@ -2,7 +2,6 @@
name = "librespot" name = "librespot"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Liétar <paul@lietar.net>"] authors = ["Paul Liétar <paul@lietar.net>"]
build = "build.rs"
license = "MIT" license = "MIT"
description = "Open Source Spotify client library" description = "Open Source Spotify client library"
keywords = ["spotify"] keywords = ["spotify"]
@ -22,10 +21,10 @@ doc = false
[dependencies.librespot-audio] [dependencies.librespot-audio]
path = "audio" path = "audio"
[dependencies.librespot-connect]
path = "connect"
[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-playback] [dependencies.librespot-playback]
@ -67,7 +66,7 @@ jackaudio-backend = ["librespot-playback/jackaudio-backend"]
with-tremor = ["librespot-audio/with-tremor"] with-tremor = ["librespot-audio/with-tremor"]
with-vorbis = ["librespot-audio/with-vorbis"] with-vorbis = ["librespot-audio/with-vorbis"]
with-dns-sd = ["librespot-discovery/with-dns-sd"] with-dns-sd = ["librespot-connect/with-dns-sd"]
default = ["librespot-playback/portaudio-backend"] default = ["librespot-playback/portaudio-backend"]

View file

@ -1,10 +1,15 @@
[package] [package]
name = "librespot-discovery" name = "librespot-connect"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Lietar <paul@lietar.net>"] authors = ["Paul Lietar <paul@lietar.net>"]
build = "build.rs"
[dependencies.librespot-core] [dependencies.librespot-core]
path = "../core" path = "../core"
[dependencies.librespot-playback]
path = "../playback"
[dependencies.librespot-protocol]
path = "../protocol"
[dependencies] [dependencies]
base64 = "0.5.0" base64 = "0.5.0"
@ -24,6 +29,9 @@ url = "1.3"
dns-sd = { version = "0.1.3", optional = true } dns-sd = { version = "0.1.3", optional = true }
mdns = { git = "https://github.com/plietar/rust-mdns", optional = true } mdns = { git = "https://github.com/plietar/rust-mdns", optional = true }
[build-dependencies]
protobuf_macros = { git = "https://github.com/plietar/rust-protobuf-macros", features = ["with-syntex"] }
[features] [features]
default = ["mdns"] default = ["mdns"]
with-dns-sd = ["dns-sd"] with-dns-sd = ["dns-sd"]

View file

@ -18,5 +18,9 @@ extern crate dns_sd;
extern crate mdns; extern crate mdns;
extern crate librespot_core as core; extern crate librespot_core as core;
extern crate librespot_playback as playback;
extern crate librespot_protocol as protocol;
pub mod discovery; pub mod discovery;
include!(concat!(env!("OUT_DIR"), "/lib.rs"));

View file

@ -2,8 +2,6 @@
#![cfg_attr(feature = "cargo-clippy", allow(unused_io_amount))] #![cfg_attr(feature = "cargo-clippy", allow(unused_io_amount))]
#[macro_use] extern crate log;
extern crate base64; extern crate base64;
extern crate crypto; extern crate crypto;
extern crate futures; extern crate futures;
@ -15,11 +13,8 @@ extern crate tokio_core;
extern crate url; extern crate url;
pub extern crate librespot_audio as audio; pub extern crate librespot_audio as audio;
pub extern crate librespot_connect as connect;
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_playback as playback; pub extern crate librespot_playback as playback;
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;
include!(concat!(env!("OUT_DIR"), "/lib.rs"));

View file

@ -26,10 +26,10 @@ use librespot::core::version;
use librespot::playback::audio_backend::{self, Sink, BACKENDS}; use librespot::playback::audio_backend::{self, Sink, BACKENDS};
use librespot::playback::config::{Bitrate, PlayerConfig}; use librespot::playback::config::{Bitrate, PlayerConfig};
use librespot::discovery::discovery::{discovery, DiscoveryStream}; use librespot::connect::discovery::{discovery, DiscoveryStream};
use librespot::playback::mixer::{self, Mixer}; use librespot::playback::mixer::{self, Mixer};
use librespot::playback::player::Player; use librespot::playback::player::Player;
use librespot::spirc::{Spirc, SpircTask}; use librespot::connect::spirc::{Spirc, SpircTask};
fn usage(program: &str, opts: &getopts::Options) -> String { fn usage(program: &str, opts: &getopts::Options) -> String {
let brief = format!("Usage: {} [options]", program); let brief = format!("Usage: {} [options]", program);