@@ -82,7 +82,10 @@ MainWindow::MainWindow(QString inputFilenameParam, QWidget *parent) :
8282
8383 // Was a filename specified on the command line?
8484 if (!inputFilenameParam.isEmpty ()) {
85+ lastFilename = inputFilenameParam;
8586 tbcSource.loadSource (inputFilenameParam);
87+ } else {
88+ lastFilename.clear ();
8689 }
8790}
8891
@@ -158,6 +161,7 @@ void MainWindow::updateGuiLoaded()
158161 ui->actionClosed_Captions ->setEnabled (true );
159162 if (tbcSource.getIsSourcePal ()) ui->actionPAL_Chroma_decoder ->setEnabled (true );
160163 else ui->actionPAL_Chroma_decoder ->setEnabled (false );
164+ ui->actionReload_TBC ->setEnabled (true );
161165
162166 // Set option button states
163167 ui->videoPushButton ->setText (tr (" Source" ));
@@ -238,6 +242,7 @@ void MainWindow::updateGuiUnloaded()
238242 ui->actionSave_frame_as_PNG ->setEnabled (false );
239243 ui->actionClosed_Captions ->setEnabled (false );
240244 ui->actionPAL_Chroma_decoder ->setEnabled (false );
245+ ui->actionReload_TBC ->setEnabled (false );
241246
242247 // Set option button states
243248 ui->videoPushButton ->setText (tr (" Source" ));
@@ -390,10 +395,20 @@ void MainWindow::on_actionOpen_TBC_file_triggered()
390395
391396 // Was a filename specified?
392397 if (!inputFileName.isEmpty () && !inputFileName.isNull ()) {
398+ lastFilename = inputFileName;
393399 loadTbcFile (inputFileName);
394400 }
395401}
396402
403+ // Reload the current TBC selection from the GUI
404+ void MainWindow::on_actionReload_TBC_triggered ()
405+ {
406+ // Reload the current TBC file
407+ if (!lastFilename.isEmpty () && !lastFilename.isNull ()) {
408+ loadTbcFile (lastFilename);
409+ }
410+ }
411+
397412// Display the scan line oscilloscope view
398413void MainWindow::on_actionLine_scope_triggered ()
399414{
@@ -550,18 +565,18 @@ void MainWindow::on_nextPushButton_clicked()
550565 }
551566}
552567
553- // Skip to end frame button has been clicked
568+ // Skip to the next chapter (note: this button was repurposed from 'end frame')
554569void MainWindow::on_endFramePushButton_clicked ()
555570{
556- currentFrameNumber = tbcSource.getNumberOfFrames ( );
571+ currentFrameNumber = tbcSource.startOfNextChapter (currentFrameNumber );
557572 ui->frameNumberSpinBox ->setValue (currentFrameNumber);
558573 ui->frameHorizontalSlider ->setValue (currentFrameNumber);
559574}
560575
561- // Skip to start frame button has been clicked
576+ // Skip to the start of chapter (note: this button was repurposed from 'start frame')
562577void MainWindow::on_startFramePushButton_clicked ()
563578{
564- currentFrameNumber = 1 ;
579+ currentFrameNumber = tbcSource. startOfChapter (currentFrameNumber) ;
565580 ui->frameNumberSpinBox ->setValue (currentFrameNumber);
566581 ui->frameHorizontalSlider ->setValue (currentFrameNumber);
567582}
@@ -876,6 +891,3 @@ void MainWindow::on_finishedLoading()
876891 busyDialog->hide ();
877892 this ->setEnabled (true );
878893}
879-
880-
881-
0 commit comments