Skip to content

Commit 88c2e73

Browse files
author
Simon Inns
authored
Merge pull request #440 from happycube/issues-380-416
Fix for issue #380 and issue #416 - both in ld-analyse
2 parents 45f2eb0 + 5aa6ee9 commit 88c2e73

5 files changed

Lines changed: 922 additions & 833 deletions

File tree

tools/ld-analyse/mainwindow.cpp

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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
398413
void 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')
554569
void 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')
562577
void 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-

tools/ld-analyse/mainwindow.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ private slots:
6262
// Menu bar handlers
6363
void on_actionExit_triggered();
6464
void on_actionOpen_TBC_file_triggered();
65+
void on_actionReload_TBC_triggered();
6566
void on_actionLine_scope_triggered();
6667
void on_actionAbout_ld_analyse_triggered();
6768
void on_actionVBI_triggered();
@@ -126,6 +127,7 @@ private slots:
126127
qint32 currentFrameNumber;
127128
qreal scaleFactor;
128129
QPalette buttonPalette;
130+
QString lastFilename;
129131

130132
// Update GUI methods
131133
void updateGuiLoaded();

tools/ld-analyse/mainwindow.ui

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
</size>
125125
</property>
126126
<property name="toolTip">
127-
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Skip to start frame&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
127+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Skip to start of chapter&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
128128
</property>
129129
<property name="text">
130130
<string/>
@@ -202,7 +202,7 @@
202202
</size>
203203
</property>
204204
<property name="toolTip">
205-
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Skip to end frame&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
205+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Skip to end of chapter&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
206206
</property>
207207
<property name="text">
208208
<string/>
@@ -435,6 +435,7 @@
435435
<string>File</string>
436436
</property>
437437
<addaction name="actionOpen_TBC_file"/>
438+
<addaction name="actionReload_TBC"/>
438439
<addaction name="separator"/>
439440
<addaction name="actionSave_frame_as_PNG"/>
440441
<addaction name="separator"/>
@@ -618,6 +619,14 @@
618619
<string>Ctrl+U</string>
619620
</property>
620621
</action>
622+
<action name="actionReload_TBC">
623+
<property name="text">
624+
<string>Reload TBC...</string>
625+
</property>
626+
<property name="shortcut">
627+
<string>Ctrl+A</string>
628+
</property>
629+
</action>
621630
</widget>
622631
<layoutdefault spacing="6" margin="11"/>
623632
<resources>

0 commit comments

Comments
 (0)