forked from wlkns-dev/stimmwerk
Passagen, Übungsmodus, Stimmfinder-Überarbeitung, Gerätedesign, Metronom und Akkorde
- Passagenwahl, Original-Kurve, Spulen/Üben und Pause - Startseite, Klartext-Oberfläche, Stimmfinder mit Stimmtyp-Vorschlag - Gerätedesign (Regler, Schalter, LED) und Metronom (frei/songsynchron, Tap) - Akkorderkennung aus der Begleitung, Akkordleiste und -karte - zweiter Song als Chart Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
//! Verlauf (Liste gespeicherter Sessions) und Review (Auswertung, Wiedergabe solo/gemischt).
|
||||
|
||||
use super::chart_view::{draw_chart_roll, score_table};
|
||||
use super::chart_view::{RollData, draw_chart_roll, score_table};
|
||||
use super::{App, Mode};
|
||||
use crate::audio::{ChartAudio, store_f32};
|
||||
use crate::pitch::HistoryPoint;
|
||||
@ -36,14 +36,15 @@ impl App {
|
||||
curve: record.curve(),
|
||||
verified: record.rescore() == record.result,
|
||||
dir,
|
||||
scrub_ms: record.range_start_ms,
|
||||
record,
|
||||
scrub_ms: 0.0,
|
||||
playing: false,
|
||||
mixed: false,
|
||||
gain_rec: 1.0,
|
||||
gain_backing: 0.8,
|
||||
});
|
||||
self.mode = Mode::Review;
|
||||
self.last_mode = Mode::Review; // der Neustart unten erledigt den Streamwechsel schon
|
||||
if self.sim_start.is_none() {
|
||||
self.restart(); // Mikrospur und Backing dieser Session laden
|
||||
}
|
||||
@ -53,29 +54,34 @@ impl App {
|
||||
pub(super) fn review_audio(&self) -> Option<ChartAudio> {
|
||||
let st = self.review.as_ref()?;
|
||||
let mut audio = ChartAudio::from_chart(&st.record.chart);
|
||||
audio.recording = st
|
||||
.record
|
||||
.wav
|
||||
.as_ref()
|
||||
.map(|w| (st.dir.join(w), st.record.countdown_ms + st.record.offset_ms));
|
||||
audio.recording = st.record.wav.as_ref().map(|w| {
|
||||
(
|
||||
st.dir.join(w),
|
||||
st.record.countdown_ms + st.record.offset_ms - st.record.range_start_ms,
|
||||
)
|
||||
});
|
||||
Some(audio)
|
||||
}
|
||||
|
||||
pub(super) fn history_ui(&mut self, ui: &mut egui::Ui) {
|
||||
ui.horizontal(|ui| {
|
||||
ui.heading("Verlauf");
|
||||
ui.heading("Mein Verlauf");
|
||||
if ui.button("Aktualisieren").clicked() {
|
||||
self.refresh_records();
|
||||
}
|
||||
ui.weak(self.sessions_root.display().to_string());
|
||||
});
|
||||
if self.records.is_empty() {
|
||||
ui.label("Noch keine gespeicherten Sessions. Eine Chart-Session bis zum Ende singen.");
|
||||
ui.label(
|
||||
egui::RichText::new(
|
||||
"Hier erscheinen deine gesungenen Songs mit Punktzahl. Sing im Tab „Singen“ einen Song bis zum Ende – dann siehst du ihn hier und kannst dir anhören, wie du geklungen hast.",
|
||||
)
|
||||
.size(16.0),
|
||||
);
|
||||
return;
|
||||
}
|
||||
let mut open = None;
|
||||
egui::Grid::new("history").striped(true).show(ui, |ui| {
|
||||
for h in ["Datum", "Chart", "Score", "Aufnahme", ""] {
|
||||
for h in ["Datum", "Song", "Punkte", "Aufnahme", ""] {
|
||||
ui.strong(h);
|
||||
}
|
||||
ui.end_row();
|
||||
@ -112,7 +118,7 @@ impl App {
|
||||
if st.scrub_ms > end_ms {
|
||||
e.shared.playing.store(false, Ordering::Relaxed);
|
||||
st.playing = false;
|
||||
st.scrub_ms = 0.0;
|
||||
st.scrub_ms = st.record.range_start_ms;
|
||||
}
|
||||
}
|
||||
let seek = |ms: f64| {
|
||||
@ -161,7 +167,13 @@ impl App {
|
||||
}
|
||||
let mut secs = st.scrub_ms / 1000.0;
|
||||
if ui
|
||||
.add(egui::Slider::new(&mut secs, 0.0..=end_ms / 1000.0).suffix(" s"))
|
||||
.add(
|
||||
egui::Slider::new(
|
||||
&mut secs,
|
||||
st.record.range_start_ms / 1000.0..=end_ms / 1000.0,
|
||||
)
|
||||
.suffix(" s"),
|
||||
)
|
||||
.changed()
|
||||
{
|
||||
st.scrub_ms = secs * 1000.0;
|
||||
@ -204,14 +216,25 @@ impl App {
|
||||
store_f32(&s.gain_monitor, 0.0);
|
||||
}
|
||||
|
||||
self.original_tick(st.record.chart.vocals.clone());
|
||||
let original = self.original_view(st.scrub_ms, st.record.transpose, &st.record.chart);
|
||||
draw_chart_roll(
|
||||
ui,
|
||||
&st.record.chart,
|
||||
&st.curve,
|
||||
st.scrub_ms,
|
||||
Some(&st.record.result),
|
||||
&RollData {
|
||||
chart: &st.record.chart,
|
||||
curve: &st.curve,
|
||||
now_ms: st.scrub_ms,
|
||||
result: Some(&st.record.result),
|
||||
octave_tolerant: st.record.score_cfg.octave_tolerant,
|
||||
original: &original,
|
||||
chords: if self.show_chords {
|
||||
&st.record.chart.chords
|
||||
} else {
|
||||
&[]
|
||||
},
|
||||
chord_flats: crate::import::chords::prefer_flats(&st.record.chart.chords),
|
||||
},
|
||||
&self.config.ui,
|
||||
st.record.score_cfg.octave_tolerant,
|
||||
);
|
||||
score_table(ui, &st.record.chart, &st.record.result);
|
||||
self.review = Some(st);
|
||||
|
||||
Reference in New Issue
Block a user