properly show exif data

irc-tor
lza_menace 2 years ago
parent 36953d0f6f
commit 2d0f788593

@ -24,8 +24,7 @@ impl eframe::App for App {
ui.label("Made by ya boi, lza_menace"); ui.label("Made by ya boi, lza_menace");
ui.hyperlink("https://lzahq.tech"); ui.hyperlink("https://lzahq.tech");
ui.separator(); ui.separator();
ui.label(format!("Now Playing: "));
ui.horizontal(|ui| { ui.horizontal(|ui| {
if ui.button("▶").clicked() { if ui.button("▶").clicked() {
// If stream thread is done, start again // If stream thread is done, start again
@ -38,16 +37,20 @@ impl eframe::App for App {
let _ = &self.player.sink.append(source); let _ = &self.player.sink.append(source);
} }
let _ = &self.player.sink.play(); let _ = &self.player.sink.play();
self.player.playing = true;
} }
if ui.button("■").clicked() { if ui.button("■").clicked() {
let _ = &self.player.sink.pause(); let _ = &self.player.sink.pause();
self.player.playing = false;
} }
}); });
ui.add(egui::Slider::new(&mut self.player.volume, 0.0..=100.0).text("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); self.player.sink.set_volume(self.player.volume / 100.0);
if self.player.playing {
ui.label(format!("{:?}", self.player.get_song_meta())); ui.label(format!("Now Playing: {:?}", self.player.get_song_meta()));
}
// ui.separator(); // ui.separator();
// ui.heading("Tor"); // ui.heading("Tor");

@ -3,7 +3,9 @@ pub struct Player {
pub sink: rodio::Sink, pub sink: rodio::Sink,
pub stream_thread: std::thread::JoinHandle<()>, pub stream_thread: std::thread::JoinHandle<()>,
pub stream_handle: rodio::OutputStreamHandle, pub stream_handle: rodio::OutputStreamHandle,
pub volume: f32 pub volume: f32,
pub stream_exif: String,
pub playing: bool
} }
impl Player { impl Player {
@ -12,7 +14,9 @@ impl Player {
sink, sink,
stream_handle, stream_handle,
stream_thread: std::thread::spawn(|| {}), stream_thread: std::thread::spawn(|| {}),
volume: 100.0 volume: 100.0,
stream_exif: "".to_owned(),
playing: false
} }
} }