Files: fca343292fb72c697c29294488b5b36397ac1dc5 / src / control.rs
565 bytesRaw
1 | use std::sync::mpsc::{channel, Sender, Receiver}; |
2 | |
3 | use clock; |
4 | |
5 | |
6 | pub struct Control { |
7 | pub tx: Sender<ControlMessage>, |
8 | pub rx: Receiver<ControlMessage> |
9 | } |
10 | |
11 | impl Control { |
12 | pub fn new() -> Self { |
13 | let (tx, rx) = channel(); |
14 | |
15 | Self { |
16 | tx, |
17 | rx |
18 | } |
19 | } |
20 | } |
21 | |
22 | |
23 | pub enum ControlMessage { |
24 | Time(clock::ClockTime), |
25 | Signature(clock::ClockSignature), |
26 | Reset, |
27 | NudgeTempo(f64), |
28 | TapTempo |
29 | /* |
30 | Stop, |
31 | SetTempo, |
32 | NudgeClock, |
33 | Configure |
34 | */ |
35 | } |
36 | |
37 |
Built with git-ssb-web