MCPcopy Create free account
hub / github.com/QNapi/qnapi / convertClicked

Method convertClicked

gui/src/forms/frmconvert.cpp:227–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225void frmConvert::subDelayToggled() { checkFPSNeeded(); }
226
227void frmConvert::convertClicked() {
228 double fpsRatio = 1.0, delayOffset = 0.0;
229
230 if (ui.cbChangeFPS->isChecked()) {
231 double fpsFrom = ui.cbFPSFrom->currentText().replace(',', '.').toDouble();
232 double fpsTo = ui.cbFPSTo->currentText().replace(',', '.').toDouble();
233 fpsRatio = fpsTo / fpsFrom;
234 }
235
236 if (ui.cbDelaySubtitles->isChecked()) {
237 delayOffset = ui.sbDelayOffset->value();
238 }
239
240 if (subConverter.convertSubtitles(
241 ui.leSrcSubFile->text(), targetFormat, ui.leTargetFileName->text(),
242 ui.cbMovieFPS->currentText().replace(',', '.').toDouble(), fpsRatio,
243 delayOffset)) {
244 QMessageBox::information(this, tr("Subtitles converted"),
245 tr("Changed subtitles format from '%1' to '%2'")
246 .arg(srcFormat, targetFormat));
247 } else {
248 QMessageBox::warning(this, tr("Could not change subtitle format!"),
249 tr("An error occured while converting subtitles!"));
250 }
251}

Callers

nothing calls this directly

Calls 1

convertSubtitlesMethod · 0.80

Tested by

no test coverage detected