@@ -626,6 +626,12 @@ def _apply_sample_fields(self) -> None:
626626 self ._thumb_choice = "up"
627627 self ._sync_thumb_buttons ()
628628
629+ self .recorder .load_saved_clip_for_sample (id_str )
630+ if self .recorder .full_audio is None :
631+ self .clear_waveform_canvas ()
632+ else :
633+ self .update_waveform ()
634+
629635 self .update_progress ()
630636 self .update_navigation_controls ()
631637
@@ -655,12 +661,27 @@ def show_done_state(self) -> None:
655661
656662 def update_progress (self ) -> None :
657663 total_count = len (self .recorder .input_data )
658- done_count = len (self .recorder .output_data ) + len (self .recorder .skipped_ids )
659- done_count = min (done_count , total_count )
660- self .progress_text .set (f"Progress: { done_count } / { total_count } " )
664+ if total_count == 0 :
665+ self .progress_text .set ("Progress: 0 / 0" )
666+ self .progress_bar ["maximum" ] = 1
667+ self .progress_bar ["value" ] = 0
668+ return
661669
662- self .progress_bar ["maximum" ] = max (total_count , 1 )
663- self .progress_bar ["value" ] = done_count
670+ if self .current_id is not None :
671+ ids_ordered = [str (s ["id" ]) for s in self .recorder .input_data ]
672+ try :
673+ line_no = ids_ordered .index (str (self .current_id )) + 1
674+ except ValueError :
675+ line_no = 0
676+ self .progress_text .set (f"Line { line_no } / { total_count } " )
677+ self .progress_bar ["maximum" ] = total_count
678+ self .progress_bar ["value" ] = line_no
679+ else :
680+ done_count = len (self .recorder .output_data ) + len (self .recorder .skipped_ids )
681+ done_count = min (done_count , total_count )
682+ self .progress_text .set (f"Progress: { done_count } / { total_count } " )
683+ self .progress_bar ["maximum" ] = max (total_count , 1 )
684+ self .progress_bar ["value" ] = done_count
664685
665686 def update_navigation_controls (self ) -> None :
666687 has_current = self .current_id is not None
0 commit comments