refactor: 调整模块位置
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
#![cfg(target_os = "linux")]
|
||||
|
||||
use anyhow::Result;
|
||||
|
||||
pub async fn run_client() -> Result<()> {
|
||||
println!("Hello, Client!");
|
||||
Ok(())
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
pub mod entry;
|
||||
@@ -1,3 +1,3 @@
|
||||
pub mod entry;
|
||||
pub mod master;
|
||||
pub mod slave;
|
||||
pub mod client;
|
||||
pub mod server;
|
||||
pub mod stereo;
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
use anyhow::Result;
|
||||
|
||||
pub async fn run_server() -> Result<()> {
|
||||
println!("Hello, Server!");
|
||||
Ok(())
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
pub mod entry;
|
||||
@@ -6,7 +6,7 @@ use crate::net::protocol::ChannelRole;
|
||||
use anyhow::Result;
|
||||
use std::env;
|
||||
|
||||
pub async fn run_xiao() -> Result<()> {
|
||||
pub async fn run_stereo() -> Result<()> {
|
||||
let args: Vec<String> = env::args().collect();
|
||||
if args.len() < 3 {
|
||||
eprintln!("用法: {} [master|slave] [left|right]", args[0]);
|
||||
@@ -0,0 +1,3 @@
|
||||
pub mod entry;
|
||||
pub mod master;
|
||||
pub mod slave;
|
||||
@@ -2,10 +2,13 @@ use anyhow::Result;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
#[cfg(target_os = "linux")]
|
||||
#[cfg(feature = "app")]
|
||||
{
|
||||
xiao::app::entry::run_xiao().await.unwrap();
|
||||
xiao::app::client::entry::run_client().await?;
|
||||
}
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
{
|
||||
eprintln!("Only support Linux");
|
||||
}
|
||||
println!("Only support Linux");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
use anyhow::Result;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
#[cfg(feature = "app")]
|
||||
{
|
||||
xiao::app::server::entry::run_server().await?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
use anyhow::Result;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
#[cfg(feature = "app")]
|
||||
{
|
||||
xiao::app::stereo::entry::run_stereo().await?;
|
||||
}
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
{
|
||||
eprintln!("Only support Linux");
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
pub mod app;
|
||||
pub mod audio;
|
||||
pub mod net;
|
||||
pub mod utils;
|
||||
|
||||
#[cfg(feature = "app")]
|
||||
pub mod app;
|
||||
|
||||
Reference in New Issue
Block a user