Skip to content

Commit

Permalink
Merge branch 'master' of github.com:happycube/ld-decode
Browse files Browse the repository at this point in the history
  • Loading branch information
happycube committed Jan 25, 2020
2 parents 1a8735a + 88c2e73 commit 40b80ef
Show file tree
Hide file tree
Showing 20 changed files with 1,037 additions and 935 deletions.
14 changes: 2 additions & 12 deletions ld-cut
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import subprocess
from lddecode.core import *
from lddecode.utils import *

parser = argparse.ArgumentParser(description='Extracts a sample area from raw RF laserdisc captures')
parser = argparse.ArgumentParser(description='Extract a sample area from raw RF laserdisc captures. (Similar to ld-decode, except it outputs samples)')
parser.add_argument('infile', metavar='infile', type=str, help='source file')
parser.add_argument('outfile', metavar='outfile', type=str, help='destination file')
parser.add_argument('outfile', metavar='outfile', type=str, help='destination file (recommended to use .lds suffix)')

parser.add_argument('-s', '--start', metavar='start', type=float, default=0, help='rough jump to frame n of capture (default is 0)')
parser.add_argument('-l', '--length', metavar='length', type=int, default = -1, help='limit length to n frames')
Expand All @@ -29,10 +29,6 @@ parser.add_argument('-E', '--end', metavar='end', type=int, default=-1, help='cu
parser.add_argument('-p', '--pal', dest='pal', action='store_true', help='source is in PAL format')
parser.add_argument('-n', '--ntsc', dest='ntsc', action='store_true', help='source is in NTSC format')

# included because some marginal CAV disks need -m 0 manually set
parser.add_argument('-m', '--MTF', metavar='mtf', type=float, default=None, help='mtf compensation multiplier')
parser.add_argument('--MTF_offset', metavar='mtf_offset', type=float, default=None, help='mtf compensation offset')

args = parser.parse_args()

#print(args)
Expand Down Expand Up @@ -61,12 +57,6 @@ original_sigint_handler = signal.signal(signal.SIGINT, signal.SIG_IGN)
ldd = LDdecode(filename, None, loader, system=system, doDOD = False)
signal.signal(signal.SIGINT, original_sigint_handler)

if args.MTF is not None:
ldd.rf.mtf_mult = args.MTF

if args.MTF_offset is not None:
ldd.rf.mtf_offset = args.MTF_offset

if args.seek != -1:
startloc = ldd.seek(args.start, args.seek)
if startloc is None:
Expand Down
16 changes: 8 additions & 8 deletions tools/ld-analyse/aboutdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:16pt; font-weight:600;">ld-analyse</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">ld-decode TBC output analysis application</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">(c) 2018-2019 Simon Inns</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">https://www.domesday86.com</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Released under the GPLv3</span></p>
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;Open-source software&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Ubuntu'; font-size:16pt; font-weight:600;&quot;&gt;ld-analyse&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Ubuntu'; font-size:10pt;&quot;&gt;ld-decode TBC output analysis application&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Ubuntu'; font-size:10pt;&quot;&gt;(c) 2018-2020 Simon Inns&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Ubuntu'; font-size:10pt;&quot;&gt;https://www.domesday86.com&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Ubuntu'; font-size:10pt;&quot;&gt;Released under the GPLv3&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Ubuntu'; font-size:10pt;&quot;&gt;Open-source software&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</widget>
Expand Down
13 changes: 4 additions & 9 deletions tools/ld-analyse/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,17 @@ int main(int argc, char *argv[])
parser.addHelpOption();
parser.addVersionOption();

// Option to show debug (-d)
QCommandLineOption showDebugOption(QStringList() << "d" << "debug",
QCoreApplication::translate("main", "Show debug"));
parser.addOption(showDebugOption);
// Add the standard debug options --debug and --quiet
addStandardDebugOptions(parser);

// Positional argument to specify input video file
parser.addPositionalArgument("input", QCoreApplication::translate("main", "Specify input TBC file"));

// Process the command line arguments given by the user
parser.process(a);

// Get the configured settings from the parser
bool isDebugOn = parser.isSet(showDebugOption);

// Process the command line options
if (isDebugOn) setDebug(true); else setDebug(false);
// Standard logging options
processStandardDebugOptions(parser);

// Get the arguments from the parser
QString inputFileName;
Expand Down
26 changes: 19 additions & 7 deletions tools/ld-analyse/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ MainWindow::MainWindow(QString inputFilenameParam, QWidget *parent) :

// Was a filename specified on the command line?
if (!inputFilenameParam.isEmpty()) {
lastFilename = inputFilenameParam;
tbcSource.loadSource(inputFilenameParam);
} else {
lastFilename.clear();
}
}

Expand Down Expand Up @@ -158,6 +161,7 @@ void MainWindow::updateGuiLoaded()
ui->actionClosed_Captions->setEnabled(true);
if (tbcSource.getIsSourcePal()) ui->actionPAL_Chroma_decoder->setEnabled(true);
else ui->actionPAL_Chroma_decoder->setEnabled(false);
ui->actionReload_TBC->setEnabled(true);

// Set option button states
ui->videoPushButton->setText(tr("Source"));
Expand Down Expand Up @@ -238,6 +242,7 @@ void MainWindow::updateGuiUnloaded()
ui->actionSave_frame_as_PNG->setEnabled(false);
ui->actionClosed_Captions->setEnabled(false);
ui->actionPAL_Chroma_decoder->setEnabled(false);
ui->actionReload_TBC->setEnabled(false);

// Set option button states
ui->videoPushButton->setText(tr("Source"));
Expand Down Expand Up @@ -390,10 +395,20 @@ void MainWindow::on_actionOpen_TBC_file_triggered()

// Was a filename specified?
if (!inputFileName.isEmpty() && !inputFileName.isNull()) {
lastFilename = inputFileName;
loadTbcFile(inputFileName);
}
}

// Reload the current TBC selection from the GUI
void MainWindow::on_actionReload_TBC_triggered()
{
// Reload the current TBC file
if (!lastFilename.isEmpty() && !lastFilename.isNull()) {
loadTbcFile(lastFilename);
}
}

// Display the scan line oscilloscope view
void MainWindow::on_actionLine_scope_triggered()
{
Expand Down Expand Up @@ -550,18 +565,18 @@ void MainWindow::on_nextPushButton_clicked()
}
}

// Skip to end frame button has been clicked
// Skip to the next chapter (note: this button was repurposed from 'end frame')
void MainWindow::on_endFramePushButton_clicked()
{
currentFrameNumber = tbcSource.getNumberOfFrames();
currentFrameNumber = tbcSource.startOfNextChapter(currentFrameNumber);
ui->frameNumberSpinBox->setValue(currentFrameNumber);
ui->frameHorizontalSlider->setValue(currentFrameNumber);
}

// Skip to start frame button has been clicked
// Skip to the start of chapter (note: this button was repurposed from 'start frame')
void MainWindow::on_startFramePushButton_clicked()
{
currentFrameNumber = 1;
currentFrameNumber = tbcSource.startOfChapter(currentFrameNumber);
ui->frameNumberSpinBox->setValue(currentFrameNumber);
ui->frameHorizontalSlider->setValue(currentFrameNumber);
}
Expand Down Expand Up @@ -876,6 +891,3 @@ void MainWindow::on_finishedLoading()
busyDialog->hide();
this->setEnabled(true);
}



2 changes: 2 additions & 0 deletions tools/ld-analyse/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ private slots:
// Menu bar handlers
void on_actionExit_triggered();
void on_actionOpen_TBC_file_triggered();
void on_actionReload_TBC_triggered();
void on_actionLine_scope_triggered();
void on_actionAbout_ld_analyse_triggered();
void on_actionVBI_triggered();
Expand Down Expand Up @@ -126,6 +127,7 @@ private slots:
qint32 currentFrameNumber;
qreal scaleFactor;
QPalette buttonPalette;
QString lastFilename;

// Update GUI methods
void updateGuiLoaded();
Expand Down
13 changes: 11 additions & 2 deletions tools/ld-analyse/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
</size>
</property>
<property name="toolTip">
<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>
<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>
</property>
<property name="text">
<string/>
Expand Down Expand Up @@ -202,7 +202,7 @@
</size>
</property>
<property name="toolTip">
<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>
<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>
</property>
<property name="text">
<string/>
Expand Down Expand Up @@ -435,6 +435,7 @@
<string>File</string>
</property>
<addaction name="actionOpen_TBC_file"/>
<addaction name="actionReload_TBC"/>
<addaction name="separator"/>
<addaction name="actionSave_frame_as_PNG"/>
<addaction name="separator"/>
Expand Down Expand Up @@ -618,6 +619,14 @@
<string>Ctrl+U</string>
</property>
</action>
<action name="actionReload_TBC">
<property name="text">
<string>Reload TBC...</string>
</property>
<property name="shortcut">
<string>Ctrl+A</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources>
Expand Down
Loading

0 comments on commit 40b80ef

Please sign in to comment.