Move music player protocol into music player crate
This commit is contained in:
parent
6aa3ca6f33
commit
62380e745e
|
@ -3,7 +3,6 @@ members = [
|
|||
"apps/magpie",
|
||||
"apps/music-player",
|
||||
"apps/sandbox",
|
||||
"crates/music-player-protocol",
|
||||
"crates/script",
|
||||
"crates/types",
|
||||
"scripts/music-player",
|
||||
|
|
|
@ -3,7 +3,16 @@ name = "canary-music-player"
|
|||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[[bin]]
|
||||
name = "canary-music-player"
|
||||
path = "src/main.rs"
|
||||
required-features = ["bin"]
|
||||
|
||||
[dependencies]
|
||||
canary-music-player-protocol = { path = "../../crates/music-player-protocol" }
|
||||
canary-magpie = { path = "../magpie" }
|
||||
mpris = "2.0.0-rc3"
|
||||
canary-magpie = { path = "../magpie", optional = true }
|
||||
mpris = { version = "2.0.0-rc3", optional = true }
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
|
||||
[features]
|
||||
bin = ["dep:canary-magpie", "dep:mpris"]
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
use serde::{Deserialize, Serialize};
|
||||
|
||||
pub use serde;
|
||||
pub use serde_json;
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
pub enum PlaybackStatus {
|
||||
/// A track is currently playing.
|
|
@ -1,4 +1,4 @@
|
|||
use canary_music_player_protocol::*;
|
||||
use canary_music_player::*;
|
||||
use canary_magpie::client::MagpieClient;
|
||||
use canary_magpie::protocol::{CreatePanel, MagpieServerMsg};
|
||||
use mpris::PlayerFinder;
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
[package]
|
||||
name = "canary-music-player-protocol"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1", features = ["derive"] }
|
|
@ -8,6 +8,5 @@ crate-type = ["cdylib"]
|
|||
|
||||
[dependencies]
|
||||
canary_script = { path = "../../crates/script" }
|
||||
canary-music-player-protocol = { path = "../../crates/music-player-protocol" }
|
||||
serde_json = "1"
|
||||
canary-music-player = { path = "../../apps/music-player" }
|
||||
wee_alloc = "^0.4"
|
||||
|
|
|
@ -44,7 +44,7 @@ impl PanelImpl for MusicPlayerPanel {
|
|||
fn on_cursor_event(&mut self, kind: CursorEventKind, at: Vec2) {}
|
||||
|
||||
fn on_message(&mut self, msg: Message) {
|
||||
use canary_music_player_protocol::InMsg;
|
||||
use canary_music_player::{InMsg, serde_json};
|
||||
let msg = msg.to_vec();
|
||||
let msg = serde_json::from_slice::<InMsg>(&msg);
|
||||
self.label.set_text(format!("{:#?}", msg));
|
||||
|
|
Loading…
Reference in New Issue