Add Rhubarb timeout Preference

This commit is contained in:
manongjohn 2021-03-14 18:18:58 -04:00 committed by manongjohn
parent ea81bcd94a
commit b66677a309
5 changed files with 12 additions and 2 deletions

View file

@ -283,6 +283,7 @@ public:
int getFfmpegTimeout() { return getIntValue(ffmpegTimeout); }
QString getFastRenderPath() const { return getStringValue(fastRenderPath); }
QString getRhubarbPath() const { return getStringValue(rhubarbPath); }
int getRhubarbTimeout() { return getIntValue(rhubarbTimeout); }
// Drawing tab
QString getScanLevelType() const { return getStringValue(scanLevelType); }

View file

@ -75,6 +75,7 @@ enum PreferencesItemId {
ffmpegTimeout,
fastRenderPath,
rhubarbPath,
rhubarbTimeout,
//----------
// Drawing

View file

@ -834,7 +834,9 @@ void LipSyncPopup::onApplyButton() {
return;
}
runRhubarb();
m_rhubarb->waitForFinished();
int rhubarbTimeout = Preferences::instance()->getRhubarbTimeout();
if (rhubarbTimeout > 0) rhubarbTimeout * 1000;
m_rhubarb->waitForFinished(rhubarbTimeout);
m_progressDialog->hide();
QString results = m_rhubarb->readAllStandardError();
results += m_rhubarb->readAllStandardOutput();

View file

@ -1046,6 +1046,7 @@ QString PreferencesPopup::getUIString(PreferencesItemId id) {
{ffmpegTimeout, tr("Process Timeout:")},
{fastRenderPath, tr("Fast Render Output Directory:")},
{rhubarbPath, tr("Executable Directory:")},
{rhubarbTimeout, tr("Analyze Audio Timeout (sec; -1 = no timeout):") },
// Drawing
{scanLevelType, tr("Scan File Format:")},
@ -1641,7 +1642,10 @@ QWidget* PreferencesPopup::createImportExportPage() {
}
QGridLayout* rhubarbOptionsLay = insertGroupBox(tr("Rhubarb Lip Sync"), lay);
{ insertUI(rhubarbPath, rhubarbOptionsLay); }
{
insertUI(rhubarbPath, rhubarbOptionsLay);
insertUI(rhubarbTimeout, rhubarbOptionsLay);
}
lay->setRowStretch(lay->rowCount(), 1);
insertFootNote(lay);

View file

@ -450,6 +450,8 @@ void Preferences::definePreferenceItems() {
std::numeric_limits<int>::max());
define(fastRenderPath, "fastRenderPath", QMetaType::QString, "desktop");
define(rhubarbPath, "rhubarbPath", QMetaType::QString, "");
define(rhubarbTimeout, "rhubarbTimeout", QMetaType::Int, -1, -1,
std::numeric_limits<int>::max());
// Drawing
define(scanLevelType, "scanLevelType", QMetaType::QString, "tif");