mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
wip: running interface in separate or combined mode
also disassociating render functions from state structs
This commit is contained in:
parent
f9218e887a
commit
d6bf840a1f
31 changed files with 905 additions and 532 deletions
39
src/sequencer.rs
Normal file
39
src/sequencer.rs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
mod handle;
|
||||
mod render;
|
||||
mod jack;
|
||||
pub use self::handle::*;
|
||||
pub use self::render::*;
|
||||
pub use self::jack::*;
|
||||
use crate::prelude::*;
|
||||
|
||||
pub struct Sequencer {
|
||||
jack: Jack<Notifications>,
|
||||
exit: bool,
|
||||
stdout: Stdout,
|
||||
cursor: (u16, u16),
|
||||
duration: u16,
|
||||
}
|
||||
|
||||
impl Sequencer {
|
||||
pub fn new () -> Result<Self, Box<dyn Error>> {
|
||||
let (client, status) = Client::new(
|
||||
"bloop-sequencer",
|
||||
ClientOptions::NO_START_SERVER
|
||||
)?;
|
||||
let jack = client.activate_async(
|
||||
Notifications,
|
||||
ClosureProcessHandler::new(Box::new(
|
||||
move |_: &Client, _: &ProcessScope| -> Control {
|
||||
Control::Continue
|
||||
}) as Box<dyn FnMut(&Client, &ProcessScope)->Control + Send>
|
||||
)
|
||||
)?;
|
||||
Ok(Self {
|
||||
exit: false,
|
||||
stdout: std::io::stdout(),
|
||||
cursor: (0, 0),
|
||||
duration: 0,
|
||||
jack,
|
||||
})
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue