generated from GarandPLG/rust-flake-template
Add audio subsystem with mute and volume controls
Update flake.lock dependencies to latest revisions
This commit is contained in:
+9
-3
@@ -1,11 +1,15 @@
|
||||
use crate::{
|
||||
app::{GameStates, handle_keybindings, threads::AppEvent, view::View},
|
||||
app::{
|
||||
GameStates, handle_keybindings,
|
||||
threads::{AppEvent, AudioCmd},
|
||||
view::View,
|
||||
},
|
||||
cli::Cli,
|
||||
};
|
||||
use ratatui::{DefaultTerminal, Frame, crossterm::event::KeyEvent, layout::Rect};
|
||||
use std::{
|
||||
io::Result,
|
||||
sync::mpsc::{Receiver, RecvTimeoutError},
|
||||
sync::mpsc::{Receiver, RecvTimeoutError, Sender},
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
@@ -15,16 +19,18 @@ pub struct App {
|
||||
pub window_area: Rect,
|
||||
pub args: Cli,
|
||||
pub states: Option<GameStates>,
|
||||
pub audio_tx: Sender<AudioCmd>,
|
||||
}
|
||||
|
||||
impl App {
|
||||
pub fn new(args: Cli) -> Self {
|
||||
pub fn new(args: Cli, audio_tx: Sender<AudioCmd>) -> Self {
|
||||
Self {
|
||||
exit: false,
|
||||
view: args.view,
|
||||
window_area: Rect::default(),
|
||||
args: args,
|
||||
states: None,
|
||||
audio_tx,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user