diff --git a/Cargo.lock b/Cargo.lock index 0f21634d..e31c72fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -316,8 +316,8 @@ dependencies = [ "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)", "librespot-audio 0.1.0", + "librespot-connect 0.1.0", "librespot-core 0.1.0", - "librespot-discovery 0.1.0", "librespot-metadata 0.1.0", "librespot-playback 0.1.0", "librespot-protocol 0.1.0", @@ -388,7 +388,7 @@ dependencies = [ ] [[package]] -name = "librespot-discovery" +name = "librespot-connect" version = "0.1.0" dependencies = [ "base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index 15e1dda1..f3b88c3f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,6 @@ name = "librespot" version = "0.1.0" authors = ["Paul LiƩtar "] -build = "build.rs" license = "MIT" description = "Open Source Spotify client library" keywords = ["spotify"] @@ -22,10 +21,10 @@ doc = false [dependencies.librespot-audio] path = "audio" +[dependencies.librespot-connect] +path = "connect" [dependencies.librespot-core] path = "core" -[dependencies.librespot-discovery] -path = "discovery" [dependencies.librespot-metadata] path = "metadata" [dependencies.librespot-playback] @@ -67,7 +66,7 @@ jackaudio-backend = ["librespot-playback/jackaudio-backend"] with-tremor = ["librespot-audio/with-tremor"] 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"] diff --git a/discovery/Cargo.toml b/connect/Cargo.toml similarity index 68% rename from discovery/Cargo.toml rename to connect/Cargo.toml index f69185a0..a345401d 100644 --- a/discovery/Cargo.toml +++ b/connect/Cargo.toml @@ -1,10 +1,15 @@ [package] -name = "librespot-discovery" +name = "librespot-connect" version = "0.1.0" authors = ["Paul Lietar "] +build = "build.rs" [dependencies.librespot-core] path = "../core" +[dependencies.librespot-playback] +path = "../playback" +[dependencies.librespot-protocol] +path = "../protocol" [dependencies] base64 = "0.5.0" @@ -24,6 +29,9 @@ url = "1.3" dns-sd = { version = "0.1.3", 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] default = ["mdns"] with-dns-sd = ["dns-sd"] diff --git a/build.rs b/connect/build.rs similarity index 100% rename from build.rs rename to connect/build.rs diff --git a/discovery/src/discovery.rs b/connect/src/discovery.rs similarity index 100% rename from discovery/src/discovery.rs rename to connect/src/discovery.rs diff --git a/src/lib.in.rs b/connect/src/lib.in.rs similarity index 100% rename from src/lib.in.rs rename to connect/src/lib.in.rs diff --git a/discovery/src/lib.rs b/connect/src/lib.rs similarity index 75% rename from discovery/src/lib.rs rename to connect/src/lib.rs index d8775b8a..22c6885f 100644 --- a/discovery/src/lib.rs +++ b/connect/src/lib.rs @@ -18,5 +18,9 @@ extern crate dns_sd; extern crate mdns; extern crate librespot_core as core; +extern crate librespot_playback as playback; +extern crate librespot_protocol as protocol; pub mod discovery; + +include!(concat!(env!("OUT_DIR"), "/lib.rs")); diff --git a/src/spirc.rs b/connect/src/spirc.rs similarity index 100% rename from src/spirc.rs rename to connect/src/spirc.rs diff --git a/src/lib.rs b/src/lib.rs index 1d0ee72d..2ba4dac0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,8 +2,6 @@ #![cfg_attr(feature = "cargo-clippy", allow(unused_io_amount))] -#[macro_use] extern crate log; - extern crate base64; extern crate crypto; extern crate futures; @@ -15,11 +13,8 @@ extern crate tokio_core; extern crate url; 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_discovery as discovery; pub extern crate librespot_playback as playback; pub extern crate librespot_protocol as protocol; pub extern crate librespot_metadata as metadata; - - -include!(concat!(env!("OUT_DIR"), "/lib.rs")); diff --git a/src/main.rs b/src/main.rs index 18f47a41..8168e844 100644 --- a/src/main.rs +++ b/src/main.rs @@ -26,10 +26,10 @@ use librespot::core::version; use librespot::playback::audio_backend::{self, Sink, BACKENDS}; 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::player::Player; -use librespot::spirc::{Spirc, SpircTask}; +use librespot::connect::spirc::{Spirc, SpircTask}; fn usage(program: &str, opts: &getopts::Options) -> String { let brief = format!("Usage: {} [options]", program);