mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
feat: run stub tek_sequencer
This commit is contained in:
parent
b8a67b8adc
commit
09abc4cd95
12 changed files with 78 additions and 56 deletions
|
|
@ -8,3 +8,10 @@ tek_core = { path = "../tek_core" }
|
|||
tek_jack = { path = "../tek_jack" }
|
||||
symphonia = { version = "0.5.4", features = [ "all" ] }
|
||||
wavers = "1.4.3"
|
||||
|
||||
[lib]
|
||||
path = "src/lib.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "tek_sampler"
|
||||
path = "src/main.rs"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
//! Sampler (currently 16bit WAVs at system rate; TODO convert/resample)
|
||||
// Sampler (currently 16bit WAVs at system rate; TODO convert/resample)
|
||||
|
||||
pub(crate) use tek_core::*;
|
||||
pub(crate) use tek_core::ratatui::prelude::*;
|
||||
|
|
|
|||
6
crates/tek_sampler/src/main.rs
Normal file
6
crates/tek_sampler/src/main.rs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
//! Phrase editor.
|
||||
include!("lib.rs");
|
||||
pub fn main () -> Usually<()> {
|
||||
tek_core::run(Arc::new(RwLock::new(crate::Sampler::new("sampler", None)?)));
|
||||
Ok(())
|
||||
}
|
||||
|
|
@ -14,6 +14,8 @@ pub struct Sampler {
|
|||
pub output_gain: f32
|
||||
}
|
||||
|
||||
process!(Sampler = Sampler::process);
|
||||
handle!(Sampler |self, event| handle_keymap(self, event, KEYMAP_SAMPLER));
|
||||
render!(Sampler |self, buf, area| {
|
||||
let Rect { x, y, height, .. } = area;
|
||||
let style = Style::default().gray();
|
||||
|
|
@ -56,8 +58,6 @@ fn draw_sample (
|
|||
Ok(label1.len() + label2.len() + 4)
|
||||
}
|
||||
|
||||
handle!(Sampler |self, event| handle_keymap(self, event, KEYMAP_SAMPLER));
|
||||
|
||||
/// Key bindings for sampler device.
|
||||
pub const KEYMAP_SAMPLER: &'static [KeyBinding<Sampler>] = keymap!(Sampler {
|
||||
[Up, NONE, "/sampler/cursor/up", "move cursor up", |state: &mut Sampler| {
|
||||
|
|
@ -98,7 +98,6 @@ pub const KEYMAP_SAMPLER: &'static [KeyBinding<Sampler>] = keymap!(Sampler {
|
|||
}],
|
||||
});
|
||||
|
||||
process!(Sampler = Sampler::process);
|
||||
|
||||
impl Sampler {
|
||||
pub fn new (name: &str, mapped: Option<BTreeMap<u7, Arc<RwLock<Sample>>>>) -> Usually<JackDevice> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue