mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 04:06:45 +01:00
fix warnings (not 55 errors)
This commit is contained in:
parent
a50e022ab6
commit
87c5e47b43
8 changed files with 290 additions and 269 deletions
|
|
@ -1,20 +1,23 @@
|
|||
use crate::prelude::*;
|
||||
|
||||
pub struct Transport {
|
||||
name: String,
|
||||
transport: ::jack::Transport,
|
||||
timesig: (f32, f32),
|
||||
bpm: f64,
|
||||
name: String,
|
||||
/// Holds info about tempo
|
||||
timebase: Arc<Mutex<Timebase>>,
|
||||
}
|
||||
|
||||
impl Transport {
|
||||
pub fn new (name: &str) -> Result<DynamicDevice<Self>, Box<dyn Error>> {
|
||||
let (client, _) = Client::new(name, ClientOptions::NO_START_SERVER)?;
|
||||
let transport = client.transport();
|
||||
DynamicDevice::new(render, handle, process, Self {
|
||||
name: name.into(),
|
||||
transport: client.transport(),
|
||||
timesig: (4.0, 4.0),
|
||||
bpm: 113.0,
|
||||
name: name.into(),
|
||||
timebase: Timebase {
|
||||
rate: transport.query()?.pos.frame_rate(),
|
||||
tempo: 113000,
|
||||
ppq: 96,
|
||||
},
|
||||
transport
|
||||
}).activate(client)
|
||||
}
|
||||
|
||||
|
|
@ -45,8 +48,8 @@ pub fn process (_: &mut Transport, _: &Client, _: &ProcessScope) -> Control {
|
|||
pub fn render (state: &Transport, buf: &mut Buffer, mut area: Rect)
|
||||
-> Usually<Rect>
|
||||
{
|
||||
area.x = area.width.saturating_sub(80) / 2;
|
||||
area.width = area.width.min(80);
|
||||
//area.x = area.width.saturating_sub(80) / 2;
|
||||
//area.width = area.width.min(80);
|
||||
area.height = 5;
|
||||
//draw_box(buf, area);
|
||||
let label = Style::default().white().not_dim();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue