git ssb

0+

dinoworm 🐛 / metronome



Commit f675cb27f2640ba304b1816b279b2ef7f8c19a59

happy beats

Michael Williams committed on 5/13/2018, 10:18:48 AM
Parent: 3ec707eee442688f2cf820a4336c7e69b3703ec0

Files changed

src/clock.rschanged
src/interface.rschanged
src/clock.rsView
@@ -157,9 +157,8 @@
157157 if diff.nanos > 0 {
158158 sleep(Duration::new(0, diff.nanos as u32))
159159 };
160160
161-
162161 self.tick = Time::now();
163162
164163 diff
165164 }
src/interface.rsView
@@ -71,12 +71,10 @@
7171 match interface_message {
7272 InterfaceMessage::Time(time) => {
7373 ncurses::clear();
7474 ncurses::mv(0, 0);
75- if time.ticks == 0 {
76- ncurses::printw("BEAT");
77- }
78- ncurses::printw("\n");
75 + print_beat(time);
76 + print_bar(time);
7977 print_time(time);
8078 print_signature(signature);
8179 },
8280 InterfaceMessage::Signature(signature) => {
@@ -90,8 +88,25 @@
9088 interface
9189 }
9290 }
9391
92 +pub fn print_beat (time: clock::ClockTime) {
93 + if time.ticks == 0 {
94 + if time.beats == 0 {
95 + ncurses::printw("SUPER ");
96 + }
97 + ncurses::printw("BEAT");
98 + }
99 + ncurses::printw("\n");
100 +}
101 +
102 +pub fn print_bar (time: clock::ClockTime) {
103 + if time.bars == 0 {
104 + ncurses::printw("YAY YAY YAY");
105 + }
106 + ncurses::printw("\n");
107 +}
108 +
94109 pub fn print_time (time: clock::ClockTime) {
95110 ncurses::printw("nanos: ");
96111 ncurses::printw(format!("{}\n", time.nanos).as_ref());
97112 ncurses::printw("ticks: ");

Built with git-ssb-web