mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
docs: add doc comments to macros
This commit is contained in:
parent
c5369328f4
commit
828436745c
7 changed files with 9 additions and 0 deletions
|
|
@ -10,6 +10,7 @@ pub trait Handle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Implement the `Handle` trait.
|
||||||
#[macro_export] macro_rules! handle {
|
#[macro_export] macro_rules! handle {
|
||||||
($T:ty) => {
|
($T:ty) => {
|
||||||
impl Handle for $T {}
|
impl Handle for $T {}
|
||||||
|
|
@ -70,12 +71,14 @@ pub fn handle_keymap <T> (
|
||||||
Ok(false)
|
Ok(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Define a key binding.
|
||||||
#[macro_export] macro_rules! key {
|
#[macro_export] macro_rules! key {
|
||||||
($k:ident $(($char:literal))?, $m:ident, $n: literal, $d: literal, $f: expr) => {
|
($k:ident $(($char:literal))?, $m:ident, $n: literal, $d: literal, $f: expr) => {
|
||||||
(KeyCode::$k $(($char))?, KeyModifiers::$m, $n, $d, &$f)
|
(KeyCode::$k $(($char))?, KeyModifiers::$m, $n, $d, &$f)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Define a keymap.
|
||||||
#[macro_export] macro_rules! keymap {
|
#[macro_export] macro_rules! keymap {
|
||||||
($T:ty { $([$k:ident $(($char:literal))?, $m:ident, $n: literal, $d: literal, $f: expr]),* $(,)? }) => {
|
($T:ty { $([$k:ident $(($char:literal))?, $m:ident, $n: literal, $d: literal, $f: expr]),* $(,)? }) => {
|
||||||
&[
|
&[
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ pub trait Render: Send {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Implement the `Render` trait.
|
||||||
#[macro_export] macro_rules! render {
|
#[macro_export] macro_rules! render {
|
||||||
($T:ty) => {
|
($T:ty) => {
|
||||||
impl Render for $T {}
|
impl Render for $T {}
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ pub trait Ports {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Implement the `Ports` trait.
|
||||||
#[macro_export] macro_rules! ports {
|
#[macro_export] macro_rules! ports {
|
||||||
($T:ty $({ $(audio: {
|
($T:ty $({ $(audio: {
|
||||||
$(ins: |$ai_arg:ident|$ai_impl:expr,)?
|
$(ins: |$ai_arg:ident|$ai_impl:expr,)?
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ pub mod jack;
|
||||||
|
|
||||||
use crate::{core::*, model::*};
|
use crate::{core::*, model::*};
|
||||||
|
|
||||||
|
/// Application entrypoint.
|
||||||
pub fn main () -> Usually<()> {
|
pub fn main () -> Usually<()> {
|
||||||
let mut app = App::default();
|
let mut app = App::default();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
use crate::core::*;
|
use crate::core::*;
|
||||||
|
|
||||||
|
/// Define a MIDI phrase.
|
||||||
#[macro_export] macro_rules! phrase {
|
#[macro_export] macro_rules! phrase {
|
||||||
($($t:expr => $msg:expr),* $(,)?) => {{
|
($($t:expr => $msg:expr),* $(,)?) => {{
|
||||||
let mut phrase = BTreeMap::new();
|
let mut phrase = BTreeMap::new();
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,7 @@ impl Sampler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Load sample from WAV and assign to MIDI note.
|
||||||
#[macro_export] macro_rules! sample {
|
#[macro_export] macro_rules! sample {
|
||||||
($note:expr, $name:expr, $src:expr) => {
|
($note:expr, $name:expr, $src:expr) => {
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ use crate::{render, App, core::*};
|
||||||
|
|
||||||
render!(App |self, buf, area| {
|
render!(App |self, buf, area| {
|
||||||
let Rect { x, mut y, width, height } = area;
|
let Rect { x, mut y, width, height } = area;
|
||||||
|
return Ok(area);
|
||||||
|
|
||||||
y = y + TransportView {
|
y = y + TransportView {
|
||||||
timebase: &self.timebase,
|
timebase: &self.timebase,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue