|
|
|
@ -30,7 +30,6 @@ impl eframe::App for App {
|
|
|
|
|
// If stream thread is done, start again
|
|
|
|
|
if self.player.stream_thread.is_finished() {
|
|
|
|
|
self.player.stream_thread = self.player.start_radio_stream();
|
|
|
|
|
std::thread::sleep(std::time::Duration::from_secs(3));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if self.player.sink.len() != 1 {
|
|
|
|
@ -42,21 +41,10 @@ impl eframe::App for App {
|
|
|
|
|
|
|
|
|
|
if ui.button("■").clicked() {
|
|
|
|
|
let _ = &self.player.sink.pause();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ui.button("status").clicked() {
|
|
|
|
|
println!(
|
|
|
|
|
"is_paused: {}. empty: {}. len: {}. volume: {}.",
|
|
|
|
|
&self.player.sink.is_paused(),
|
|
|
|
|
&self.player.sink.empty(),
|
|
|
|
|
&self.player.sink.len(),
|
|
|
|
|
&self.player.sink.volume()
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ui.add(egui::Slider::new(&mut self.player.volume, 0.0..=100.0).text("Volume"));
|
|
|
|
|
self.player.sink.set_volume(self.player.volume / 100.0);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
ui.add(egui::Slider::new(&mut self.player.volume, 0.0..=100.0).text("Volume"));
|
|
|
|
|
self.player.sink.set_volume(self.player.volume / 100.0);
|
|
|
|
|
|
|
|
|
|
// ui.separator();
|
|
|
|
|
// ui.heading("Tor");
|
|
|
|
|