| 1 | use models::player::ResultFile; |
| 2 | use hound::WavWriter; |
| 3 | use once_cell::sync::OnceCell; |
| 4 | use rodio::Sink; |
| 5 | use std::{ |
| 6 | fs::File, |
| 7 | io::BufWriter, |
| 8 | sync::{mpsc::Sender, Arc, Mutex}, |
| 9 | }; |
| 10 | |
| 11 | use crate::models; |
| 12 | |
| 13 | pub static mut VOCALS_SINK: OnceCell<Sink> = OnceCell::new(); |
| 14 | pub static mut DRUMS_SINK: OnceCell<Sink> = OnceCell::new(); |
| 15 | pub static mut BASS_SINK: OnceCell<Sink> = OnceCell::new(); |
| 16 | pub static mut OTHER_SINK: OnceCell<Sink> = OnceCell::new(); |
| 17 | |
| 18 | pub static mut VOCALS_FILE: OnceCell<ResultFile> = OnceCell::new(); |
| 19 | pub static mut DRUMS_FILE: OnceCell<ResultFile> = OnceCell::new(); |
| 20 | pub static mut BASS_FILE: OnceCell<ResultFile> = OnceCell::new(); |
| 21 | pub static mut OTHER_FILE: OnceCell<ResultFile> = OnceCell::new(); |
| 22 | |
| 23 | pub type RecordingWriter = Arc<Mutex<Option<WavWriter<BufWriter<File>>>>>; |
| 24 | pub static mut RECORDING_WRITER: OnceCell<RecordingWriter> = OnceCell::new(); |
| 25 | pub static mut RECORDING_SENDER: OnceCell<Sender<()>> = OnceCell::new(); |