mirror of
https://github.com/Dummi26/musicdb.git
synced 2025-12-14 11:56:16 +01:00
s
This commit is contained in:
7
musicdb-lib/Cargo.toml
Executable file → Normal file
7
musicdb-lib/Cargo.toml
Executable file → Normal file
@@ -6,8 +6,11 @@ edition = "2021"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
awedio = "0.2.0"
|
||||
awedio = { version = "0.2.0", optional = true }
|
||||
base64 = "0.21.2"
|
||||
rand = "0.8.5"
|
||||
rc-u8-reader = "2.0.16"
|
||||
tokio = "1.29.1"
|
||||
tokio = { version = "1.29.1", features = ["sync"] }
|
||||
|
||||
[features]
|
||||
playback = ["awedio"]
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
pub mod data;
|
||||
pub mod load;
|
||||
#[cfg(feature = "playback")]
|
||||
pub mod player;
|
||||
pub mod server;
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
pub mod get;
|
||||
|
||||
use std::{
|
||||
io::{BufRead, BufReader, Read, Write},
|
||||
net::{SocketAddr, TcpListener},
|
||||
io::{Read, Write},
|
||||
sync::{mpsc, Arc, Mutex},
|
||||
thread,
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
@@ -18,8 +15,15 @@ use crate::{
|
||||
AlbumId, ArtistId, SongId,
|
||||
},
|
||||
load::ToFromBytes,
|
||||
player::Player,
|
||||
server::get::handle_one_connection_as_get,
|
||||
};
|
||||
#[cfg(feature = "playback")]
|
||||
use crate::{player::Player, server::get::handle_one_connection_as_get};
|
||||
#[cfg(feature = "playback")]
|
||||
use std::{
|
||||
io::{BufRead, BufReader},
|
||||
net::{SocketAddr, TcpListener},
|
||||
thread,
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
@@ -84,6 +88,7 @@ impl Command {
|
||||
/// a) initialize new connections using db.init_connection() to synchronize the new client
|
||||
/// b) handle the decoding of messages using Command::from_bytes()
|
||||
/// c) re-encode all received messages using Command::to_bytes_vec(), send them to the db, and send them to all your clients.
|
||||
#[cfg(feature = "playback")]
|
||||
pub fn run_server(
|
||||
database: Arc<Mutex<Database>>,
|
||||
addr_tcp: Option<SocketAddr>,
|
||||
|
||||
Reference in New Issue
Block a user