turn off autorefresh and redraw only on demand

this should significantly reduce CPU usage but is a little bit more complicated.
while we're at it, remove the different screen redraw events and use a combined
event for all screens.

TODO:
the spotify player still needs to update the statusbar at least every second.
This commit is contained in:
Henrik Friedrichsen
2019-03-09 01:55:55 +01:00
parent 2bc87d8af5
commit 392e3efb87
6 changed files with 50 additions and 58 deletions

View File

@@ -1,14 +1,13 @@
use crossbeam_channel::{unbounded, Receiver, Sender, TryIter};
use cursive::{CbFunc, Cursive};
use queue::QueueEvent;
use spotify::PlayerEvent;
use ui::playlist::PlaylistEvent;
pub enum Event {
Queue(QueueEvent),
Player(PlayerEvent),
Playlist(PlaylistEvent),
ScreenChange(String),
}
pub type EventSender = Sender<Event>;