|
|
|
@ -116,16 +116,16 @@ impl eframe::App for App {
|
|
|
|
|
ui.horizontal(|ui| {
|
|
|
|
|
if self.player.playing {
|
|
|
|
|
if ui.button("⏸").clicked() {
|
|
|
|
|
let _ = &self.player.sink.pause();
|
|
|
|
|
let _ = self.player.sink.pause();
|
|
|
|
|
self.player.playing = false;
|
|
|
|
|
}
|
|
|
|
|
if ui.button("⏹").clicked() {
|
|
|
|
|
let _ = &self.player.sink.stop();
|
|
|
|
|
self.player.playing = false;
|
|
|
|
|
std::fs::remove_file(path);
|
|
|
|
|
}
|
|
|
|
|
// if ui.button("⏹").clicked() {
|
|
|
|
|
// let _ = self.player.sink.stop();
|
|
|
|
|
// self.player.playing = false;
|
|
|
|
|
// let _ = std::fs::remove_file(crate::RADIO_STREAM);
|
|
|
|
|
// }
|
|
|
|
|
ui.add(egui::Slider::new(&mut self.player.volume, 0.0..=100.0));
|
|
|
|
|
self.player.sink.set_volume(self.player.volume / 100.0);
|
|
|
|
|
self.player.sink.set_volume(&self.player.volume / 100.0);
|
|
|
|
|
if self.player.sink.len() != 1 {
|
|
|
|
|
let f = std::fs::File::open(crate::RADIO_STREAM);
|
|
|
|
|
if let Ok(fo) = f {
|
|
|
|
|