dividing across functions / files
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
use clap::Parser;
|
||||
use ringbuf::{HeapRb, wrap::caching::Caching};
|
||||
use ropus::Decoder;
|
||||
use shared::AudioStreamInfo;
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
sync::{Arc, Mutex, RwLock},
|
||||
};
|
||||
|
||||
#[derive(Parser)]
|
||||
#[command(version, about)]
|
||||
pub struct CliArgs {
|
||||
#[arg(short, long, required(true))]
|
||||
pub server_ip: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub enum ClientEvent {
|
||||
NewConnection,
|
||||
NewAudioStreamRequest(AudioStreamInfo),
|
||||
NewAudioStreamAccepted(u8),
|
||||
}
|
||||
|
||||
pub struct ClientInfo {
|
||||
pub client_id: u32,
|
||||
pub server_address: String,
|
||||
pub connected: bool,
|
||||
}
|
||||
|
||||
type AudioStreamKey = (u32, u8);
|
||||
|
||||
pub type InputAudioStreamsProducers =
|
||||
Arc<Mutex<HashMap<AudioStreamKey, Caching<Arc<HeapRb<f32>>, true, false>>>>;
|
||||
pub type InputAudioStreamsConsumers =
|
||||
Arc<Mutex<HashMap<AudioStreamKey, Caching<Arc<HeapRb<f32>>, false, true>>>>;
|
||||
|
||||
pub type InputAudioStreamsEncoders = Arc<RwLock<HashMap<AudioStreamKey, Mutex<Decoder>>>>;
|
||||
|
||||
pub type InputAudioStreamsInfo = Arc<RwLock<HashMap<AudioStreamKey, AudioStreamInfo>>>;
|
||||
Reference in New Issue
Block a user